vi [options] [files]

A screen-oriented text editor based on ex. See Chapter 23 for more information on vi and ex. Options -c, -C, -L, - r, -R, and -t are the same as in ex.


-c command

Enter vi and execute the given vi command.


Edit in ex mode.


Don’t make a temporary backup of the entire file.


Run in LISP mode for editing LISP programs.

-r file

Recover and edit file after an editor or system crash.


Read-only mode. Files can’t be changed.


No other programs can be run, vi is put in secure edit mode.


This option works only when ex mode is being used. It enters into batch mode.

-t tag

Edit the file containing tag and position the editor at its definition.

-w n

Set default window size to n; useful when editing via a slow dial-up line.


Start vi on last line of file.

+ n

Start vi on line n of file.

+/ pat

Start vi on line containing pattern pat. This option fails if nowrapscan is set in your .exrc file.

Get Mac OS X Panther in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.