Editing Multiple Files
vi enables you to edit multiple files. For example, to edit the file orwell while you are editing paint:
-
First, save your current work in paint. Type :w and press Return.
-
To edit orwell, type :n orwell and press Return.
-
Make editing changes to orwell and save your work.
-
When you are finished working with orwell and have saved your work, you have three choices:
-
Exit vi. Type :q and press Return.
-
Return to paint. Type :n # and press Return.
-
Swap back and forth between two files with the command :n #.