home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

C.2 nvi 1.79 Options

nvi 1.79 has a total of 78 options that affect its behavior. Table C.2 summarizes the most important ones. Most options described in Table C.1 are not repeated here.

Table C.2: nvi 1.79 Set Options
Option Default Description

A string describing a backup filename to use. The current contents of a file are saved in this file before writing the new data out. For example, a value of "N%.bak" causes nvi to include a version number at the end of the file; version numbers are always incremented.


environment variable CDPATH , or current directory

A search path for the :cd command.


When the first character of this string is entered on the colon command line, nvi opens a new window on the command history that you can then edit. Hitting [RETURN] on any given line executes that line. [ESC] is a good choice for this option. (Use ^V ^[ to enter it.)

comment nocomment

If the first non-empty line begins with /* , // , or # , nvi skips the comment text before displaying the file. This avoids displaying long, boring legal notices.

directory (dir)

environment variable TMPDIR , or /tmp

The directory where nvi puts its temporary files.

extended noextended

Searches use egrep -style extended regular expressions.


When the first character of this string is entered on the colon command line, nvi treats the blank delimited word in front of the cursor as if it had an * appended to it and does shell-style filename expansion. [ESC] is a also good choice for this option. (Use ^V ^[ to enter it.) When this character is the same as for the cedit option, command line editing is performed only when the character is entered as the first character on the colon command line.

iclower noiclower

Make all regular expression searches case insensitive, as long as the search pattern contains no uppercase letters.

leftright noleftright

Long lines scroll the screen left to right, instead of wrapping.

lock lock

nvi attempts to get an exclusive lock on the file. Editing a file that cannot be locked creates a read-only session.

octal nooctal

Displays unknown characters in octal, instead of in hexadecimal.


A colon-separated list of directories in which nvi will look for the file to be edited.

recdir /var/tmp/vi.recover

The directory where recovery files are stored.

ruler noruler

Displays the row and column of the cursor.

searchincr nosearchincr

Searches are done incrementally.

secure nosecure

Turns off access to external programs via text filtering (:r! , :w! ), disables the vi mode ! and ^Z commands, and the ex mode ! , shell , stop , and suspend commands. Once set, it cannot be changed.

shellmeta ~{[*?$`'"\

When any of these characters appear in a filename argument to an ex command, the argument is expanded by the program named by the shell option.

showmode (smd) noshowmode

Displays a string in the status line showing the current mode. Displays an * if the file has been modified.

sidescroll 16

The number of columns by which the screen is shifted left or right when leftright is true.

taglength (tl) 0

Defines number of characters that are significant for tags. Default (zero) means that all characters are significant.

tags (tag)

tags /var/db/libc.tags /sys/kern/tags

The list of possible tag files.

tildeop notildeop

The ~ command takes an associated motion, not just a preceding count.

wraplen (wl) 0

Identical to the wrapmargin option, except that it specifies the number of characters from the left margin at which the line will be split. The value of wrapmargin overrides wraplen .

Previous: C.1 Solaris 2.6 vi Options Learning the vi Editor Next: C.3 elvis 2.0 Options
C.1 Solaris 2.6 vi Options Book Index C.3 elvis 2.0 Options

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System