VI(1) VI(1)
NAME
ex, vi, view - text editors
SYNOPSIS
ex [-eFGRrSsv] [-c cmd] [-t tag] [-w size] [file ...]
vi [-eFGlRrSv] [-c cmd] [-t tag] [-w size] [file ...]
view [-eFGRrSv] [-c cmd] [-t tag] [-w size] [file ...]
LICENSE
The vi program is freely redistributable. You are welcome
to copy, modify and share it with others under the condi-
tions listed in the LICENSE file. If any company (not
individual!) finds vi sufficiently useful that you would
have purchased it, or if any company wishes to redis-
tribute it, contributions to the authors would be appreci-
ated.
DESCRIPTION
Vi is a screen oriented text editor. Ex is a line-ori-
ented text editor. Ex and vi are different interfaces to
the same program, and it is possible to switch back and
forth during an edit session. View is the equivalent of
using the -R (read-only) option of vi.
This manual page is the one provided with the nex/nvi ver-
sions of the ex/vi text editors. Nex/nvi are intended as
bug-for-bug compatible replacements for the original
Fourth Berkeley Software Distribution (4BSD) ex and vi
programs. For the rest of this manual page, nex/nvi is
used only when it's necessary to distinguish it from the
historic implementations of ex/vi.
This manual page is intended for users already familiar
with ex/vi. Anyone else should almost certainly read a
good tutorial on the editor before this manual page. If
you're in an unfamiliar environment, and you absolutely
have to get work done immediately, read the section after
the options description, entitled ``Fast Startup''. It's
probably enough to get you going.
The following options are available:
-c Execute cmd immediately after starting the edit
session. Particularly useful for initial position-
ing in the file, however cmd is not limited to
positioning commands. This is the POSIX 1003.2
interface for the historic ``+cmd'' syntax.
Nex/nvi supports both the old and new syntax.
-e Start editing in ex mode, as if the command name
were ex.
-F Don't copy the entire file when first starting to
edit. (The default is to make a copy in case some-
one else modifies the file during your edit ses-
sion.)
-l Start editing with the lisp and showmatch options
set.
-G Start editing in gtags mode, as if the gtagsmode
option was set.
-R Start editing in read-only mode, as if the command
name was view, or the readonly option was set.
-r Recover the specified files, or, if no files are
specified, list the files that could be recovered.
If no recoverable files by the specified name
exist, the file is edited as if the -r option had
not been specified.
-S Run with the secure edit option set, disallowing
all access to external programs.
-s Enter batch mode; applicable only to ex edit ses-
sions. Batch mode is useful when running ex
scripts. Prompts, informative messages and other
user oriented message are turned off, and no
startup files or environment variables are read.
This is the POSIX 1003.2 interface for the historic
``-'' argument. Nex/nvi supports both the old and
new syntax.
-t Start editing at the specified tag. (See
ctags(1)).
-w Set the initial window size to the specified number
of lines.
-v Start editing in vi mode, as if the command name
was vi or view.
Command input for ex/vi is read from the standard input.
In the vi interface, it is an error if standard input is
not a terminal. In the ex interface, if standard input is
not a terminal, ex will read commands from it regardless,
however, the session will be a batch mode session, exactly
as if the -s option had been specified.
Ex/vi exits 0 on success, and greater than 0 if an error
occurs.