Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Moving around in Vim

    Mike HartingtonMike Hartington
    vimVim

    Learn how to efficiently move around Vim and stop reaching for your mouse

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Navigating around a file in Vim is driven solely by the keyword. Where most editors use the arrow keys and your mouse, Vim use the H, J, K, and the L keys. These keys are preferred since they keep your hands right on the home row instead of reaching constantly for your mouse.

    To move down a file, you can use the J key. To move back up a file, you can use the K key. If you want to move to the right, you can use the L key. If you want to move to the left, you can use the H key. Vim also provides a way to move through text word by word, using the W key. If you want to go back word by word, you can use the B key.

    To sum up, H moves you left one letter. L moves you right one letter. J moves you down one line. K moves you up one line. W moves you forward one word. B moves you back one word.