VIM

filesystem

:e - open a file :w - write a file :q - quit :q! - quit without saving :x - write and quit (only wtites if there are changes). “exit”

view

:set nu! toggle line numbering

Modes

Normal Mode

Esc Enter normal mode. This is the mode vim starts in.

While in Normal mode use the following commands:

:g/<string-to-search>/d will delete the line with the last instance of <string-to-search>

All the filesystem commands

Insert mode

i - enter/exit insert mode

While in Insert mode use the following commands:

Visual mode

v - enter/exit “visual” mode. This can be used to select text. Once you’ve selected it there are several things you can do

References