| Exit commands | |
ZZ | Write (save) the file if modified, and quit file |
:x | Write (save) the file if modified, and quit file |
:wq | Write (save) the file unconditionally, and quit the file |
:w | Write (save) the file |
:w! | Write (save) the file, overriding protection |
:30, 60w newfile | Write from line 30 through line 60 to newfile |
:30, 60w>>file | Write from line 30 through line 60 and append to file |
:w %.new | Write current buffer named file as file.new |
:q | Quit file |
:q! | Quit file, overriding protection |
Q | Quit vi and invoke ex |
:e file2 | Edit file2 without leaving vi |
:r newfile | Read contents of newfile into current file |
:n | Edit next file |
:e! | Return to version of current file at time of last write (save) |
:e # | Edit alternate file |
:vi | Invoke vi from ex |
: | Invoke one ex command from vi editor |
% | Current filename (substitutes into ex command line) |
# | Alternate filename (substitutes into ex command line) |
^] | Look up the location of the identifier under the cursor in the tags file and move to that location. If tag stacking is enabled, the current location is automatically pushed onto the tag stack. |
^T | Return to the previous location in the tag stack, i.e. pop off one element |