Difference between revisions of "Vi"
Line 14: | Line 14: | ||
write changes: | write changes: | ||
− | <pre:w (then enter)</pre> | + | <pre>:w (then enter)</pre> |
exit vi: | exit vi: |
Revision as of 03:57, 11 April 2015
Quick reference for basic editing in vi
go into insert mode, here you may use arrows to navigate text, and edit it with the keyboard as normal:
i
Esc (the escape key) = exit insert mode
WHEN NOT in insert mode you may use:
write changes:
:w (then enter)
exit vi:
: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!