Skip to content

Latest commit

 

History

History
50 lines (25 loc) · 834 Bytes

vim.md

File metadata and controls

50 lines (25 loc) · 834 Bytes
date draft weight title
2016-04-08
false
99
VIM Cheat Sheet

How to edit a file using vim

vim somefile - Edit a file called somefile!

i - enter edit mode (Insert mode)

Edit the file

esc - To exit insert mode

ZZ - In all caps to save

How to edit a file using vi

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

Other handy commands:

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)