Vim Flashcards
Moving keys
hjkl
exit
:q!
delete
x
insert
i
Save and exit
:wq!
delete word
dw
delete 5 words
d5w
undo the u
CTRL-R
move to 200th line
200G
search a word forward
/word
search a word backward
?word
substitute a word one time
:s/old/new/g
substitute in whole document
:%s/old/new/g
ask for confirmation each time before substitution
:%s/old/new/gc
save
:w
how to use external commands?
:!command
select text
v(visual mode)
open new line
o-below , O-above
copy
y
paste
p
ignore case when searching
:set ic
highlight search results
:set hls
find help
:help or press F1 or :help user-manual
autocomplete
TAB
close a file
:q
basic Vim modes
1. Normal Default; for navigation and simple editing2.Insert For explicitly inserting and modifying text3.Command Line For operations like saving, exiting, etc.4.Visual, 5.Select, 6.Ex-Mode