Solaris Advanced User's Guide

Editing Multiple Files

vi enables you to edit multiple files. For example, to edit the file orwell while you are editing paint:

  1. First, save your current work in paint. Type :w and press Return.

  2. To edit orwell, type :n orwell and press Return.

  3. Make editing changes to orwell and save your work.

  4. 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 #.