Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Learning the vi Editor/Moving around

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

We can move around in the editor by first entering command mode, and then using the h, j, k, and l keys. Note your arrow keys may be set up to work, and you can use them if you like, but for proficiency and for advanced work later, you should learn to use the letter keys. The h key, in command mode, moves the cursor one character left. The j key, in command mode, moves the cursor one character down. The k key, in command mode, moves the cursor one character up. The l key, in command mode, moves the cursor one character right. If you have trouble remembering this, keep in mind that h is leftmost, the letter jgoes down below the line, the letter kpokes up above the line, and the l key is rightmost. (J also resembles an arrow pointing downward, if you squint a bit.) After you have moved the cursor using those keys, you can enter insert mode again by pressing i. When you do this, you insert text at the cursor, inserting text between the character to the left of the cursor and the current position of the cursor. Let's practice this in an exercise.