Appendix B. Setting Options

This appendix describes the important set command options for the “Heirloom” vi, Solaris /usr/xpg7/bin/vi, and Vim 8.2.

Heirloom and Solaris vi Options

Table B-1 contains brief descriptions of the important set command options. In the first column, options are listed in alphabetical order; if the option can be abbreviated, that abbreviation is shown in parentheses. The second column shows the default setting that vi uses unless you issue an explicit set command (either manually or in the .exrc file). The last column describes what the option does when enabled.

Table B-1. “Heirloom” and Solaris vi set options
Option Default Description

autoindent (ai)

noai

In insert mode, indent each line to the same level as the line above or below. Use with the shiftwidth option.

autoprint (ap)

ap

Change the display after each editor command. For global replacement, display the last replacement.

autowrite (aw)

noaw

Automatically write (save) the file if changed before opening another file with :n or before giving a Unix command with :!.

beautify (bf)

nobf

Ignore all control characters during input (except tab, newline, or form feed).

directory (dir)

/var/tmp

Names the directory in which ex/vi stores buffer files. The directory must be writable.

edcompatible

noedcompatible

Remember the flags used with the most recent substitute command (global, confirming), and use them for the next substitute command. Despite the name, no version of ed actually does ...

Get Learning the vi and Vim Editors, 8th 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.