date | draft | weight | title |
---|---|---|---|
2016-04-08 |
false |
99 |
VIM Cheat Sheet |
How to edit a file using vim
i - enter edit mode (Insert mode)
Edit the file
esc - To exit insert mode
ZZ - In all caps to save
vi somefile - Edit a file called somefile!
i - enter edit mode (Insert mode)
Edit the file
esc - To exit insert mode
:wq - To write the file and quit
When in INSERT mode, hit the Esc key; to enter COMMAND mode. Then you can type
:q to quit (short for :quit)
:q! to quit without saving (short for :quit!)
:wq to write and quit (think write and quit)
:x to write and quit (shorter than :wq)
:qa to quit all (short for :quitall)