Vim mini cheatsheet
Vim mini cheatsheet
- Insert modes:
- A to insert at end of line
- a to insert after next char
- i to insert at current cursor
- Visual modes:
- v character, V: line
- ↑ ↓ ← → to select text
- d to cut, y to copy (yank)
- Move cursor to position and P to paste before or p to paste after
- Normal mode:
y{motion} for copying and cutting in normal mode
- Y: yanks current line, including newline char at the end
yiw: yanks current word without surrounding whitespace
yaw: yanks current word with surrounding whitespace
- Cutting can be done with
d{motion}
- Deleting lines
dd to delete current line
:10d to delete Line 10
:10,20d to delete from Line 10 to Line 20
10gg or :10 + Enter to go to Line 10
- x delete character after cursor, X for before
- u to undo
- . repeat last change