Vim

A reference


Open existing file

vim <existing-file.txt>

Starts a new Vim session to edit the existing file


Open new file

vim <new-file.txt>

Starts a new Vim session to create a new file


Enter Insert mode

i

Puts you into Insert mode so you can type


Exit any active mode

esc

Exits any mode you might be in


Save document

:w

After exiting any active modes, type :w to save


Quit Vim

:q

After exiting any active modes, type :q to quit


Save and quit

:wq

After exiting any active modes, type :wq to save and quit