Saturday 22 November 2014

Colon (“:”) commands vi filex

:w
Write to file; defaults to the file name you gave it on invocation. If you didn't give it a file
name on the command line, it will gripe.
:w  filename
Save the file to filename
:q
Quit .In vim ,also exists from help
:q!
 Quit without saving.
:wq
Write to the file and quit (see also “ZZ”).
:r filename
Read in file (handy for “cut and paste” between two different files).
:e
Exit (without saving).
:e!
 Exit immediately, and don't ask about saving.
:d
 Delete the current line.
:h
 Go to online help.
:j
Delete the line below the cursor.
:n
 If you specified multiple files on the command line, go on to edit the next file.
:u
Undo the last operation.
:x
 Quick exit. Saves the file without being asked.
:n
 Go to line number n.
:-n
 Go up n lines.
:+n
 Go down n lines.


No comments:

Post a Comment