Important Command-Line Arguments

elvis is not typically installed as vi, though it can be. If invoked as ex, it operates as a line editor and allows the Q command from vi mode to switch into ex mode.

elvis has a number of command-line options. The most useful are described here:

-a

Load each file named on the command line into a separate window.

-c command

Execute command upon startup. This is the POSIX version of the historical +command syntax. (The old syntax is also accepted.)

-f filename

Use filename for the session file instead of the default name. Session files are discussed later in this chapter.

-G gui

Use the given interface. The default is the termcap interface. Other choices include x11, windows, curses, open, and quit. Not all the interfaces may be compiled into your version of elvis.

-i

Start editing in input mode instead of in command mode. This may be easier for novice users.

-o logfile

Redirect the startup messages out to a file, instead of stdout/stderr. This is of critical importance to MS Windows users because Windows discards anything written to standard output and standard error, which made WinElvis configuration problems almost impossible to diagnose. With -ofilename you can send the diagnostic info to a file and view it later.

-r

Perform recovery after a crash.

-R

Start editing each file in read-only mode.

-s

Read an ex script from standard input and execute (per the POSIX standard). This bypasses all initialization scripts.

-S

Set the option security=safer for the whole ...

Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.