Skip to content
cheatsheet
home
/
cv
/
weblog
/
cheatsheet
/
proxy
/
vpn
/
status
/
links
EN
RU
☾
New version available
reload
×
cheatsheet
/
vim
/
Global search and replace
Global search and replace
vim
Replace all occurrences interactively (c = confirm)
:%s/old/new/gc
⎘ copy
#vim
#linux
more vim
all 10 commands →
Open file at line number
vim +42 file.txt
Search forward / backward
/pattern (n/N next/prev) ?pattern (backward)
Delete lines matching pattern
:g/^#/d
Re-indent whole file
gg=G
Record and play macro
qa (record into a) q (stop) @a (play) 10@a (play 10 times)