DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Editing files

Editing more than one file

To edit more than one file in a session, start vi giving it a list of files, as follows:

vi file1 file2 file3 ...

vi only edits one file at a time, but you can move forward through the list by typing :n (next) in command mode, or go to a specific file by typing :e filename (short for :edit filename) in command mode. Note that you cannot edit the next file if you have made changes to the current one, unless you save the current file with :w or override vi by using the :n! (unconditional next file) command. To return to editing the first in the list of files, type :rew (short for :rewind).

Note that if you switch files without saving the contents of the last one you edited you will lose any changes you have made: see ``Saving files and quitting vi'' for how to save the current file.


Next topic: Using buffers to cut and paste text
Previous topic: Accessing the shell

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005