Though I prefer using emacs, vi is used as the default editor in unix. Here I list a simple summary of vi command just for basic usage.
1) Modes in vi:
There are three basic modes of vi: command mode, insert mode and line mode.
2) start and saving files:
:wq -----write the file and quit vi
:q! --- quit without saving
:w! new_filename -----write into a new filename
3) insert text:
i ------insert text from the left of cursor
4) delete text:
x ------- remove a single character
5) useful internet sources:
http://www.smashingmagazine.com/2010/05/03/vi-editor-linux-terminal-cheat-sheet-pdf/
http://www.uic.edu/depts/accc/software/unixgeneral/vi101.html#introvi
Aucun commentaire:
Enregistrer un commentaire