Cursor Movement: VI Cheat Sheet
Cursor Movement: VI Cheat Sheet
Cursor movement
h - move left
j - move down
k - move up
l - move right
$ - end of line
Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves
down 4 lines.
o - open (append) blank line below current line (no need to press return)
Editing
u - undo
aw - mark a word
ib - inner () block
iB - inner {} block
Visual commands
~ - switch case
yw - yank word
Exiting
Search/Replace
:%s/old/new/gc - replace all old with new throughout file with confirmations