Command line
vim fileedit the file in the current window
gvim fileedit the file in graphical mode (other window + menubar)
vim +r123 fileedit the file with the cursor positioned on line 123
vim -b fileedit foobar in binary more (i.e. set noexpandtab, textwidth=0, nomodeline, and binary)
vim -o file1 file2 file3start vim with each file loaded in a horizontal window
vim -O file1 file2 file3start vim with each file loaded in a vertical window
vim -o4 file1 file2start vim with four horizontal windows
vim -O4 file1 file2start vim with four vertical windows
vim -R fileopen the file in read only mode

Undo/redo
U
:u[ndo]
undo
CtrlR
:red[o]
redo
Uundo latest changes on the line

Cut ’n paste
V
move the cursor at the end of the region to copy
Y
copy characters
ShiftPpaste before the cursor
Ppaste after the cursor

Search
/search forward
?search backward
*search forward for the word under the cursor
#search backward for the word under the cursor
Nnext match
ShiftNprevious match
:set hlsearchenable search result highlighting
:set noh[lsearch]disable search result highlighting
:nohlsearchhide the current search result highlighting

Windows
CtrlWSsplit the window horizontally in two
CtrlW
CtrlWCtrlH
CtrlWH
go to the left window
CtrlW
CtrlWCtrlL
CtrlWL
go to the right window
CtrlW
CtrlWCtrlJ
CtrlWJ
go to the window below
CtrlW
CtrlWCtrlK
CtrlWK
go to the window above

Numbering
:set number
:set nu
display line numbers
:set nonumber
:set nonu
undisplay line numbers
:set nu!toggle the display of line numbers

Colours
:set background=darkset the syntax highlight colours corresponding to a dark background
:set background=lightset the syntax highlight colours corresponding to a light background
:syntax onenable syntax highlighting (the default colours are applied)
:syntax enableenable syntax highlighting (the colours defined by :highlight are kept)
:syntax offdisable syntax highlighting

Miscellaneous
%move to matching brace or keyword

the configuration file is $HOME/.vimrc.