vim is a customizable, highly modal text editor. The wikipedia page has good history and overview.
And, of course, you can read the user manual.
Cheat Sheet
Files
- Exit / save and exit / discard and exit:
:q
:wq
:q!
- Load / save / close pane:
:edit file
:saveas file
:close
Movement
- Move left/down/up/right:
h
j
k
l
- Move by word left/right/right (end of word):
b
w
e
- Move by paragraph:
{
}
- Move to matching brace/character:
%
- Move to start/non-WS-start/end of line:
0
^
$
- Move to start/end of document:
gg
G
- Move to line N:
Ngg
- Search forward / search next:
/SEARCH
n
Editing
- Undo / redo:
u
Ctrl+r
- Insert before/after cursor/open line below/above:
i
a
o
O
- Visual mode:
v
- Copy / paste / copy clipboard / paste clipboard / copy line:
y
p
"*y
"*p
yy
- Delete character, through end line, through end of file:
x
D
dG
- Replace OLD with NEW in file/with confirmation:
:%s/OLD/NEW/g
:%s/OLD/NEW/gc
- Exit insert mode:
Esc
or Ctrl+c
Fancy Stuff
- (UNIX) Exit to shell, come back:
Ctrl+Z
, fg
Home