Send by LINE
B! Bookmarks in Hate-bu
Bookmarks in Pocket
RSS feeds

Linux vim: Move the cursor efficiently

Other language site
No available translations found
Google Translate
programing image

I use it for more than 15 years from the vi command.

However, for some reason I forget the shortcut key for cursor movement operation.

So I gathered various cursor movements.

 Working with rows

Key Go to
gg First row
G Last row
:0(Zero) First row
:$ Last row

Jumping a specified line using command mode

You can jump line in command mode to use by pressing Esc key.

Jump to specified line


Jump to last line


You can do the same without using "gg" or "G".

If you want maximum efficiency, you'd better memorize "gg" and "G". However, if you want to operate with minimal knowledge, you may use ": 1", ": $".

I often use command mode.

Word unit operation

Key Go to
w Next word
b Previous word
^ Text at beginning of line

In English it is simple. English contains one-byte space for each word.

Jump to the next letter of that half-width space as basic action. Symbols are recognized as one word even if they are not delimited by single-byte spaces.

In the case of Japanese it is somewhat different. Japanese is never separated by spaces for each word.

In the case of Japanese, it is recognized as a word for each type of kanji, hiragana and katakana. So, when using this shortcut in Japanese, the particle is also recognized as one word, so it is a bit irritated.

"^" Is a text with indentation such as source code, it moves to the beginning without indentation.

Detailed operation

Key Go to
h Before 1 character
l After 1 character
j Next line
k Previous row

Probably the most used shortcut. It is possible to do all work with this alone. However, it is not very efficient.

Leave a Reply