Quick reference for basic editing in Vi
Vi is a very basic (yet incredibly powerful) text editor that comes with just about every single Linux Distribution. Using Vi allows you to avoid installing other text editors.
Note: Avoid using the number pad in Vi.
go into insert mode, here you may use arrows to navigate text, and edit it with the keyboard as normal:
exit insert mode:
Esc (the escape key)
WHEN NOT in insert mode you may use:
:w (then enter)
:q (then enter)
exit vi without saving changes:
:q! (then enter)
Example of usage...
[root@localhost ~]# vi /README.txt
i This is my first readme file, wrote with vi! (Esc key) :w :q
[root@localhost ~]# cat /README.txt This is my first readme file, wrote with vi!