Important Command-Line Arguments
In a pure BSD environment, nvi is installed under the names ex, vi,
and view. Typically they are all
links to the same executable, and nvi looks at how it is invoked to determine
its behavior. (Unix vi works this
way, too.) It allows the Q command
from vi mode to switch it into
ex mode. The view variant is like vi, except that the readonly option is set initially.
nvi has a number of command-line options. The most useful are described here:
-ccommandExecute command upon startup. This is the POSIX version of the historical
+command syntax, but nvi is not limited to positioning commands. (The old syntax is also accepted.)-FDon’t copy the entire file when starting to edit. This may be faster, but it allows the possibility of someone else changing the file while you’re working on it.
-rRecover specified files, or if no files are listed on the command line, list all the files that can be recovered.
-RStart in read-only mode, setting the
readonlyoption.-sEnter batch (script) mode. This is only for ex and is intended for running editing scripts. Prompts and nonerror messages are disabled. This is the POSIX version of the historic “-” argument; nvi supports both.
-SRun with the
secureoption set, disallowing access to external programs.[53]-ttagStart editing at the specified tag.
-wsizeSet the initial window size to size lines.
[53] As with anything labeled “secure,” blind trust is usually inappropriate. Keith Bostic says, though, that you can trust ...