Saturday, November 10, 2018

Simple VI editor workflow

On terminal start editing by writing vi <filename>
for example
vi readme.txt
Move cursor to place you want to edit with arrow keys.
Press i key to start editing.
Press ESC to edn the editing.
Press a colon (:) to change to command mode. Cursor moves to bottom of the screen.
On command mmode
  • w is save
  • q is quit
So save and quit is wq
To quit is without saving is q!
Saving readonly files is
:w !sudo tee %
Afterwards exit with :q!

No comments:

Post a Comment