This lesson is for PRO members.

Unlock this lesson NOW!
Already subscribed? sign in

Moving around in Vim

1:01 Tools lesson by

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


egghead.io comment guidelines

Avatar
egghead.io

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

Avatar
Jun

How do you open a file with vim?

In reply to egghead.io
Avatar
Mike

see the "saving files in vim" video

In reply to Jun

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.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?