Vim cheatsheet
Updated:
Something that I need for VIM editor
vim
open
vim main.c
open and point particular line
vim +5 main.c
Vim modes are:
- normal
- input
- visual
- exit
normal mode: type “Esc”
input mode: change into normal mode first, and, type “a” to append type “i” to insert
exit mode: change into normal mode first, and, type “:” “:w” to write(save) file “:q” to quit “:wq” to write and quit
To copy lines,
change to normal mode by typing “Esc”,
and type “yy” to copy single line,
Or to copy multiple lines, for example, 10 lines,
type “10”, and type “yy”
”%” or (shift + 5) to go to parenthesis that is matched
find and replace all
press “:” to switch to command mode
“%s/pair/my_pair/g”
Leave a comment