-- EDIT --
i insert [wor|_d] (I to BOL)
a append [word|_] (A to EOL)
o open a new line [A+\n] (O inv)
J combile lines (delete \n)
d<motion> delete (dd line, D=d$)
d/here<Enter> delete to "here"
S = ddi
x extract char
s = xi
r replace char (R many)
c<motion> change (cc line, C=c$)
ci} change { inner }
daw delete outer Word
y<motion> yank (copy) (yy line)
p paste [_+<buffer>] (P inv)
Ctrl+a|x increment|decrement
~ invert case (char or visual)
gU<motion> uppercase (u,~)
>>, << shift line
== auto-indent
. repeat
u undo (U the whole line)
Ctrl+r redo
g<edit> persist cursor pos
-- SEARCH --
/<pattern> | n ->, N <-
?<pattern> | n <-, N ->
/<pattern>\c ignore case
:set ic always ignore case
-- VISUAL --
v VISUAL mode
vep replace next word to buffer content
:'<,'>w save slected
I prepend to each block line
o switch cursor
|
-- MOTIONS --
e>| w>|
| fb>|
| tb>||
aaa bbb
||<Ta |
|<Fa |
|<ge |<b
w word (W greedy)
$ EOL
^ content BOL (0 true BOL)
% matching bracket
) sentence
} para
m<mark> bookmark
`<mark> jump to <mark> (' to BOL)
'. last edited line
`` undo jump
Ctrl+o previous jump
-- NAVIGATION --
Ctrl+g status
<line>G go to line
g<motion> go in visible
2$|2+ EOL|BOL of the next line
G go to EOF
gg go to BOF
Ctrl+i return
Ctrl+o forward
<0-100>% jump to percent
Ctrl+e|y move view pane
zt|zz|zb cursor line -> top|mid|bot
Ctrl+d|u move half-page
Ctrl+b|f move page
H|M|L cursor -> high|mid|low
; repeat in same direction
, repeat in reverse direction
-- WINDOWS --
:[v]split <file>
Ctrl+W W|hjkl navigate (HJKL move)
Ctrl+W [n]+-<> size
|
-- COMMANDS --
:s/<old>/<new> sub. 1st in line
:s/<old>/<new>/g globally in line
:%s sub. in all lines of file
/gc ask before sub.
/<pattern>/d delete
:r <file> retrieve file
:!<command> execute in shell
Ctrl+R<reg> paste
Ctrl+R Ctrl+W retrieve current word
Ctrl+N autocompletion
:x = :wq
ZZ = :x
ZQ = :q!
Esc = Ctrl+[
Ctrl+o Esc for 1 op.
Ctrl+L redraw
<INSERT> Ctrl+r,= calculator
-- REGISTERS --
:reg registers
:echo @<reg>
<reg>p paste from reg
"_ black hole
"/ search pattern
"0 yank
"1 big delete ("2..9 stack)
"- small delete
"+|"* clipboard
"a..z user space ("A..Z append)
q# record macros #
@# playback macros # (@@ repeat)
-- MISC --
:so .vimrc
:set st=4 tab size
:set et indent with spaces
:set nu line numbers
:set hls highlight all found
:set is highlight current found
:set paste/nopaste
|