Vi editor

From GHER

(Difference between revisions)
Jump to: navigation, search
Line 13: Line 13:
* ''':wq''' to write and quit
* ''':wq''' to write and quit
* ''':q!''' to quit without saving the file
* ''':q!''' to quit without saving the file
 +
 +
== Guides and tutorials ==
More complete guides available at:
More complete guides available at:
Line 18: Line 20:
* http://acms.ucsd.edu/info/vi_tutorial.shtml
* http://acms.ucsd.edu/info/vi_tutorial.shtml
* http://www.eng.hawaii.edu/Tutor/vi.html
* http://www.eng.hawaii.edu/Tutor/vi.html
 +
 +
== Turn on/off color syntax ==
 +
 +
cd
 +
vi .vimrc
 +
 +
then put in file .vimrc
 +
syntax on

Revision as of 08:50, 9 April 2013

vi is a text editor originally created for Unix.

Several guides are available through internet. Here we just summarize a few useful commands with which you can survive with vi:

vi file.txt

will open the text file with the editor. Once with the editor, type

  • i to inserts text to the left of the cursor (insert mode)
  • Esc to stop the insert mode
  • :w to write the changes you made
  • :q to quit the editor
  • :wq to write and quit
  • :q! to quit without saving the file

Guides and tutorials

More complete guides available at:

Turn on/off color syntax

cd
vi .vimrc

then put in file .vimrc

syntax on
Personal tools