By David Akin
Create and open a new file
vim file.txt
Vim has 3 main modes: NORMAL, INSERT and VISUAL. The most you’ll be using are NORMAL and INSERT.
Switch to insert mode
Press the i
key
Switch to normal mode
Press the esc
key
To switch to commands/combo mode i.e the :
below the vim editor
Press the Ctrl
+C
key
Save
Type :w
or ZZ
Save in root/admin mode
:w !sudo tee %
Save all opened buffer
wa
Save and quit
Type :wq
Exit w/o save
ZQ
Quit
Type :q
Force quit
Type :q!
Read another file data or system output into the buffer
:r file1.txt
:r !ls
:r !date
h left
l right
j down
k up