https://vim.rtorr.com/ - Cheatsheet
https://www.openvim.com/ - interactive Tutorial
:wq! - save and quit
:w - save withouth quit
:q - quit
:q! - quit withouth saving
i - insert mode esc - normal mode / esc to exit insert mode
v / V - visual mode
h - left
j - down
k - up
l - right
w - next word
e - end of word
b - begining of word
e.g 5w
e.g 3iText then esc
f || F
/
e.g
/test\c - c case insensitive | C sensitive
n - nex occurence
N - prev occurence
%
0 - start
$ - end
* - next occurence
# - prev occcurence
gg - first line
G - last line
5g - specific line 5
a | A
o - insert after the current line
O - insert before the current line
x - remove the current char
X - remove the char before the pointed char
r
:s/article\c/tutorial/g :%s/oldtext/newtext/gi :%s/old/new/g - replace all old with new throughout file :%s/old/new/gc - replace all old with new throughout file with confirmations
d
can combine with word movement
de - delete the whole word
d$ - delete the whole line
. - repeat previous command
p - all deleted text can be pasted
yy
u - undo
ctrl + r - redo
S
D
Cheatsheet
https://www.atmos.albany.edu/daes/atmclasses/atm350/vi_cheat_sheet.pdf