xref: /minix3/external/bsd/nvi/dist/docs/vi.ref/ex.cmd.texi (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc@comment  Copyright (c) 1994
2*84d9c625SLionel Sambuc@comment 	The Regents of the University of California.  All rights reserved.
3*84d9c625SLionel Sambuc@comment  Copyright (c) 1994, 1995, 1996
4*84d9c625SLionel Sambuc@comment 	Keith Bostic.  All rights reserved.
5*84d9c625SLionel Sambuc@comment
6*84d9c625SLionel Sambuc@comment  See the LICENSE file for redistribution information.
7*84d9c625SLionel Sambuc@comment
8*84d9c625SLionel Sambuc@comment 	Id: ex.cmd.texi,v 8.2 2001/08/20 16:05:50 skimo Exp  (Berkeley) Date: 2001/08/20 16:05:50
9*84d9c625SLionel Sambuc@comment
10*84d9c625SLionel Sambuc@chapter Ex Description
11*84d9c625SLionel Sambuc
12*84d9c625SLionel SambucThe following words have special meanings for
13*84d9c625SLionel Sambuc@CO{ex}
14*84d9c625SLionel Sambuccommands.
15*84d9c625SLionel Sambuc@itemize @bullet
16*84d9c625SLionel Sambuc@cindex "<end-of-file>"
17*84d9c625SLionel Sambuc@IP{<end-of-file>}
18*84d9c625SLionel Sambuc
19*84d9c625SLionel SambucThe end-of-file character is used to scroll the screen in the
20*84d9c625SLionel Sambuc@CO{ex}
21*84d9c625SLionel Sambuceditor.
22*84d9c625SLionel SambucThis character is normally
23*84d9c625SLionel Sambuc@LI{<control-D>}.
24*84d9c625SLionel SambucHowever, whatever character is set for the current terminal is supported
25*84d9c625SLionel Sambucas well as
26*84d9c625SLionel Sambuc@LI{<control-D>}.
27*84d9c625SLionel Sambuc@cindex "line"
28*84d9c625SLionel Sambuc@IP{line}
29*84d9c625SLionel Sambuc
30*84d9c625SLionel SambucA single-line address, given in any of the forms described in the
31*84d9c625SLionel Sambucsection entitled
32*84d9c625SLionel Sambuc@QB{Ex Addressing} .
33*84d9c625SLionel SambucThe default for
34*84d9c625SLionel Sambuc@LI{line}is the current line.
35*84d9c625SLionel Sambuc@cindex "range"
36*84d9c625SLionel Sambuc@IP{range}
37*84d9c625SLionel Sambuc
38*84d9c625SLionel SambucA line, or a pair of line addresses, separated by a comma or semicolon.
39*84d9c625SLionel Sambuc(See the section entitled
40*84d9c625SLionel Sambuc@QB{Ex Addressing}
41*84d9c625SLionel Sambucfor more information.)
42*84d9c625SLionel SambucThe default for range is the current line
43*84d9c625SLionel Sambuc@emph{only},
44*84d9c625SLionel Sambuci.e.
45*84d9c625SLionel Sambuc@QT{.,.}.
46*84d9c625SLionel SambucA percent sign
47*84d9c625SLionel Sambuc@PQ{%}
48*84d9c625SLionel Sambucstands for the range
49*84d9c625SLionel Sambuc@QT{1,$}.
50*84d9c625SLionel SambucThe starting address must be less than, or equal to, the ending address.
51*84d9c625SLionel Sambuc@cindex "count"
52*84d9c625SLionel Sambuc@IP{count}
53*84d9c625SLionel Sambuc
54*84d9c625SLionel SambucA positive integer, specifying the number of lines to be affected by
55*84d9c625SLionel Sambucthe command; the default is 1.
56*84d9c625SLionel SambucGenerally, a count past the end-of-file may be specified, e.g. the
57*84d9c625SLionel Sambuccommand
58*84d9c625SLionel Sambuc@QT{p 3000}
59*84d9c625SLionel Sambucin a 10 line file is acceptable, and will print from the current line
60*84d9c625SLionel Sambucthrough the last line in the file.
61*84d9c625SLionel Sambuc@cindex "flags"
62*84d9c625SLionel Sambuc@IP{flags}
63*84d9c625SLionel Sambuc
64*84d9c625SLionel SambucOne or more of the characters
65*84d9c625SLionel Sambuc@QQ{#},
66*84d9c625SLionel Sambuc@QQ{p},
67*84d9c625SLionel Sambucand
68*84d9c625SLionel Sambuc@QQ{l}.
69*84d9c625SLionel SambucWhen a command that accepts these flags completes, the addressed line(s)
70*84d9c625SLionel Sambucare written out as if by the corresponding
71*84d9c625SLionel Sambuc@CO{#},
72*84d9c625SLionel Sambuc@CO{l}
73*84d9c625SLionel Sambucor
74*84d9c625SLionel Sambuc@CO{p}
75*84d9c625SLionel Sambuccommands.
76*84d9c625SLionel SambucIn addition, any number of
77*84d9c625SLionel Sambuc@QT{+}
78*84d9c625SLionel Sambucor
79*84d9c625SLionel Sambuc@QT{-}
80*84d9c625SLionel Sambuccharacters can be specified before, after, or during the flags, in which
81*84d9c625SLionel Sambuccase the line written is not necessarily the one affected by the command,
82*84d9c625SLionel Sambucbut rather the line addressed by the offset address specified.
83*84d9c625SLionel SambucThe default for
84*84d9c625SLionel Sambuc@LI{flags}is none.
85*84d9c625SLionel Sambuc@cindex "file"
86*84d9c625SLionel Sambuc@IP{file}
87*84d9c625SLionel Sambuc
88*84d9c625SLionel SambucA pattern used to derive a pathname; the default is the current file.
89*84d9c625SLionel SambucFile names are subjected to normal
90*84d9c625SLionel Sambuc@XR{sh,1}
91*84d9c625SLionel Sambucword expansions.
92*84d9c625SLionel Sambuc@end itemize
93*84d9c625SLionel Sambuc
94*84d9c625SLionel SambucAnywhere a file name is specified, it is also possible to use
95*84d9c625SLionel Sambucthe special string
96*84d9c625SLionel Sambuc@QT{/tmp}.
97*84d9c625SLionel SambucThis will be replaced with a temporary file name which can be used
98*84d9c625SLionel Sambucfor temporary work, e.g.
99*84d9c625SLionel Sambuc@QT{:e /tmp}
100*84d9c625SLionel Sambuccreates and edits a new file.
101*84d9c625SLionel Sambuc
102*84d9c625SLionel SambucIf both a count and a range are specified for commands that use either,
103*84d9c625SLionel Sambucthe starting line for the command is the
104*84d9c625SLionel Sambuc@emph{last}
105*84d9c625SLionel Sambucline addressed by the range, and
106*84d9c625SLionel Sambuc@LI{count}- 1
107*84d9c625SLionel Sambucsubsequent lines are affected by the command, e.g. the command
108*84d9c625SLionel Sambuc@QT{2,3p4}
109*84d9c625SLionel Sambucprints out lines 3, 4, 5 and 6.
110*84d9c625SLionel Sambuc
111*84d9c625SLionel SambucWhen only a line or range is specified, with no command, the implied
112*84d9c625SLionel Sambuccommand is either a
113*84d9c625SLionel Sambuc@CO{list},
114*84d9c625SLionel Sambuc@CO{number}
115*84d9c625SLionel Sambucor
116*84d9c625SLionel Sambuc@CO{print}
117*84d9c625SLionel Sambuccommand.
118*84d9c625SLionel SambucThe command used is the most recent of the three commands to have been
119*84d9c625SLionel Sambucused (including any use as a flag).
120*84d9c625SLionel SambucIf none of these commands have been used before, the
121*84d9c625SLionel Sambuc@CO{print}
122*84d9c625SLionel Sambuccommand is the implied command.
123*84d9c625SLionel SambucWhen no range or count is specified and the command line is a blank line,
124*84d9c625SLionel Sambucthe current line is incremented by 1 and then the current line is displayed.
125*84d9c625SLionel Sambuc
126*84d9c625SLionel SambucZero or more whitespace characters may precede or follow the addresses,
127*84d9c625SLionel Sambuccount, flags, or command name.
128*84d9c625SLionel SambucAny object following a command name (such as buffer, file, etc.),
129*84d9c625SLionel Sambucthat begins with an alphabetic character,
130*84d9c625SLionel Sambucshould be separated from the command name by at least one whitespace
131*84d9c625SLionel Sambuccharacter.
132*84d9c625SLionel Sambuc
133*84d9c625SLionel SambucAny character, including
134*84d9c625SLionel Sambuc@LI{<carriage-return>},
135*84d9c625SLionel Sambuc@QT{%}
136*84d9c625SLionel Sambucand
137*84d9c625SLionel Sambuc@QT{#}
138*84d9c625SLionel Sambucretain their literal value when preceded by a backslash.
139*84d9c625SLionel Sambuc@chapter Ex Commands
140*84d9c625SLionel Sambuc
141*84d9c625SLionel SambucThe following section describes the commands available in the
142*84d9c625SLionel Sambuc@CO{ex}
143*84d9c625SLionel Sambuceditor.
144*84d9c625SLionel SambucIn each entry below, the tag line is a usage synopsis for the command.
145*84d9c625SLionel Sambuc
146*84d9c625SLionel SambucEach command can be entered as the abbreviation
147*84d9c625SLionel Sambuc(those characters in the synopsis command word preceding the
148*84d9c625SLionel Sambuc@QQ{[}
149*84d9c625SLionel Sambuccharacter),
150*84d9c625SLionel Sambucthe full command (all characters shown for the command word,
151*84d9c625SLionel Sambucomitting the
152*84d9c625SLionel Sambuc@QQ{[}
153*84d9c625SLionel Sambucand
154*84d9c625SLionel Sambuc@QQ{]}
155*84d9c625SLionel Sambuccharacters),
156*84d9c625SLionel Sambucor any leading subset of the full command down to the abbreviation.
157*84d9c625SLionel SambucFor example, the args command (shown as
158*84d9c625SLionel Sambuc@QT{ar[gs]}
159*84d9c625SLionel Sambucin the synopsis)
160*84d9c625SLionel Sambuccan be entered as
161*84d9c625SLionel Sambuc@QT{ar},
162*84d9c625SLionel Sambuc@QT{arg}
163*84d9c625SLionel Sambucor
164*84d9c625SLionel Sambuc@QT{args}.
165*84d9c625SLionel Sambuc
166*84d9c625SLionel SambucEach
167*84d9c625SLionel Sambuc@CO{ex}
168*84d9c625SLionel Sambuccommand described below notes the new current line after it
169*84d9c625SLionel Sambucis executed, as well as any options that affect the command.
170*84d9c625SLionel Sambuc@cindex DOUBLEQUOTE
171*84d9c625SLionel Sambuc@deftypefn Command {} {"}
172*84d9c625SLionel Sambuc
173*84d9c625SLionel SambucA comment.
174*84d9c625SLionel SambucCommand lines beginning with the double-quote character
175*84d9c625SLionel Sambuc@PQ{"}
176*84d9c625SLionel Sambucare ignored.
177*84d9c625SLionel SambucThis permits comments in editor scripts and startup files.
178*84d9c625SLionel Sambuc@end deftypefn
179*84d9c625SLionel Sambuc@cindex "<control-D>"
180*84d9c625SLionel Sambuc@cindex "<end-of-file>"
181*84d9c625SLionel Sambuc@deftypefn Command {} {<control-D>}
182*84d9c625SLionel Sambuc
183*84d9c625SLionel Sambuc@deftypefnx Command {} {<end-of-file>}
184*84d9c625SLionel Sambuc
185*84d9c625SLionel SambucScroll the screen.
186*84d9c625SLionel SambucWrite the next N lines, where N is the value of the
187*84d9c625SLionel Sambuc@OP{scroll}
188*84d9c625SLionel Sambucoption.
189*84d9c625SLionel SambucThe command is the end-of-file terminal character, which may be
190*84d9c625SLionel Sambucdifferent on different terminals.
191*84d9c625SLionel SambucTraditionally, it is the
192*84d9c625SLionel Sambuc@LI{<control-D>}key.
193*84d9c625SLionel Sambuc@sp 1
194*84d9c625SLionel SambucHistorically, the
195*84d9c625SLionel Sambuc@CO{eof}
196*84d9c625SLionel Sambuccommand ignored any preceding count, and the
197*84d9c625SLionel Sambuc@LI{<end-of-file>}character was ignored unless it was entered as the first character
198*84d9c625SLionel Sambucof the command.
199*84d9c625SLionel SambucThis implementation treats it as a command
200*84d9c625SLionel Sambuc@emph{only}
201*84d9c625SLionel Sambucif entered as the first character of the command line, and otherwise
202*84d9c625SLionel Sambuctreats it as any other character.
203*84d9c625SLionel Sambuc@table @asis
204*84d9c625SLionel Sambuc@item Line:
205*84d9c625SLionel SambucSet to the last line written.
206*84d9c625SLionel Sambuc@item Options:
207*84d9c625SLionel SambucAffected by the
208*84d9c625SLionel Sambuc@OP{scroll}
209*84d9c625SLionel Sambucoption.
210*84d9c625SLionel Sambuc@end table
211*84d9c625SLionel Sambuc@end deftypefn
212*84d9c625SLionel Sambuc@cindex "!"
213*84d9c625SLionel Sambuc@deftypefn Command {} {!} {argument(s)}
214*84d9c625SLionel Sambuc
215*84d9c625SLionel Sambuc@deftypefnx Command {}  {[range]!} {argument(s)}
216*84d9c625SLionel SambucExecute a shell command, or filter lines through a shell command.
217*84d9c625SLionel SambucIn the first synopsis, the remainder of the line after the
218*84d9c625SLionel Sambuc@QT{!}
219*84d9c625SLionel Sambuccharacter is passed to the program named by the
220*84d9c625SLionel Sambuc@OP{shell}
221*84d9c625SLionel Sambucoption, as a single argument.
222*84d9c625SLionel Sambuc@sp 1
223*84d9c625SLionel SambucWithin the rest of the line,
224*84d9c625SLionel Sambuc@QT{%}
225*84d9c625SLionel Sambucand
226*84d9c625SLionel Sambuc@QT{#}
227*84d9c625SLionel Sambucare expanded into the current and alternate pathnames, respectively.
228*84d9c625SLionel SambucThe character
229*84d9c625SLionel Sambuc@QT{!}
230*84d9c625SLionel Sambucis expanded with the command text of the previous
231*84d9c625SLionel Sambuc@CO{!}
232*84d9c625SLionel Sambuccommand.
233*84d9c625SLionel Sambuc(Therefore, the command
234*84d9c625SLionel Sambuc@CO{!!}
235*84d9c625SLionel Sambucrepeats the previous
236*84d9c625SLionel Sambuc@CO{!}
237*84d9c625SLionel Sambuccommand.)
238*84d9c625SLionel SambucThe special meanings of
239*84d9c625SLionel Sambuc@QT{%},
240*84d9c625SLionel Sambuc@QT{#},
241*84d9c625SLionel Sambucand
242*84d9c625SLionel Sambuc@QT{!}
243*84d9c625SLionel Sambuccan be overridden by escaping them with a backslash.
244*84d9c625SLionel SambucIf no
245*84d9c625SLionel Sambuc@CO{!}
246*84d9c625SLionel Sambucor
247*84d9c625SLionel Sambuc@CO{:!}
248*84d9c625SLionel Sambuccommand has yet been executed, it is an error to use an unescaped
249*84d9c625SLionel Sambuc@QT{!}
250*84d9c625SLionel Sambuccharacter.
251*84d9c625SLionel SambucThe
252*84d9c625SLionel Sambuc@CO{!}
253*84d9c625SLionel Sambuccommand does
254*84d9c625SLionel Sambuc@emph{not}
255*84d9c625SLionel Sambucdo shell expansion on the strings provided as arguments.
256*84d9c625SLionel SambucIf any of the above expansions change the command the user entered,
257*84d9c625SLionel Sambucthe command is redisplayed at the bottom of the screen.
258*84d9c625SLionel Sambuc@sp 1
259*84d9c625SLionel Sambuc@CO{Ex}
260*84d9c625SLionel Sambucthen executes the program named by the
261*84d9c625SLionel Sambuc@OP{shell}
262*84d9c625SLionel Sambucoption, with a
263*84d9c625SLionel Sambuc@strong{-c}
264*84d9c625SLionel Sambucflag followed by the arguments (which are bundled into a single argument).
265*84d9c625SLionel Sambuc@sp 1
266*84d9c625SLionel SambucThe
267*84d9c625SLionel Sambuc@CO{!}
268*84d9c625SLionel Sambuccommand is permitted in an empty file.
269*84d9c625SLionel Sambuc@sp 1
270*84d9c625SLionel SambucIf the file has been modified since it was last completely written,
271*84d9c625SLionel Sambucthe
272*84d9c625SLionel Sambuc@CO{!}
273*84d9c625SLionel Sambuccommand will warn you.
274*84d9c625SLionel Sambuc@sp 1
275*84d9c625SLionel SambucA single
276*84d9c625SLionel Sambuc@QT{!}
277*84d9c625SLionel Sambuccharacter is displayed when the command completes.
278*84d9c625SLionel Sambuc@sp 1
279*84d9c625SLionel SambucIn the second form of the
280*84d9c625SLionel Sambuc@CO{!}
281*84d9c625SLionel Sambuccommand, the remainder of the line after the
282*84d9c625SLionel Sambuc@QT{!}
283*84d9c625SLionel Sambucis passed to the program named by the
284*84d9c625SLionel Sambuc@OP{shell}
285*84d9c625SLionel Sambucoption, as described above.
286*84d9c625SLionel SambucThe specified lines are passed to the program as standard input,
287*84d9c625SLionel Sambucand the standard and standard error output of the program replace
288*84d9c625SLionel Sambucthe original lines.
289*84d9c625SLionel Sambuc@table @asis
290*84d9c625SLionel Sambuc@item Line:
291*84d9c625SLionel SambucUnchanged if no range was specified, otherwise set to the first
292*84d9c625SLionel Sambucline of the range.
293*84d9c625SLionel Sambuc@item Options:
294*84d9c625SLionel SambucAffected by the
295*84d9c625SLionel Sambuc@OP{shell}
296*84d9c625SLionel Sambucand
297*84d9c625SLionel Sambuc@OP{warn}
298*84d9c625SLionel Sambucoptions.
299*84d9c625SLionel Sambuc@end table
300*84d9c625SLionel Sambuc@end deftypefn
301*84d9c625SLionel Sambuc@cindex "#"
302*84d9c625SLionel Sambuc@deftypefn Command {[range]} {#} {[count] [flags]}
303*84d9c625SLionel Sambuc
304*84d9c625SLionel Sambuc@cindex "number"
305*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {nu[mber]} {[count] [flags]}
306*84d9c625SLionel SambucDisplay the selected lines, each preceded with its line number.
307*84d9c625SLionel Sambuc@sp 1
308*84d9c625SLionel SambucThe line number format is
309*84d9c625SLionel Sambuc@QQ{%6d},
310*84d9c625SLionel Sambucfollowed by two spaces.
311*84d9c625SLionel Sambuc@table @asis
312*84d9c625SLionel Sambuc@item Line:
313*84d9c625SLionel SambucSet to the last line displayed.
314*84d9c625SLionel Sambuc@item Options:
315*84d9c625SLionel SambucAffected by the
316*84d9c625SLionel Sambuc@OP{list}
317*84d9c625SLionel Sambucoption.
318*84d9c625SLionel Sambuc@end table
319*84d9c625SLionel Sambuc@end deftypefn
320*84d9c625SLionel Sambuc@cindex "@@"
321*84d9c625SLionel Sambuc@deftypefn Command {@@} {buffer}
322*84d9c625SLionel Sambuc
323*84d9c625SLionel Sambuc@cindex "*"
324*84d9c625SLionel Sambuc@deftypefnx Command {}  {*} {buffer}
325*84d9c625SLionel SambucExecute a buffer.
326*84d9c625SLionel SambucEach line in the named buffer is executed as an
327*84d9c625SLionel Sambuc@CO{ex}
328*84d9c625SLionel Sambuccommand.
329*84d9c625SLionel SambucIf no buffer is specified, or if the specified buffer is
330*84d9c625SLionel Sambuc@QT{@@}
331*84d9c625SLionel Sambucor
332*84d9c625SLionel Sambuc@QT{*},
333*84d9c625SLionel Sambucthe last buffer executed is used.
334*84d9c625SLionel Sambuc@end deftypefn
335*84d9c625SLionel Sambuc@cindex <
336*84d9c625SLionel Sambuc@deftypefn Command {[range]} {<[< ...]} {[count] [flags]}
337*84d9c625SLionel Sambuc
338*84d9c625SLionel SambucShift lines left or right.
339*84d9c625SLionel SambucThe specified lines are shifted to the left (for the
340*84d9c625SLionel Sambuc@CO{<}
341*84d9c625SLionel Sambuccommand) or right (for the
342*84d9c625SLionel Sambuc@CO{>}
343*84d9c625SLionel Sambuccommand), by the number of columns specified by the
344*84d9c625SLionel Sambuc@OP{shiftwidth}
345*84d9c625SLionel Sambucoption.
346*84d9c625SLionel SambucOnly leading whitespace characters are deleted when shifting left;
347*84d9c625SLionel Sambuconce the first column of the line contains a nonblank character,
348*84d9c625SLionel Sambucthe
349*84d9c625SLionel Sambuc@CO{shift}
350*84d9c625SLionel Sambuccommand will succeed, but the line will not be modified.
351*84d9c625SLionel Sambuc@sp 1
352*84d9c625SLionel SambucIf the command character
353*84d9c625SLionel Sambuc@CO{<}
354*84d9c625SLionel Sambucor
355*84d9c625SLionel Sambuc@CO{>}
356*84d9c625SLionel Sambucis repeated more than once, the command is repeated once for each
357*84d9c625SLionel Sambucadditional command character.
358*84d9c625SLionel Sambuc@table @asis
359*84d9c625SLionel Sambuc@item Line:
360*84d9c625SLionel SambucIf the current line is set to one of the lines that are affected
361*84d9c625SLionel Sambucby the command, it is unchanged.
362*84d9c625SLionel SambucOtherwise, it is set to the first nonblank character of the lowest
363*84d9c625SLionel Sambucnumbered line shifted.
364*84d9c625SLionel Sambuc@item Options:
365*84d9c625SLionel SambucAffected by the
366*84d9c625SLionel Sambuc@OP{shiftwidth}
367*84d9c625SLionel Sambucoption.
368*84d9c625SLionel Sambuc@end table
369*84d9c625SLionel Sambuc@end deftypefn
370*84d9c625SLionel Sambuc@cindex =
371*84d9c625SLionel Sambuc@deftypefn Command {[line]} {=} {[flags]}
372*84d9c625SLionel Sambuc
373*84d9c625SLionel SambucDisplay the line number of
374*84d9c625SLionel Sambuc@LI{line}(which defaults to the last line in the file).
375*84d9c625SLionel Sambuc@table @asis
376*84d9c625SLionel Sambuc@item Line:
377*84d9c625SLionel SambucUnchanged.
378*84d9c625SLionel Sambuc@item Options:
379*84d9c625SLionel SambucNone.
380*84d9c625SLionel Sambuc@end table
381*84d9c625SLionel Sambuc@end deftypefn
382*84d9c625SLionel Sambuc@cindex >
383*84d9c625SLionel Sambuc@deftypefn Command {[range]} {>[> ...]} {[count] [flags]}
384*84d9c625SLionel Sambuc
385*84d9c625SLionel SambucShift right.
386*84d9c625SLionel SambucThe specified lines are shifted to the right by the number of columns
387*84d9c625SLionel Sambucspecified by the
388*84d9c625SLionel Sambuc@OP{shiftwidth}
389*84d9c625SLionel Sambucoption, by inserting tab and space characters.
390*84d9c625SLionel SambucEmpty lines are not changed.
391*84d9c625SLionel Sambuc@sp 1
392*84d9c625SLionel SambucIf the command character
393*84d9c625SLionel Sambuc@QT{>}
394*84d9c625SLionel Sambucis repeated more than once, the command is repeated once for each
395*84d9c625SLionel Sambucadditional command character.
396*84d9c625SLionel Sambuc@table @asis
397*84d9c625SLionel Sambuc@item Line:
398*84d9c625SLionel SambucSet to the last line modified by the command.
399*84d9c625SLionel Sambuc@item Options:
400*84d9c625SLionel SambucAffected by the
401*84d9c625SLionel Sambuc@OP{shiftwidth}
402*84d9c625SLionel Sambucoption.
403*84d9c625SLionel Sambuc@end table
404*84d9c625SLionel Sambuc@end deftypefn
405*84d9c625SLionel Sambuc@cindex abbrev
406*84d9c625SLionel Sambuc@deftypefn Command {} {ab[brev]} {lhs rhs}
407*84d9c625SLionel Sambuc
408*84d9c625SLionel SambucAdd an abbreviation to the current abbreviation list.
409*84d9c625SLionel SambucWhen inserting text in
410*84d9c625SLionel Sambuc@CO{vi},
411*84d9c625SLionel Sambuceach time a non-word character is entered after a word character,
412*84d9c625SLionel Sambuca set of characters ending at the word character are checked for
413*84d9c625SLionel Sambuca match with
414*84d9c625SLionel Sambuc@LI{lhs}.
415*84d9c625SLionel SambucIf a match is found, they are replaced with
416*84d9c625SLionel Sambuc@LI{rhs}.
417*84d9c625SLionel SambucThe set of characters that are checked for a match are defined as follows,
418*84d9c625SLionel Sambucfor inexplicable historical reasons.
419*84d9c625SLionel SambucIf only one or two characters were entered before the non-word character
420*84d9c625SLionel Sambucthat triggered the check,
421*84d9c625SLionel Sambucand after the beginning of the insertion,
422*84d9c625SLionel Sambucor the beginning of the line or the file,
423*84d9c625SLionel Sambucor the last
424*84d9c625SLionel Sambuc@LI{<blank>}character that was entered,
425*84d9c625SLionel Sambucthen the one or the both characters are checked for a match.
426*84d9c625SLionel SambucOtherwise, the set includes both characters,
427*84d9c625SLionel Sambucas well as the characters that precede them that are the same word
428*84d9c625SLionel Sambucclass (i.e. word or non-word) as the
429*84d9c625SLionel Sambuc@strong{second}
430*84d9c625SLionel Sambucto last character entered before the non-word character that triggered
431*84d9c625SLionel Sambucthe check,
432*84d9c625SLionel Sambucback to the first
433*84d9c625SLionel Sambuc@LI{<blank>}character,
434*84d9c625SLionel Sambucthe beginning of the insertion,
435*84d9c625SLionel Sambucor the beginning of the line or the file.
436*84d9c625SLionel Sambuc@sp 1
437*84d9c625SLionel SambucFor example, the abbreviations:
438*84d9c625SLionel Sambuc@sp 1
439*84d9c625SLionel Sambuc@multitable {:abbreviate} {/*#i} {/********************}
440*84d9c625SLionel Sambuc@item :abbreviate @tab abc @tab ABC
441*84d9c625SLionel Sambuc@item :abbreviate @tab #i @tab #include
442*84d9c625SLionel Sambuc@item :abbreviate @tab /*#i @tab /*#include
443*84d9c625SLionel Sambuc@end multitable
444*84d9c625SLionel Sambucwill all work, while the abbreviations:
445*84d9c625SLionel Sambuc@sp 1
446*84d9c625SLionel Sambuc@multitable {:abbreviate} {/*#i} {/********************}
447*84d9c625SLionel Sambuc@item :abbreviate @tab a#i @tab A#include
448*84d9c625SLionel Sambuc@item :abbreviate @tab /* @tab /********************
449*84d9c625SLionel Sambuc@end multitable
450*84d9c625SLionel Sambucwill not work, and are not permitted by
451*84d9c625SLionel Sambuc@CO{nvi}.
452*84d9c625SLionel Sambuc@sp 1
453*84d9c625SLionel SambucTo keep the abbreviation expansion from happening,
454*84d9c625SLionel Sambucthe character immediately following the
455*84d9c625SLionel Sambuc@LI{lhs}characters should be quoted with a
456*84d9c625SLionel Sambuc@LI{<literal-next>}character.
457*84d9c625SLionel Sambuc@sp 1
458*84d9c625SLionel SambucThe replacement
459*84d9c625SLionel Sambuc@LI{rhs}is itself subject to both further abbreviation expansion and further
460*84d9c625SLionel Sambucmap expansion.
461*84d9c625SLionel Sambuc@table @asis
462*84d9c625SLionel Sambuc@item Line:
463*84d9c625SLionel SambucUnchanged.
464*84d9c625SLionel Sambuc@item Options:
465*84d9c625SLionel SambucNone.
466*84d9c625SLionel Sambuc@end table
467*84d9c625SLionel Sambuc@end deftypefn
468*84d9c625SLionel Sambuc@cindex append
469*84d9c625SLionel Sambuc@deftypefn Command {[line]} {a[ppend][!]}
470*84d9c625SLionel Sambuc
471*84d9c625SLionel SambucThe input text is appended to the specified line.
472*84d9c625SLionel SambucIf line 0 is specified, the text is inserted at the beginning of the file.
473*84d9c625SLionel SambucSet to the last line input.
474*84d9c625SLionel SambucIf no lines are input, then set to
475*84d9c625SLionel Sambuc@LI{line},
476*84d9c625SLionel Sambucor to the first line of the file if a
477*84d9c625SLionel Sambuc@LI{line}of 0 was specified.
478*84d9c625SLionel SambucFollowing the command name with a
479*84d9c625SLionel Sambuc@QT{!}
480*84d9c625SLionel Sambuccharacter causes the
481*84d9c625SLionel Sambuc@OP{autoindent}
482*84d9c625SLionel Sambucoption to be toggled for the duration of the command.
483*84d9c625SLionel Sambuc@table @asis
484*84d9c625SLionel Sambuc@item Line:
485*84d9c625SLionel SambucUnchanged.
486*84d9c625SLionel Sambuc@item Options:
487*84d9c625SLionel SambucAffected by the
488*84d9c625SLionel Sambuc@OP{autoindent}
489*84d9c625SLionel Sambucand
490*84d9c625SLionel Sambuc@OP{number}
491*84d9c625SLionel Sambucoptions.
492*84d9c625SLionel Sambuc@end table
493*84d9c625SLionel Sambuc@end deftypefn
494*84d9c625SLionel Sambuc@cindex args
495*84d9c625SLionel Sambuc@deftypefn Command {} {ar[gs]}
496*84d9c625SLionel Sambuc
497*84d9c625SLionel SambucDisplay the argument list.
498*84d9c625SLionel SambucThe current argument is displayed inside of
499*84d9c625SLionel Sambuc@QT{[}
500*84d9c625SLionel Sambucand
501*84d9c625SLionel Sambuc@QT{]}
502*84d9c625SLionel Sambuccharacters.
503*84d9c625SLionel SambucThe argument list is the list of operands specified on startup,
504*84d9c625SLionel Sambucwhich can be replaced using the
505*84d9c625SLionel Sambuc@CO{next}
506*84d9c625SLionel Sambuccommand.
507*84d9c625SLionel Sambuc@table @asis
508*84d9c625SLionel Sambuc@item Line:
509*84d9c625SLionel SambucUnchanged.
510*84d9c625SLionel Sambuc@item Options:
511*84d9c625SLionel SambucNone.
512*84d9c625SLionel Sambuc@end table
513*84d9c625SLionel Sambuc@end deftypefn
514*84d9c625SLionel Sambuc@cindex bg
515*84d9c625SLionel Sambuc@deftypefn Command {} {bg}
516*84d9c625SLionel Sambuc
517*84d9c625SLionel Sambuc@CO{Vi}
518*84d9c625SLionel Sambucmode only.
519*84d9c625SLionel SambucBackground the current screen.
520*84d9c625SLionel SambucThe screen is unchanged,
521*84d9c625SLionel Sambucbut is no longer accessible and disappears from the display.
522*84d9c625SLionel SambucUse the
523*84d9c625SLionel Sambuc@CO{fg}
524*84d9c625SLionel Sambuccommand to bring the screen back to the display foreground.
525*84d9c625SLionel Sambuc@table @asis
526*84d9c625SLionel Sambuc@item Line:
527*84d9c625SLionel SambucSet to the current line when the screen was last edited.
528*84d9c625SLionel Sambuc@item Options:
529*84d9c625SLionel SambucNone.
530*84d9c625SLionel Sambuc@end table
531*84d9c625SLionel Sambuc@end deftypefn
532*84d9c625SLionel Sambuc@cindex change
533*84d9c625SLionel Sambuc@deftypefn Command {[range]} {c[hange][!]} {[count]}
534*84d9c625SLionel Sambuc
535*84d9c625SLionel SambucReplace the lines with input text.
536*84d9c625SLionel SambucFollowing the command name with a
537*84d9c625SLionel Sambuc@QT{!}
538*84d9c625SLionel Sambuccharacter causes the
539*84d9c625SLionel Sambuc@OP{autoindent}
540*84d9c625SLionel Sambucoption to be toggled for the duration of the command.
541*84d9c625SLionel Sambuc@table @asis
542*84d9c625SLionel Sambuc@item Line:
543*84d9c625SLionel SambucSet to the last line input, or, if no lines were input,
544*84d9c625SLionel Sambucset to the line before the target line, or to the first
545*84d9c625SLionel Sambucline of the file if there are no lines preceding the target line.
546*84d9c625SLionel Sambuc@item Options:
547*84d9c625SLionel SambucAffected by the
548*84d9c625SLionel Sambuc@OP{autoindent}
549*84d9c625SLionel Sambucand
550*84d9c625SLionel Sambuc@OP{number}
551*84d9c625SLionel Sambucoptions.
552*84d9c625SLionel Sambuc@end table
553*84d9c625SLionel Sambuc@cindex cd
554*84d9c625SLionel Sambuc@end deftypefn
555*84d9c625SLionel Sambuc@cindex chdir
556*84d9c625SLionel Sambuc@deftypefn Command {} {chd[ir][!]} {[directory]}
557*84d9c625SLionel Sambuc
558*84d9c625SLionel Sambuc@deftypefnx Command {}  {cd[!]} {[directory]}
559*84d9c625SLionel SambucChange the current working directory.
560*84d9c625SLionel SambucThe
561*84d9c625SLionel Sambuc@LI{directory}argument is subjected to
562*84d9c625SLionel Sambuc@XR{sh,1}
563*84d9c625SLionel Sambucword expansions.
564*84d9c625SLionel SambucWhen invoked with no directory argument and the
565*84d9c625SLionel Sambuc@LI{HOME}environment variable is set, the directory named by the
566*84d9c625SLionel Sambuc@LI{HOME}environment variable becomes the new current directory.
567*84d9c625SLionel SambucOtherwise, the new current directory becomes the directory returned
568*84d9c625SLionel Sambucby the
569*84d9c625SLionel Sambuc@XR{getpwent,3}
570*84d9c625SLionel Sambucroutine.
571*84d9c625SLionel Sambuc@sp 1
572*84d9c625SLionel SambucThe
573*84d9c625SLionel Sambuc@CO{chdir}
574*84d9c625SLionel Sambuccommand will fail if the file has been modified since the last complete
575*84d9c625SLionel Sambucwrite of the file.
576*84d9c625SLionel SambucYou can override this check by appending a
577*84d9c625SLionel Sambuc@QT{!}
578*84d9c625SLionel Sambuccharacter to the command.
579*84d9c625SLionel Sambuc@table @asis
580*84d9c625SLionel Sambuc@item Line:
581*84d9c625SLionel SambucUnchanged.
582*84d9c625SLionel Sambuc@item Options:
583*84d9c625SLionel SambucAffected by the
584*84d9c625SLionel Sambuc@OP{cdpath}
585*84d9c625SLionel Sambucoption.
586*84d9c625SLionel Sambuc@end table
587*84d9c625SLionel Sambuc@cindex copy
588*84d9c625SLionel Sambuc@end deftypefn
589*84d9c625SLionel Sambuc@cindex t
590*84d9c625SLionel Sambuc@deftypefn Command {[range]} {co[py]} {line [flags]}
591*84d9c625SLionel Sambuc
592*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {t} {line [flags]}
593*84d9c625SLionel SambucCopy the specified lines (range) after the destination line.
594*84d9c625SLionel SambucLine 0 may be specified to insert the lines at the beginning of
595*84d9c625SLionel Sambucthe file.
596*84d9c625SLionel Sambuc@table @asis
597*84d9c625SLionel Sambuc@item Line:
598*84d9c625SLionel SambucUnchanged.
599*84d9c625SLionel Sambuc@item Options:
600*84d9c625SLionel SambucNone.
601*84d9c625SLionel Sambuc@end table
602*84d9c625SLionel Sambuc@end deftypefn
603*84d9c625SLionel Sambuc@cindex cscope
604*84d9c625SLionel Sambuc@deftypefn Command {} {cs[cope]} {command [args]}
605*84d9c625SLionel Sambuc
606*84d9c625SLionel SambucExecute a
607*84d9c625SLionel Sambuc@CO{cscope}
608*84d9c625SLionel Sambuccommand.
609*84d9c625SLionel SambucFor more information, see the section of the reference manual entitled
610*84d9c625SLionel Sambuc@QB{Tags, Tag Stacks, and Cscope} .
611*84d9c625SLionel Sambuc@end deftypefn
612*84d9c625SLionel Sambuc@cindex delete
613*84d9c625SLionel Sambuc@deftypefn Command {[range]} {d[elete]} {[buffer] [count] [flags]}
614*84d9c625SLionel Sambuc
615*84d9c625SLionel SambucDelete the lines from the file.
616*84d9c625SLionel SambucThe deleted text is saved in the specified buffer, or, if no buffer
617*84d9c625SLionel Sambucis specified, in the unnamed buffer.
618*84d9c625SLionel SambucIf the command name is followed by a letter that could be interpreted
619*84d9c625SLionel Sambucas either a buffer name or a flag value (because neither a
620*84d9c625SLionel Sambuc@LI{count}or
621*84d9c625SLionel Sambuc@LI{flags}values were given),
622*84d9c625SLionel Sambuc@CO{ex}
623*84d9c625SLionel Sambuctreats the letter as a
624*84d9c625SLionel Sambuc@LI{flags}value if the letter immediately follows the command name,
625*84d9c625SLionel Sambucwithout any whitespace separation.
626*84d9c625SLionel SambucIf the letter is preceded by whitespace characters,
627*84d9c625SLionel Sambucit treats it as a buffer name.
628*84d9c625SLionel Sambuc@table @asis
629*84d9c625SLionel Sambuc@item Line:
630*84d9c625SLionel SambucSet to the line following the deleted lines,
631*84d9c625SLionel Sambucor to the last line if the deleted lines were at the end.
632*84d9c625SLionel Sambuc@item Options:
633*84d9c625SLionel SambucNone.
634*84d9c625SLionel Sambuc@end table
635*84d9c625SLionel Sambuc@end deftypefn
636*84d9c625SLionel Sambuc@cindex display
637*84d9c625SLionel Sambuc@deftypefn Command {} {di[splay]} {b[uffers] | c[onnections] | s[creens] | t[ags]}
638*84d9c625SLionel Sambuc
639*84d9c625SLionel SambucDisplay buffers,
640*84d9c625SLionel Sambuc@CO{cscope}
641*84d9c625SLionel Sambucconnections, screens or tags.
642*84d9c625SLionel SambucThe
643*84d9c625SLionel Sambuc@CO{display}
644*84d9c625SLionel Sambuccommand takes one of three additional arguments, which are as follows:
645*84d9c625SLionel Sambuc@table @asis
646*84d9c625SLionel Sambuc@item b[uffers]
647*84d9c625SLionel SambucDisplay all buffers (including named, unnamed, and numeric)
648*84d9c625SLionel Sambucthat contain text.
649*84d9c625SLionel Sambuc@item c[onnections]
650*84d9c625SLionel SambucDisplay the source directories for all attached
651*84d9c625SLionel Sambuc@CO{cscope}
652*84d9c625SLionel Sambucdatabases.
653*84d9c625SLionel Sambuc@item s[creens]
654*84d9c625SLionel SambucDisplay the file names of all background screens.
655*84d9c625SLionel Sambuc@item t[ags]
656*84d9c625SLionel SambucDisplay the tags stack.
657*84d9c625SLionel Sambuc@end table
658*84d9c625SLionel Sambuc@table @asis
659*84d9c625SLionel Sambuc@item Line:
660*84d9c625SLionel SambucUnchanged.
661*84d9c625SLionel Sambuc@item Options:
662*84d9c625SLionel SambucNone.
663*84d9c625SLionel Sambuc@end table
664*84d9c625SLionel Sambuc@end deftypefn
665*84d9c625SLionel Sambuc@cindex edit
666*84d9c625SLionel Sambuc@deftypefn Command {} {e[dit][!]} {[+cmd] [file]}
667*84d9c625SLionel Sambuc@deftypefnx Command {}  {ex[!]} {[+cmd] [file]}
668*84d9c625SLionel Sambuc@deftypefnx Command {} {vs[plit][!]} {[+cmd] [file]}
669*84d9c625SLionel SambucEdit a different file.
670*84d9c625SLionel SambucIf the current buffer has been modified since the last complete write,
671*84d9c625SLionel Sambucthe command will fail.
672*84d9c625SLionel SambucYou can override this by appending a
673*84d9c625SLionel Sambuc@QT{!}
674*84d9c625SLionel Sambuccharacter to the command name.
675*84d9c625SLionel Sambuc@sp 1
676*84d9c625SLionel SambucIf the
677*84d9c625SLionel Sambuc@QT{+cmd}
678*84d9c625SLionel Sambucoption is specified, that
679*84d9c625SLionel Sambuc@CO{ex}
680*84d9c625SLionel Sambuccommand will be executed in the new file.
681*84d9c625SLionel SambucAny
682*84d9c625SLionel Sambuc@CO{ex}
683*84d9c625SLionel Sambuccommand may be used, although the most common use of this feature is
684*84d9c625SLionel Sambucto specify a line number or search pattern to set the initial location
685*84d9c625SLionel Sambucin the new file.
686*84d9c625SLionel Sambuc@sp 1
687*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.,
688*84d9c625SLionel Sambuc@CO{Edit}
689*84d9c625SLionel Sambucor
690*84d9c625SLionel Sambuc@CO{Ex},
691*84d9c625SLionel Sambucwhile in
692*84d9c625SLionel Sambuc@CO{vi}
693*84d9c625SLionel Sambucmode, will edit the file in a new screen.
694*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
695*84d9c625SLionel Sambuc@cindex vertical split
696*84d9c625SLionel Sambuc@cindex splitting, vertically
697*84d9c625SLionel Sambuc@CO{vsplit} is similar, but the screen will be split vertically
698*84d9c625SLionel Sambucto produce the new screen, rather than horizontally.
699*84d9c625SLionel Sambuc
700*84d9c625SLionel Sambuc@table @asis
701*84d9c625SLionel Sambuc@item Line:
702*84d9c625SLionel SambucIf you have previously edited the file, the current line will be set
703*84d9c625SLionel Sambucto your last position in the file.
704*84d9c625SLionel SambucIf that position does not exist, or you have not previously edited the
705*84d9c625SLionel Sambucfile, the current line will be set to the first line of the file if
706*84d9c625SLionel Sambucyou are in
707*84d9c625SLionel Sambuc@CO{vi}
708*84d9c625SLionel Sambucmode, and the last line of the file if you are in
709*84d9c625SLionel Sambuc@CO{ex}.
710*84d9c625SLionel Sambuc@item Options:
711*84d9c625SLionel SambucNone.
712*84d9c625SLionel Sambuc@end table
713*84d9c625SLionel Sambuc@end deftypefn
714*84d9c625SLionel Sambuc@cindex exusage
715*84d9c625SLionel Sambuc@deftypefn Command {} {exu[sage]} {[command]}
716*84d9c625SLionel Sambuc
717*84d9c625SLionel SambucDisplay usage for an
718*84d9c625SLionel Sambuc@CO{ex}
719*84d9c625SLionel Sambuccommand.
720*84d9c625SLionel SambucIf
721*84d9c625SLionel Sambuc@LI{command}is specified, a usage statement for that command is displayed.
722*84d9c625SLionel SambucOtherwise, usage statements for all
723*84d9c625SLionel Sambuc@CO{ex}
724*84d9c625SLionel Sambuccommands are displayed.
725*84d9c625SLionel Sambuc@table @asis
726*84d9c625SLionel Sambuc@item Line:
727*84d9c625SLionel SambucUnchanged.
728*84d9c625SLionel Sambuc@item Options:
729*84d9c625SLionel SambucNone.
730*84d9c625SLionel Sambuc@end table
731*84d9c625SLionel Sambuc@end deftypefn
732*84d9c625SLionel Sambuc@cindex file
733*84d9c625SLionel Sambuc@deftypefn Command {} {f[ile]} {[file]}
734*84d9c625SLionel Sambuc
735*84d9c625SLionel SambucDisplay and optionally change the file name.
736*84d9c625SLionel SambucIf a file name is specified, the current pathname is changed to the
737*84d9c625SLionel Sambucspecified name.
738*84d9c625SLionel SambucThe current pathname, the number of lines, and the current position
739*84d9c625SLionel Sambucin the file are displayed.
740*84d9c625SLionel Sambuc@table @asis
741*84d9c625SLionel Sambuc@item Line:
742*84d9c625SLionel SambucUnchanged.
743*84d9c625SLionel Sambuc@item Options:
744*84d9c625SLionel SambucNone.
745*84d9c625SLionel Sambuc@end table
746*84d9c625SLionel Sambuc@end deftypefn
747*84d9c625SLionel Sambuc@cindex fg
748*84d9c625SLionel Sambuc@deftypefn Command {} {fg} {[name]}
749*84d9c625SLionel Sambuc
750*84d9c625SLionel Sambuc@CO{Vi}
751*84d9c625SLionel Sambucmode only.
752*84d9c625SLionel SambucForeground the specified screen.
753*84d9c625SLionel SambucIf the argument name doesn't exactly match the name of a file displayed
754*84d9c625SLionel Sambucby a background screen,
755*84d9c625SLionel Sambucit is compared against the last component of each of the file names.
756*84d9c625SLionel SambucIf no background screen is specified,
757*84d9c625SLionel Sambucthe first background screen is foregrounded.
758*84d9c625SLionel Sambuc@sp 1
759*84d9c625SLionel SambucBy default,
760*84d9c625SLionel Sambucforegrounding causes the current screen to be swapped with the backgrounded
761*84d9c625SLionel Sambucscreen.
762*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
763*84d9c625SLionel Sambuc@CO{Fg},
764*84d9c625SLionel Sambucwill foreground the backgrounded screen in a new screen instead of
765*84d9c625SLionel Sambucswapping it with the current screen.
766*84d9c625SLionel Sambuc@table @asis
767*84d9c625SLionel Sambuc@item Line:
768*84d9c625SLionel SambucSet to the current line when the screen was last edited.
769*84d9c625SLionel Sambuc@item Options:
770*84d9c625SLionel SambucNone.
771*84d9c625SLionel Sambuc@end table
772*84d9c625SLionel Sambuc@end deftypefn
773*84d9c625SLionel Sambuc@cindex global
774*84d9c625SLionel Sambuc@deftypefn Command {[range]} {g[lobal]} {/pattern/ [commands]}
775*84d9c625SLionel Sambuc
776*84d9c625SLionel Sambuc@cindex v
777*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {v} {/pattern/ [commands]}
778*84d9c625SLionel SambucApply commands to lines matching (or not matching) a pattern.
779*84d9c625SLionel SambucThe lines within the given range that match
780*84d9c625SLionel Sambuc@PQ{g[lobal]},
781*84d9c625SLionel Sambucor do not match
782*84d9c625SLionel Sambuc@PQ{v}
783*84d9c625SLionel Sambucthe given pattern are selected.
784*84d9c625SLionel SambucThen, the specified
785*84d9c625SLionel Sambuc@CO{ex}
786*84d9c625SLionel Sambuccommand(s) are executed with the current line
787*84d9c625SLionel Sambuc@PQ{.}
788*84d9c625SLionel Sambucset to each selected line.
789*84d9c625SLionel SambucIf no range is specified, the entire file is searched for matching,
790*84d9c625SLionel Sambucor not matching, lines.
791*84d9c625SLionel Sambuc@sp 1
792*84d9c625SLionel SambucMultiple commands can be specified, one per line, by escaping each
793*84d9c625SLionel Sambuc@LI{<newline>}character with a backslash, or by separating commands with a
794*84d9c625SLionel Sambuc@QT{|}
795*84d9c625SLionel Sambuccharacter.
796*84d9c625SLionel SambucIf no commands are specified, the command defaults to the
797*84d9c625SLionel Sambuc@CO{print}
798*84d9c625SLionel Sambuccommand.
799*84d9c625SLionel Sambuc@sp 1
800*84d9c625SLionel SambucFor the
801*84d9c625SLionel Sambuc@CO{append},
802*84d9c625SLionel Sambuc@CO{change}
803*84d9c625SLionel Sambucand
804*84d9c625SLionel Sambuc@CO{insert}
805*84d9c625SLionel Sambuccommands, the input text must be part of the global command line.
806*84d9c625SLionel SambucIn this case, the terminating period can be omitted if it ends the commands.
807*84d9c625SLionel Sambuc@sp 1
808*84d9c625SLionel SambucThe
809*84d9c625SLionel Sambuc@CO{visual}
810*84d9c625SLionel Sambuccommand may also be specified as one of the
811*84d9c625SLionel Sambuc@CO{ex}
812*84d9c625SLionel Sambuccommands.
813*84d9c625SLionel SambucIn this mode, input is taken from the terminal.
814*84d9c625SLionel SambucEntering a
815*84d9c625SLionel Sambuc@CO{Q}
816*84d9c625SLionel Sambuccommand in
817*84d9c625SLionel Sambuc@CO{vi}
818*84d9c625SLionel Sambucmode causes the next line matching the pattern to be selected and
819*84d9c625SLionel Sambuc@CO{vi}
820*84d9c625SLionel Sambucto be reentered, until the list is exhausted.
821*84d9c625SLionel Sambuc@sp 1
822*84d9c625SLionel SambucThe
823*84d9c625SLionel Sambuc@CO{global},
824*84d9c625SLionel Sambuc@CO{v}
825*84d9c625SLionel Sambucand
826*84d9c625SLionel Sambuc@CO{undo}
827*84d9c625SLionel Sambuccommands cannot be used as part of these commands.
828*84d9c625SLionel Sambuc@sp 1
829*84d9c625SLionel SambucThe editor options
830*84d9c625SLionel Sambuc@OP{autoindent},
831*84d9c625SLionel Sambuc@OP{autoprint}
832*84d9c625SLionel Sambucand
833*84d9c625SLionel Sambuc@OP{report}
834*84d9c625SLionel Sambucare turned off for the duration of the
835*84d9c625SLionel Sambuc@CO{global}
836*84d9c625SLionel Sambucand
837*84d9c625SLionel Sambuc@CO{v}
838*84d9c625SLionel Sambuccommands.
839*84d9c625SLionel Sambuc@table @asis
840*84d9c625SLionel Sambuc@item Line:
841*84d9c625SLionel SambucThe last line modified.
842*84d9c625SLionel Sambuc@item Options:
843*84d9c625SLionel SambucAffected by the
844*84d9c625SLionel Sambuc@OP{ignorecase}
845*84d9c625SLionel Sambucand
846*84d9c625SLionel Sambuc@OP{magic}
847*84d9c625SLionel Sambucoptions.
848*84d9c625SLionel SambucTurns off the
849*84d9c625SLionel Sambuc@OP{autoindent},
850*84d9c625SLionel Sambuc@OP{autoprint}
851*84d9c625SLionel Sambucand
852*84d9c625SLionel Sambuc@OP{report}
853*84d9c625SLionel Sambucoptions.
854*84d9c625SLionel Sambuc@end table
855*84d9c625SLionel Sambuc@end deftypefn
856*84d9c625SLionel Sambuc@cindex help
857*84d9c625SLionel Sambuc@deftypefn Command {} {he[lp]}
858*84d9c625SLionel Sambuc
859*84d9c625SLionel SambucDisplay a help message.
860*84d9c625SLionel Sambuc@table @asis
861*84d9c625SLionel Sambuc@item Line:
862*84d9c625SLionel SambucUnchanged.
863*84d9c625SLionel Sambuc@item Options:
864*84d9c625SLionel SambucNone.
865*84d9c625SLionel Sambuc@end table
866*84d9c625SLionel Sambuc@end deftypefn
867*84d9c625SLionel Sambuc@cindex insert
868*84d9c625SLionel Sambuc@deftypefn Command {[line]} {i[nsert][!]}
869*84d9c625SLionel Sambuc
870*84d9c625SLionel SambucThe input text is inserted before the specified line.
871*84d9c625SLionel SambucFollowing the command name with a
872*84d9c625SLionel Sambuc@QT{!}
873*84d9c625SLionel Sambuccharacter causes the
874*84d9c625SLionel Sambuc@OP{autoindent}
875*84d9c625SLionel Sambucoption setting to be toggled for the duration of this command.
876*84d9c625SLionel Sambuc@table @asis
877*84d9c625SLionel Sambuc@item Line:
878*84d9c625SLionel SambucSet to the last line input; if no lines were input,
879*84d9c625SLionel Sambucset to the line before the target line, or to the first line
880*84d9c625SLionel Sambucof the file if there are no lines preceding the target line.
881*84d9c625SLionel SambucAffected by the
882*84d9c625SLionel Sambuc@OP{autoindent}
883*84d9c625SLionel Sambucand
884*84d9c625SLionel Sambuc@OP{number}
885*84d9c625SLionel Sambucoptions.
886*84d9c625SLionel Sambuc@end table
887*84d9c625SLionel Sambuc@end deftypefn
888*84d9c625SLionel Sambuc@cindex join
889*84d9c625SLionel Sambuc@deftypefn Command {[range]} {j[oin][!]} {[count] [flags]}
890*84d9c625SLionel Sambuc
891*84d9c625SLionel SambucJoin lines of text together.
892*84d9c625SLionel Sambuc@sp 1
893*84d9c625SLionel SambucA
894*84d9c625SLionel Sambuc@LI{count}specified to the
895*84d9c625SLionel Sambuc@CO{join}
896*84d9c625SLionel Sambuccommand specifies that the last line of the
897*84d9c625SLionel Sambuc@LI{range}plus
898*84d9c625SLionel Sambuc@LI{count}subsequent lines will be joined.
899*84d9c625SLionel Sambuc(Note, this differs by one from the general rule where only
900*84d9c625SLionel Sambuc@LI{count}- 1
901*84d9c625SLionel Sambucsubsequent lines are affected.)
902*84d9c625SLionel Sambuc@sp 1
903*84d9c625SLionel SambucIf the current line ends with a whitespace character, all whitespace
904*84d9c625SLionel Sambucis stripped from the next line.
905*84d9c625SLionel SambucOtherwise, if the next line starts with a open parenthesis
906*84d9c625SLionel Sambuc@PQ{(},
907*84d9c625SLionel Sambucdo nothing.
908*84d9c625SLionel SambucOtherwise, if the current line ends with a question mark
909*84d9c625SLionel Sambuc@PQ{?},
910*84d9c625SLionel Sambucperiod
911*84d9c625SLionel Sambuc@PQ{.}
912*84d9c625SLionel Sambucor exclamation point
913*84d9c625SLionel Sambuc@PQ{!},
914*84d9c625SLionel Sambucinsert two spaces.
915*84d9c625SLionel SambucOtherwise, insert a single space.
916*84d9c625SLionel Sambuc@sp 1
917*84d9c625SLionel SambucAppending a
918*84d9c625SLionel Sambuc@QT{!}
919*84d9c625SLionel Sambuccharacter to the command name causes a simpler join with no
920*84d9c625SLionel Sambucwhite-space processing.
921*84d9c625SLionel Sambuc@table @asis
922*84d9c625SLionel Sambuc@item Line:
923*84d9c625SLionel SambucUnchanged.
924*84d9c625SLionel Sambuc@item Options:
925*84d9c625SLionel SambucNone.
926*84d9c625SLionel Sambuc@end table
927*84d9c625SLionel Sambuc@end deftypefn
928*84d9c625SLionel Sambuc@cindex list
929*84d9c625SLionel Sambuc@deftypefn Command {[range]} {l[ist]} {[count] [flags]}
930*84d9c625SLionel Sambuc
931*84d9c625SLionel SambucDisplay the lines unambiguously.
932*84d9c625SLionel SambucTabs are displayed as
933*84d9c625SLionel Sambuc@QT{^I},
934*84d9c625SLionel Sambucand the end of the line is marked with a
935*84d9c625SLionel Sambuc@QT{$}
936*84d9c625SLionel Sambuccharacter.
937*84d9c625SLionel Sambuc@table @asis
938*84d9c625SLionel Sambuc@item Line:
939*84d9c625SLionel SambucSet to the last line displayed.
940*84d9c625SLionel Sambuc@item Options:
941*84d9c625SLionel SambucAffected by the
942*84d9c625SLionel Sambuc@OP{number}
943*84d9c625SLionel Sambucoption.
944*84d9c625SLionel Sambuc@end table
945*84d9c625SLionel Sambuc@end deftypefn
946*84d9c625SLionel Sambuc@cindex map
947*84d9c625SLionel Sambuc@deftypefn Command {} {map[!]} {[lhs rhs]}
948*84d9c625SLionel Sambuc
949*84d9c625SLionel SambucDefine or display maps (for
950*84d9c625SLionel Sambuc@CO{vi}
951*84d9c625SLionel Sambuconly).
952*84d9c625SLionel Sambuc@sp 1
953*84d9c625SLionel SambucIf
954*84d9c625SLionel Sambuc@QT{lhs}
955*84d9c625SLionel Sambucand
956*84d9c625SLionel Sambuc@QT{rhs}
957*84d9c625SLionel Sambucare not specified, the current set of command mode maps are displayed.
958*84d9c625SLionel SambucIf a
959*84d9c625SLionel Sambuc@QT{!}
960*84d9c625SLionel Sambuccharacter is appended to to the command,
961*84d9c625SLionel Sambucthe text input mode maps are displayed.
962*84d9c625SLionel Sambuc@sp 1
963*84d9c625SLionel SambucOtherwise, when the
964*84d9c625SLionel Sambuc@QT{lhs}
965*84d9c625SLionel Sambuccharacter sequence is entered in
966*84d9c625SLionel Sambuc@CO{vi},
967*84d9c625SLionel Sambucthe action is as if the corresponding
968*84d9c625SLionel Sambuc@QT{rhs}
969*84d9c625SLionel Sambuchad been entered.
970*84d9c625SLionel SambucIf a
971*84d9c625SLionel Sambuc@QT{!}
972*84d9c625SLionel Sambuccharacter is appended to the command name,
973*84d9c625SLionel Sambucthe mapping is effective during text input mode,
974*84d9c625SLionel Sambucotherwise, it is effective during command mode.
975*84d9c625SLionel SambucThis allows
976*84d9c625SLionel Sambuc@QT{lhs}
977*84d9c625SLionel Sambucto have two different macro definitions at the same time: one for command
978*84d9c625SLionel Sambucmode and one for input mode.
979*84d9c625SLionel Sambuc@sp 1
980*84d9c625SLionel SambucWhitespace characters require escaping with a
981*84d9c625SLionel Sambuc@LI{<literal-next>}character to be entered in the
982*84d9c625SLionel Sambuc@LI{lhs}string in visual mode.
983*84d9c625SLionel Sambuc@sp 1
984*84d9c625SLionel SambucNormally, keys in the
985*84d9c625SLionel Sambuc@LI{rhs}string are remapped (see the
986*84d9c625SLionel Sambuc@OP{remap}
987*84d9c625SLionel Sambucoption),
988*84d9c625SLionel Sambucand it is possible to create infinite loops.
989*84d9c625SLionel SambucHowever, keys which map to themselves are not further remapped,
990*84d9c625SLionel Sambucregardless of the setting of the
991*84d9c625SLionel Sambuc@OP{remap}
992*84d9c625SLionel Sambucoption.
993*84d9c625SLionel SambucFor example, the command
994*84d9c625SLionel Sambuc@QT{:map n nz.}
995*84d9c625SLionel Sambucmaps the
996*84d9c625SLionel Sambuc@QT{n}
997*84d9c625SLionel Sambuckey to the
998*84d9c625SLionel Sambuc@CO{n}
999*84d9c625SLionel Sambucand
1000*84d9c625SLionel Sambuc@CO{z}
1001*84d9c625SLionel Sambuccommands.
1002*84d9c625SLionel Sambuc@sp 1
1003*84d9c625SLionel SambucTo exit an infinitely looping map, use the terminal
1004*84d9c625SLionel Sambuc@LI{<interrupt>}character.
1005*84d9c625SLionel Sambuc@table @asis
1006*84d9c625SLionel Sambuc@item Line:
1007*84d9c625SLionel SambucUnchanged.
1008*84d9c625SLionel Sambuc@item Options:
1009*84d9c625SLionel SambucAffected by the
1010*84d9c625SLionel Sambuc@OP{remap}
1011*84d9c625SLionel Sambucoption.
1012*84d9c625SLionel Sambuc@end table
1013*84d9c625SLionel Sambuc@cindex mark
1014*84d9c625SLionel Sambuc@end deftypefn
1015*84d9c625SLionel Sambuc@cindex k
1016*84d9c625SLionel Sambuc@deftypefn Command {[line]} {ma[rk]} {<character>}
1017*84d9c625SLionel Sambuc
1018*84d9c625SLionel Sambuc@deftypefnx Command  {[line]} {k} {<character>}
1019*84d9c625SLionel SambucMark the line with the mark
1020*84d9c625SLionel Sambuc@LI{<character>}.
1021*84d9c625SLionel SambucThe expressions
1022*84d9c625SLionel Sambuc@QT{'<character>}
1023*84d9c625SLionel Sambucand
1024*84d9c625SLionel Sambuc@QT{`<character>}
1025*84d9c625SLionel Sambuccan then be used as an address in any command that uses one.
1026*84d9c625SLionel Sambuc@table @asis
1027*84d9c625SLionel Sambuc@item Line:
1028*84d9c625SLionel SambucUnchanged.
1029*84d9c625SLionel Sambuc@item Options:
1030*84d9c625SLionel SambucNone.
1031*84d9c625SLionel Sambuc@end table
1032*84d9c625SLionel Sambuc@end deftypefn
1033*84d9c625SLionel Sambuc@cindex move
1034*84d9c625SLionel Sambuc@deftypefn Command {[range]} {m[ove]} {line}
1035*84d9c625SLionel Sambuc
1036*84d9c625SLionel SambucMove the specified lines after the target line.
1037*84d9c625SLionel SambucA target line of 0 places the lines at the beginning of the file.
1038*84d9c625SLionel Sambuc@table @asis
1039*84d9c625SLionel Sambuc@item Line:
1040*84d9c625SLionel SambucSet to the first of the moved lines.
1041*84d9c625SLionel Sambuc@item Options:
1042*84d9c625SLionel SambucNone.
1043*84d9c625SLionel Sambuc@end table
1044*84d9c625SLionel Sambuc@end deftypefn
1045*84d9c625SLionel Sambuc@cindex mkexrc
1046*84d9c625SLionel Sambuc@deftypefn Command {} {mk[exrc][!]} {file}
1047*84d9c625SLionel Sambuc
1048*84d9c625SLionel SambucWrite the abbreviations, editor options and maps to the specified
1049*84d9c625SLionel Sambucfile.
1050*84d9c625SLionel SambucInformation is written in a form which can later be read back in
1051*84d9c625SLionel Sambucusing the
1052*84d9c625SLionel Sambuc@CO{ex}
1053*84d9c625SLionel Sambuc@CO{source}
1054*84d9c625SLionel Sambuccommand.
1055*84d9c625SLionel SambucIf
1056*84d9c625SLionel Sambuc@LI{file}already exists, the
1057*84d9c625SLionel Sambuc@CO{mkexrc}
1058*84d9c625SLionel Sambuccommand will fail.
1059*84d9c625SLionel SambucThis check can be overridden by appending a
1060*84d9c625SLionel Sambuc@QT{!}
1061*84d9c625SLionel Sambuccharacter to the command.
1062*84d9c625SLionel Sambuc@table @asis
1063*84d9c625SLionel Sambuc@item Line:
1064*84d9c625SLionel SambucUnchanged.
1065*84d9c625SLionel Sambuc@item Options:
1066*84d9c625SLionel SambucNone.
1067*84d9c625SLionel Sambuc@end table
1068*84d9c625SLionel Sambuc@end deftypefn
1069*84d9c625SLionel Sambuc@cindex next
1070*84d9c625SLionel Sambuc@deftypefn Command {} {n[ext][!]} {[file ...]}
1071*84d9c625SLionel Sambuc
1072*84d9c625SLionel SambucEdit the next file from the argument list.
1073*84d9c625SLionel SambucThe
1074*84d9c625SLionel Sambuc@CO{next}
1075*84d9c625SLionel Sambuccommand will fail if the file has been modified since the last complete
1076*84d9c625SLionel Sambucwrite.
1077*84d9c625SLionel SambucThis check can be overridden by appending the
1078*84d9c625SLionel Sambuc@QT{!}
1079*84d9c625SLionel Sambuccharacter to the command name.
1080*84d9c625SLionel SambucThe argument list can optionally be replaced by specifying a new one
1081*84d9c625SLionel Sambucas arguments to this command.
1082*84d9c625SLionel SambucIn this case, editing starts with the first file on the new list.
1083*84d9c625SLionel Sambuc@sp 1
1084*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1085*84d9c625SLionel Sambuc@CO{Next},
1086*84d9c625SLionel Sambucwhile in
1087*84d9c625SLionel Sambuc@CO{vi}
1088*84d9c625SLionel Sambucmode, will set the argument list and edit the file in a new screen.
1089*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1090*84d9c625SLionel Sambuc@table @asis
1091*84d9c625SLionel Sambuc@item Line:
1092*84d9c625SLionel SambucSet as described for the
1093*84d9c625SLionel Sambuc@CO{edit}
1094*84d9c625SLionel Sambuccommand.
1095*84d9c625SLionel Sambuc@item Options:
1096*84d9c625SLionel SambucAffected by the options
1097*84d9c625SLionel Sambuc@OP{autowrite}
1098*84d9c625SLionel Sambucand
1099*84d9c625SLionel Sambuc@OP{writeany}.
1100*84d9c625SLionel Sambuc@end table
1101*84d9c625SLionel Sambuc@end deftypefn
1102*84d9c625SLionel Sambuc@cindex open
1103*84d9c625SLionel Sambuc@deftypefn Command {[line]} {o[pen]} {/pattern/ [flags]}
1104*84d9c625SLionel Sambuc
1105*84d9c625SLionel SambucEnter open mode.
1106*84d9c625SLionel SambucOpen mode is the same as being in
1107*84d9c625SLionel Sambuc@CO{vi},
1108*84d9c625SLionel Sambucbut with a one-line window.
1109*84d9c625SLionel SambucAll the standard
1110*84d9c625SLionel Sambuc@CO{vi}
1111*84d9c625SLionel Sambuccommands are available.
1112*84d9c625SLionel SambucIf a match is found for the optional RE argument,
1113*84d9c625SLionel Sambucthe cursor is set to the start of the matching pattern.
1114*84d9c625SLionel Sambuc@sp 1
1115*84d9c625SLionel Sambuc@emph{This command is not yet implemented.}
1116*84d9c625SLionel Sambuc@table @asis
1117*84d9c625SLionel Sambuc@item Line:
1118*84d9c625SLionel SambucUnchanged, unless the optional RE is specified, in which case it is
1119*84d9c625SLionel Sambucset to the line where the matching pattern is found.
1120*84d9c625SLionel Sambuc@item Options:
1121*84d9c625SLionel SambucAffected by the
1122*84d9c625SLionel Sambuc@OP{open}
1123*84d9c625SLionel Sambucoption.
1124*84d9c625SLionel Sambuc@end table
1125*84d9c625SLionel Sambuc@end deftypefn
1126*84d9c625SLionel Sambuc@cindex preserve
1127*84d9c625SLionel Sambuc@deftypefn Command {} {pre[serve]}
1128*84d9c625SLionel Sambuc
1129*84d9c625SLionel SambucSave the file in a form that can later be recovered using the
1130*84d9c625SLionel Sambuc@CO{ex}
1131*84d9c625SLionel Sambuc@strong{-r}
1132*84d9c625SLionel Sambucoption.
1133*84d9c625SLionel SambucWhen the file is preserved, an email message is sent to the user.
1134*84d9c625SLionel Sambuc@table @asis
1135*84d9c625SLionel Sambuc@item Line:
1136*84d9c625SLionel SambucUnchanged.
1137*84d9c625SLionel Sambuc@item Options:
1138*84d9c625SLionel SambucNone.
1139*84d9c625SLionel Sambuc@end table
1140*84d9c625SLionel Sambuc@end deftypefn
1141*84d9c625SLionel Sambuc@cindex previous
1142*84d9c625SLionel Sambuc@deftypefn Command {} {prev[ious][!]}
1143*84d9c625SLionel Sambuc
1144*84d9c625SLionel SambucEdit the previous file from the argument list.
1145*84d9c625SLionel SambucThe
1146*84d9c625SLionel Sambuc@CO{previous}
1147*84d9c625SLionel Sambuccommand will fail if the file has been modified since the last complete
1148*84d9c625SLionel Sambucwrite.
1149*84d9c625SLionel SambucThis check can be overridden by appending the
1150*84d9c625SLionel Sambuc@QT{!}
1151*84d9c625SLionel Sambuccharacter to the command name.
1152*84d9c625SLionel Sambuc@sp 1
1153*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1154*84d9c625SLionel Sambuc@CO{Previous},
1155*84d9c625SLionel Sambucwhile in
1156*84d9c625SLionel Sambuc@CO{vi}
1157*84d9c625SLionel Sambucmode, will edit the file in a new screen.
1158*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1159*84d9c625SLionel Sambuc@table @asis
1160*84d9c625SLionel Sambuc@item Line:
1161*84d9c625SLionel SambucSet as described for the
1162*84d9c625SLionel Sambuc@CO{edit}
1163*84d9c625SLionel Sambuccommand.
1164*84d9c625SLionel Sambuc@item Options:
1165*84d9c625SLionel SambucAffected by the options
1166*84d9c625SLionel Sambuc@OP{autowrite}
1167*84d9c625SLionel Sambucand
1168*84d9c625SLionel Sambuc@OP{writeany}.
1169*84d9c625SLionel SambucNone.
1170*84d9c625SLionel Sambuc@end table
1171*84d9c625SLionel Sambuc@end deftypefn
1172*84d9c625SLionel Sambuc@cindex print
1173*84d9c625SLionel Sambuc@deftypefn Command {[range]} {p[rint]} {[count] [flags]}
1174*84d9c625SLionel Sambuc
1175*84d9c625SLionel SambucDisplay the specified lines.
1176*84d9c625SLionel Sambuc@table @asis
1177*84d9c625SLionel Sambuc@item Line:
1178*84d9c625SLionel SambucSet to the last line displayed.
1179*84d9c625SLionel Sambuc@item Options:
1180*84d9c625SLionel SambucAffected by the
1181*84d9c625SLionel Sambuc@OP{list}
1182*84d9c625SLionel Sambucand
1183*84d9c625SLionel Sambuc@OP{number}
1184*84d9c625SLionel Sambucoption.
1185*84d9c625SLionel Sambuc@end table
1186*84d9c625SLionel Sambuc@end deftypefn
1187*84d9c625SLionel Sambuc@cindex put
1188*84d9c625SLionel Sambuc@deftypefn Command {[line]} {pu[t]} {[buffer]}
1189*84d9c625SLionel Sambuc
1190*84d9c625SLionel SambucAppend buffer contents to the current line.
1191*84d9c625SLionel SambucIf a buffer is specified, its contents are appended to the line,
1192*84d9c625SLionel Sambucotherwise, the contents of the unnamed buffer are used.
1193*84d9c625SLionel Sambuc@table @asis
1194*84d9c625SLionel Sambuc@item Line:
1195*84d9c625SLionel SambucSet to the line after the current line.
1196*84d9c625SLionel Sambuc@item Options:
1197*84d9c625SLionel SambucNone.
1198*84d9c625SLionel Sambuc@end table
1199*84d9c625SLionel Sambuc@end deftypefn
1200*84d9c625SLionel Sambuc@cindex quit
1201*84d9c625SLionel Sambuc@deftypefn Command {} {q[uit][!]}
1202*84d9c625SLionel Sambuc
1203*84d9c625SLionel SambucEnd the editing session.
1204*84d9c625SLionel SambucIf the file has been modified since the last complete write, the
1205*84d9c625SLionel Sambuc@CO{quit}
1206*84d9c625SLionel Sambuccommand will fail.
1207*84d9c625SLionel SambucThis check may be overridden by appending a
1208*84d9c625SLionel Sambuc@QT{!}
1209*84d9c625SLionel Sambuccharacter to the command.
1210*84d9c625SLionel Sambuc@sp 1
1211*84d9c625SLionel SambucIf there are more files to edit, the
1212*84d9c625SLionel Sambuc@CO{quit}
1213*84d9c625SLionel Sambuccommand will fail.
1214*84d9c625SLionel SambucAppending a
1215*84d9c625SLionel Sambuc@QT{!}
1216*84d9c625SLionel Sambuccharacter to the command name or entering two
1217*84d9c625SLionel Sambuc@CO{quit}
1218*84d9c625SLionel Sambuccommands (i.e.
1219*84d9c625SLionel Sambuc@CO{wq},
1220*84d9c625SLionel Sambuc@CO{quit},
1221*84d9c625SLionel Sambuc@CO{xit}
1222*84d9c625SLionel Sambucor
1223*84d9c625SLionel Sambuc@CO{ZZ})
1224*84d9c625SLionel Sambucin a row) will override this check and the editor will exit.
1225*84d9c625SLionel Sambuc@table @asis
1226*84d9c625SLionel Sambuc@item Line:
1227*84d9c625SLionel SambucUnchanged.
1228*84d9c625SLionel Sambuc@item Options:
1229*84d9c625SLionel SambucNone.
1230*84d9c625SLionel Sambuc@end table
1231*84d9c625SLionel Sambuc@end deftypefn
1232*84d9c625SLionel Sambuc@cindex read
1233*84d9c625SLionel Sambuc@deftypefn Command {[line]} {r[ead][!]} {[file]}
1234*84d9c625SLionel Sambuc
1235*84d9c625SLionel SambucRead a file.
1236*84d9c625SLionel SambucA copy of the specified file is appended to the line.
1237*84d9c625SLionel SambucIf
1238*84d9c625SLionel Sambuc@LI{line}is 0, the copy is inserted at the beginning of the file.
1239*84d9c625SLionel SambucIf no file is specified, the current file is read; if there is no
1240*84d9c625SLionel Sambuccurrent file, then
1241*84d9c625SLionel Sambuc@LI{file}becomes the current file.
1242*84d9c625SLionel SambucIf there is no current file and no
1243*84d9c625SLionel Sambuc@LI{file}is specified, then the
1244*84d9c625SLionel Sambuc@CO{read}
1245*84d9c625SLionel Sambuccommand will fail.
1246*84d9c625SLionel Sambuc@sp 1
1247*84d9c625SLionel SambucIf
1248*84d9c625SLionel Sambuc@LI{file}is preceded by a
1249*84d9c625SLionel Sambuc@QT{!}
1250*84d9c625SLionel Sambuccharacter,
1251*84d9c625SLionel Sambuc@LI{file}is treated as if it were a shell command, and passed to the program
1252*84d9c625SLionel Sambucnamed by the
1253*84d9c625SLionel Sambuc@OP{shell}
1254*84d9c625SLionel Sambucedit option.
1255*84d9c625SLionel SambucThe standard and standard error outputs of that command are read into
1256*84d9c625SLionel Sambucthe file after the specified line.
1257*84d9c625SLionel SambucThe special meaning of the
1258*84d9c625SLionel Sambuc@QT{!}
1259*84d9c625SLionel Sambuccharacter can be overridden by escaping it with a backslash
1260*84d9c625SLionel Sambuc@PQ{\e}
1261*84d9c625SLionel Sambuccharacter.
1262*84d9c625SLionel Sambuc@table @asis
1263*84d9c625SLionel Sambuc@item Line:
1264*84d9c625SLionel SambucWhen executed from
1265*84d9c625SLionel Sambuc@CO{ex},
1266*84d9c625SLionel Sambucthe current line is set to the last line read.
1267*84d9c625SLionel SambucWhen executed from
1268*84d9c625SLionel Sambuc@CO{vi},
1269*84d9c625SLionel Sambucthe current line is set to the first line read.
1270*84d9c625SLionel Sambuc@item Options:
1271*84d9c625SLionel SambucNone.
1272*84d9c625SLionel Sambuc@end table
1273*84d9c625SLionel Sambuc@end deftypefn
1274*84d9c625SLionel Sambuc@cindex recover
1275*84d9c625SLionel Sambuc@deftypefn Command {} {rec[over]} {file}
1276*84d9c625SLionel Sambuc
1277*84d9c625SLionel SambucRecover
1278*84d9c625SLionel Sambuc@LI{file}if it was previously saved.
1279*84d9c625SLionel SambucIf no saved file by that name exists, the
1280*84d9c625SLionel Sambuc@CO{recover}
1281*84d9c625SLionel Sambuccommand behaves equivalently to the
1282*84d9c625SLionel Sambuc@CO{edit}
1283*84d9c625SLionel Sambuccommand.
1284*84d9c625SLionel Sambuc@table @asis
1285*84d9c625SLionel Sambuc@item Line:
1286*84d9c625SLionel SambucSet as described for the
1287*84d9c625SLionel Sambuc@CO{edit}
1288*84d9c625SLionel Sambuccommand.
1289*84d9c625SLionel Sambuc@item Options:
1290*84d9c625SLionel SambucNone.
1291*84d9c625SLionel Sambuc@end table
1292*84d9c625SLionel Sambuc@end deftypefn
1293*84d9c625SLionel Sambuc@cindex resize
1294*84d9c625SLionel Sambuc@deftypefn Command {} {res[ize]} {[+|-]size}
1295*84d9c625SLionel Sambuc
1296*84d9c625SLionel Sambuc@CO{Vi}
1297*84d9c625SLionel Sambucmode only.
1298*84d9c625SLionel SambucGrow or shrink the current screen.
1299*84d9c625SLionel SambucIf
1300*84d9c625SLionel Sambuc@LI{size}is a positive, signed number, the current screen is grown by that many lines.
1301*84d9c625SLionel SambucIf
1302*84d9c625SLionel Sambuc@LI{size}is a negative, signed number, the current screen is shrunk by that many lines.
1303*84d9c625SLionel SambucIf
1304*84d9c625SLionel Sambuc@LI{size}is not signed, the current screen is set to the specified
1305*84d9c625SLionel Sambuc@LI{size}.
1306*84d9c625SLionel SambucApplicable only to split screens.
1307*84d9c625SLionel Sambuc@table @asis
1308*84d9c625SLionel Sambuc@item Line:
1309*84d9c625SLionel SambucUnchanged.
1310*84d9c625SLionel Sambuc@item Options:
1311*84d9c625SLionel SambucNone.
1312*84d9c625SLionel Sambuc@end table
1313*84d9c625SLionel Sambuc@end deftypefn
1314*84d9c625SLionel Sambuc@cindex rewind
1315*84d9c625SLionel Sambuc@deftypefn Command {} {rew[ind][!]}
1316*84d9c625SLionel Sambuc
1317*84d9c625SLionel SambucRewind the argument list.
1318*84d9c625SLionel SambucIf the current file has been modified since the last complete write,
1319*84d9c625SLionel Sambucthe
1320*84d9c625SLionel Sambuc@CO{rewind}
1321*84d9c625SLionel Sambuccommand will fail.
1322*84d9c625SLionel SambucThis check may be overridden by appending the
1323*84d9c625SLionel Sambuc@QT{!}
1324*84d9c625SLionel Sambuccharacter to the command.
1325*84d9c625SLionel Sambuc@sp 1
1326*84d9c625SLionel SambucOtherwise, the current file is set to the first file in the argument
1327*84d9c625SLionel Sambuclist.
1328*84d9c625SLionel Sambuc@table @asis
1329*84d9c625SLionel Sambuc@item Line:
1330*84d9c625SLionel SambucSet as described for the
1331*84d9c625SLionel Sambuc@CO{edit}
1332*84d9c625SLionel Sambuccommand.
1333*84d9c625SLionel Sambuc@item Options:
1334*84d9c625SLionel SambucAffected by the
1335*84d9c625SLionel Sambuc@OP{autowrite}
1336*84d9c625SLionel Sambucand
1337*84d9c625SLionel Sambuc@OP{writeany}
1338*84d9c625SLionel Sambucoptions.
1339*84d9c625SLionel Sambuc@end table
1340*84d9c625SLionel Sambuc@end deftypefn
1341*84d9c625SLionel Sambuc@cindex set
1342*84d9c625SLionel Sambuc@deftypefn Command {} {se[t]} {[option[=[value]] ...] [nooption ...] [option? ...] [all]}
1343*84d9c625SLionel Sambuc
1344*84d9c625SLionel SambucDisplay or set editor options.
1345*84d9c625SLionel SambucWhen no arguments are specified, the editor option
1346*84d9c625SLionel Sambuc@OP{term},
1347*84d9c625SLionel Sambucand any editor options whose values have been changed from the
1348*84d9c625SLionel Sambucdefault settings are displayed.
1349*84d9c625SLionel SambucIf the argument
1350*84d9c625SLionel Sambuc@LI{all}is specified, the values of all of editor options are displayed.
1351*84d9c625SLionel Sambuc@sp 1
1352*84d9c625SLionel SambucSpecifying an option name followed by the character
1353*84d9c625SLionel Sambuc@QT{?}
1354*84d9c625SLionel Sambuccauses the current value of that option to be displayed.
1355*84d9c625SLionel SambucThe
1356*84d9c625SLionel Sambuc@QT{?}
1357*84d9c625SLionel Sambuccan be separated from the option name by whitespace characters.
1358*84d9c625SLionel SambucThe
1359*84d9c625SLionel Sambuc@QT{?}
1360*84d9c625SLionel Sambucis necessary only for Boolean valued options.
1361*84d9c625SLionel SambucBoolean options can be given values by the form
1362*84d9c625SLionel Sambuc@QT{set option}
1363*84d9c625SLionel Sambucto turn them on, or
1364*84d9c625SLionel Sambuc@QT{set nooption}
1365*84d9c625SLionel Sambucto turn them off.
1366*84d9c625SLionel SambucString and numeric options can be assigned by the form
1367*84d9c625SLionel Sambuc@QT{set option=value}.
1368*84d9c625SLionel SambucAny whitespace characters in strings can be included literally by preceding
1369*84d9c625SLionel Sambuceach with a backslash.
1370*84d9c625SLionel SambucMore than one option can be set or listed by a single set command,
1371*84d9c625SLionel Sambucby specifying multiple arguments, each separated from the next by
1372*84d9c625SLionel Sambucwhitespace characters.
1373*84d9c625SLionel Sambuc@table @asis
1374*84d9c625SLionel Sambuc@item Line:
1375*84d9c625SLionel SambucUnchanged.
1376*84d9c625SLionel Sambuc@item Options:
1377*84d9c625SLionel SambucNone.
1378*84d9c625SLionel Sambuc@end table
1379*84d9c625SLionel Sambuc@end deftypefn
1380*84d9c625SLionel Sambuc@cindex shell
1381*84d9c625SLionel Sambuc@deftypefn Command {} {sh[ell]}
1382*84d9c625SLionel Sambuc
1383*84d9c625SLionel SambucRun the shell program.
1384*84d9c625SLionel SambucThe program named by the
1385*84d9c625SLionel Sambuc@OP{shell}
1386*84d9c625SLionel Sambucoption is run with a
1387*84d9c625SLionel Sambuc@strong{-i}
1388*84d9c625SLionel Sambuc(for interactive) flag.
1389*84d9c625SLionel SambucEditing is resumed when that program exits.
1390*84d9c625SLionel Sambuc@table @asis
1391*84d9c625SLionel Sambuc@item Line:
1392*84d9c625SLionel SambucUnchanged.
1393*84d9c625SLionel Sambuc@item Options:
1394*84d9c625SLionel SambucAffected by the
1395*84d9c625SLionel Sambuc@OP{shell}
1396*84d9c625SLionel Sambucoption.
1397*84d9c625SLionel Sambuc@end table
1398*84d9c625SLionel Sambuc@end deftypefn
1399*84d9c625SLionel Sambuc@cindex source
1400*84d9c625SLionel Sambuc@deftypefn Command {} {so[urce]} {file}
1401*84d9c625SLionel Sambuc
1402*84d9c625SLionel SambucRead and execute
1403*84d9c625SLionel Sambuc@CO{ex}
1404*84d9c625SLionel Sambuccommands from a file.
1405*84d9c625SLionel Sambuc@CO{Source}
1406*84d9c625SLionel Sambuccommands may be nested.
1407*84d9c625SLionel Sambuc@table @asis
1408*84d9c625SLionel Sambuc@item Line:
1409*84d9c625SLionel SambucUnchanged.
1410*84d9c625SLionel Sambuc@item Options:
1411*84d9c625SLionel SambucNone.
1412*84d9c625SLionel Sambuc@end table
1413*84d9c625SLionel Sambuc@end deftypefn
1414*84d9c625SLionel Sambuc@cindex substitute
1415*84d9c625SLionel Sambuc@deftypefn Command {[range]} {s[ubstitute]} {[/pattern/replace/] [options] [count] [flags]}
1416*84d9c625SLionel Sambuc
1417*84d9c625SLionel Sambuc@cindex &
1418*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {&} {[options] [count] [flags]}
1419*84d9c625SLionel Sambuc@cindex ~
1420*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {~} {[options] [count] [flags]}
1421*84d9c625SLionel SambucMake substitutions.
1422*84d9c625SLionel SambucReplace the first instance of
1423*84d9c625SLionel Sambuc@LI{pattern}with the string
1424*84d9c625SLionel Sambuc@LI{replace}on the specified line(s).
1425*84d9c625SLionel SambucIf the
1426*84d9c625SLionel Sambuc@QT{/pattern/repl/}
1427*84d9c625SLionel Sambucargument is not specified, the
1428*84d9c625SLionel Sambuc@QT{/pattern/repl/}
1429*84d9c625SLionel Sambucfrom the previous
1430*84d9c625SLionel Sambuc@CO{substitute}
1431*84d9c625SLionel Sambuccommand is used.
1432*84d9c625SLionel SambucAny character other than an alphabetic, numeric, <blank> or backslash
1433*84d9c625SLionel Sambuccharacter may be used as the delimiter.
1434*84d9c625SLionel Sambuc@sp 1
1435*84d9c625SLionel SambucIf
1436*84d9c625SLionel Sambuc@LI{options}includes the letter
1437*84d9c625SLionel Sambuc@QT{c}
1438*84d9c625SLionel Sambuc(confirm), you will be prompted for confirmation before each replacement
1439*84d9c625SLionel Sambucis done.
1440*84d9c625SLionel SambucAn affirmative response (in English, a
1441*84d9c625SLionel Sambuc@QT{y}
1442*84d9c625SLionel Sambuccharacter) causes the replacement to be made.
1443*84d9c625SLionel SambucA quit response (in English, a
1444*84d9c625SLionel Sambuc@QT{q}
1445*84d9c625SLionel Sambuccharacter) causes the
1446*84d9c625SLionel Sambuc@CO{substitute}
1447*84d9c625SLionel Sambuccommand to be terminated.
1448*84d9c625SLionel SambucAny other response causes the replacement not to be made, and the
1449*84d9c625SLionel Sambuc@CO{substitute}
1450*84d9c625SLionel Sambuccommand continues.
1451*84d9c625SLionel SambucIf
1452*84d9c625SLionel Sambuc@LI{options}includes the letter
1453*84d9c625SLionel Sambuc@QT{g}
1454*84d9c625SLionel Sambuc(global), all nonoverlapping instances of
1455*84d9c625SLionel Sambuc@LI{pattern}in the line are replaced.
1456*84d9c625SLionel Sambuc@sp 1
1457*84d9c625SLionel SambucThe
1458*84d9c625SLionel Sambuc@CO{&}
1459*84d9c625SLionel Sambucversion of the command is the same as not specifying a pattern
1460*84d9c625SLionel Sambucor replacement string to the
1461*84d9c625SLionel Sambuc@CO{substitute}
1462*84d9c625SLionel Sambuccommand, and the
1463*84d9c625SLionel Sambuc@QT{&}
1464*84d9c625SLionel Sambucis replaced by the pattern and replacement information from the
1465*84d9c625SLionel Sambucprevious substitute command.
1466*84d9c625SLionel Sambuc@sp 1
1467*84d9c625SLionel SambucThe
1468*84d9c625SLionel Sambuc@CO{~}
1469*84d9c625SLionel Sambucversion of the command is the same as
1470*84d9c625SLionel Sambuc@CO{&}
1471*84d9c625SLionel Sambucand
1472*84d9c625SLionel Sambuc@CO{s},
1473*84d9c625SLionel Sambucexcept that the search pattern used is the last RE used in
1474*84d9c625SLionel Sambuc@emph{any}
1475*84d9c625SLionel Sambuccommand, not necessarily the one used in the last
1476*84d9c625SLionel Sambuc@CO{substitute}
1477*84d9c625SLionel Sambuccommand.
1478*84d9c625SLionel Sambuc@sp 1
1479*84d9c625SLionel SambucFor example, in the sequence
1480*84d9c625SLionel Sambuc@example
1481*84d9c625SLionel Sambucs/red/blue/
1482*84d9c625SLionel Sambuc/green
1483*84d9c625SLionel Sambuc~
1484*84d9c625SLionel Sambuc@end example
1485*84d9c625SLionel Sambucthe
1486*84d9c625SLionel Sambuc@QT{~}
1487*84d9c625SLionel Sambucis equivalent to
1488*84d9c625SLionel Sambuc@QT{s/green/blue/}.
1489*84d9c625SLionel Sambuc@sp 1
1490*84d9c625SLionel SambucThe
1491*84d9c625SLionel Sambuc@CO{substitute}
1492*84d9c625SLionel Sambuccommand may be interrupted, using the terminal interrupt character.
1493*84d9c625SLionel SambucAll substitutions completed before the interrupt are retained.
1494*84d9c625SLionel Sambuc@table @asis
1495*84d9c625SLionel Sambuc@item Line:
1496*84d9c625SLionel SambucSet to the last line upon which a substitution was made.
1497*84d9c625SLionel Sambuc@item Options:
1498*84d9c625SLionel SambucAffected by the
1499*84d9c625SLionel Sambuc@OP{ignorecase}
1500*84d9c625SLionel Sambucand
1501*84d9c625SLionel Sambuc@OP{magic}
1502*84d9c625SLionel Sambucoption.
1503*84d9c625SLionel Sambuc@end table
1504*84d9c625SLionel Sambuc@end deftypefn
1505*84d9c625SLionel Sambuc@cindex suspend
1506*84d9c625SLionel Sambuc@deftypefn Command {} {su[spend][!]}
1507*84d9c625SLionel Sambuc
1508*84d9c625SLionel Sambuc@cindex stop
1509*84d9c625SLionel Sambuc@deftypefnx Command {}  {st[op][!]}
1510*84d9c625SLionel Sambuc@deftypefnx Comamnd {}  <control-Z>
1511*84d9c625SLionel SambucSuspend the edit session.
1512*84d9c625SLionel SambucAppending a
1513*84d9c625SLionel Sambuc@QT{!}
1514*84d9c625SLionel Sambuccharacter to these commands turns off the
1515*84d9c625SLionel Sambuc@OP{autowrite}
1516*84d9c625SLionel Sambucoption for the command.
1517*84d9c625SLionel Sambuc@table @asis
1518*84d9c625SLionel Sambuc@item Line:
1519*84d9c625SLionel SambucUnchanged.
1520*84d9c625SLionel Sambuc@item Options:
1521*84d9c625SLionel SambucAffected by the
1522*84d9c625SLionel Sambuc@OP{autowrite}
1523*84d9c625SLionel Sambucand
1524*84d9c625SLionel Sambuc@OP{writeany}
1525*84d9c625SLionel Sambucoptions.
1526*84d9c625SLionel Sambuc@end table
1527*84d9c625SLionel Sambuc@end deftypefn
1528*84d9c625SLionel Sambuc@cindex tag
1529*84d9c625SLionel Sambuc@deftypefn Command {} {ta[g][!]} {tagstring}
1530*84d9c625SLionel Sambuc
1531*84d9c625SLionel SambucEdit the file containing the specified tag.
1532*84d9c625SLionel SambucIf the tag is in a different file, then the new file is edited.
1533*84d9c625SLionel SambucIf the current file has been modified since the last complete write,
1534*84d9c625SLionel Sambucthe
1535*84d9c625SLionel Sambuc@CO{tag}
1536*84d9c625SLionel Sambuccommand will fail.
1537*84d9c625SLionel SambucThis check can be overridden by appending the
1538*84d9c625SLionel Sambuc@QT{!}
1539*84d9c625SLionel Sambuccharacter to the command name.
1540*84d9c625SLionel Sambuc@sp 1
1541*84d9c625SLionel SambucThe
1542*84d9c625SLionel Sambuc@CO{tag}
1543*84d9c625SLionel Sambuccommand searches for
1544*84d9c625SLionel Sambuc@LI{tagstring}in the tags file(s) specified by the
1545*84d9c625SLionel Sambuc@OP{tags}
1546*84d9c625SLionel Sambucoption.
1547*84d9c625SLionel Sambuc(See
1548*84d9c625SLionel Sambuc@XR{ctags,1}
1549*84d9c625SLionel Sambucfor more information on tags files.)
1550*84d9c625SLionel Sambuc@sp 1
1551*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1552*84d9c625SLionel Sambuc@CO{Tag},
1553*84d9c625SLionel Sambucwhile in
1554*84d9c625SLionel Sambuc@CO{vi}
1555*84d9c625SLionel Sambucmode, will edit the file in a new screen.
1556*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1557*84d9c625SLionel Sambuc@table @asis
1558*84d9c625SLionel Sambuc@item Line:
1559*84d9c625SLionel SambucSet to the line indicated by the tag.
1560*84d9c625SLionel Sambuc@item Options:
1561*84d9c625SLionel SambucAffected by the
1562*84d9c625SLionel Sambuc@OP{autowrite},
1563*84d9c625SLionel Sambuc@OP{taglength},
1564*84d9c625SLionel Sambuc@OP{tags}
1565*84d9c625SLionel Sambucand
1566*84d9c625SLionel Sambuc@OP{writeany}
1567*84d9c625SLionel Sambucoptions.
1568*84d9c625SLionel Sambuc@end table
1569*84d9c625SLionel Sambuc@end deftypefn
1570*84d9c625SLionel Sambuc@cindex tagnext
1571*84d9c625SLionel Sambuc@deftypefn Command {} {tagn[ext][!]}
1572*84d9c625SLionel Sambuc
1573*84d9c625SLionel SambucEdit the file containing the next context for the current tag.
1574*84d9c625SLionel SambucIf the context is in a different file, then the new file is edited.
1575*84d9c625SLionel SambucIf the current file has been modified since the last complete write,
1576*84d9c625SLionel Sambucthe
1577*84d9c625SLionel Sambuc@CO{tagnext}
1578*84d9c625SLionel Sambuccommand will fail.
1579*84d9c625SLionel SambucThis check can be overridden by appending the
1580*84d9c625SLionel Sambuc@QT{!}
1581*84d9c625SLionel Sambuccharacter to the command name.
1582*84d9c625SLionel Sambuc@sp 1
1583*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1584*84d9c625SLionel Sambuc@CO{Tagnext},
1585*84d9c625SLionel Sambucwhile in
1586*84d9c625SLionel Sambuc@CO{vi}
1587*84d9c625SLionel Sambucmode, will edit the file in a new screen.
1588*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1589*84d9c625SLionel Sambuc@table @asis
1590*84d9c625SLionel Sambuc@item Line:
1591*84d9c625SLionel SambucSet to the line indicated by the tag.
1592*84d9c625SLionel Sambuc@item Options:
1593*84d9c625SLionel SambucAffected by the
1594*84d9c625SLionel Sambuc@OP{autowrite}
1595*84d9c625SLionel Sambucand
1596*84d9c625SLionel Sambuc@OP{writeany}
1597*84d9c625SLionel Sambucoptions.
1598*84d9c625SLionel Sambuc@end table
1599*84d9c625SLionel Sambuc@end deftypefn
1600*84d9c625SLionel Sambuc@cindex tagpop
1601*84d9c625SLionel Sambuc@deftypefn Command {} {tagp[op][!]} {[file | number]}
1602*84d9c625SLionel Sambuc
1603*84d9c625SLionel SambucPop to the specified tag in the tags stack.
1604*84d9c625SLionel SambucIf neither
1605*84d9c625SLionel Sambuc@LI{file}or
1606*84d9c625SLionel Sambuc@LI{number}is specified, the
1607*84d9c625SLionel Sambuc@CO{tagpop}
1608*84d9c625SLionel Sambuccommand pops to the most recent entry on the tags stack.
1609*84d9c625SLionel SambucIf
1610*84d9c625SLionel Sambuc@LI{file}or
1611*84d9c625SLionel Sambuc@LI{number}is specified, the
1612*84d9c625SLionel Sambuc@CO{tagpop}
1613*84d9c625SLionel Sambuccommand pops to the most recent entry in the tags stack for that file,
1614*84d9c625SLionel Sambucor numbered entry in the tags stack, respectively.
1615*84d9c625SLionel Sambuc(See the
1616*84d9c625SLionel Sambuc@CO{display}
1617*84d9c625SLionel Sambuccommand for information on displaying the tags stack.)
1618*84d9c625SLionel Sambuc@sp 1
1619*84d9c625SLionel SambucIf the file has been modified since the last complete write, the
1620*84d9c625SLionel Sambuc@CO{tagpop}
1621*84d9c625SLionel Sambuccommand will fail.
1622*84d9c625SLionel SambucThis check may be overridden by appending a
1623*84d9c625SLionel Sambuc@QT{!}
1624*84d9c625SLionel Sambuccharacter to the command name.
1625*84d9c625SLionel Sambuc@table @asis
1626*84d9c625SLionel Sambuc@item Line:
1627*84d9c625SLionel SambucSet to the line indicated by the tag.
1628*84d9c625SLionel Sambuc@item Options:
1629*84d9c625SLionel SambucAffected by the
1630*84d9c625SLionel Sambuc@OP{autowrite}
1631*84d9c625SLionel Sambucand
1632*84d9c625SLionel Sambuc@OP{writeany}
1633*84d9c625SLionel Sambucoptions.
1634*84d9c625SLionel Sambuc@end table
1635*84d9c625SLionel Sambuc@end deftypefn
1636*84d9c625SLionel Sambuc@cindex tagprev
1637*84d9c625SLionel Sambuc@deftypefn Command {} {tagp[rev][!]}
1638*84d9c625SLionel Sambuc
1639*84d9c625SLionel SambucEdit the file containing the previous context for the current tag.
1640*84d9c625SLionel SambucIf the context is in a different file, then the new file is edited.
1641*84d9c625SLionel SambucIf the current file has been modified since the last complete write,
1642*84d9c625SLionel Sambucthe
1643*84d9c625SLionel Sambuc@CO{tagprev}
1644*84d9c625SLionel Sambuccommand will fail.
1645*84d9c625SLionel SambucThis check can be overridden by appending the
1646*84d9c625SLionel Sambuc@QT{!}
1647*84d9c625SLionel Sambuccharacter to the command name.
1648*84d9c625SLionel Sambuc@sp 1
1649*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1650*84d9c625SLionel Sambuc@CO{Tagprev},
1651*84d9c625SLionel Sambucwhile in
1652*84d9c625SLionel Sambuc@CO{vi}
1653*84d9c625SLionel Sambucmode, will edit the file in a new screen.
1654*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1655*84d9c625SLionel Sambuc@table @asis
1656*84d9c625SLionel Sambuc@item Line:
1657*84d9c625SLionel SambucSet to the line indicated by the tag.
1658*84d9c625SLionel Sambuc@item Options:
1659*84d9c625SLionel SambucAffected by the
1660*84d9c625SLionel Sambuc@OP{autowrite}
1661*84d9c625SLionel Sambucand
1662*84d9c625SLionel Sambuc@OP{writeany}
1663*84d9c625SLionel Sambucoptions.
1664*84d9c625SLionel Sambuc@end table
1665*84d9c625SLionel Sambuc@end deftypefn
1666*84d9c625SLionel Sambuc@cindex tagtop
1667*84d9c625SLionel Sambuc@deftypefn Command {} {tagt[op][!]}
1668*84d9c625SLionel Sambuc
1669*84d9c625SLionel SambucPop to the least recent tag on the tags stack, clearing the tags stack.
1670*84d9c625SLionel Sambuc@sp 1
1671*84d9c625SLionel SambucIf the file has been modified since the last complete write, the
1672*84d9c625SLionel Sambuc@CO{tagtop}
1673*84d9c625SLionel Sambuccommand will fail.
1674*84d9c625SLionel SambucThis check may be overridden by appending a
1675*84d9c625SLionel Sambuc@QT{!}
1676*84d9c625SLionel Sambuccharacter to the command name.
1677*84d9c625SLionel Sambuc@table @asis
1678*84d9c625SLionel Sambuc@item Line:
1679*84d9c625SLionel SambucSet to the line indicated by the tag.
1680*84d9c625SLionel Sambuc@item Options:
1681*84d9c625SLionel SambucAffected by the
1682*84d9c625SLionel Sambuc@OP{autowrite}
1683*84d9c625SLionel Sambucand
1684*84d9c625SLionel Sambuc@OP{writeany}
1685*84d9c625SLionel Sambucoptions.
1686*84d9c625SLionel Sambuc@end table
1687*84d9c625SLionel Sambuc@end deftypefn
1688*84d9c625SLionel Sambuc@cindex unabbrev
1689*84d9c625SLionel Sambuc@deftypefn Command {} {una[bbrev]} {lhs}
1690*84d9c625SLionel Sambuc
1691*84d9c625SLionel SambucDelete an abbreviation.
1692*84d9c625SLionel SambucDelete
1693*84d9c625SLionel Sambuc@LI{lhs}from the current list of abbreviations.
1694*84d9c625SLionel Sambuc@table @asis
1695*84d9c625SLionel Sambuc@item Line:
1696*84d9c625SLionel SambucUnchanged.
1697*84d9c625SLionel Sambuc@item Options:
1698*84d9c625SLionel SambucNone.
1699*84d9c625SLionel Sambuc@end table
1700*84d9c625SLionel Sambuc@end deftypefn
1701*84d9c625SLionel Sambuc@cindex undo
1702*84d9c625SLionel Sambuc@deftypefn Command {} {u[ndo]}
1703*84d9c625SLionel Sambuc
1704*84d9c625SLionel SambucUndo the last change made to the file.
1705*84d9c625SLionel SambucChanges made by
1706*84d9c625SLionel Sambuc@CO{global},
1707*84d9c625SLionel Sambuc@CO{v},
1708*84d9c625SLionel Sambuc@CO{visual}
1709*84d9c625SLionel Sambucand map sequences are considered a single command.
1710*84d9c625SLionel SambucIf repeated, the
1711*84d9c625SLionel Sambuc@CO{u}
1712*84d9c625SLionel Sambuccommand alternates between these two states, and is its own inverse.
1713*84d9c625SLionel Sambuc@table @asis
1714*84d9c625SLionel Sambuc@item Line:
1715*84d9c625SLionel SambucSet to the last line modified by the command.
1716*84d9c625SLionel Sambuc@item Options:
1717*84d9c625SLionel SambucNone.
1718*84d9c625SLionel Sambuc@end table
1719*84d9c625SLionel Sambuc@end deftypefn
1720*84d9c625SLionel Sambuc@cindex unmap
1721*84d9c625SLionel Sambuc@deftypefn Command {} {unm[ap][!]} {lhs}
1722*84d9c625SLionel Sambuc
1723*84d9c625SLionel SambucUnmap a mapped string.
1724*84d9c625SLionel SambucDelete the command mode map definition for
1725*84d9c625SLionel Sambuc@LI{lhs}.
1726*84d9c625SLionel SambucIf a
1727*84d9c625SLionel Sambuc@QT{!}
1728*84d9c625SLionel Sambuccharacter is appended to the command name, delete the text input mode
1729*84d9c625SLionel Sambucmap definition instead.
1730*84d9c625SLionel Sambuc@table @asis
1731*84d9c625SLionel Sambuc@item Line:
1732*84d9c625SLionel SambucUnchanged.
1733*84d9c625SLionel Sambuc@item Options:
1734*84d9c625SLionel SambucNone.
1735*84d9c625SLionel Sambuc@end table
1736*84d9c625SLionel Sambuc@end deftypefn
1737*84d9c625SLionel Sambuc@cindex version
1738*84d9c625SLionel Sambuc@deftypefn Command {} {ve[rsion]}
1739*84d9c625SLionel Sambuc
1740*84d9c625SLionel SambucDisplay the version of the
1741*84d9c625SLionel Sambuc@CO{ex/vi}
1742*84d9c625SLionel Sambuceditor.
1743*84d9c625SLionel Sambuc@end deftypefn
1744*84d9c625SLionel Sambuc@cindex visual
1745*84d9c625SLionel Sambuc@deftypefn Command {[line]} {vi[sual]} {[type] [count] [flags]}
1746*84d9c625SLionel Sambuc
1747*84d9c625SLionel Sambuc@CO{Ex}
1748*84d9c625SLionel Sambucmode only.
1749*84d9c625SLionel SambucEnter
1750*84d9c625SLionel Sambuc@CO{vi}.
1751*84d9c625SLionel SambucThe
1752*84d9c625SLionel Sambuc@LI{type}is optional, and can be
1753*84d9c625SLionel Sambuc@QT{-},
1754*84d9c625SLionel Sambuc@QT{+}
1755*84d9c625SLionel Sambucor
1756*84d9c625SLionel Sambuc@QT{^},
1757*84d9c625SLionel Sambucas in the
1758*84d9c625SLionel Sambuc@CO{ex}
1759*84d9c625SLionel Sambuc@CO{z}
1760*84d9c625SLionel Sambuccommand, to specify the position of the specified line in the screen
1761*84d9c625SLionel Sambucwindow.
1762*84d9c625SLionel Sambuc(The default is to place the line at the top of the screen window.)
1763*84d9c625SLionel SambucA
1764*84d9c625SLionel Sambuc@LI{count}specifies the number of lines that will initially be displayed.
1765*84d9c625SLionel Sambuc(The default is the value of the
1766*84d9c625SLionel Sambuc@OP{window}
1767*84d9c625SLionel Sambuceditor option.)
1768*84d9c625SLionel Sambuc@table @asis
1769*84d9c625SLionel Sambuc@item Line:
1770*84d9c625SLionel SambucUnchanged unless
1771*84d9c625SLionel Sambuc@LI{line}is specified, in which case it is set to that line.
1772*84d9c625SLionel Sambuc@item Options:
1773*84d9c625SLionel SambucNone.
1774*84d9c625SLionel Sambuc@end table
1775*84d9c625SLionel Sambuc@end deftypefn
1776*84d9c625SLionel Sambuc@cindex visual
1777*84d9c625SLionel Sambuc@deftypefn Command {} {vi[sual][!]} {[+cmd] [file]}
1778*84d9c625SLionel Sambuc
1779*84d9c625SLionel Sambuc@CO{Vi}
1780*84d9c625SLionel Sambucmode only.
1781*84d9c625SLionel SambucEdit a new file.
1782*84d9c625SLionel SambucIdentical to the
1783*84d9c625SLionel Sambuc@QT{edit[!] [+cmd] [file]}
1784*84d9c625SLionel Sambuccommand.
1785*84d9c625SLionel Sambuc@sp 1
1786*84d9c625SLionel SambucCapitalizing the first letter of the command, i.e.
1787*84d9c625SLionel Sambuc@CO{Visual},
1788*84d9c625SLionel Sambucwill edit the file in a new screen.
1789*84d9c625SLionel SambucIn this case, any modifications to the current file are ignored.
1790*84d9c625SLionel Sambuc@end deftypefn
1791*84d9c625SLionel Sambuc@cindex viusage
1792*84d9c625SLionel Sambuc@deftypefn Command {} {viu[sage]} {[command]}
1793*84d9c625SLionel Sambuc
1794*84d9c625SLionel SambucDisplay usage for a
1795*84d9c625SLionel Sambuc@CO{vi}
1796*84d9c625SLionel Sambuccommand.
1797*84d9c625SLionel SambucIf
1798*84d9c625SLionel Sambuc@LI{command}is specified, a usage statement for that command is displayed.
1799*84d9c625SLionel SambucOtherwise, usage statements for all
1800*84d9c625SLionel Sambuc@CO{vi}
1801*84d9c625SLionel Sambuccommands are displayed.
1802*84d9c625SLionel Sambuc@table @asis
1803*84d9c625SLionel Sambuc@item Line:
1804*84d9c625SLionel SambucUnchanged.
1805*84d9c625SLionel Sambuc@item Options:
1806*84d9c625SLionel SambucNone.
1807*84d9c625SLionel Sambuc@end table
1808*84d9c625SLionel Sambuc@end deftypefn
1809*84d9c625SLionel Sambuc@cindex write
1810*84d9c625SLionel Sambuc@deftypefn Command {[range]} {w[rite][!]} {[>>] [file]}
1811*84d9c625SLionel Sambuc
1812*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {w[rite]} {[!] [file]}
1813*84d9c625SLionel Sambuc@cindex wn
1814*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {wn[!]} {[>>] [file]}
1815*84d9c625SLionel Sambuc@cindex wq
1816*84d9c625SLionel Sambuc@deftypefnx Command  {[range]} {wq[!]} {[>>] [file]}
1817*84d9c625SLionel SambucWrite the file.
1818*84d9c625SLionel SambucThe specified lines (the entire file, if no range is given) is written
1819*84d9c625SLionel Sambucto
1820*84d9c625SLionel Sambuc@LI{file}.
1821*84d9c625SLionel SambucIf
1822*84d9c625SLionel Sambuc@LI{file}is not specified, the current pathname is used.
1823*84d9c625SLionel SambucIf
1824*84d9c625SLionel Sambuc@LI{file}is specified, and it exists, or if the current pathname was set using the
1825*84d9c625SLionel Sambuc@CO{file}
1826*84d9c625SLionel Sambuccommand, and the file already exists, these commands will fail.
1827*84d9c625SLionel SambucAppending a
1828*84d9c625SLionel Sambuc@QT{!}
1829*84d9c625SLionel Sambuccharacter to the command name will override this check and the write
1830*84d9c625SLionel Sambucwill be attempted, regardless.
1831*84d9c625SLionel Sambuc@sp 1
1832*84d9c625SLionel SambucSpecifying the optional
1833*84d9c625SLionel Sambuc@QT{>>}
1834*84d9c625SLionel Sambucstring will cause the write to be appended to the file, in which case
1835*84d9c625SLionel Sambucno tests are made for the file already existing.
1836*84d9c625SLionel Sambuc@sp 1
1837*84d9c625SLionel SambucIf the file is preceded by a
1838*84d9c625SLionel Sambuc@QT{!}
1839*84d9c625SLionel Sambuccharacter, the program named by the shell edit option is
1840*84d9c625SLionel Sambucinvoked with file as its second argument, and the specified
1841*84d9c625SLionel Sambuclines are passed as standard input to that command.
1842*84d9c625SLionel SambucThe
1843*84d9c625SLionel Sambuc@QT{!}
1844*84d9c625SLionel Sambucin this usage must be separated from command name by at least one
1845*84d9c625SLionel Sambucwhitespace character.
1846*84d9c625SLionel SambucThe special meaning of the
1847*84d9c625SLionel Sambuc@QT{!}
1848*84d9c625SLionel Sambucmay be overridden by escaping it with a backslash
1849*84d9c625SLionel Sambuc@PQ{\e}
1850*84d9c625SLionel Sambuccharacter.
1851*84d9c625SLionel Sambuc@sp 1
1852*84d9c625SLionel SambucThe
1853*84d9c625SLionel Sambuc@CO{wq}
1854*84d9c625SLionel Sambucversion of the write command will exit the editor after writing the file,
1855*84d9c625SLionel Sambucif there are no further files to edit.
1856*84d9c625SLionel SambucAppending a
1857*84d9c625SLionel Sambuc@QT{!}
1858*84d9c625SLionel Sambuccharacter to the command name or entering two
1859*84d9c625SLionel Sambuc@QQ{quit}
1860*84d9c625SLionel Sambuccommands (i.e.
1861*84d9c625SLionel Sambuc@CO{wq},
1862*84d9c625SLionel Sambuc@CO{quit},
1863*84d9c625SLionel Sambuc@CO{xit}
1864*84d9c625SLionel Sambucor
1865*84d9c625SLionel Sambuc@CO{ZZ})
1866*84d9c625SLionel Sambucin a row) will override this check and the editor will exit,
1867*84d9c625SLionel Sambucignoring any files that have not yet been edited.
1868*84d9c625SLionel Sambuc@sp 1
1869*84d9c625SLionel SambucThe
1870*84d9c625SLionel Sambuc@CO{wn}
1871*84d9c625SLionel Sambucversion of the write command will move to the next file after writing
1872*84d9c625SLionel Sambucthe file, unless the write fails.
1873*84d9c625SLionel Sambuc@table @asis
1874*84d9c625SLionel Sambuc@item Line:
1875*84d9c625SLionel SambucUnchanged.
1876*84d9c625SLionel Sambuc@item Options:
1877*84d9c625SLionel SambucAffected by the
1878*84d9c625SLionel Sambuc@OP{readonly}
1879*84d9c625SLionel Sambucand
1880*84d9c625SLionel Sambuc@OP{writeany}
1881*84d9c625SLionel Sambucoptions.
1882*84d9c625SLionel Sambuc@end table
1883*84d9c625SLionel Sambuc@end deftypefn
1884*84d9c625SLionel Sambuc@cindex xit
1885*84d9c625SLionel Sambuc@deftypefn Command {[range]} {x[it][!]} {[file]}
1886*84d9c625SLionel Sambuc
1887*84d9c625SLionel SambucWrite the file if it has been modified.
1888*84d9c625SLionel SambucThe specified lines are written to
1889*84d9c625SLionel Sambuc@LI{file},
1890*84d9c625SLionel Sambucif the file has been modified since the last complete write to any
1891*84d9c625SLionel Sambucfile.
1892*84d9c625SLionel SambucIf no
1893*84d9c625SLionel Sambuc@LI{range}is specified, the entire file is written.
1894*84d9c625SLionel Sambuc@sp 1
1895*84d9c625SLionel SambucThe
1896*84d9c625SLionel Sambuc@CO{xit}
1897*84d9c625SLionel Sambuccommand will exit the editor after writing the file,
1898*84d9c625SLionel Sambucif there are no further files to edit.
1899*84d9c625SLionel SambucAppending a
1900*84d9c625SLionel Sambuc@QT{!}
1901*84d9c625SLionel Sambuccharacter to the command name or entering two
1902*84d9c625SLionel Sambuc@QQ{quit}
1903*84d9c625SLionel Sambuccommands (i.e.
1904*84d9c625SLionel Sambuc@CO{wq},
1905*84d9c625SLionel Sambuc@CO{quit},
1906*84d9c625SLionel Sambuc@CO{xit}
1907*84d9c625SLionel Sambucor
1908*84d9c625SLionel Sambuc@CO{ZZ})
1909*84d9c625SLionel Sambucin a row) will override this check and the editor will exit,
1910*84d9c625SLionel Sambucignoring any files that have not yet been edited.
1911*84d9c625SLionel Sambuc@table @asis
1912*84d9c625SLionel Sambuc@item Line:
1913*84d9c625SLionel SambucUnchanged.
1914*84d9c625SLionel Sambuc@item Options:
1915*84d9c625SLionel SambucAffected by the
1916*84d9c625SLionel Sambuc@OP{readonly}
1917*84d9c625SLionel Sambucand
1918*84d9c625SLionel Sambuc@OP{writeany}
1919*84d9c625SLionel Sambucoptions.
1920*84d9c625SLionel Sambuc@end table
1921*84d9c625SLionel Sambuc@end deftypefn
1922*84d9c625SLionel Sambuc@cindex yank
1923*84d9c625SLionel Sambuc@deftypefn Command {[range]} {ya[nk]} {[buffer] [count]}
1924*84d9c625SLionel Sambuc
1925*84d9c625SLionel SambucCopy the specified lines to a buffer.
1926*84d9c625SLionel SambucIf no buffer is specified, the unnamed buffer is used.
1927*84d9c625SLionel Sambuc@table @asis
1928*84d9c625SLionel Sambuc@item Line:
1929*84d9c625SLionel SambucUnchanged.
1930*84d9c625SLionel Sambuc@item Options:
1931*84d9c625SLionel SambucNone.
1932*84d9c625SLionel Sambuc@end table
1933*84d9c625SLionel Sambuc@end deftypefn
1934*84d9c625SLionel Sambuc@cindex z
1935*84d9c625SLionel Sambuc@deftypefn Command {[line]} {z} {[type] [count] [flags]}
1936*84d9c625SLionel Sambuc
1937*84d9c625SLionel SambucAdjust the window.
1938*84d9c625SLionel SambucIf no
1939*84d9c625SLionel Sambuc@LI{type}is specified, then
1940*84d9c625SLionel Sambuc@LI{count}lines following the specified line are displayed.
1941*84d9c625SLionel SambucThe default
1942*84d9c625SLionel Sambuc@LI{count}is the value of the
1943*84d9c625SLionel Sambuc@OP{window}
1944*84d9c625SLionel Sambucoption.
1945*84d9c625SLionel SambucThe
1946*84d9c625SLionel Sambuc@LI{type}argument changes the position at which
1947*84d9c625SLionel Sambuc@LI{line}is displayed on the screen by changing the number of lines
1948*84d9c625SLionel Sambucdisplayed before and after
1949*84d9c625SLionel Sambuc@LI{line}.
1950*84d9c625SLionel SambucThe following
1951*84d9c625SLionel Sambuc@LI{type}characters may be used:
1952*84d9c625SLionel Sambuc@table @asis
1953*84d9c625SLionel Sambuc@item -
1954*84d9c625SLionel SambucPlace the line at the bottom of the screen.
1955*84d9c625SLionel Sambuc@item +
1956*84d9c625SLionel SambucPlace the line at the top of the screen.
1957*84d9c625SLionel Sambuc@item .
1958*84d9c625SLionel SambucPlace the line in the middle of the screen.
1959*84d9c625SLionel Sambuc@item ^
1960*84d9c625SLionel SambucWrite out count lines starting
1961*84d9c625SLionel Sambuc@LI{count * 2}lines before
1962*84d9c625SLionel Sambuc@LI{line};
1963*84d9c625SLionel Sambucthe net effect of this is that a
1964*84d9c625SLionel Sambuc@QT{z^}
1965*84d9c625SLionel Sambuccommand following a
1966*84d9c625SLionel Sambuc@CO{z}
1967*84d9c625SLionel Sambuccommand writes the previous page.
1968*84d9c625SLionel Sambuc@item =
1969*84d9c625SLionel SambucCenter
1970*84d9c625SLionel Sambuc@LI{line}on the screen with a line of hyphens displayed immediately before and
1971*84d9c625SLionel Sambucafter it.
1972*84d9c625SLionel SambucThe number of preceding and following lines of text displayed are
1973*84d9c625SLionel Sambucreduced to account for those lines.
1974*84d9c625SLionel Sambuc@end table
1975*84d9c625SLionel Sambuc@table @asis
1976*84d9c625SLionel Sambuc@item Line:
1977*84d9c625SLionel SambucSet to the last line displayed, with the exception of the
1978*84d9c625SLionel Sambuc@QT{=}
1979*84d9c625SLionel Sambuc@LI{type},
1980*84d9c625SLionel Sambucwhere the current line is set to the line specified by the command.
1981*84d9c625SLionel Sambuc@item Options:
1982*84d9c625SLionel SambucAffected by the
1983*84d9c625SLionel Sambuc@OP{scroll}
1984*84d9c625SLionel Sambucoption.
1985*84d9c625SLionel Sambuc@end table
1986*84d9c625SLionel Sambuc@end deftypefn
1987