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

Already subscribed? Sign In

Autoplay

    Moving around in Vim

    Mike HartingtonMike Hartington

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

    vimVim
    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
    Transcript

    Transcript

    00:00 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.

    00:20 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.

    00:46 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.

    Discuss

    Discuss