2 .\" The Regents of the University of California. All rights reserved.
3 .\" Copyright (c) 1994, 1995, 1996
4 .\" Keith Bostic. All rights reserved.
6 .\" Zhihao Yuan. All rights reserved.
8 .\" The vi program is freely redistributable.
9 .\" You are welcome to copy, modify and share it with others
10 .\" under the conditions listed in the LICENSE file.
11 .\" If any company (not individual!) finds vi sufficiently useful
12 .\" that you would have purchased it, or if any company wishes to
13 .\" redistribute it, contributions to the authors would be appreciated.
15 .\" $Id: vi.1,v 9.0 2013/11/02 12:11:56 zy Exp $
45 is a screen-oriented text editor.
47 is a line-oriented text editor.
51 are different interfaces to the same program,
52 and it is possible to switch back and forth during an edit session.
54 is the equivalent of using the
60 This manual page is the one provided with the
61 .Nm nex Ns / Ns Nm nvi
65 .Nm nex Ns / Ns Nm nvi
66 are intended as bug-for-bug compatible replacements for the original
67 Fourth Berkeley Software Distribution
73 For the rest of this manual page,
74 .Nm nex Ns / Ns Nm nvi
75 is used only when it's necessary to distinguish it from the historic
77 .Nm ex Ns / Ns Nm vi .
79 This manual page is intended for users already familiar with
80 .Nm ex Ns / Ns Nm vi .
81 Anyone else should almost certainly read a good tutorial on the
82 editor before this manual page.
83 If you're in an unfamiliar environment,
84 and you absolutely have to get work done immediately,
85 read the section after the options description, entitled
87 It's probably enough to get you going.
89 The following options are available:
90 .Bl -tag -width "-w size "
94 on the first file loaded.
95 Particularly useful for initial positioning in the file, although
97 is not limited to positioning commands.
98 This is the POSIX 1003.2 interface for the historic
101 .Nm nex Ns / Ns Nm nvi
102 supports both the old and new syntax.
104 Start editing in ex mode, as if the command name were
107 Don't copy the entire file when first starting to edit.
108 (The default is to make a copy in case someone else modifies
109 the file during your edit session.)
111 .\" Start editing with the lisp and showmatch options set.
113 Start editing in read-only mode, as if the command name was
119 Recover the specified files, or, if no files are specified,
120 list the files that could be recovered.
121 If no recoverable files by the specified name exist,
122 the file is edited as if the
124 option had not been specified.
128 edit option set, disallowing all access to external programs.
130 Enter batch mode; applicable only to
133 Batch mode is useful when running
136 Prompts, informative messages and other user oriented messages are turned off,
137 and no startup files or environment variables are read.
138 This is the POSIX 1003.2 interface for the historic
141 .Nm nex Ns / Ns Nm nvi
142 supports both the old and new syntax.
144 Start editing at the specified
148 Start editing in vi mode, as if the command name was
151 Set the initial window size to the specified number of lines.
156 is read from the standard input.
159 interface, it is an error if standard input is not a terminal.
162 interface, if standard input is not a terminal,
164 will read commands from it regardless; however, the session will be a
165 batch mode session, exactly as if the
167 option had been specified.
169 This section will tell you the minimum amount that you need to
170 do simple editing tasks using
172 If you've never used any screen editor before,
173 you're likely to have problems even with this simple introduction.
174 In that case you should find someone that already knows
176 and have them walk you through this section.
180 This means that it takes up almost the entire screen,
181 displaying part of the file on each screen line,
182 except for the last line of the screen.
183 The last line of the screen is used for you to give commands to
187 to give information to you.
189 The other fact that you need to understand is that
192 i.e., you are either entering text or you are executing commands,
193 and you have to be in the right mode to do one or the other.
194 You will be in command mode when you first start editing a file.
195 There are commands that switch you into input mode.
196 There is only one key that takes you out of input mode,
201 Key names are written using less-than and greater-than signs, e.g.,
207 on your terminal's keyboard.
208 If you're ever confused as to which mode you're in,
216 will beep at you if you try and do something that's not allowed.
217 It will also display error messages.
219 To start editing a file, enter the following command:
223 The command you should enter as soon as you start editing is:
225 .Dl :set verbose showmode
227 This will make the editor give you verbose error messages and display
228 the current mode at the bottom of the screen.
230 The commands to move around the file are:
233 Move the cursor left one character.
235 Move the cursor down one line.
237 Move the cursor up one line.
239 Move the cursor right one character.
240 .It Aq Cm cursor-arrows
241 The cursor arrow keys should work, too.
243 Search for the string
246 and move the cursor to its first character.
249 The commands to enter new text are:
250 .Bl -tag -width "<escape>"
252 Append new text, after the cursor.
254 Insert new text, before the cursor.
256 Open a new line below the line the cursor is on, and start entering text.
258 Open a new line above the line the cursor is on, and start entering text.
260 Once you've entered input mode using one of the
268 to quit entering text and return to command mode.
271 The commands to copy text are:
274 Copy the line the cursor is on.
276 Append the copied line after the line the cursor is on.
279 The commands to delete text are:
282 Delete the line the cursor is on.
284 Delete the character the cursor is on.
287 The commands to write the file are:
290 Write the file back to the file with the name that you originally used
291 as an argument on the
294 .It Cm :w Ar file_name
295 Write the file back to the file with the name
299 The commands to quit editing and exit the editor are:
302 Quit editing and leave
304 (if you've modified the file, but not saved your changes,
306 will refuse to quit).
308 Quit, discarding any modifications that you may have made.
312 Unusual characters can take up more than one column on the screen,
313 and long lines can take up more than a single screen line.
314 The above commands work on
316 characters and lines,
317 i.e., they affect the entire line no matter how many screen lines it takes up
318 and the entire character no matter how many screen columns it takes up.
319 .Sh REGULAR EXPRESSIONS
321 supports regular expressions
325 for line addresses, as the first part of the
326 .Nm ex Cm substitute ,
330 commands, and in search patterns.
331 Basic regular expressions
333 are enabled by default;
334 extended regular expressions
339 The use of regular expressions can be largely disabled using the
343 The following strings have special meanings in the
345 version of regular expressions:
346 .Bl -bullet -offset 6u
348 An empty regular expression is equivalent to the last regular expression used.
351 matches the beginning of the word.
354 matches the end of the word.
357 matches the replacement part of the last
362 A buffer is an area where commands can save changed or deleted text
365 buffers are named with a single character preceded by a double quote,
369 buffers are the same,
370 but without the double quote.
371 .Nm nex Ns / Ns Nm nvi
372 permits the use of any character without another meaning in the position where
373 a buffer name is expected.
375 All buffers are either in
379 Inserting a buffer in line mode into the text creates new lines for each of the
380 lines it contains, while a buffer in character mode creates new lines for any
383 than the first and last lines it contains.
384 The first and last lines are inserted at the current cursor position, becoming
385 part of the current line.
386 If there is more than one line in the buffer,
387 the current line itself will be split.
390 commands which store text into buffers do so in line mode.
393 commands depend on their associated motion command:
394 .Bl -bullet -offset 6u
412 make the destination buffer character-oriented.
426 make the destination buffer line-oriented.
440 make the destination buffer character-oriented, unless the starting and
441 end positions are the first and last characters on a line.
442 In that case, the buffer is line-oriented.
449 displays the current mode for each buffer.
455 may be referred to using their uppercase equivalent, in which case new content
456 will be appended to the buffer, instead of replacing it.
463 A region of text modified using the
469 commands is placed into the numeric buffer
471 if no other buffer is specified and if it meets one of the following conditions:
472 .Bl -bullet -offset 6u
474 It includes characters from more than one line.
476 It is specified using a line-oriented motion.
478 It is specified using one of the following motion commands:
480 .Cm ` Ns Aq Cm character ,
493 Before this copy is done, the previous contents of buffer
495 are moved into buffer
501 The contents of buffer
504 Note that this rotation occurs
506 of the user specifying another buffer.
509 text may be explicitly stored into the numeric buffers.
510 In this case, the buffer rotation occurs before the replacement of the buffer's
512 The numeric buffers are only available in
516 The following section describes the commands available in the command
520 The following words have a special meaning in the commands description:
522 .Bl -tag -width bigword -compact -offset 3u
524 A set of non-whitespace characters.
526 Temporary area where commands may place text.
527 If not specified, the default buffer is used.
532 A positive number used to specify the desired number of iterations
534 It defaults to 1 if not specified.
536 A cursor movement command which indicates the other end of the affected region
537 of text, the first being the current cursor position.
538 Repeating the command character makes it affect the whole current line.
540 A sequence of letters, digits or underscores.
546 if both present, may be specified in any order.
550 if both present, are effectively multiplied together
551 and considered part of the motion.
553 .Bl -tag -width Ds -compact
558 for the word starting at the cursor position.
567 Two lines of overlap are maintained, if possible.
578 is not given, scroll forward the number of lines specified by the last
585 command, scroll half the number of lines in the current screen.
593 lines, leaving the current line and column as is, if possible.
602 Two lines of overlap are maintained, if possible.
605 Display the following file information:
607 .Pq as given to Nm vi ;
608 whether the file has been modified since it was last written;
609 if the file is read-only;
610 the current line number;
611 the total number of lines in the file;
612 and the current line number as a percentage of the total lines in the file.
624 characters in the current line.
640 lines without changing the current column.
656 lines to the first non-blank character of that line.
668 lines, without changing the current column.
671 Return to the most recent tag context.
682 is not given, scroll backwards the number of lines specified by the last
689 command, scroll half the number of lines in the current screen.
692 Switch to the next lower screen in the window,
693 or to the first screen if there are no lower screens in the window.
701 lines, leaving the current line and column as is, if possible.
704 Suspend the current editor session.
709 command being entered, or cancel it if it is only partial.
712 Push a tag reference onto the tag stack.
715 Switch to the most recently edited file.
725 Move the cursor forward
727 characters without changing the current line.
732 .Ar motion shell-argument(s)
733 .Aq Li carriage-return
735 Replace the lines spanned by
740 .Pq standard output and standard error
741 of the program named by the
743 option, called with a
746 .Ar shell-argument(s)
747 .Pq bundled into a single argument .
749 .Ar shell-argument(s) ,
755 characters are expanded to the current file name,
756 the previous current file name,
757 and the command text of the previous
761 commands, respectively.
762 The special meaning of
767 can be overridden by escaping them with a backslash.
777 .Pq trailing So # Sc or So + Sc
780 the number under the cursor by
782 starting at the cursor position or at the first non-blank
783 character following it.
784 Numbers with a leading
788 are interpreted as hexadecimal numbers.
789 Numbers with a leading
791 are interpreted as octal numbers unless they contain a non-octal digit.
792 Other numbers may be prefixed with a
802 Move the cursor to the end of a line.
805 is specified, additionally move the cursor down
813 the one found at the cursor position or the closest to the right of it.
816 Repeat the previous substitution command on the current line.
819 .Cm ' Ns Aq Ar character
822 .Cm ` Ns Aq Ar character
824 Return to the cursor position marked by the character
832 to the position of the cursor before the last of the following commands:
850 The first form returns to the first non-blank character of the line marked by
852 The second form returns to the line and column marked by
865 sentences backward or forward, respectively.
866 A sentence is an area of text that begins with the first nonblank character
867 following the previous sentence, paragraph, or section
868 boundary and continues until the next period, exclamation point,
869 or question mark character, followed by any number of closing parentheses,
870 brackets, double or single quote characters, followed by
871 either an end-of-line or two whitespace characters.
872 Groups of empty lines
873 .Pq or lines containing only whitespace characters
874 are treated as a single sentence.
880 Reverse find character
881 .Pq i.e., the last Cm F , f , T No or Cm t No command
889 Move to the first non-blank character of the previous line,
899 command that modified text.
903 argument of the repeated command and that of the associated
909 command, the change log is rolled forward or backward, depending on the action
916 .Aq Li carriage-return
922 .Aq Li carriage-return
926 .Aq Li carriage-return
929 .Pf ?\& Ns Ar RE Ns ?\&
932 .Aq Li carriage-return
940 for a regular expression.
944 repeat the last search in the same or opposite directions, respectively.
947 is empty, the last search regular expression is used.
950 is specified, the cursor is placed
952 lines before or after the matched regular expression.
957 commands are used as motion components for the
959 command, there will be no prompt for the text of the command and the previous
962 Multiple search patterns may be grouped together by delimiting them with
963 semicolons and zero or more whitespace characters.
964 These patterns are evaluated from left to right with the final cursor position
965 determined by the last search pattern.
968 command may be appended to the closed search expressions to reposition the
972 Move to the first character in the current line.
983 Repeat the last character find
984 .Pq i.e., the last .Cm F , f , T No or Cm t No command
1000 lines left or right, respectively, by an amount of
1009 The buffer may include
1011 commands too, but they must be expressed as a
1020 then the last buffer executed shall be used.
1026 Enter input mode, appending the text after the end of the line.
1029 argument is given, the characters input are repeated
1031 \- 1 times after input mode is exited.
1045 Change text from the current position to the end-of-line.
1050 the deleted text into
1057 Delete text from the current position to the end-of-line.
1062 the deleted text into
1075 .Cm F Aq Ar character
1079 times backward through the current line for
1088 or the last line of the file if
1096 Move to the screen line
1098 \- 1 lines below the top of the screen.
1104 Enter input mode, inserting the text at the beginning of the line.
1108 the characters input are repeated
1118 lines with the current line.
1119 The spacing between two joined lines is set to two whitespace characters if the
1120 former ends with a question mark, a period or an exclamation point.
1121 It is set to one whitespace character otherwise.
1127 Move to the screen line
1129 \- 1 lines above the bottom of the screen.
1132 Move to the screen line in the middle of the screen.
1138 Enter input mode, appending text in a new line above the current line.
1142 the characters input are repeated
1152 before the current column if
1154 is character-oriented or before the current line if it is line-oriented.
1168 Enter input mode, replacing the characters in the current line.
1172 the characters input are repeated
1174 \- 1 more times upon exit from insert mode.
1188 the deleted text into
1198 times, through the current line for the character after the specified
1202 Restore the current line to its state before the cursor last moved to it.
1219 characters before the cursor, on the current line.
1224 the deleted text into
1239 Write the file and exit
1241 if there are no more files to edit.
1244 commands in a row ignores any remaining file to edit.
1263 Move to the first non-blank character on the current line.
1271 \- 1 lines, to the first non-blank character.
1277 Enter input mode, appending the text after the cursor.
1281 the characters input are repeated
1299 Change the region of text described by
1307 the changed text into
1316 Delete the region of text described by
1324 the deleted text into
1337 .Cm f Aq Ar character
1341 times, through the rest of the current line for
1348 Enter input mode, inserting the text before the cursor.
1352 the characters input are repeated
1360 Save the current context
1369 Enter input mode, appending text in a new line under the current line.
1373 the characters input are repeated
1383 Text is appended after the current column if
1385 is character oriented, or after the current line otherwise.
1404 characters in the current line starting with the current character.
1409 the substituted text into
1419 times, through the current line for the character immediately before
1423 Undo the last change made to the file.
1426 command alternates between these two states.
1429 command, when used immediately after
1431 causes the change log to be rolled forward or backward, depending on the action
1451 characters at the current cursor position, but no more than there are till the
1462 a text region specified by
1474 Redraw, optionally repositioning and resizing the screen.
1477 is specified, limit the screen size to
1482 characters may be used:
1487 is specified, place the line
1489 at the top of the screen.
1490 Otherwise, display the screen after the current screen.
1491 .It Aq Cm carriage-return
1494 at the top of the screen.
1498 in the center of the screen.
1502 at the bottom of the screen.
1507 display the screen before the screen before
1509 .Pq i.e., 2 screens before .
1510 Otherwise, display the screen before the current screen.
1527 position on the current line.
1531 move to the start of the current line.
1548 option is not set, reverse the case of the next
1557 reverses the case of the characters in a text region specified by the
1563 Interrupt the current operation.
1566 character is usually
1569 .Sh VI TEXT INPUT COMMANDS
1570 The following section describes the commands available in the text input mode
1575 .Bl -tag -width Ds -compact
1577 Replay the previous input.
1580 Erase to the previous
1584 .It Cm ^ Ns Aq Cm control-D
1585 Erase all of the autoindent characters, and reset the autoindent level.
1587 .It Cm 0 Ns Aq Cm control-D
1588 Erase all of the autoindent characters.
1595 characters to move forward to the next
1601 Erase the last character.
1603 .It Aq Cm literal next
1604 Escape the next character from any special meaning.
1607 character is usually
1611 Resolve all text input into the file, and return to command mode.
1613 .It Aq Cm line erase
1614 Erase the current line.
1617 .It Aq Cm word erase
1618 Erase the last word.
1619 The definition of word is dependent on the
1632 Insert a character with the specified hexadecimal value into the text.
1635 Interrupt text input mode, returning to command mode.
1638 character is usually
1642 The following section describes the commands available in the
1645 In each entry below, the tag line is a usage synopsis for the command.
1647 .Bl -tag -width Ds -compact
1648 .It Aq Cm end-of-file
1651 .It Cm !\& Ar argument(s)
1657 Execute a shell command, or filter lines through a shell command.
1664 .Cm nu Ns Op Cm mber
1674 Display the selected lines, each preceded with its line number.
1682 .Cm < Ns Op Cm < ...
1693 Display the line number of
1697 is not specified, display the line number of the last line in the file.
1701 .Cm > Ns Op Cm > ...
1708 .Cm ab Ns Op Cm breviate
1715 as an abbreviation for
1717 to the abbreviation list.
1721 .Cm a Ns Op Cm ppend Ns
1724 The input text is appended after the specified line.
1726 .It Cm ar Ns Op Cm gs
1727 Display the argument list.
1732 Background the current screen.
1736 .Cm c Ns Op Cm hange Ns
1740 The input text replaces the specified range.
1743 .Cm chd Ns Op Cm ir Ns
1751 Change the current working directory.
1765 Copy the specified lines after the destination
1769 .Cm cs Ns Op Cm cope
1770 .Cm add | find | help | kill | reset
1772 Execute a Cscope command.
1776 .Cm d Ns Op Cm elete
1781 Delete the lines from the file.
1784 .Cm di Ns Op Cm splay
1785 .Cm b Ns Oo Cm uffers Oc |
1786 .Cm c Ns Oo Cm onnections Oc |
1787 .Cm s Ns Oo Cm creens Oc |
1790 Display buffers, Cscope connections, screens or tags.
1805 Edit a different file.
1808 .Cm exu Ns Op Cm sage
1811 Display usage for an
1819 Display and optionally change the file name.
1828 Foreground the specified screen.
1832 .Cm g Ns Op Cm lobal
1833 .No / Ns Ar pattern Ns /
1839 .No / Ns Ar pattern Ns /
1842 Apply commands to lines matching
1848 .It Cm he Ns Op Cm lp
1849 Display a help message.
1853 .Cm i Ns Op Cm nsert Ns
1856 The input text is inserted before the specified line.
1860 .Cm j Ns Op Cm oin Ns
1865 Join lines of text together.
1873 Display the lines unambiguously.
1876 .Cm map Ns Op Cm !\&
1879 Define or display maps
1880 .Pq for Nm vi No only .
1889 .Cm k Aq Ar character
1891 Mark the line with the mark
1899 Move the specified lines after the target line.
1902 .Cm mk Ns Op Cm exrc Ns
1906 Write the abbreviations, editor options and maps to the specified
1915 Edit the next file from the argument list.
1919 .\" .Cm o Ns Op Cm pen
1920 .\" .No / Ns Ar pattern Ns /
1923 .\" Enter open mode.
1925 .It Cm pre Ns Op Cm serve
1926 Save the file in a form that can later be recovered using the
1933 .Cm rev Ns Op Cm ious Ns
1936 Edit the previous file from the argument list.
1944 Display the specified lines.
1951 Append buffer contents to the current line.
1954 .Cm q Ns Op Cm uit Ns
1957 End the editing session.
1961 .Cm r Ns Op Cm ead Ns
1968 .Cm rec Ns Op Cm over
1973 if it was previously saved.
1976 .Cm res Ns Op Cm ize
1977 .Op Cm + Ns | Ns Cm - Ns
1982 Grow or shrink the current screen.
1985 .Cm rew Ns Op Cm ind Ns
1988 Rewind the argument list.
1993 .Op option Oo = Oo value Oc Oc \ \&...
1995 .Pf \ \& Op nooption ...
1999 Display or set editor options.
2001 .It Cm sh Ns Op Cm ell
2002 Run a shell program.
2005 .Cm so Ns Op Cm urce
2010 commands from a file.
2014 .Cm s Ns Op Cm ubstitute
2016 .Op / Ar pattern No / Ar replace No /
2018 .Pf \ \& Op Ar options
2039 field may contain any of the following sequences:
2045 The replacement part of the previous
2049 If this is the entire
2051 pattern, the replacement part of the previous
2057 is an integer from 1 to 9, the text matched by the #'th subexpression in
2060 Causes the characters up to the end of the line of the next occurrence of
2064 to be converted to lowercase.
2066 Causes the next character to be converted to lowercase.
2068 Causes the characters up to the end of the line of the next occurrence of
2072 to be converted to uppercase.
2074 Causes the next character to be converted to uppercase.
2078 .Cm su Ns Op Cm spend Ns
2082 .Cm st Ns Op Cm op Ns
2086 Suspend the edit session.
2089 character is usually
2098 Edit the file containing the specified tag.
2101 .Cm tagn Ns Op Cm ext Ns
2104 Edit the file containing the next context for the current tag.
2107 .Cm tagp Ns Op Cm op Ns
2109 .Op Ar file | number
2111 Pop to the specified tag in the tags stack.
2114 .Cm tagpr Ns Op Cm ev Ns
2117 Edit the file containing the previous context for the current tag.
2120 .Cm tagt Ns Op Cm op Ns
2123 Pop to the least recent tag on the tags stack, clearing the stack.
2126 .Cm una Ns Op Cm bbreviate
2131 Delete an abbreviation.
2133 .It Cm u Ns Op Cm ndo
2134 Undo the last change made to the file.
2137 .Cm unm Ns Op Cm ap Ns
2141 Unmap a mapped string.
2143 .It Cm ve Ns Op Cm rsion
2144 Display the version of the
2145 .Nm ex Ns / Ns Nm vi
2150 .Cm vi Ns Op Cm sual
2162 .Cm i Ns Op Cm sual Ns
2172 .Cm viu Ns Op Cm sage
2181 .Cm w Ns Op Cm rite Ns
2208 .Cm x Ns Op Cm it Ns
2213 writing the file if it has been modified.
2221 Copy the specified lines to a buffer.
2233 There are a large number of options that may be set
2235 to change the editor's behavior.
2236 This section describes the options, their abbreviations and their
2239 In each entry below, the first part of the tag line is the full name
2240 of the option, followed by any equivalent abbreviations.
2241 The part in square brackets is the default value of the option.
2242 Most of the options are boolean, i.e., they are either on or off,
2243 and do not have an associated value.
2245 Options apply to both
2249 modes, unless otherwise specified.
2251 .It Cm altwerase Bq off
2254 Select an alternate word erase algorithm.
2255 .It Cm autoindent , ai Bq off
2256 Automatically indent new lines.
2257 .It Cm autoprint , ap Bq on
2260 Display the current line automatically.
2261 .It Cm autowrite , aw Bq off
2262 Write modified files automatically when changing files or suspending the editor
2264 .It Cm backup Bq \&"\&"
2265 Back up files before they are overwritten.
2266 .It Cm beautify , bf Bq off
2267 Discard control characters.
2268 .It Cm cdpath Bq "environment variable CDPATH, or current directory"
2269 The directory paths used as path prefixes for the
2272 .It Cm cedit Bq no default
2273 Set the character to edit the colon command-line history.
2274 .It Cm columns , co Bq 80
2275 Set the number of columns in the screen.
2276 .It Cm comment Bq off
2279 Skip leading comments in shell, C and C++ language files.
2280 .It Cm directory , dir Bq "environment variable TMPDIR, or /tmp"
2281 The directory where temporary files are created.
2282 .It Cm edcompatible , ed Bq off
2283 Remember the values of the
2289 commands, instead of initializing them as unset for each new command.
2290 .It Cm errorbells , eb Bq off
2293 Announce error messages with a bell.
2294 .It Cm escapetime Bq 1
2295 The tenths of a second
2296 .Nm ex Ns / Ns Nm vi
2297 waits for a subsequent key to complete an
2300 .It Cm exrc , ex Bq off
2301 Read the startup files in the local directory.
2302 .It Cm extended Bq off
2303 Use extended regular expressions
2305 rather than basic regular expressions
2309 for more information on regular expressions.
2310 .It Cm filec Bq Aq tab
2311 Set the character to perform file path completion on the colon command line.
2312 .It Cm fileencoding , fe Bq auto detect
2313 Set the encoding of the current file.
2315 Flash the screen instead of beeping the keyboard on error.
2316 .It Cm hardtabs, ht Bq 0
2317 Set the spacing between hardware tab settings.
2318 This option currently has no effect.
2319 .It Cm iclower Bq off
2320 Makes all regular expressions case-insensitive,
2321 as long as an upper-case letter does not appear in the search string.
2322 .It Cm ignorecase , ic Bq off
2323 Ignore case differences in regular expressions.
2324 .It Cm inputencoding , ie Bq locale
2325 Set the encoding of your input characters.
2327 The tenths of a second
2328 .Nm ex Ns / Ns Nm vi
2329 waits for a subsequent key to complete a key mapping.
2330 .It Cm leftright Bq off
2333 Do left-right scrolling.
2334 .It Cm lines , li Bq 24
2337 Set the number of lines in the screen.
2341 Modify various search commands and options to work with Lisp.
2342 This option is not yet implemented.
2344 Display lines in an unambiguous fashion.
2346 Attempt to get an exclusive lock on any file being edited, read or written.
2348 When turned off, all regular expression characters except for
2352 are treated as ordinary characters.
2353 Preceding individual characters by
2356 .It Cm matchchars Bq []{}()
2357 Character pairs looked for by the
2360 .It Cm matchtime Bq 7
2363 The tenths of a second
2364 .Nm ex Ns / Ns Nm vi
2365 pauses on the matching character when the
2369 Permit messages from other users.
2370 .It Cm msgcat Bq /usr/share/vi/catalog/
2371 Selects a message catalog to be used to display error and informational
2372 messages in a specified language.
2373 .It Cm modelines , modeline Bq off
2374 Read the first and last few lines of each file for
2377 This option will never be implemented.
2378 .It Cm noprint Bq \&"\&"
2379 Characters that are never handled as printable characters.
2380 .It Cm number , nu Bq off
2381 Precede each line displayed with its current line number.
2383 Display unknown characters as octal numbers, instead of the default
2388 If this option is not set, the
2392 commands are disallowed.
2393 .It Cm optimize , opt Bq on
2396 Optimize text throughput to dumb terminals.
2397 This option is not yet implemented.
2398 .It Cm paragraphs , para Bq "IPLPPPQPP LIpplpipbp"
2401 Define additional paragraph boundaries for the
2406 .It Cm path Bq \&"\&"
2407 Define additional directories to search for files being edited.
2408 .It Cm print Bq \&"\&"
2409 Characters that are always handled as printable characters.
2413 Display a command prompt.
2414 .It Cm readonly , ro Bq off
2415 Mark the file and session as read-only.
2416 .It Cm recdir Bq /var/tmp/vi.recover
2417 The directory where recovery files are stored.
2418 .It Cm redraw , re Bq off
2421 Simulate an intelligent terminal on a dumb one.
2422 This option is not yet implemented.
2424 Remap keys until resolved.
2426 Set the number of lines about which the editor reports changes or yanks.
2430 Display a row/column ruler on the colon command line.
2431 .It Cm scroll , scr Bq "window size / 2"
2432 Set the number of lines scrolled.
2433 .It Cm searchincr Bq off
2438 commands incremental.
2439 .It Cm sections , sect Bq "NHSHH HUnhsh"
2442 Define additional section boundaries for the
2447 .It Cm secure Bq off
2448 Turns off all access to external programs.
2449 .It Cm shell , sh Bq "environment variable SHELL, or /bin/sh"
2450 Select the shell used by the editor.
2451 .It Cm shellmeta Bq ~{[*?$`'\&"\e
2452 Set the meta characters checked to determine if file name expansion
2454 .It Cm shiftwidth , sw Bq 8
2455 Set the autoindent and shift command indentation width.
2456 .It Cm showmatch , sm Bq off
2459 Note the left matching characters when the right ones are inserted.
2460 .It Cm showmode , smd Bq off
2463 Display the current editor mode and a
2466 .It Cm sidescroll Bq 16
2469 Set the amount a left-right scroll will shift.
2470 .It Cm slowopen , slow Bq off
2471 Delay display updating during text input.
2472 This option is not yet implemented.
2473 .It Cm sourceany Bq off
2474 Read startup files not owned by the current user.
2475 This option will never be implemented.
2476 .It Cm tabstop , ts Bq 8
2477 This option sets tab widths for the editor display.
2478 .It Cm taglength , tl Bq 0
2479 Set the number of significant characters in tag names.
2480 .It Cm tags , tag Bq tags
2481 Set the list of tags files.
2483 .Cm term , ttytype , tty
2484 .Bq "environment variable TERM"
2486 Set the terminal type.
2488 This option has historically made editor messages less verbose.
2489 It has no effect in this implementation.
2490 .It Cm tildeop Bq off
2493 command to take an associated motion.
2494 .It Cm timeout , to Bq on
2495 Time out on keys which may be mapped.
2496 .It Cm ttywerase Bq off
2499 Select an alternate erase algorithm.
2500 .It Cm verbose Bq off
2503 Display an error message for every error.
2504 .It Cm w300 Bq no default
2507 Set the window size if the baud rate is less than 1200 baud.
2508 .It Cm w1200 Bq no default
2511 Set the window size if the baud rate is equal to 1200 baud.
2512 .It Cm w9600 Bq no default
2515 Set the window size if the baud rate is greater than 1200 baud.
2519 This option causes a warning message to be printed on the terminal
2520 if the file has been modified since it was last written, before a
2525 .Bq "environment variable LINES \- 1"
2527 Set the window size for the screen.
2528 .It Cm windowname Bq off
2529 Change the icon/window name to the current file name.
2530 .It Cm wraplen , wl Bq 0
2533 Break lines automatically,
2534 the specified number of columns from the left-hand margin.
2539 edit options are set, the
2542 .It Cm wrapmargin , wm Bq 0
2545 Break lines automatically,
2546 the specified number of columns from the right-hand margin.
2551 edit options are set, the
2554 .It Cm wrapscan , ws Bq on
2555 Set searches to wrap around the end or beginning of the file.
2556 .It Cm writeany , wa Bq off
2557 Turn off file-overwriting checks.
2560 .Bl -tag -width "COLUMNS"
2562 The number of columns on the screen.
2563 This value overrides any system or terminal specific values.
2566 environment variable is not set when
2567 .Nm ex Ns / Ns Nm vi
2570 option is explicitly reset by the user,
2571 .Nm ex Ns / Ns Nm vi
2572 enters the value into the environment.
2576 startup commands, read after
2582 The user's home directory, used as the initial directory path for the startup
2587 This value is also used as the default directory for the
2591 The number of rows on the screen.
2592 This value overrides any system or terminal specific values.
2595 environment variable is not set when
2596 .Nm ex Ns / Ns Nm vi
2599 option is explicitly reset by the user,
2600 .Nm ex Ns / Ns Nm vi
2601 enters the value into the environment.
2605 startup commands, read after
2608 The user's shell of choice
2609 .Pq see also the Cm shell No option .
2611 The user's terminal type.
2612 The default is the type
2616 environment variable is not set when
2617 .Nm ex Ns / Ns Nm vi
2620 option is explicitly reset by the user,
2621 .Nm ex Ns / Ns Nm vi
2622 enters the value into the environment.
2624 The location used to store temporary files
2625 .Pq see also the Cm directory No edit option .
2627 .Sh ASYNCHRONOUS EVENTS
2628 .Bl -tag -width "SIGWINCH" -compact
2630 .Nm vi Ns / Ns Nm ex
2631 uses this signal for periodic backups of file modifications and to display
2633 messages when operations are likely to take a long time.
2637 If the current buffer has changed since it was last written in its entirety,
2638 the editor attempts to save the modified file so it can be later recovered.
2640 .Nm vi Ns / Ns Nm ex
2641 reference manual section
2643 for more information.
2646 When an interrupt occurs, the current operation is halted
2647 and the editor returns to the command level.
2648 If interrupted during text input,
2649 the text already input is resolved into the file as if the text
2650 input had been normally terminated.
2653 The screen is resized.
2655 .Nm vi Ns / Ns Nm ex
2656 reference manual section
2657 .Sx Sizing the Screen
2658 for more information.
2662 .\" .Nm vi Ns / Ns Nm ex
2663 .\" ignores these signals.
2666 .Bl -tag -width "/var/tmp/vi.recover"
2668 The default user shell.
2675 commands first in the startup sequence.
2676 Must be owned by root or the user,
2677 and writable only by the owner.
2679 Temporary file directory.
2680 .It Pa /var/tmp/vi.recover
2681 The default recovery file directory.
2683 First choice for user's home directory startup file, read for
2685 commands right after
2692 Must be owned by root or the user,
2693 and writable only by the owner.
2695 Second choice for user's home directory startup file, read for
2697 commands under the same conditions as
2700 First choice for local directory startup file, read for
2702 commands at the end of the startup sequence if the
2704 option was turned on earlier.
2705 Must be owned by the user
2706 and writable only by the owner.
2708 Second choice for local directory startup file, read for
2710 commands under the same conditions as
2718 utilities exit 0 on success,
2719 and \*(Gt0 if an error occurs.
2725 .Nm nex Ns / Ns Nm nvi
2728 That document differs from historical
2729 .Nm ex Ns / Ns Nm vi
2730 practice in several places; there are changes to be made on both sides.
2734 editor first appeared in
2737 .Nm nex Ns / Ns Nm nvi
2738 replacements for the
2739 .Nm ex Ns / Ns Nm vi
2740 editor first appeared in
2744 wrote the original version of