Initial version 2004 by Fabio Szostak, updated 2018
VI editor command summary. Enjoy and increase it. You're welcome.
Open, save and exit
On shell:
$ vi filename
On editor:
:e filename open file
:e! filename open file with ignore changes
:e# or :e!# open previous file
:wq or :x or :x! save and exit
:q! exit without save
!!command run command and get output
Check on bottom of screen the current mode:
nothing is on command mode
-- INSERT -- is on insert mode
-- REPLACE -- is on replace mode
Note: Always type esc to switch to command mode
RegExp Replace Example
ORIGINAL FILE CHANGED FILE
........ 1234.10 => ........ 1234,10
........ 2233.20 => ........ 2233,20
Command: :1,$ s /\.\([0-9]\)/,\1/
Find: .(dígit 0 to 9)
Replace: ,(dígit 0 to 9)