Linux vim: Move the cursor efficiently

Other language site
ja ja
Google Translate
  • -

    シェア
  • ---

    LINEで送る
  • -

    はてなブックマーク
    ブックマーク
  • -

    pocket
  • -

    rss
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

KeyGo to
ggFirst row
GLast 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

:(number)

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

KeyGo to
wNext word
bPrevious 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

KeyGo to
hBefore 1 character
lAfter 1 character
jNext line
kPrevious row

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

SNS also distributes articles.
Leave a Reply

*

If you like this article, share it!