Each option is recognized by vi or ex (or both) as indicated and some can be abbreviated.
autoindent (vi/ex)
abbr: ai default: noai
To change autoindent on a new line, space over to the desired column to increase
indent. To decrease indent to previous shiftwidth value, use
<ctrl>D as first character in the line. To input a single line with no
indent and return to previous indent, use ^ followed by <ctrl>D
at beg of unindented line. If a new line starts with one or more <tab>s or
<space>s, the next following line is started at the new indent.
autoprint (ex)
abbr: ap default: ap
Option prints current line after the commands:
copy, delete, join, l, move, shift, substitute, undo
essentially autoprint performs the same as the p flag at the end
of each of above commands.
autowrite (vi/ex)
abbr: aw default: noaw
Buffer contents is written to the current file if vi or ex encounters:
rewind, tag, ! (shell escape)
In vi ^ (switch files) or ^| (tag goto) trigger
autowrite. If we want to bypass autowrite, we can use ! (forced
command). To prevent autowrite:
quit! |
instead of quit |
edit |
instead of next |
rewind! |
instead of rewind |
stop! |
followed by the tag! command instead of
tag |
shell |
instead of ! |
from vi:
:e# (switching between two files)
:ta! (using tag files to find text segments)
beautify (vi/ex)
abbr: bf default: nobf
Allows to eliminate all control characters except <tab>, newline and
formfeed when we enter text in insert or append mode.
closepunct (vi/ex)
abbr: none default: '".,;)]}
Define punctuation for words.
directory (vi/ex)
abbr: dir default: dir=/var/tmp
Specifies which directory (platform dependent) is used by the editor for temporary file buffering. Option does not affect the buffer location if it is set during the session. Used for recovery after crash, file system full, etc.
edcompatible (vi/ex)
abbr: ed default: noed
When this option is enabled, if g (global) or c (check) flags
are present in a substitute command, the flags are toggled and the command
is processed accordingly.
errorbells (vi/ex)
abbr: eb default: noeb
Used only on terminals that do not support inverse video to print messages.
flash
abbr: fl default: fl
Use visible flash rather than bell.
hardtabs (vi/ex)
abbr: ht default: ht=8
Defines spacing between hardware <tab> setting and number of spaces used
by the system when expanding <tab> characters.
ignorecase (vi/ex)
abbr: ic default: noic
Matching regular expressions, command maps all uppercase characters in text to lowercase.
lisp (vi/ex)
abbr: none default: nolisp
Special autoindent for Lisp source.
list (vi/ex)
abbr: none default: nolist
Shows tabs and newline.
magic (vi/ex)
abbr: none default: magic
Setting nomagic reduces the number of regular expression metacharacters to only
^ and $. To reenable metacharacters while in nomagic, precede them
with \.
mesg (vi/ex)
abbr: none default: mesg
Enables other users to send messages to terminal.
modeline (vi/ex)
abbr: none default: nomodeline
With modeline the editor scans the first and last five lines in file
looking for ex commands. modelines must appear in a single line as:
ex: set <option>:
To separate multiple command on a single line, use |
(vertical bar).
novice
abbr: none default: nonovice
Guided usage for newcomers.
number (vi/ex)
abbr: nu default: nonu
Displays lines with line number.
open (ex)
abbr: op default: open
Allows entry to vi mode from ex
optimize (vi/ex)
abbr: opt default: noopt
Suppresses automatic CR by the terminal when direct cursor
addressing is not supported. Speed up operation of terminal without cursor
addressing.
paragraphs (vi/ex)
abbr: para default: paragraphs=IPLPPPQPP LIpplpipbp
Specifies the one/two-character macro name to be used by nroff.
partialcharacter
abbr: pc default: -
Undocumented.
prompt (ex)
abbr: none default: prompt
Editor prompts for new commands by typing : (colon), the ex prompt.
readonly (vi/ex)
abbr: ro default: noreadonly
Set readonly attribute to editing file.
redraw (vi/ex)
abbr: none default: redraw
Option simulates intelligent on dumb terminal. Editor prints new characters on current line to the right of cursor and reprints lines as needed when inserting, deleting or changing visible characters on display.
remap (vi/ex)
abbr: none default: remap
Links a macro directly to last macro found in series. For examples if a is
mapped to b and b to c, remap will map a to c.
report (vi/ex)
abbr: none default: report=5
Sets a threshold of changes (number of lines). Editor will notify when this threshold is exceeded.
scroll (vi/ex)
abbr: none default: scroll=11
Sets number of lines scrolled when editor receives <ctrl>D.
sections (vi/ex)
abbr: sect default: sect=NHSHH HUnhsh
Specifies the one/two-character macro name to be used by nroff.
shell (vi/ex)
abbr: sh default: sh=/bin/sh
Defines path and filename of user SHELL environment variable.
shiftwidth (vi/ex)
abbr: sw default: sw=8
Sets spacing between <tab> stops. The editor uses shiftwidth
to reverse tabbing with <ctrl>D, when using autoindent while
appending text, and when using the << and >> shift commands.
showmatch (vi/ex)
abbr: sm default: nosm
In open mode, while inserting text, the cursor moves to the
matching open parenthesis or curly bracket ( or {
for one second when the closing item ) or } is typed and
then returns to closing matching character.
showmode (vi)
abbr: smd default: nosmd
Display at screen bottom whether vi is in insert mode.
slowopen (vi/ex)
abbr: slow default: noslow
Only for slow terminals.
tabstop (vi/ex)
abbr: ts default: tabstop=8
Defines tab spacing used when the editor expands tabs.
taglength (vi/ex)
abbr: tl default: tl=0
Defines the maximum number of characters considered significant in a tag.
Setting tl to 0 makes all characters significant.
tags (vi/ex)
abbr: none default: tags=tags /usr/lib/tags
Defines path and filename to be used as tag files for the tag command
or the -t editor startup option.
term (vi/ex)
abbr: none default: term=vt300
Defines terminal type.
terse (vi/ex)
abbr: none default: noterse
Types shorter error diagnostics.
timeout (vi/ex)
abbr: none default: timeout
If set, the timeout function is enabled, meaning that if an escape character is not followed within the time limit by another character, the escape is treated as a separate character rather than as part of a two-character sequence.
ttytype (vi/ex)
abbr: none default: ttytype=vt300
Defines ttytype for the terminal in use with the editor.
warn (vi/ex)
abbr: none default: warn
The editor displays the following warning message:
before the ! shell subcommand executes a
shell command, when the editing buffer has been changed over the
threshold without writing.
window (vi/ex)
abbr: none default: window=23
Specifies the number of lines displayed in a text window.
wrapscan (vi)
abbr: ws default: wrapscan
Pattern searches resulting from the /?nN search commands
automatically wrap around the file to opposite EOF and continue
whenever BOF or EOF is reached.
wrapmargin (vi/ex)
abbr: wm default: wrapmargin=0
Specifies the number of chars from the right margin the editor should use
for automatic wrapping, i.e. force automatic insertion of <LF><NL>
sequences.
writeany
abbr: wa default: nowriteany
Option inhibits checks before write command, so we can write to any file that system's protection will allow.
nosourceany
Allows the use of the source command of a file not owned by user.