w
: Move [] -> next wordW
: Move [] -> next WORDe
: Move [] -> word endE
: Move [] -> WORD end$
: Move [] -> line end0
(zero): Move [] -> line startb
: [] -> prev wordB
: [] -> prev WORDCtrl-G
: Show [] location in footerG
: [] -> bottom of filegg
: [] -> top of file<num>G
: [] -> to line<num>
Ctrl-O
: [] -> back history [] locationCtrl-I
: [] -> forward history [] location%
: [] -> matching paren()
,[]
,{}
Ctrl-W Ctrl-W
: jump between windows
i
: Insert mode at []a
: Insert mode after []A
: Insert mode at EOLo
: Insert mode on newline below []O
: Insert mode on newline above []p
: Put removed content after []P
: Put removed content before []r<char>
: Replace char at [] with<char>
R
: Replace (overwrite) mode at []y
: Yank (copy)yy
: Yank whole lineyw
: Yank [] -> next wordye
: Yank [] -> end of wordy$
: Yank [] -> end of line
d
: Delete operatordw
: Delete [] -> next word startde
: Delete [] -> current word endd$
: Delete [] -> line end<num = 1>dd
: Delete whole lines current and down
c
: Change (remove current and enter Insert mode)cw
: Change [] -> next wordce
: Change [] -> end of wordc$
: Change [] -> end of linecC
: Change whole line
<num><motion>
: repeat action times<operator><num><motion>
: repeat action times in directionu
: Undo last commandU
: Revert whole line to previous saveCtrl-R
: Redo last undone commend~
: Toggle case.
: Repeat last command*
: Highlight all instances of current word
/<phrase>
: Search for<phrase>
forward from [] (append\c
to ignore case)?<phrase>
: Search for<phrase>
backward from [] (append\c
to ignore case)n
: [] -> next resultN
: [] -> prev result:s/<old>/<new>/g
: substitute command. Replace all<old>
with<new>
in the current line (g
flag is global):<line1>,<line2>s/<old>/<new>/g
: substitute command. Replace all<old>
with<new>
in the<line1>,<line2>
range (g
flag is global):%s/<old>/<new>/g
: substitute command. Replace all<old>
with<new>
in the whole file (g
flag is global):%s/<old>/<new>/gc
: substitute command. Replace all<old>
with<new>
in the whole file with prompt (g
flag is global):[no]hlsearch/[no]hls
: toggle highlight of current search
:!<cmd>
: execute external command (!
prefix executes the command anywhere):w <filename>
: save current buffer to<filename>
v <motion> w <filename>
: save current selection to<filename>
:r <filename>
: insert contents of<filename>
below []:r !<cmd>
: insert output of<cmd>
below []
:help
: show Help:help <cmd>
: show Help for specific<cmd>
:help v_<cmd>
: show Help for specific<cmd>
in Visual mode:help i_<cmd>
: show Help for specific<cmd>
in Insert mode:help :<cmd>
: show Help for specific command-line<cmd>
:help c_<???>
: show Help for specific command-line editing<???>
:help <option>
: show Help for<option>
Ctrl-]
: show help for current word/tagCtrl-T
|Ctrl-O
: go back from current word/tag
:set [no]<option>
: enable/disable<option>
[no]ic
: ignore case[no]hlsearch/[no]hls
: highlight search[no]incsearch/[no]is
: incremental search