source: trunk/minix/commands/elvis/Doc.sh@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 129.6 KB
Line 
1echo x - cflags.ms
2sed '/^X/s///' > cflags.ms << '/'
3X.Go 9 "CFLAGS"
4X.PP
5X\*E uses many preprocessor symbols to control compilation.
6XSome of these control the sizes of buffers and such.
7XThe "-DNO_XXXX" options remove small sets of related features.
8X.PP
9XMost \*E users will probably want to keep all features available.
10XMinix-PC users, though, will have to sacrifice some sets because otherwise
11X\*E would be too bulky to compile.
12XThe "asld" phase of the compiler craps out.
13X.IP "-DM_SYSV, -Dbsd, -DTOS, -DCOHERENT, -Damiga"
14XThese flags tell the compiler that \*E is being compiled for
15XSystem-V UNIX, BSD UNIX, Atari TOS, Coherent, or AmigaDos, respectively.
16XFor other systems, the config.h file can generally figure it out automatically.
17X.IP -DRAINBOW
18XFor MS-DOS systems, this causes support for the DEC Rainbow to be compiled
19Xinto \*E.
20X.IP -DS5WINSIZE
21XSome versions of SysV UNIX don't support support the "winsize"
22Xstyle of screen-size testing,
23Xso elvis ignores window size changes by default.
24X.IP
25XHowever, many of the newer SysV systems defines "winsize" in the
26Xfile "/usr/include/sys/ptem.h".
27XIf your SysV system has "winsize" then you should add
28X-DS5SWINSIZE to the CFLAGS setting.
29X.IP -DTERMIOS
30XPOSIX is a SysV-derived specification which uses a terminal control
31Xpackage called "termios", instead of "termio".
32XSome other SysV systems may also use termios.
33XYou can make elvis uses termios instead of the more common termio
34Xby adding -DTERMIOS to CFLAGS.
35X(Note: This hasn't been tested very well.)
36X.IP -DNBUFS=\fInumber\fP
37X\*E keeps most of your text in a temporary file;
38Xonly a small amount is actually stored in RAM.
39XThis flag allows you to control how much of the file can be in RAM at any time.
40XThe default is 5 blocks, and the minimum is 3 blocks.
41X(See the -DBLKSIZE flag, below.)
42X.IP
43XMore RAM allows global changes to happen a little faster.
44X f you're just making many small changes in one section of a file, though,
45Xextra RAM won't help much.
46X.IP -DBLKSIZE=\fInumber\fP
47XThis controls the size of blocks that \*E uses internally.
48XThe value of BLKSIZE must be a power of two.
49XEvery time you double BLKSIZE, you quadruple the size of a text file that
50X\*E can handle, but you also cause the temporary file to grow faster.
51XFor MS-DOS, Coherent, and Minix-PC, the default value is 1024, which allows
52Xyou to edit files up to almost 512K bytes long.
53XFor all other systems, the default value is 2048, which allows you to edit
54Xfiles that are nearly 2 megabytes long.
55X.IP
56XThe BLKSIZE also determines the maximum line length, and a few other limits.
57XBLKSIZE should be either 256, 512, 1024, or 2048.
58XValues other than these can lead to strange behaviour.
59X.IP -DTMPDIR=\fIstring\fP
60XThis sets the default value of the "directory" option, which specifies where
61Xthe temporary files should reside.
62XThe value of TMPDIR must be a string, so be sure your value includes the
63Xquote characters on each end.
64X.IP "-DEXRC=\fIstr\fP, -DHMEXRC=\fIstr\fP, -DSYSEXRC=\fIstr\fP, -DEXINIT=\fIstr\fP"
65XThis lets you control the names of the initialization files.
66XTheir values must be strings, so be careful about quoting.
67X.IP
68XEXRC is the name of the initialization file in the current directory.
69XIts default value is ".exrc" on UNIX systems -- the same as the real vi.
70XSince that isn't a legal DOS filename, under DOS the default is "elvis.rc".
71XFor other systems, check the config.h file.
72X.IP
73XHMEXRC is the name of the initialization file in your home directory.
74XBy default, it is the same as EXRC.
75X\*E will automatically prepend the name of your home directory to HMEXRC
76Xat run time, so don't give a full path name.
77X.IP
78XSYSEXRC is the name of a system-wide initialization file.
79XIt has no default value;
80Xif you don't define a value for it, then
81Xthe code that supports SYSEXRC just isn't compiled.
82XThe value of SYSEXRC should be a full pathname, in quotes.
83X.IP
84XEXINIT is the name of an environment variable that can contain initialization
85Xcommands.
86XNormally, its value is "EXINIT".
87X.IP -DKEYWORDPRG=\fIstring\fP
88XThis flag determines the default value of the "keywordprg" option.
89XIts value must be a string, so be careful about quoting.
90XThe default value of this flag is "ref", which is a C reference program.
91X.IP "-DCC_COMMAND=\fIstring\fP -DMAKE_COMMAND=\fIstring\fP -DERRLIST=\fIstring\fP"
92XThese control the names of the C compiler, the "make" utility, and the
93Xerror output file, respectively.
94XThey are only used if -DNO_ERRLIST is not given.
95X.IP
96XThe default value of CC_COMMAND depends on the Operating System and compiler
97Xthat you use to compile elvis;
98Xfor UNIX, the default is "cc".
99XThe default values of MAKE_COMMAND and ERRLIST are "make" and "errlist",
100Xrespectively.
101X.IP -DMAXRCLEN=\fInumber\fP
102XThis determines how large a :@ macro command can be (measured in bytes).
103XThe default is 1000 bytes.
104XIf you increase this value significantly,
105Xthen you may need to allocate extra memory for the stack.
106XSee the "CHMEM" setting in the Makefile.
107X.IP -DSHELL=\fIstring\fP
108XThis is the default value of the "shell" option, and hence
109Xthe default shell used from within \*E.
110XThis only controls the default;
111Xthe value you give here may be overridden at run-time by setting
112Xan environment variable named SHELL (or COMSPEC for MS-DOS).
113XIts value must be a string constant, so be careful about quoting.
114X.IP -DTAGS=\fIstring\fP
115XThis sets the name of the "tags" file,
116Xwhich is used by the :tag command.
117XIts value must be a string constant, so be careful about quoting.
118X.IP "-DCS_IBMPC -DCS_LATIN1 -DCS_SPECIAL"
119XThe digraph table and flipcase option will normally start out empty.
120XHowever, if you add -DCS_IBMPC or -DCS_LATIN1 to your CFLAGS,
121Xthen they will start out filled with values that are appropriate for the
122XIBM PC character set or the ISO Latin-1 character set, respectively.
123X.IP
124XYou can also use -DCS_IBMPC and -DCS_SPECIAL together to get digraphs
125Xthat produce the PC's graphic characters.
126X.IP "-DDEBUG -DEBUG2"
127X-DDEBUG adds the ":debug" and ":validate" commands,
128Xand also adds many internal consistency checks.
129XIt increases the size of the ".text" segment by about 6K.
130X.IP
131X-DDEBUG2 causes a line to be appended to a file called "debug.out"
132Xeverytime any change is made to the edit buffer.
133X.IP -DCRUNCH
134XThis flag removes some non-critical code, so that \*E is smaller.
135XFor example, it removes a short-cut from the regexp package, so that
136Xtext searches are slower.
137XAlso, screen updates are not as efficient.
138XA couple of obscure features are disabled by this, too.
139X.IP -DNO_MKEXRC
140XThis removes the ":mkexrc" command,
141Xso you have to create any .exrc files manually.
142XThe size of the .text segment will be reduced by about 600 bytes.
143X.IP -DNO_CHARATTR
144XPermanently disables the charattr option.
145XThis reduces the size of your ".text" segment by about 850 bytes.
146X.IP -DNO_RECYCLE
147XNormally, \*E will recycle space (from the temporary file) which contains
148Xtotally obsolete text.
149XThis flag disables this recycling.
150XWithout recycling, the ".text" segment is about 1K smaller
151Xthan it would otherwise be,
152Xbut the tmp file grows much faster.
153XIf you have a lot of free space on your hard disk,
154Xbut \*E is too bulky to run with recycling,
155Xthen try it without recycling.
156X.IP
157XWhen using a version of \*E that has been compiled with -DNO_RECYCLE,
158Xyou should be careful to avoid making many small changes to a file
159Xbecause each individual change will cause the tmp file to grow by at least 1k.
160XHitting "x" thirty times counts as thirty changes,
161Xbut typing "30x" counts as one change.
162XAlso, you should occasionally do a ":w" followed by a ":e" to start with a
163Xfresh tmp file.
164X.IP
165XInterestingly, the real vi never recycles space from its temporary file.
166X.IP -DNO_SENTENCE
167XLeaves out the "(" and ")" visual mode commands.
168XAlso, the "[[", "]]", "{", and "}" commands will not recognize *roff macros.
169XThe sections and paragraphs options go away.
170XThis saves about 650 bytes in the ".text" segment.
171X.IP -DNO_CHARSEARCH
172XLeaves out the visual commands which locate a given character
173Xin the current line:
174X"f", "t", "F", "T", "," and ";".
175XThis saves about 900 bytes.
176X.IP -DNO_EXTENSIONS
177XLeaves out the "K" and "#" visual commands.
178XAlso, the arrow keys will no longer work in input mode.
179XRegular expressions will no longer recognize the \\{\\} operator.
180X(Other extensions are either inherent in the design of \*E,
181Xor are controlled by more specific flags,
182Xor are too tiny to be worth removing.)
183XThis saves about 250 bytes.
184X.IP -DNO_MAGIC
185XPermanently disables the "magic" option, so that most meta-characters
186Xin a regular expression are *NOT* recognized.
187XThis saves about 3k of space in the ".text" segment, because
188Xthe complex regular expression code can be replaced by much simpler code.
189X.IP -DNO_SHOWMODE
190XPermanently disables the "showmode" option, saving about 250 bytes.
191X.IP -DNO_CURSORSHAPE
192XNormally, \*E tries to adjust the shape of the cursor as a reminder
193Xof which mode you're in.
194XThe -DNO_CURSORSHAPE flag disables this, saving about 150 bytes.
195X.IP -DNO_DIGRAPH
196XTo allow entry of non-ASCII characters, \*E supports digraphs.
197XA digraph is a single (non-ASCII) character which is entered as a
198Xcombination of two other (ASCII) characters.
199XIf you don't need to input non-ASCII characters,
200Xor if your keyboard supports a better way of entering non-ASCII characters,
201Xthen you can disable the digraph code and save about 450 bytes.
202X.IP -DNO_ERRLIST
203X\*E adds a ":errlist" command, which is useful to programmers.
204XIf you don't need this feature, you can disable it via the -DNO_ERRLIST flag.
205XThis will reduce the .text segment by about 900 bytes, and the .bss segment
206Xby about 300 bytes.
207X.IP -DNO_ABBR
208XThe -DNO_ABBR flag disables the ":abbr" command,
209Xand reduces the size of \*E by about 250 bytes.
210X.IP -DNO_OPTCOLS
211XWhen \*E displays the current options settings via the ":set" command,
212Xthe options are normally sorted into columns.
213XThe -DNO_OPTCOLS flag causes the options to be sorted across the rows,
214Xwhich is much simpler for the computer.
215XThe -DNO_OPTCOLS flag will reduce the size of your .text segment by about
216X500 bytes.
217X.IP -DNO_MODELINES
218XThis removes all support for modelines.
219X.IP -DNO_TAG
220XThis disables tag lookup.
221XIt reduces the size of the .text segment by about 750 bytes.
222X.IP "-DNO_ALT_FKEY -DNO_CTRL_FKEY -DNO_SHIFT_FKEY -DNO_FKEY"
223XThese remove explicit support of function keys.
224X-DNO_ALT_FKEY removes support for the <alternate> versions function keys.
225X-DNO_CTRL_FKEY removes support for the <control> and <alternate> versions function keys.
226X-DNO_SHIFT_FKEY removes support for the <shift>, <control>, and <alternate> versions function keys.
227X-DNO_FKEY removes all support of function keys.
228X.IP
229X\*E's ":map" command normally allows you to use the special sequence "#<n>"
230Xto map function key <n>.
231XFor example, ":map #1 {!}fmt^M" will cause the <F1> key to reformat a paragraph.
232X\*E checks the :k1=: field in the termcap description of your terminal
233Xto figure out what code is sent by the <F1> key.
234XThis is handy because it allows you to create a .exrc file which maps function
235Xkeys the same way regardless of what type of terminal you use.
236X.IP
237XThat behaviour is standard; most implementations of the real vi supports it too.
238X\*E extends this to allow you to use "#1s" to refer to <shift>+<F1>,
239X"#1c" to refer to <control>+<F1>, and
240X"#1a" to refer to <alt>+<F1>.
241XThe termcap description for the terminal should have fields named
242X:s1=:c1=:a1=: respectively, to define the code sent by these key conbinations.
243X(You should also have :k2=:s2=:c2=:a2=: for the <F2> key, and so on.)
244X.IP
245XBut there may be problems.
246XThe terminfo database doesn't support :s1=:c1=:a1=:, so no terminfo terminal
247Xdescription could ever support shift/control/alt function keys;
248Xso you might as well add -DNO_SHIFT_FKEY to CFLAGS if you're using terminfo.
249X.IP
250XNote that, even if you have -DNO_FKEYS, you can still configure \*E to use
251Xyour function keys my mapping the literal character codes sent by the key.
252XYou just couldn't do it in a terminal-independent way.
253XTERM_925
254X.IP "-DTERM_AMIGA -DTERM_VT100 -DTERM_VT52 etc."
255XThe tinytcap.c file contains descriptions of several terminal types.
256XFor each system that uses tinytcap, a reasonable subset of the available
257Xdescriptions is actually compiled into \*E.
258XIf you wish to enlarge this subset, then you can add the appropriate -DTERM_XXX
259Xflag to your CFLAGS settings.
260X.IP
261XFor a list of the available terminal types, check the tinytcap.c file.
262X.IP -DINTERNAL_TAGS
263XNormally, \*E uses the "ref" program to perform tag lookup.
264XThis is more powerful than the real vi's tag lookup,
265Xbut it can be much slower.
266X.IP
267XIf you add -DINTERNAL_TAGS to your CFLAGS setting,
268Xthen \* will use its own internal tag lookup code, which is faster.
269X.IP -DPRSVDIR=\fIdirectory\fR
270XThis controls where preserved files will be placed.
271XAn appropriate default has been chosen for each Operating System,
272Xso you probably don't need to worry about it.
273X.IP -DFILEPERMS=\fInumber\fR
274XThis affects the attributes of files that are created by \*E;
275Xit is used as the second argument to the creat() function.
276XThe default is 0666 which (on UNIX systems at least) means that
277Xanybody can read or write the new file, but nobody can execute it.
278XOn UNIX systems, the creat() call modifies this via the umask setting.
279X.IP -DKEYBUFSIZE=\fInumber\fR
280XThis determines the size of the type-ahead buffer that elvis uses.
281XIt also limits the size of keymaps that it can handle.
282XThe default is 1000 characters, which should be plenty.
283/
284echo x - cutbufs.ms
285sed '/^X/s///' > cutbufs.ms << '/'
286X.Go 6 "CUT BUFFERS"
287X.PP
288XWhen \*E deletes text, it stores that text in a cut buffer.
289XThis happens in both visual mode and EX mode.
290XThere is no practical limit to how much text a cut buffer can hold.
291X.PP
292XThere are 36 cut buffers:
293X26 named buffers ("a through "z),
294X9 anonymous buffers ("1 through "9),
295Xand 1 extra cut buffer (".).
296X.PP
297XIn EX mode, the :move and :copy commands use a cut buffer to temporarily
298Xhold the text to be moved/copied.
299X.NH 2
300XPutting text into a Cut Buffer
301X.PP
302XIn visual mode, text is copied into a cut buffer when you use the
303Xd, y, c, C, s, or x commands.
304XThere are also a few others.
305X.PP
306XBy default, the text goes into the "1 buffer.
307XThe text that used to be in "1 gets shifted into "2,
308X"2 gets shifted into "3, and so on.
309XThe text that used to be in "9 is lost.
310XThis way, the last 9 things you deleted are still accessible.
311X.PP
312XYou can also put the text into a named buffer -- "a through "z.
313XTo do this, you should type the buffer's name
314X(two keystrokes: a double-quote and a lowercase letter)
315Xbefore the command that will cut the text.
316XWhen you do this, "1 through "9 are not affected by the cut.
317X.PP
318XYou can append text to one of the named buffers.
319XTo do this, type the buffer's name in uppercase
320X(a double-quote and an uppercase letter)
321Xbefore the d/y/c/C/s/x command.
322X.PP
323XThe ". buffer is special.
324XIt isn't affected by the d/y/c/C/s/x command.
325XInstead, it stores the text that you typed in
326Xthe last time you were in input mode.
327XIt is used to implement the . visual command,
328Xand ^A in input mode.
329X.PP
330XIn EX mode (also known as colon mode),
331Xthe :delete, :change, and :yank commands all copy text into a cut buffer.
332XLike the visual commands, these EX commands normally use the "1 buffer,
333Xbut you can use one of the named buffers by giving its name after the command.
334XFor example,
335X.sp 1
336X.ti +0.5i
337X:20,30y a
338X.sp
339X.LP
340Xwill copy lines 20 through 30 into cut buffer "a.
341X.PP
342XYou can't directly put text into the ". buffer, or the "2 through "9 buffers.
343X.NH 2
344XPasting from a Cut Buffer
345X.PP
346XThere are two styles of pasting:
347Xline-mode and character-mode.
348XIf a cut buffer contains whole lines (from a command like "dd")
349Xthen line-mode pasting is used;
350Xif it contains partial lines (from a command like "dw")
351Xthen character-mode pasting is used.
352XThe EX commands always cut whole lines.
353X.PP
354XCharacter-mode pasting causes the text to be inserted into the line that
355Xthe cursor is on.
356X.PP
357XLine-mode pasting inserts the text on a new line above or below the line
358Xthat the cursor is on.
359XIt doesn't affect the cursor's line at all.
360X.PP
361XIn visual mode, the p and P commands insert text from a cut buffer.
362XUppercase P will insert it before the cursor,
363Xand lowercase p will insert it after the cursor.
364XNormally, these commands will paste from the "1 buffer, but you can
365Xspecify any other buffer to paste from.
366XJust type its name (a double-quote and another character)
367Xbefore you type the P or p.
368X.PP
369XIn EX mode, the (pu)t command pastes text after a given line.
370XTo paste from a buffer other that "1,
371Xenter its name after the command.
372X.NH 2
373XMacros
374X.PP
375XThe contents of a named cut buffer can be executed as a series of
376Xex/vi commands.
377X.PP
378XTo put the instructions into the cut buffer, you must first insert
379Xthem into the file, and then delete them into a named cut buffer.
380X.PP
381XTo execute a cut buffer's contents as EX commands,
382Xyou should give the EX command "@" and the name of the buffer.
383XFor example, :@z will execute "z as a series of EX commands.
384X.PP
385XTo execute a cut buffer's contents as visual commands,
386Xyou should give the visual command "@" and the letter of the buffer's name.
387XThe visual "@" command is different from the EX "@" command.
388XThey interpret the cut buffer's contents differently.
389X.PP
390XThe visual @ command can be rather finicky.
391XEach character in the buffer is interpretted as a keystroke.
392XIf you load the instructions into the cut buffer via a "zdd command,
393Xthen the newline character at the end of the line will be executed just
394Xlike any other character, so the cursor would be moved down 1 line.
395XIf you don't want the cursor to move down 1 line at the end of each
396X@z command, then you should load the cut buffer by saying 0"zD instead.
397X.PP
398XAlthough cut buffers can hold any amount of text,
399X\*E can only \fIexecute\fR small buffers.
400XThe size limit is roughly 1000 characters, for either EX macros or VI macros.
401XIf a buffer is too large to execute, an error message is displayed.
402X.PP
403XYou can't nest :@ commands.
404XYou can't run :@ commands from your .exrc file,
405Xor any other :source file either.
406XSimilarly, you can't run a :source command from within an @ command.
407XHopefully, these restrictions will be lifted in a later version.
408X.NH 2
409XThe Effect of Switching Files
410X.PP
411XWhen \*E first starts up, all cut buffers are empty.
412XWhen you switch to a different file
413X(via the :n or :e commands perhaps)
414Xthe 9 anonymous cut buffers are emptied again,
415Xbut the other 27 buffers ("a through "z, and ".) retain their text.
416/
417echo x - differ.ms
418sed '/^X/s///' > differ.ms << '/'
419X.Go 7 "DIFFERENCES BETWEEN \*E & BSD VI/EX"
420X.PP
421X\*E is not 100% compatible with the real vi/ex.
422X\*E has many small extensions, some omissions, and a few features which
423Xare implemented in a slightly different manner.
424X.NH 2
425XExtensions
426X.IP "Save Configuration" 1i
427XThe :mkexrc command saves the current :set and :map configurations in
428Xthe ".exrc" file in your current directory.
429X.IP "Previous File" 1i
430XThe :N or :prev command moves backwards through the args list.
431X.IP "Center Current Row" 1i
432XIn visual command mode, the (lowercase) "zz" command will center the current
433Xline on the screen, like "z=".
434X.IP "Changing Repeat Count" 1i
435XThe default count value for . is the same as the previous command
436Xwhich . is meant to repeat.
437XHowever, you can supply a new count if you wish.
438XFor example, after "3dw", "." will delete 3 words,
439Xbut "5." will delete 5 words.
440X.IP "Previous Text" 1i
441XThe text which was most recently input
442X(via a "cw" command, or something similar)
443Xis saved in a cut buffer called ". (which
444Xis a pretty hard name to write in an English sentence).
445X.IP "Keyword Lookup" 1i
446XIn visual command mode, you can move the cursor onto a word and press
447Xshift-K to have \*E run a reference program to look that word up.
448XThis command alone is worth the price of admission!
449XSee the ctags and ref programs.
450X.IP "Increment/Decrement" 1i
451XIn visual command mode, you can move the cursor onto a number and
452Xthen hit ## or #+ to increment that number by 1.
453XTo increment it by a larger amount,
454Xtype in the increment value before hitting the initial #.
455XThe number can also be decremented or set by hitting #- or #=, respectively.
456X.IP "Input Mode" 1i
457XYou can backspace past the beginning of the line.
458X.IP "" 1i
459XThe arrow keys work in input mode.
460X.IP "" 1i
461XIf you type control-A, then the text that you input last time is inserted.
462XYou will remain in input mode, so you can backspace over part of it,
463Xor add more to it.
464X(This is sort of like control-@ on the real vi,
465Xexcept that control-A really works.)
466X.IP "" 1i
467XControl-P will insert the contents of the cut buffer.
468X.IP "" 1i
469XReal vi can only remember up to 128 characters of input,
470Xbut \*E can remember any amount.
471X.IP "" 1i
472XThe ^T and ^D keys can adjust the indent of a line no matter where
473Xthe cursor happens to be in that line.
474X.IP "" 1i
475XYou can save your file and exit \*E directly from input mode by hitting
476Xcontrol-Z twice.
477X.IP "" 1i
478X\*E supports digraphs as a way to enter non-ASCII characters.
479X.IP "Start in Input Mode" 1i
480XIf you ":set inputmode" in your .exrc file, then \*E will start up in
481Xinput mode instead of visual command mode.
482X.IP "Visible Fonts" 1i
483XWith ":set charattr", \*E can display "backslash-f" style character attributes on the
484Xscreen as you edit.
485XThe following example shows the recognized atributes:
486X.sp
487X.ti +0.5i
488Xnormal \\fBboldface\\fR \\fIitalics\\fR \\fUunderlined\\fR normal
489X.sp
490XNOTE: you must compile \*E without the -DNO_CHARATTR flag for
491Xthis to work.
492X.IP "File Syncing" 1i
493XAfter a crash, you can usually recover the altered form of the file
494Xfrom the temporary file that \*E uses -- unless the temporary file was
495Xcorrupted.
496X.IP "" 1i
497XUNIX systems use a delayed-write cache, which means that when \*E tries to
498Xwrite to the temporary file, the information might still be in RAM instead
499Xof on the disk.
500XA power failure at that time would cause the in-RAM information to be lost.
501XUNIX's sync() call will force all such information to disk.
502X.IP "" 1i
503XMS-DOS and Atari TOS don't write a file's length to disk until that file
504Xis closed.
505XConsequently, the temporary file would appear to be 0 bytes long if power
506Xfailed when we were editing.
507XTo avoid this problem, a sync() function has been written which will close
508Xthe temporary file and then immediately reopen it.
509X.IP "Cursor Shape" 1i
510X\*E changes the shape of the cursor to indicate which mode you're in,
511Xif your terminal's termcap entry includes the necessary capabilities.
512X.IP "Hide nroff Lines" 1i
513XTh ":set hideformat" option hides nroff format control lines.
514X(They are displayed on the screen as blank lines.)
515X.ne 7
516X.IP "Compiler Interface" 1i
517X\*E is clever enough to parse the error messages emitted by many compilers.
518XTo use this feature,
519Xyou should collect your compiler's error messages into a file called "errlist";
520X\*E will read this file,
521Xdetermine which source file caused the error messages,
522Xstart editing that file,
523Xmove the cursor to the line where the error was detected,
524Xand display the error message on the status line.
525XNifty!
526X.IP "Visible Text Selection" 1i
527XIn visual command mode, 'v' starts visibly selecting characters and
528X\&'V' starts visibly selecting whole lines.
529XThe character or line where the cursor is located becomes one
530Xendpoint of the selection.
531XYou can then use the standard cursor movement commands to move the cursor
532Xto the other endpoint, and then press one of the operator commands
533X(c/d/y/</>/!/=/\\).
534XThe operator will then immediately be applied to the selected text.
535X.IP "Pop-up Menu Operator" 1i
536XThe '\\' key is a new operator,
537Xsimilar in operation to the c/d/y/</>/! operators
538XIt conjures up a menu, from which you can select any of the other
539Xoperators plus a few other common commands.
540X.IP "Preset Filter Operator" 1i
541XThe '=' key is another new operator.
542XIt is similar to the '!' operator, except that while
543X\&'!' asks you to type in a filter command each time,
544X\&'=' assumes it should always run the command stored in the \fIequalprg\fR option.
545X.IP "Move to a Given Percentage" 1i
546XThe '%' movement key can now accept an optional count.
547XWithout a count, the '%' key still moves to a matching parenthesis
548Xlike it always did.
549XWith a count somewhere between 1 and 100, though, it moves the cursor to
550Xapproximately a given percentage of the way through the file.
551XFor example, typing "50%" will move the cursor to the middle of the file.
552X.IP "Regular Expressions"
553XIn regular expressions, several new forms of closure operators are supported:
554X\\{\fIn\fR}, \\{\fIn\fR,\fIm\fR}, \\+, and \\?.
555X.NH 2
556XOmissions
557X.PP
558XThe replace mode is a hack.
559XIt doesn't save the text that it overwrites.
560X.PP
561XLong lines are displayed differently -- where the real vi would
562Xwrap a long line onto several rows of the screen, \*E simply
563Xdisplays part of the line, and allows you to scroll the screen
564Xsideways to see the rest of it.
565X.PP
566XThe ":preserve" and ":recover" commands are missing.
567XSo is the -r flag.
568XI've never had a good reason to use ":preserve",
569Xand since ":recover" is used so rarely
570XI decided to implement it as a separate program.
571XThere's no need to load the recovery code into memory every
572Xtime you edit a file, I figured.
573X.PP
574XLISP support is missing.
575XHowever, the = key is still an operator that reformats lines of text.
576XBy default, it reformats lines by sending them through the \fIfmt\fP filter,
577Xbut you could write your own LISP beautifier and configure elvis to use it.
578XKey mappings could take care of most other differences.
579XAuto-indent is the only thing that is irrecoverably lost.
580X.PP
581XAutoindent mode acts a little different from the real vi, anyway.
582XIt doesn't handle ^^D or 0^D correctly.
583XOn the other hand, it \fIdoes\fP allow ^D and ^T to be used anywhere in the
584Xline, to adjust the indentation for the whole line.
585/
586echo x - environ.ms
587sed '/^X/s///' > environ.ms << '/'
588X.Go 11 "ENVIRONMENT VARIABLES"
589X.PP
590X\*E examines several environment variables when it starts up.
591XThe values of these variables are used internally for a variety
592Xof purposes.
593XYou don't need to define all of these;
594Xon most systems, \*E only requires TERM to be defined.
595XOn AmigaDOS, MS-DOS or TOS systems, even that is optional.
596X.SH
597XTERM, TERMCAP
598X.PP
599XTERM tells \*E the name of the termcap entry to use.
600XTERMCAP may contain either the entire termcap entry,
601Xor the full pathname of the termcap file to search through.
602X.PP
603XIf your version of \*E is using tinytcap instead of the full termcap library,
604Xthen the value of TERMCAP \fIcannot\fR contain any backslash escapes (\\E, \\r, etc.)
605Xor carat escapes (^[, ^M, etc.), because tinytcap doesn't understand them.
606XInstead, you should embed the actual control character into the string.
607X.SH
608XTMP, TEMP
609X.PP
610XThese only work for AmigaDOS, MS-DOS and Atari TOS.
611XEither of these variables may be used to set the "directory" option,
612Xwhich controls where temporary files are stored.
613XIf you define them both, then TMP is used, and TEMP is ignored.
614X.SH
615XLINES, COLUMNS
616X.PP
617XThe termcap entry for your terminal should specify the size of your screen.
618XIf you're using a windowing interface, then there is an ioctl() call which
619Xwill provide the size of the window; the ioctl() values will override the
620Xvalues in the termcap entry.
621XThe LINES and COLUMNS environment variables (if defined)
622Xwill override either of these sources.
623XThey, in turn, can be overridden by a ":set" command.
624X.PP
625XNormally, the LINES and COLUMNS variables shouldn't need to be defined.
626X.SH
627XEXINIT
628X.PP
629XThis variable's value may contain one or more colon-mode commands,
630Xwhich will be executed after all of the ".exrc" files
631Xbut before interactive editing begins.
632X.PP
633XTo put more than one command in EXINIT, you can separate the commands
634Xwith either a newline or a '|' character.
635X.SH
636XSHELL, COMSPEC
637X.PP
638XYou can use COMSPEC in MS-DOS, or SHELL in any other system,
639Xto specify which shell should be used for executing commands and
640Xexpanding wildcards.
641X.SH
642XHOME
643X.PP
644XThis variable should give the full pathname of your home directory.
645X\*E needs to know the name of your home directory so it can locate
646Xthe ".exrc" file there.
647X.SH
648XTAGPATH
649X.PP
650XThis variable is used by the "ref" program.
651XIt contains a list of directories that might contain a relevent "tags" file.
652XUnder AmigaDOS, MS-DOS or Atari TOS, the names of the directories should be separated by
653Xsemicolons (";").
654XUnder other operating systems, the names should be separated by colons (":").
655X.PP
656XIf you don't define TAGPATH, then "ref" will use a default list which includes
657Xthe current directory and a few other likely places.
658XSee the definition of DEFTAGPATH at the start of ref.c for an accurate list.
659/
660echo x - ex.ms
661sed '/^X/s///' > ex.ms << '/'
662X.Go 3 "COLON MODE COMMANDS"
663X.ID
664X.ps
665X.in 0.8i
666X.ta 2i 3.i
667X.\" NOTE: The following macro is used to output a single line of the
668X.\" command chart. Its usage is:
669X.\"
670X.\" .Cm <linespecs> <name> <arguments>...
671X.\"
672X.de Cm
673X.if "\\$1"0" \t\\$2\t\\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
674X.if "\\$1"1" \s-2[line]\s+2\t\\$2\t\\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
675X.if "\\$1"2" \s-2[line][,line]\s+2\t\\$2\t\\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
676X..
677X.if t .ds Q ``
678X.if t .ds U ''
679X.if n .ds Q "
680X.if n .ds U "
681X\s+2LINES COMMAND ARGUMENTS\s-2
682X.Cm 0 ab[br] [short] [expanded form]
683X.Cm 1 a[ppend][!]
684X.Cm 0 ar[gs] [files]
685X.Cm 0 cc [files]
686X.Cm 0 cd[!] [directory]
687X.Cm 2 c[hange]
688X.Cm 0 chd[ir][!] [directory]
689X.Cm 2 co[py] line
690X.Cm 0 col[or] [when] [[\*Qlight\*U] color] [\*Qon\*U color]
691X.Cm 2 d[elete] [\*Ux]
692X.Cm 0 dig[raph][!] [XX [Y]]
693X.Cm 0 e[dit][!] [file]
694X.Cm 0 er[rlist][!] [errlist]
695X.Cm 0 f[ile] [file]
696X.Cm 2 g[lobal] /regexp/ command
697X.Cm 1 i[nsert]
698X.Cm 2 j[oin][!]
699X.Cm 2 l[ist]
700X.Cm 0 mak[e] [target]
701X.Cm 0 map[!] key mapped_to
702X.Cm 1 ma[rk] \*Ux
703X.Cm 0 mk[exrc]
704X.Cm 2 m[ove] line
705X.Cm 0 n[ext][!] [files]
706X.Cm 0 N[ext][!]
707X.Cm 2 nu[mber]
708X.Cm 2 p[rint]
709X.Cm 1 pu[t] [\*Ux]
710X.Cm 0 q[uit][!]
711X.Cm 1 r[ead] file
712X.Cm 0 rew[ind][!]
713X.Cm 0 se[t] [options]
714X.Cm 0 so[urce] file
715X.Cm 2 s[ubstitute] /regexp/replacement/[p][g][c]
716X.Cm 0 ta[g][!] tagname
717X.Cm 0 una[bbr] [short]
718X.Cm 0 u[ndo]
719X.Cm 0 unm[ap][!] key
720X.Cm 0 ve[rsion]
721X.Cm 2 v[global] /regexp/ command
722X.Cm 0 vi[sual] [filename]
723X.Cm 0 wq
724X.Cm 2 w[rite][!] [[>>]file]
725X.Cm 0 x[it][!]
726X.Cm 2 y[ank] [\*Ux]
727X.Cm 2 ! command
728X.Cm 2 <
729X.Cm 2 =
730X.Cm 2 >
731X.Cm 2 &
732X.Cm 0 @ "" \*Ux
733X.DE
734X.TA
735X.PP
736XTo use colon mode commands, you must switch from visual command
737Xmode to colon command mode.
738XThe visual mode commands to do this are ":" for a single colon command,
739Xor "Q" for many colon mode commands.
740X.NH 2
741XLine Specifiers
742X.PP
743XLine specifiers are always optional.
744XThe first line specifier of most commands usually defaults to the current line.
745XThe second line specifier usually defaults to be the same
746Xas the first line specifier.
747XExceptions are :write, :global, and :vglobal, which act on all lines of the
748Xfile by default, and :!, which acts on no lines by default.
749X.PP
750XLine specifiers consist of an absolute part and a relative part.
751XThe absolute part of a line specifier may be either an explicit line number,
752Xa mark, a dot to denote the current line, a dollar sign to denote the last
753Xline of the file, or a forward or backward search.
754X.PP
755XAn explicit line number is simply a decimal number, expressed as a
756Xstring of digits.
757X.PP
758XA mark is typed in as an apostrophe followed by a letter.
759XMarks must be set before they can be used.
760XYou can set a mark in visual command mode by typing "m" and a letter,
761Xor you can set it in colon command mode via the "mark" command.
762X.PP
763XA forward search is typed in as a regular expression surrounded by
764Xslash characters; searching begins at the default line.
765XA backward search is typed in as a regular expression surrounded by
766Xquestion marks; searching begins at the line before the default line.
767X.PP
768XIf you omit the absolute part, then the default line is used.
769X.PP
770XThe relative part of a line specifier is typed as a "+" or "-" character
771Xfollowed by a decimal number.
772XThe number is added to or subtracted from the absolute part
773Xof the line specifier to produce the final line number.
774X.PP
775XAs a special case, the % character may be used to specify all lines of the file.
776XIt is roughly equivelent to saying 1,$.
777XThis can be a handy shortcut.
778X.PP
779XSome examples:
780X.LD
781X.ps
782X.ta 0.5i 1.8i
783X :p print the current line
784X :37p print line 37
785X :'gp print the line which contains mark g
786X :/foo/p print the next line that contains "foo"
787X :$p print the last line of the file
788X :20,30p print lines 20 through 30
789X :1,$p print all lines of the file
790X :%p print all lines of the file
791X :/foo/-2,+4p print 5 lines around the next "foo"
792X.TA
793X.DE
794X.NH 2
795XText Entry Commands
796X.if n .ul 0
797X.ID
798X.ps
799X[line] append
800X[line][,line] change ["x]
801X[line] insert
802X.DE
803X.PP
804XThe \fBa\fRppend command inserts text after the specified line.
805X.PP
806XThe \fBi\fRnsert command inserts text before the specified line.
807X.PP
808XThe \fBc\fRhange command copies the range of lines into a cut buffer,
809Xdeletes them, and inserts new text where the old text used to be.
810X.PP
811XFor all of these commands, you indicate the end of the text you're
812Xinserting by hitting ^D or by entering a line which contains only a
813Xperiod.
814X.NH 2
815XCut & Paste Commands
816X.if n .ul 0
817X.ID
818X.ps
819X[line][,line] delete ["x]
820X[line][,line] yank ["x]
821X[line] put ["x]
822X[line][,line] copy line
823X[line][,line] to line
824X[line][,line] move line
825X.DE
826X.PP
827XThe \fBd\fRelete command copies the specified range of lines into a
828Xcut buffer, and then deletes them.
829X.PP
830XThe \fBy\fRank command copies the specified range of lines into a cut
831Xbuffer, but does *not* delete them.
832X.PP
833XThe \fBpu\fRt command inserts text from a cut buffer after the
834Xspecified line.
835X.PP
836XThe \fBco\fRpy and \fBt\fRo commands yank the specified range of lines and
837Xthen immediately paste them after some other line.
838X.PP
839XThe \fBm\fRove command deletes the specified range of lines and then
840Ximmediately pastes them after some other line.
841XIf the destination line comes after the deleted text,
842Xthen it will be adjusted automatically to account for the deleted lines.
843X.NH 2
844XDisplay Text Commands
845X.if n .ul 0
846X.ID
847X.ps
848X[line][,line] print
849X[line][,line] list
850X[line][,line] number
851X.DE
852X.PP
853XThe \fBp\fRrint command displays the specified range of lines.
854X.PP
855XThe \fBnu\fRmber command displays the lines, with line numbers.
856X.PP
857XThe \fBl\fRist command also displays them, but it is careful to make
858Xcontrol characters visible.
859X.NH 2
860XGlobal Operations Commands
861X.if n .ul 0
862X.ID
863X.ps
864X[line][,line] global /regexp/ command
865X[line][,line] vglobal /regexp/ command
866X.DE
867X.PP
868XThe \fBg\fRlobal command searches through the lines of the specified range
869X(or through the whole file if no range is specified)
870Xfor lines that contain a given regular expression.
871XIt then moves the cursor to each of these lines and
872Xruns some other command on them.
873X.PP
874XThe \fBv\fRglobal command is similar, but it searches for lines that \fIdon't\fR
875Xcontain the regular expression.
876X.NH 2
877XLine Editing Commands
878X.if n .ul 0
879X.ID
880X.ps
881X[line][,line] join[!]
882X[line][,line] ! program
883X[line][,line] <
884X[line][,line] >
885X[line][,line] substitute /regexp/replacement/[p][g][c]
886X[line][,line] &
887X.DE
888X.PP
889XThe \fBj\fRoin command catenates all lines in the specified range together
890Xto form one big line.
891XIf only a single line is specified, then the following line is catenated
892Xonto it.
893XThe normal ":join" inserts one or two spaces between the lines;
894Xthe ":join!" variation (with a '!') doesn't insert spaces.
895X.PP
896XThe \fB!\fR command runs an external filter program,
897Xand feeds the specified range of lines to it's stdin.
898XThe lines are then replaced by the output of the filter.
899XA typical example would be ":'a,'z!sort" to sort the lines 'a,'z.
900X.PP
901XThe \fB<\fR and \fB>\fR commands shift the specified range of lines left or right,
902Xnormally by the width of 1 tab character.
903XThe "shiftwidth" option determines the shifting amount.
904X.PP
905XThe \fBs\fRubstitute command finds the regular expression in each line,
906Xand replaces it with the replacement text.
907XThe "p" option causes the altered lines to be printed.
908XThe "g" option permits all instances of the regular expression
909Xto be found & replaced.
910X(Without "g", only the first occurrence in each line is replaced.)
911XThe "c" option asks for confirmation before each substitution.
912X.PP
913XThe \fB&\fR command repeats the previous substitution command.
914XActually, "&" is equivelent to "s//~/" with the same options as last time.
915XIt searches for the last regular expression that you specified for any purpose,
916Xand replaces it with the the same text
917Xthat was used in the previous substitution.
918X.NH 2
919XUndo Command
920X.if n .ul 0
921X.ID
922X.ps
923Xundo
924X.DE
925X.PP
926XThe \fBu\fRndo command restores the file to the state it was in before
927Xyour most recent command which changed text.
928X.NH 2
929XConfiguration & Status Commands
930X.if n .ul 0
931X.ID
932X.ps
933Xmap[!] [key mapped_to]
934Xunmap[!] key
935Xabbr [word expanded_form_of_word]
936Xunabbr word
937Xdigraph[!] [XX [Y]]
938Xset [options]
939Xmkexrc
940X[line] mark "x
941Xvisual
942Xversion
943X[line][,line] =
944Xfile [file]
945Xsource file
946X@ "x
947Xcolor [when] [["light"] color] ["on" color]
948X.DE
949X.PP
950XThe \fBma\fRp command allows you to configure \*E to recognize your function keys,
951Xand treat them as though they transmitted some other sequence of characters.
952XNormally this mapping is done only when in the visual command mode,
953Xbut with the [!] present it will map keys under input and replace modes as well.
954XWhen this command is given with no arguments,
955Xit prints a table showing all mappings currently in effect.
956XWhen called with two arguments, the first is the sequence that your
957Xfunction key really sends, and the second is the sequence that you want
958X\*E to treat it as having sent.
959XAs a special case, if the first argument is a number then \*E will map the
960Xcorresponding function key;
961Xfor example, ":map 7 dd" will cause the <F7> key to delete a line.
962X.PP
963XThe \fBunm\fRap command removes key definitions that were made via the map command.
964X.PP
965XThe \fBab\fRbr command is used to define/list a table of abbreviations.
966XThe table contains both the abbreviated form and the fully spelled-out form.
967XWhen you're in visual input mode, and you type in the abbreviated form,
968X\*E will replace the abbreviated form with the fully spelled-out form.
969XWhen this command is called without arguments, it lists the table;
970Xwith two or more arguments, the first argument is taken as the abbreviated
971Xform, and the rest of the command line is the fully-spelled out form.
972X.PP
973XThe \fBuna\fRbbr command deletes entries from the abbr table.
974X.PP
975XThe \fBdi\fRgraph command allows you to display the set of digraphs that \*E is
976Xusing, or add/remove a digraph.
977XTo list the set of digraphs, use the digraph command with no arguments.
978XTo add a digraph, you should give the digraph command two arguments.
979XThe first argument is the two ASCII characters that are to be combined;
980Xthe second is the non-ASCII character that they represent.
981XThe non-ASCII character's most significant bit is automatically set by the
982Xdigraph command, unless to append a ! to the command name.
983XRemoval of a digraph is similar to adding a digraph, except that you should
984Xleave off the second argument.
985X.PP
986XThe \fBse\fRt command allows you examine or set various options.
987XWith no arguments, it displays the values of options that have been changed.
988XWith the single argument "all" it displays the values of all options,
989Xregardless of whether they've been explicitly set or not.
990XOtherwise, the arguments are treated as options to be set.
991X.PP
992XThe \fBmk\fRexrc command saves the current configuration to a file
993Xcalled ".exrc" in the current directory.
994X.PP
995XThe mar\fBk\fR command defines a named mark to refer to a specific place
996Xin the file.
997XThis mark may be used later to specify lines for other commands.
998X.PP
999XThe \fBvi\fRsual command puts the editor into visual mode.
1000XInstead of emulating ex, \*E will start emulating vi.
1001X.PP
1002XThe \fBve\fRrsion command tells you that what version of \*E this is.
1003X.PP
1004XThe \fB=\fR command tells you what line you specified, or,
1005Xif you specified a range of lines, it will tell you both endpoints and
1006Xthe number of lines included in the range.
1007X.PP
1008XThe \fBf\fRile command tells you the name of the file,
1009Xwhether it has been modified,
1010Xthe number of lines in the file,
1011Xand the current line number.
1012XYou can also use it to change the name of the current file.
1013X.PP
1014XThe \fBso\fRurce command reads a sequence of colon mode commands from a file,
1015Xand interprets them.
1016X.PP
1017XThe \fB@\fR command executes the contents of a cut-buffer as EX commands.
1018X.PP
1019XThe \fBcol\fRor command only works under MS-DOS, or if you have an ANSI-compatible
1020Xcolor terminal.
1021XIt allows you to set the foreground and background colors
1022Xfor different types of text:
1023Xnormal, bold, italic, underlined, standout, pop-up menu, and visible selection.
1024XBy default, it changes the "normal" colors;
1025Xto change other colors, the first argument to the :color command should be
1026Xthe first letter of the type of text you want.
1027XThe syntax for the colors themselves is fairly intuitive.
1028XFor example, ":color light cyan on blue" causes normal text to be displayed
1029Xin light cyan on a blue background, and
1030X":color b bright white" causes bold text to be displayed in bright white on
1031Xa blue background.
1032XThe background color always defaults to the current background color of
1033Xnormal text.
1034XYour first :color command \fImust\fP specify both the foreground and background
1035Xfor normal text.
1036X.NH 2
1037XMultiple File Commands
1038X.if n .ul 0
1039X.ID
1040X.ps
1041Xargs [files]
1042Xnext[!] [files]
1043XNext[!]
1044Xprevious[!]
1045Xrewind[!]
1046X.DE
1047X.PP
1048XWhen you invoke \*E from your shell's command line,
1049Xany filenames that you give to \*E as arguments are stored in the args list.
1050XThe \fBar\fRgs command will display this list, or define a new one.
1051X.PP
1052XThe \fBn\fRext command switches from the current file to the next one
1053Xin the args list.
1054XYou may specify a new args list here, too.
1055X.PP
1056XThe \fBN\fRext and \fBpre\fRvious commands
1057X(they're really aliases for the same command)
1058Xswitch from the current file to the preceding file in the args list.
1059X.PP
1060XThe \fBrew\fRind command switches from the current file to the first file
1061Xin the args list.
1062X.NH 2
1063XSwitching Files
1064X.if n .ul 0
1065X.ID
1066X.ps
1067Xedit[!] [file]
1068Xtag[!] tagname
1069X.DE
1070X.PP
1071XThe \fBe\fRdit command allows to switch from the current file to some other file.
1072XThis has nothing to do with the args list, by the way.
1073X.PP
1074XThe \fBta\fRg command looks up a given tagname in a file called "tags".
1075XThis tells it which file the tag is in, and how to find it in that file.
1076X\*E then switches to the tag's file and finds the tag.
1077X.NH 2
1078XWorking with a Compiler
1079X.if n .ul 0
1080X.ID
1081X.ps
1082Xcc [files]
1083Xmake [target]
1084Xerrlist[!] [errlist]
1085X.DE
1086X.PP
1087XThe \fBcc\fR and \fBmak\fRe commands execute your compiler or "make" utility
1088Xand redirect any error messages into a file called "errlist".
1089XBy default, cc is run on the current file.
1090X(You should write it before running cc.)
1091XThe contents of the "errlist" file are then scanned for error messages.
1092XIf an error message is found, then the cursor is moved to the line where
1093Xthe error was detected,
1094Xand the description of the error is displayed on the status line.
1095X.PP
1096XAfter you've fixed one error, the \fBer\fRrlist command will move
1097Xthe cursor to the next error.
1098XIn visual command mode,
1099Xhitting `*' will do this, too.
1100X.PP
1101XYou can also create an "errlist" file from outside of \*E,
1102Xand use "\*E -m" to start elvis and have the cursor moved to the
1103Xfirst error.
1104XNote that you don't need to supply a filename with "\*E -m" because
1105Xthe error messages always say which source file an error is in.
1106X.PP
1107XNote:
1108XWhen you use errlist repeatedly to fix several errors in a single file,
1109Xit will attempt to adjust the reported line numbers to allow for lines
1110Xthat you have inserted or deleted.
1111XThese adjustments are made with the assumption that you will work though
1112Xthe file from the beginning to the end.
1113X.NH 2
1114XExit Commands
1115X.if n .ul 0
1116X.ID
1117X.ps
1118Xquit[!]
1119Xwq
1120Xxit
1121X.DE
1122X.PP
1123XThe \fBq\fRuit command exits from the editor without saving your file.
1124X.PP
1125XThe \fBwq\fR command writes your file out, then then exits.
1126X.PP
1127XThe \fBx\fRit command is similar to the \fBwq\fR command, except that
1128X\fBx\fRit won't bother to write your file if you haven't modified it.
1129X.NH 2
1130XFile I/O Commands
1131X.if n .ul 0
1132X.ID
1133X.ps
1134X[line] read file
1135X[line][,line] write[!] [[>>]file]
1136X.DE
1137X.PP
1138XThe \fBr\fRead command gets text from another file and inserts it
1139Xafter the specified line.
1140XIt can also read the output of a program;
1141Xsimply precede the program name by a '!' and use it in place of the file name.
1142X.PP
1143XThe \fBw\fRrite command writes the whole file, or just part of it,
1144Xto some other file.
1145XThe !, if present, will permit the lines to be written even if you've set
1146Xthe readonly option.
1147XIf you precede the filename by >> then the lines will be appended to the file.
1148XYou can send the lines to the standard input of a program by replacing the
1149Xfilename with a '!' followed by the command and its arguments.
1150X.PP
1151XNote: Be careful not to confuse ":w!filename" and ":w !command".
1152XTo write to a program, you must have at least one blank before the '!'.
1153X.NH 2
1154XDirectory Commands
1155X.if n .ul 0
1156X.ID
1157X.ps
1158Xcd [directory]
1159Xchdir [directory]
1160Xshell
1161X.DE
1162X.PP
1163XThe \fBcd\fR and \fBchd\fRir commands
1164X(really two names for one command)
1165Xswitch the current working directory.
1166X.PP
1167XThe \fBsh\fRell command starts an interactive shell.
1168X.NH 2
1169XDebugging Commands
1170X.if n .ul 0
1171X.ID
1172X.ps
1173X[line][,line] debug[!]
1174Xvalidate[!]
1175X.DE
1176X.PP
1177XThese commands are only available if you compile \*E with the -DDEBUG flag.
1178X.PP
1179XThe de\fBb\fRug command lists statistics for the blocks which contain
1180Xthe specified range of lines.
1181XIf the ! is present, then the contents of those blocks is displayed, too.
1182X.PP
1183XThe \fBva\fRlidate command checks certain variables for internal consistency.
1184XNormally it doesn't output anything unless it detects a problem.
1185XWith the !, though, it will always produce *some* output.
1186/
1187echo x - index.ms
1188sed '/^X/s///' > index.ms << '/'
1189X.XS 1
1190XINTRODUCTION
1191XWhat E\s-2LVIS\s+2 does,
1192XCopyright,
1193XHow to compile E\s-2LVIS\s+2,
1194XOverview
1195X.XA 2
1196XVISUAL MODE COMMANDS
1197XNormal interactive editing,
1198XInput mode,
1199XArrow keys,
1200XDigraphs,
1201XAbbreviations,
1202XAuto-indentation
1203X.XA 3
1204XCOLON MODE COMMANDS
1205XLine specifiers,
1206XText entry,
1207XCut & paste,
1208XDisplay text,
1209XGlobal operations,
1210XLine editing,
1211XUndo,
1212XConfiguration & status,
1213XMultiple files,
1214XSwitching files,
1215XWorking with a compiler,
1216XExiting,
1217XFile I/O,
1218XDirectory & shell,
1219XDebugging
1220X.XA 4
1221XREGULAR EXPRESSIONS
1222XSyntax,
1223XOptions,
1224XSubstitutions,
1225XExamples
1226X.XA 5
1227XOPTIONS
1228XAutoindent,
1229XAutoprint,
1230Xetc.
1231X.XA 6
1232XCUT BUFFERS
1233XPutting text into a cut buffer,
1234XPasting from a cut buffer,
1235XMacros,
1236XThe effect of switching files
1237X.XA 7
1238XDIFFERENCES BETWEEN E\s-2LVIS\s+2 AND THE REAL VI/EX
1239XExtensions,
1240XOmissions
1241X.XA 8
1242XINTERNAL
1243XFor programmers only,
1244XThe temporary file,
1245XImplementation of editing,
1246XMarks and the cursor,
1247XColon command interpretation,
1248XScreen control,
1249XPortability
1250X.XA 9
1251XCFLAGS
1252X.XA 10
1253XTERMCAP
1254X.XA 11
1255XENVIRONMENT VARIABLES
1256X.XA 12
1257XVERSIONS
1258X.XA 13
1259XQUESTIONS & ANSWERS
1260X.XE
1261X.PX
1262X.sp 0.3i
1263X.ce 1
1264XUNIX-style "man" pages appear at the end of this manual.
1265/
1266echo x - internal.ms
1267sed '/^X/s///' > internal.ms << '/'
1268X.Go 8 "INTERNAL"
1269X.PP
1270XYou don't need to know the material in this section to use \*E.
1271XYou only need it if you intend to modify \*E.
1272X.PP
1273XYou should also check out the CFLAGS, TERMCAP, ENVIRONMENT VARIABLES,
1274XVERSIONS, and QUIESTIONS & ANSWERS sections of this manual.
1275X.NH 2
1276XThe temporary file
1277X.PP
1278XThe temporary file is divided into blocks of 1024 bytes each.
1279XThe functions in "blk.c" maintain a cache of the five most recently used blocks,
1280Xto minimize file I/O.
1281X.PP
1282XWhen \*E starts up, the file is copied into the temporary file
1283Xby the function \fBtmpstart()\fR in "tmp.c".
1284XSmall amounts of extra space are inserted into the temporary file to
1285Xinsure that no text lines cross block boundaries.
1286XThis speeds up processing and simplifies storage management.
1287XThe extra space is filled with NUL characters.
1288Xthe input file must not contain any NULs, to avoid confusion.
1289XThis also limits lines to a length of 1023 characters or less.
1290X.PP
1291XThe data blocks aren't necessarily stored in sequence.
1292XFor example, it is entirely possible that the data block containing
1293Xthe first lines of text will be stored after the block containing the
1294Xlast lines of text.
1295X.PP
1296XIn RAM, \*E maintains two lists: one that describes the "proper"
1297Xorder of the disk blocks, and another that records the line number of
1298Xthe last line in each block.
1299XWhen \*E needs to fetch a given line of text, it uses these tables
1300Xto locate the data block which contains that line.
1301X.PP
1302XBefore each change is made to the file, these lists are copied.
1303XThe copies can be used to "undo" the change.
1304XAlso, the first list
1305X-- the one that lists the data blocks in their proper order --
1306Xis written to the first data block of the temp file.
1307XThis list can be used during file recovery.
1308X.PP
1309XWhen blocks are altered, they are rewritten to a \fIdifferent\fR block in the file,
1310Xand the order list is updated accordingly.
1311XThe original block is left intact, so that "undo" can be performed easily.
1312X\*E will eventually reclaim the original block, when it is no longer needed.
1313X.NH 2
1314XImplementation of Editing
1315X.PP
1316XThere are three basic operations which affect text:
1317X.ID
1318X\(bu delete text - delete(from, to)
1319X\(bu add text - add(at, text)
1320X\(bu yank text - cut(from, to)
1321X.DE
1322X.PP
1323XTo yank text, all text between two text positions is copied into a cut buffer.
1324XThe original text is not changed.
1325XTo copy the text into a cut buffer,
1326Xyou need only remember which physical blocks that contain the cut text,
1327Xthe offset into the first block of the start of the cut,
1328Xthe offset into the last block of the end of the cut,
1329Xand what kind of cut it was.
1330X(Cuts may be either character cuts or line cuts;
1331Xthe kind of a cut affects the way it is later "put".)
1332XYanking is implemented in the function \fBcut()\fR,
1333Xand pasting is implemented in the function \fBpaste()\fR.
1334XThese functions are defined in "cut.c".
1335X.PP
1336XTo delete text, you must modify the first and last blocks, and
1337Xremove any reference to the intervening blocks in the header's list.
1338XThe text to be deleted is specified by two marks.
1339XThis is implemented in the function \fBdelete()\fR.
1340X.PP
1341XTo add text, you must specify
1342Xthe text to insert (as a NUL-terminated string)
1343Xand the place to insert it (as a mark).
1344XThe block into which the text is to be inserted may need to be split into
1345Xas many as four blocks, with new intervening blocks needed as well...
1346Xor it could be as simple as modifying a single block.
1347XThis is implemented in the function \fBadd()\fR.
1348X.PP
1349XThere is also a \fBchange()\fR function,
1350Xwhich generally just calls delete() and add().
1351XFor the special case where a single character is being replaced by another
1352Xsingle character, though, change() will optimize things somewhat.
1353XThe add(), delete(), and change() functions are all defined in "modify.c".
1354X.PP
1355XThe \fBinput()\fR function reads text from a user and inserts it into the file.
1356XIt makes heavy use of the add(), delete(), and change() functions.
1357XIt inserts characters one at a time, as they are typed.
1358X.PP
1359XWhen text is modified, an internal file-revision counter, called \fBchanges\fR,
1360Xis incremented.
1361XThis counter is used to detect when certain caches are out of date.
1362X(The "changes" counter is also incremented when we switch to a different file,
1363Xand also in one or two similar situations -- all related to invalidating caches.)
1364X.NH 2
1365XMarks and the Cursor
1366X.PP
1367XMarks are places within the text.
1368XThey are represented internally as 32-bit values which are split
1369Xinto two bitfields:
1370Xa line number and a character index.
1371XLine numbers start with 1, and character indexes start with 0.
1372XLines can be up to 1023 characters long, so the character index is 10 bits
1373Xwide and the line number fills the remaining 22 bits in the long int.
1374X.PP
1375XSince line numbers start with 1,
1376Xit is impossible for a valid mark to have a value of 0L.
1377X0L is therefore used to represent unset marks.
1378X.PP
1379XWhen you do the "delete text" change, any marks that were part of
1380Xthe deleted text are unset, and any marks that were set to points
1381Xafter it are adjusted.
1382XMarks are adjusted similarly after new text is inserted.
1383X.PP
1384XThe cursor is represented as a mark.
1385X.NH 2
1386XColon Command Interpretation
1387X.PP
1388XColon commands are parsed, and the command name is looked up in an array
1389Xof structures which also contain a pointer to the function that implements
1390Xthe command, and a description of the arguments that the command can take.
1391XIf the command is recognized and its arguments are legal,
1392Xthen the function is called.
1393X.PP
1394XEach function performs its task; this may cause the cursor to be
1395Xmoved to a different line, or whatever.
1396X.NH 2
1397XScreen Control
1398X.PP
1399XIn input mode or visual command mode,
1400Xthe screen is redrawn by a function called \fBredraw()\fR.
1401XThis function is called in the getkey() function before each keystroke is
1402Xread in, if necessary.
1403X.PP
1404XRedraw() write to the screen via a package which looks like the "curses"
1405Xlibrary, but isn't.
1406XIt is actually much simpler.
1407XMost curses operations are implemented as macros which copy characters
1408Xinto a large I/O buffer, which is then written with a single large
1409Xwrite() call as part of the refresh() operation.
1410X.PP
1411X(Note: Under MS-DOS, the pseudo-curses macros check to see whether you're
1412Xusing the pcbios interface. If you are, then the macros call functions
1413Xin "pc.c" to implement screen updates.)
1414X.PP
1415XThe low-level functions which modify text (namely add(), delete(), and change())
1416Xsupply redraw() with clues to help redraw() decide which parts of the
1417Xscreen must be redrawn.
1418XThe clues are given via a function called \fBredrawrange()\fR.
1419X.PP
1420XMost EX commands use the pseudo-curses package to perform their output,
1421Xlike redraw().
1422X.PP
1423XThere is also a function called \fBmsg()\fR which uses the same syntax as printf().
1424XIn EX mode, msg() writes message to the screen and automatically adds a
1425Xnewline.
1426XIn VI mode, msg() writes the message on the bottom line of the screen
1427Xwith the "standout" character attribute turned on.
1428X.NH 2
1429XOptions
1430X.PP
1431XFor each option available through the ":set" command,
1432X\*E contains a character array variable, named "o_\fIoption\fR".
1433XFor example, the "lines" option uses a variable called "o_lines".
1434X.PP
1435XFor boolean options, the array has a dimension of 1.
1436XThe first (and only) character of the array will be NUL if the
1437Xvariable's value is FALSE, and some other value if it is TRUE.
1438XTo check the value, just by dereference the array name,
1439Xas in "if (*o_autoindent)".
1440X.PP
1441XFor number options, the array has a dimension of 3.
1442XThe array is treated as three unsigned one-byte integers.
1443XThe first byte is the current value of the option.
1444XThe second and third bytes are the lower and upper bounds of that
1445Xoption.
1446X.PP
1447XFor string options, the array usually has a dimension of about 60
1448Xbut this may vary.
1449XThe option's value is stored as a normal NUL-terminated string.
1450X.PP
1451XAll of the options are declared in "opts.c".
1452XMost are initialized to their default values;
1453Xthe \fBinitopts()\fR function is used to perform any environment-specific
1454Xinitialization.
1455X.NH 2
1456XPortability
1457X.PP
1458XTo improve portability, \*E collects as many of the system-dependent
1459Xdefinitions as possible into the "config.h" file.
1460XThis file begins with some preprocessor instructions which attempt to
1461Xdetermine which compiler and operating system you have.
1462XAfter that, it conditionally defines some macros and constants for your system.
1463X.PP
1464XOne of the more significant macros is \fBttyread()\fR.
1465XThis macro is used to read raw characters from the keyboard, possibly
1466Xwith timeout.
1467XFor UNIX systems, this basically reads bytes from stdin.
1468XFor MSDOS, TOS, and OS9, ttyread() is a function defined in curses.c.
1469XThere is also a \fBttywrite()\fR macro.
1470X.PP
1471XThe \fBtread()\fR and \fBtwrite()\fR macros are versions of read() and write() that are
1472Xused for text files.
1473XOn UNIX systems, these are equivelent to read() and write().
1474XOn MS-DOS, these are also equivelent to read() and write(),
1475Xsince DOS libraries are generally clever enough to convert newline characters
1476Xautomatically.
1477XFor Atari TOS, though, the MWC library is too stupid to do this,
1478Xso we had to do the conversion explicitly.
1479X.PP
1480XOther macros may substitute index() for strchr(), or bcopy() for memcpy(),
1481Xor map the "void" data type to "int", or whatever.
1482X.PP
1483XThe file "tinytcap.c" contains a set of functions that emulate the termcap
1484Xlibrary for a small set of terminal types.
1485XThe terminal-specific info is hard-coded into this file.
1486XIt is only used for systems that don't support real termcap.
1487XAnother alternative for screen control can be seen in
1488Xthe "curses.h" and "pc.c" files.
1489XHere, macros named VOIDBIOS and CHECKBIOS are used to indirectly call
1490Xfunctions which perform low-level screen manipulation via BIOS calls.
1491X.PP
1492XThe stat() function must be able to come up with UNIX-style major/minor/inode
1493Xnumbers that uniquely identify a file or directory.
1494X.PP
1495XPlease try to keep you changes localized,
1496Xand wrap them in #if/#endif pairs,
1497Xso that \*E can still be compiled on other systems.
1498XAnd PLEASE let me know about it, so I can incorporate your changes into
1499Xmy latest-and-greatest version of \*E.
1500/
1501echo x - intro.ms
1502sed '/^X/s///' > intro.ms << '/'
1503X.Go 1 "INTRODUCTION"
1504X.PP
1505X\*E is a clone of vi/ex, the standard UNIX editor.
1506X\*E supports nearly all of the vi/ex commands,
1507Xin both visual mode and colon mode.
1508X.PP
1509XLike vi/ex, \*E stores most of the text in a temporary file, instead of RAM.
1510XThis allows it to edit files that are too large to fit
1511Xin a single process' data space.
1512XAlso, the edit buffer can survive a power failure or crash.
1513X.PP
1514X\*E runs under BSD UNIX, AT&T SysV UNIX, Minix, MS-DOS, Atari TOS,
1515XCoherent, OS9/68000, VMS and AmigaDos.
1516XThe next version is also expected to add MS-Windows, OS/2 and MacOS.
1517XContact me before you start porting it to some other OS,
1518Xbecause somebody else may have already done it for you.
1519X.PP
1520X\*E is freely redistributable, in either source form or executable form.
1521XThere are no restrictions on how you may use it.
1522X.NH 2
1523XCompiling
1524X.PP
1525XSee the "Versions" section of this manual for instructions on how to compile
1526X\*E.
1527X.PP
1528XIf you want to port \*E to another O.S. or compiler, then
1529Xyou should start be reading the "Portability" part of the "Internal" section.
1530X.NH 2
1531XOverview of \*E
1532X.PP
1533XThe user interface of \*E/vi/ex is weird.
1534XThere are two major command modes in \*E, and a few text input modes as well.
1535XEach command mode has a command which allows you to switch to the other mode.
1536X.PP
1537XYou will probably use the \fIvisual command mode\fR
1538Xmost of the time.
1539XThis is the mode that \*E normally starts up in.
1540X.PP
1541XIn visual command mode, the entire screen is filled with lines of text
1542Xfrom your file.
1543XEach keystroke is interpretted as part of a visual command.
1544XIf you start typing text, it will \fInot\fR be inserted,
1545Xit will be treated as part of a command.
1546XTo insert text, you must first give an "insert text" command.
1547XThis will take some getting used to.
1548X(An alternative exists.
1549XLookup the "inputmode" option.)
1550X.PP
1551XThe \fIcolon mode\fR is quite different.
1552X\*E displays a ":" character on the bottom line of the screen, as a prompt.
1553XYou are then expected to type in a command line and hit the <Return> key.
1554XThe set of commands recognized in the colon mode is different
1555Xfrom visual mode's.
1556/
1557echo x - options.ms
1558sed '/^X/s///' > options.ms << '/'
1559X.Go 5 "OPTIONS"
1560X.PP
1561XOptions may be set or examined via the colon command "set".
1562XThe values of options will affect the operation of later commands.
1563X.PP
1564XFor convenience, options have both a long descriptive name and a short name
1565Xwhich is easy to type.
1566XYou may use either name interchangably.
1567XI like the short names, myself.
1568X.PP
1569XThere are three types of options: Boolean, string, and numeric.
1570XBoolean options are made TRUE by giving the name of the option as an
1571Xargument to the "set" command;
1572Xthey are made FALSE by prefixing the name with "no".
1573XFor example, "set autoindent" makes the autoindent option TRUE,
1574Xand "set noautoindent" makes it FALSE.
1575X\*E also allows boolean options to be toggled by prefixing the name with "neg".
1576XSo, ":map g :set neglist^M" will cause the <g> key to alternately toggle the
1577X"list" option on and off.
1578X(The "neg" prefix is an extension; the real vi doesn't support it.)
1579X.PP
1580XTo change the value of a string or numeric option, pass the "set" command
1581Xthe name of the option, followed by an "=" sign and the option's new value.
1582XFor example, "set tabstop=8" will give the tabstop option a value of 8.
1583XFor string options, you may enclose the new value in quotes.
1584X.LD
1585X.ta 1.9i 2.4i 3.8i
1586X.ps +2
1587X\fBNAMES TYPE DEFAULT MEANING\fP
1588X.ps
1589Xautoindent, ai Bool noai auto-indent during input
1590Xautoprint, ap Bool ap in EX, print the current line
1591Xautotab, at Bool at auto-indent allowed to use tabs?
1592Xautowrite, aw Bool noaw auto-write when switching files
1593Xbeautify, bf Bool nobf strip control chars from file?
1594Xcharattr, ca Bool noca interpret \\fX sequences?
1595Xcc, cc Str cc="cc -c" name of the C compiler
1596Xcolumns, co Num co=80 width of the screen
1597Xdigraph, dig Bool nodig recognize digraphs?
1598Xdirectory, dir Str dir="/usr/tmp" where tmp files are kept
1599Xedcompatible, ed Bool noed remember ":s//" options
1600Xequalprg, ep Bool ep="fmt" program to run for = operator
1601Xerrorbells, eb Bool eb ring bell on error
1602Xexrc, exrc Bool noexrc read "./.exrc" file?
1603Xexrefresh, er Bool er write lines indiviually in EX
1604Xflash, vbell Bool flash use visible alternative to bell
1605Xflipcase, fc Str fc="" non-ASCII chars flipped by ~
1606Xhideformat, hf Bool hf hide text formatter commands
1607Xignorecase, ic Bool noic upper/lowercase match in search
1608Xinputmode, im Bool noim start vi in insert mode?
1609Xkeytime, kt Num kt=2 timeout for mapped key entry
1610Xkeywordprg, kp Str kp="ref" full pathname of shift-K prog
1611Xlines, ln Num ln=25 number of lines on the screen
1612Xlist, li Bool noli display lines in "list" mode
1613Xmagic, ma Bool ma use regular expression in search
1614Xmake, mk Str mk="make" name of the "make" program
1615Xmesg, ms Bool ms allow messages from other users?
1616Xmodelines, ml Bool noml are modelines processed?
1617Xmore, more Bool more pause between messages?
1618Xnovice, nov Bool nonovice set options for ease of use
1619Xparagraphs, para Str para="PPppIPLPQP" names of "paragraph" nroff cmd
1620Xprompt, pr Bool pr show ':' prompt in \fIex\fR mode
1621Xreadonly, ro Bool noro prevent overwriting of orig file
1622Xremap, rem Bool remap allow key maps to call key maps
1623Xreport, re Num re=5 report when 5 or more changes
1624Xruler, ru Bool noru display line/column numbers
1625Xscroll, sc Num sc=12 scroll amount for ^U and ^D
1626Xsections, sect Str sect="NHSHSSSEse" names of "section" nroff cmd
1627Xshell, sh Str sh="/bin/sh" full pathname of the shell
1628Xshowmatch, sm Bool nosm show matching ()[]{}
1629Xshowmode, smd Bool nosmd say when we're in input mode
1630Xshiftwidth, sw Num sw=8 shift amount for < and >
1631Xsidescroll, ss Num ss=8 amount of sideways scrolling
1632Xsync, sy Bool nosy call sync() often
1633Xtabstop, ts Num ts=8 width of tab characters
1634Xtaglength, tl Num tl=0 significant chars in tag name
1635Xterm, te Str te="$TERM" name of the termcap entry
1636Xterse, tr Bool notr give shorter error messages
1637Xtimeout, to Bool to distinguish <esc> from <arrow>?
1638Xwarn, wa Bool wa warn for ! if file modified
1639Xwindow, wi Num wi=24 lines to redraw after long move
1640Xwrapmargin, wm Num wm=0 wrap long lines in input mode
1641Xwrapscan, ws Bool ws at EOF, searches wrap to line 1
1642Xwriteany, wr Bool nowr allow :w to clobber files
1643X.DE
1644X.TA
1645X.ne 6
1646X.IP "autoindent, ai"
1647XDuring input mode, the autoindent option will cause each added line
1648Xto begin with the same amount of leading whitespace as the line above it.
1649XWithout autoindent, added lines are initially empty.
1650X.IP "autoprint, ap"
1651XThis option only affects EX mode.
1652XIf the autoprint option on,
1653Xand either the cursor has moved to a different line
1654Xor the previous command modified the file,
1655Xthen \*E will print the current line.
1656X.IP "autotab, at"
1657XThis option affects the behaviour of the autoindent mode.
1658XIf autoindent is turned off, then autotab has no effect.
1659X.IP
1660XWhen autotab is turned on, elvis will use a mixture of spaces and tabs
1661Xto create the proper amount of indentation.
1662XThis is the default.
1663X.IP
1664XWhen autotab is turned off, elvis will only use spaces for auto-indent.
1665X\*E will still insert a real tab character when you hit the <Tab> key, though;
1666Xthe autotab option only affects \fIautomatic\fR indentation.
1667X.IP "autowrite, aw"
1668XWhen you're editing one file and decide to switch to another
1669X\- via the :tag command, or :next command, perhaps \-
1670Xif your current file has been modified,
1671Xthen \*E will normally print an error message and refuse to switch.
1672X.IP
1673XHowever, if the autowrite option is on,
1674Xthen \*E will write the modified version of the current file
1675Xand successfully switch to the new file.
1676X.IP "beautify, bf"
1677XThis option causes all control characters to be deleted from the text file,
1678Xat the time when you start editing it.
1679XIf you're already editing a file when you turn on the beautify option,
1680Xthen that file won't be affected.
1681X.IP cc
1682XThe :cc command runs the C compiler.
1683XThis option should be set to the name of your compiler.
1684X.IP "charattr, ca"
1685XMany text formatting programs allow you to designate portions of
1686Xyour text to be underlined, italicized, or boldface by embedding
1687Xthe special strings \\fU, \\fI, and \\fB in your text.
1688XThe special string \\fP marks the end of underlined or boldface text.
1689X.IP
1690X\*E normally treats those special strings just like any other text.
1691X.IP
1692XHowever, if the charattr option is on, then \*E will interpret
1693Xthose special strings correctly,
1694Xto display underlined or boldface text on the screen.
1695X(This only works, of course, if your terminal can display
1696Xunderlined and boldface, and if the TERMCAP entry says how to do it.)
1697X.IP "columns, co"
1698XThis option shows how wide your screen is.
1699X.IP "digraph, dig"
1700XThis option is used to enable/disable recognition of digraphs.
1701XThe default value is nodigraph, which means that digraphs will not be
1702Xrecognized.
1703X.IP "directory, dir"
1704X\*E stores text in temporary files.
1705XThis option allows you to control which directory those temporary files will
1706Xappear in.
1707XThe default is /usr/tmp.
1708X.IP
1709XThis option can only be set in a .exrc file;
1710Xafter that, \*E will have already started making temporary files
1711Xin some other directory, so it would be too late.
1712X.IP "edcompatible, ed"
1713XThis option affects the behaviour of the ":s/regexp/text/options" command.
1714XIt is normally off (:se noed) which causes all of the substitution options
1715Xto be off unless explicitly given.
1716X.IP
1717XHowever, with edcompatible on (:se ed), the substitution command remembers
1718Xwhich options you used last time.
1719XThose same options will continue to be used until you change them.
1720XIn edcompatible mode, when you explicitly give the name of a
1721Xsubstitution option, you will toggle the state of that option.
1722X.IP
1723XThis all seems very strange to me, but its implementation was almost free
1724Xwhen I added the ":&" command to repeat the previous substitution,
1725Xso there it is.
1726X.IP "equalprg, ep"
1727XThis holds the name & arguments of the external filter program
1728Xused the the visual = operator.
1729XThe defualt value is "fmt",
1730Xso the = operator will adjust line breaks in text.
1731X.IP "errorbells, eb"
1732X\*E normally rings a bell when you do something wrong.
1733XThis option lets you disable the bell.
1734X.IP exrc
1735XThis option specifies whether a .exrc file in the current directory
1736Xshould be executed.
1737XBy default, this option is off (":set noexrc") which prevents elvis from
1738Xexecuting .exrc in the current directory.
1739XIf the .exrc file in your home directory turns this option on (":set exrc")
1740Xthen the \*E will attempt to execute the .exrc file in the current directory.
1741X.IP
1742XThis option exist mainly for security reasons.
1743XA mean-spirited person could do something like
1744X.br
1745X echo >/tmp/.exrc '!rm -rf $HOME'
1746X.br
1747Xand then anybody who attempted to edit or view a file in the /tmp directory
1748Xwould lose most of their files.
1749XWith the exrc option turned off, this couldn't happen to you.
1750X.IP "exrefresh, er"
1751XThe EX mode of \*E writes many lines to the screen.
1752XYou can make \*E either write each line to the screen separately,
1753Xor save up many lines and write them all at once.
1754X.IP
1755XThe exrefresh option is normally on, so each line is written to the
1756Xscreen separately.
1757X.IP
1758XYou may wish to turn the exrefresh option off (:se noer) if the
1759X"write" system call is costly on your machine, or if you're using a
1760Xwindowing environment.
1761X(Windowing environments scroll text a lot faster when you write
1762Xmany lines at once.)
1763X.IP
1764XThis option has no effect in visual command mode or input mode.
1765X.IP "flash, vbell"
1766XIf your termcap entry describes a visible alternative to ringing
1767Xyour terminal's bell, then this option will say whether the visible
1768Xversion gets used or not.
1769XNormally it will be.
1770X.IP
1771XIf your termcap does NOT include a visible bell capability,
1772Xthen the flash option will be off, and you can't turn it on.
1773X.IP "flipcase, fc"
1774XThe flipcase option allows you to control how the non-ASCII characters are
1775Xaltered by the "~" command.
1776X.IP
1777XThe string is divided into pairs of characters.
1778XWhen "~" is applied to a non-ASCII character,
1779X\*E looks up the character in the flipcase string to see which pair it's in,
1780Xand replaces it by the other character of the pair.
1781X.IP "hideformat, hf"
1782XMany text formatters require you to embed format commands in your text,
1783Xon lines that start with a "." character.
1784X\*E normally displays these lines like any other text,
1785Xbut if the hideformat option is on,
1786Xthen format lines are displayed as blank lines.
1787X.IP "ignorecase, ic"
1788XNormally, when \*E searches for text, it treats uppercase letters
1789Xas being different for lowercase letters.
1790X.IP
1791XWhen the ignorecase option is on, uppercase and lowercase are treated as equal.
1792X.IP "inputmode, im"
1793XThis option allows you to have \*E start up in insert mode.
1794XYou can still exit insert mode at any time by hitting the ESC key, as usual.
1795XUsually, this option would be set in your ".exrc" file.
1796X.IP "keytime, kt"
1797XThe arrow keys of most terminals send a multi-character sequence.
1798XIt takes a measurable amount of time for these sequences to be transmitted.
1799XThe keytime option allows you to control the maximum amount of time
1800Xto allow for an arrow key (or other mapped key) to be received in full.
1801X.IP
1802XOn most systems, the setting is the number of tenths of a second to allow
1803Xbetween characters.
1804XOn some other systems, the setting is in whole seconds.
1805X.IP
1806XTry to avoid setting keytime=1.
1807XMost systems just count clock beats, so if you tried to read a character
1808Xshortly before a clock beat, you could allow almost no time at all for
1809Xreading the characters.
1810XFor higher keytime settings, the difference is less critical.
1811X.IP
1812XIf your system's response time is poor, you might want to increase the keytime.
1813XIn particular, I've found that when keystrokes must be sent through a network
1814X(via X windows, rlogin, or telnet, for example) the keytime should be set to
1815Xat least 1 second.
1816X.IP
1817XAs a special case,
1818Xyou can set keytime to 0 to disable this time limit stuff altogether.
1819XThe big problem here is:
1820XIf your arrow keys' sequences start with an ESC,
1821Xthen every time you hit your ESC key \*E will wait... and wait...
1822Xto see if maybe that ESC was part of an arrow key's sequence.
1823X.IP
1824XNOTE: this option is a generalization of the timeout option of the real vi.
1825X.IP "keywordprg, kp"
1826X\*E has a special keyword lookup feature.
1827XYou move the cursor onto a word, and hit shift-K,
1828Xand \*E uses another program to look up the word
1829Xand display information about it.
1830X.IP
1831XThis option says which program gets run.
1832X.IP
1833XThe default value of this option is "ref",
1834Xwhich is a program that looks up the definition of a function in C.
1835XIt looks up the function name in a file called "refs" which is created by ctags.
1836X.IP
1837XYou can subtitute other programs, such as an English dictionary program
1838Xor the online manual.
1839X\*E runs the program, using the keyword as its only argument.
1840XThe program should write information to stdout.
1841XThe program's exit status should be 0, unless you want \*E to print
1842X"<<< failed >>>".
1843X.IP "lines, ln"
1844XThis option says how many lines you screen has.
1845X.IP "list, li"
1846XIn nolist mode (the default), \*E displays text in a "normal" manner
1847X-- with tabs expanded to an appropriate number of spaces, etc.
1848X.IP
1849XHowever, sometimes it is useful to have tab characters displayed differently.
1850XIn list mode, tabs are displayed as "^I",
1851Xand a "$" is displayed at the end of each line.
1852X.IP "magic, ma"
1853XThe search mechanism in \*E can accept "regular expressions"
1854X-- strings in which certain characters have special meaning.
1855X.IP
1856XThe magic option is normally on, which causes these characters to be treated
1857Xspecially.
1858X.IP
1859XIf you turn the magic option off (:se noma),
1860Xthen all characters except ^ and $ are treated literally.
1861X^ and $ retain their special meanings regardless of the setting of magic.
1862X.IP "make, mk"
1863XThe :make command runs your "make" program.
1864XThis option defines the name of your "make" program.
1865X.IP mesg
1866XWith the real vi, running under real UNIX,
1867X":set nomesg" would prevent other users from sending you messages.
1868X\*E ignores it, though.
1869X.IP "modelines, ml"
1870X\*E supports modelines.
1871XModelines are lines near the beginning or end of your text file which
1872Xcontain "ex:yowza:",
1873Xwhere "yowza" is any EX command.
1874XA typical "yowza" would be something like "set ts=5 ca kp=spell wm=15".
1875XOther text may also appear on a modeline,
1876Xso you can place the "ex:yowza:" in a comment:
1877X.br
1878X.ID
1879X/* ex:set sw=4 ai: */
1880X.DE
1881X.IP
1882XNormally these lines are ignored, for security reasons,
1883Xbut if you have "set modelines" in your .exrc file
1884Xthen "yowza" is executed.
1885X.IP "novice, nov"
1886XThe command ":set novice" is equivelent to ":set nomagic report=1 showmode".
1887X.IP "paragraphs, pa"
1888XThe { and } commands move the cursor forward or backward in increments
1889Xof one paragraph.
1890XParagraphs may be separated by blank lines, or by a "dot" command of
1891Xa text formatter.
1892XDifferent text formatters use different "dot" commands.
1893XThis option allows you to configure \*E to work with your text formatter.
1894X.IP
1895XIt is assumed that your formatter uses commands that start with a
1896X"." character at the front of a line,
1897Xand then have a one- or two-character command name.
1898X.IP
1899XThe value of the paragraphs option is a string in which each pair
1900Xof characters is one possible form of your text formatter's paragraph
1901Xcommand.
1902X.IP "more"
1903XWhen \*E must display a sequence of messages at the bottom line of the screen
1904Xin visual mode, it normally pauses after all but the last one, so you have
1905Xtime to read them all.
1906X.IP
1907XIf you turn off the "more" option, then \*E will not pause.
1908XThis means you can only read the last message, but it is usually the most
1909Ximportant one anyway.
1910X.IP "prompt, pr"
1911XIf you ":set noprompt", then \*E will no longer emit a ':' when it
1912Xexpects you to type in an \fIex\fR command.
1913XThis is slightly useful if you're using an astonishingly slow UNIX machine,
1914Xbut the rest of us can just ignore this one.
1915X.IP "readonly, ro"
1916XNormally, \*E will let you write back any file to which you have
1917Xwrite permission.
1918XIf you don't have write permission, then you can only write the changed
1919Xversion of the file to a \fIdifferent\fP file.
1920X.IP
1921XIf you set the readonly option,
1922Xthen \*E will pretend you don't have write permission to \fIany\fP file you edit.
1923XIt is useful when you really only mean to use \*E to look at a file,
1924Xnot to change it.
1925XThis way you can't change it accidentally.
1926X.IP
1927XThis option is normally off, unless you use the "view" alias of \*E.
1928X"View" is like "vi" except that the readonly option is on.
1929X.IP "remap"
1930XThe ":map" command allows you to convert one key sequence into another.
1931XThe remap option allows you to specify what should happen if portions of
1932Xthat other sequence are also in the map table.
1933XIf remap is on, then those portions will also be mapped, just as if they
1934Xhad been typed on the keyboard.
1935XIf remap is off, then the matching portions will not be mapped.
1936X.IP
1937XFor example, if you enter the commands ":map A B" and ":map B C",
1938Xthen when remap is on, A will be converted to C.
1939XBut when remap is off, A will be converted only to B.
1940X.IP "report, re"
1941XCommands in \*E may affect many lines.
1942XFor commands that affect a lot of lines, \*E will output a message saying
1943Xwhat was done and how many lines were affected.
1944XThis option allows you to define what "a lot of lines" means.
1945XThe default is 5, so any command which affects 5 or more lines will cause
1946Xa message to be shown.
1947X.IP "ruler, ru"
1948XThis option is normally off.
1949XIf you turn it on, then \*E will constantly display the line/column numbers
1950Xof the cursor, at the bottom of the screen.
1951X.IP "scroll, sc"
1952XThe ^U and ^D keys normally scroll backward or forward by half a screenful,
1953Xbut this is adjustable.
1954XThe value of this option says how many lines those keys should scroll by.
1955XIf you invoke ^U or ^D with a count argument (for example, "33^D") then
1956Xthis option's value is set to the count.
1957X.IP "sections, se"
1958XThe [[ and ]] commands move the cursor backward or forward in increments of
1959X1 section.
1960XSections may be delimited by a { character in column 1
1961X(which is useful for C source code)
1962Xor by means of a text formatter's "dot" commands.
1963X.IP
1964XThis option allows you to configure \*E to work with your text formatter's
1965X"section" command, in exectly the same way that the paragraphs option makes
1966Xit work with the formatter's "paragraphs" command.
1967X.IP "shell, sh"
1968XWhen \*E forks a shell
1969X(perhaps for the :! or :shell commands)
1970Xthis is the program that is uses as a shell.
1971XThis is "/bin/sh" by default,
1972Xunless you have set the SHELL (or COMSPEC, for MS-DOS) environment variable,
1973Xit which case the default value is copied from the environment.
1974X.IP "shiftwidth, sw"
1975XThe < and > commands shift text left or right by some uniform number of columns.
1976XThe shiftwidth option defines that "uniform number".
1977XThe default is 8.
1978X.IP "showmatch, sm"
1979XWith showmatch set,
1980Xin input mode every time you hit one of )}],
1981X\*E will momentarily move the cursor to the matching ({[.
1982X.IP "showmode, smd"
1983XIn visual mode, it is easy to forget whether you're in the visual command mode
1984Xor input/replace mode.
1985XNormally, the showmode option is off, and you haven't a clue as to which mode
1986Xyou're in.
1987XIf you turn the showmode option on, though, a little message will appear in the
1988Xlower right-hand corner of your screen, telling you which mode you're in.
1989X.IP "sidescroll, ss"
1990XFor long lines, \*E scrolls sideways.
1991X(This is different from the real vi,
1992Xwhich wraps a single long line onto several rows of the screen.)
1993X.IP
1994XTo minimize the number of scrolls needed,
1995X\*E moves the screen sideways by several characters at a time.
1996XThe value of this option says how many characters' widths to scroll at a time.
1997X.IP
1998XGenerally, the faster your screen can be redrawn,
1999Xthe lower the value you will want in this option.
2000X.IP "sync, sy"
2001XIf the system crashes during an edit session, then most of your work
2002Xcan be recovered from the temporary file that \*E uses to store
2003Xchanges.
2004XHowever, sometimes the OS will not copy changes to the
2005Xhard disk immediately, so recovery might not be possible.
2006XThe [no]sync option lets you control this.
2007X.IP
2008XIn nosync mode (which is the default, for UNIX), \*E lets the operating system
2009Xcontrol when data is written to the disk.
2010XThis is generally faster.
2011X.IP
2012XIn sync mode (which is the default for MS-DOS, AmigaDos, and Atari TOS),
2013X\*E forces all changes out
2014Xto disk every time you make a change.
2015XThis is generally safer, but slower.
2016XIt can also be a rather rude thing to do on a multi-user system.
2017X.IP "tabstop, ts"
2018XTab characters are normally 8 characters wide,
2019Xbut you can change their widths by means of this option.
2020X.IP "taglength, tl"
2021XThis option allows you to specify how many characters of a tag's name
2022Xmust match when performing tag lookup.
2023XAs a special case, ":set taglength=0" means that all characters of a tag's
2024Xname must match.
2025X.IP
2026XNote: some configurations of \*E don't support this option.
2027X.IP "term, te"
2028XThis read-only option shows the name of the termcap entry that
2029X\*E is using for your terminal.
2030X.IP "terse, tr"
2031XThe real vi uses this option to select longer vs. shorter error messages.
2032X\*E has only one set of error messages, though, so this option has no effect.
2033X.IP "timeout, to"
2034XThe command ":set notimeout" is equivelent to ":set keytime=0",
2035Xand ":set timeout" is equivelent to ":set keytime=1".
2036XThis affects the behaviour of the <Esc> key.
2037XSee the discussion of the "keytime" option for more information.
2038X.IP "warn, wa"
2039XIf you have modified a file but not yet written it back to disk, then
2040X\*E will normally print a warning before executing a ":!cmd" command.
2041XHowever, in nowarn mode, this warning is not given.
2042X.IP
2043X\*E also normally prints a message after a successful search that
2044Xwrapped at EOF.
2045XThe [no]warn option can also disable this warning.
2046X.IP "window, wi"
2047XThis option controls how many lines are redrawn after a long move.
2048X.IP
2049XOn fast terminals, this is usually set to the number of rows that the
2050Xterminal can display, minus one.
2051XThis causes the entire screen to be filled with text around the cursor.
2052X.IP
2053XOn slow terminals, you may wish to reduce this value to about 7 or so.
2054XThat way, if you're doing something like repeatedly hitting 'n' to search
2055Xfor each occurrence of some string and trying to find a particular occurrence,
2056Xthen you don't need to wait as long for \*E to redraw the screen after each
2057Xsearch.
2058X.IP "wrapmargin, wm"
2059XNormally (with wrapmargin=0) \*E will let you type in extremely long
2060Xlines, if you wish.
2061X.IP
2062XHowever, with warpmargin set to something other that 0 (wrapmargin=10
2063Xis nice), \*E will automatically cause long lines to be "wrapped"
2064Xon a word break for lines come too close to the right-hand margin.
2065XFor example: On an 80-column screen, ":set wm=10" will cause lines to
2066Xwrap when their length exceeds 70 columns.
2067X.IP "wrapscan, ws"
2068XNormally, when you search for something, \*E will find it no matter
2069Xwhere it is in the file.
2070X\*E starts at the cursor position, and searches forward.
2071XIf \*E hits EOF without finding what you're looking for,
2072Xthen it wraps around to continue searching from line 1.
2073XIf you turn off the wrapscan option (:se nows),
2074Xthen when \*E hits EOF during a search, it will stop and say so.
2075X.IP "writeany, wr"
2076XWith "writeany" turned off, elvis will prevent you from accidentally
2077Xoverwriting a file.
2078XFor example, if "foo" exists then ":w foo" will fail.
2079XIf you turn on the "writeany" option, then ":w foo" will work.
2080X.IP
2081XRegardless of the setting of "writeany", though, ":w! foo" will work.
2082XThe '!' forces the ":w" command to write the file unless the operating system
2083Xwon't allow it.
2084/
2085echo x - question.ms
2086sed '/^X/s///' > question.ms << '/'
2087X.nr Qn 0 1
2088X.de QQ
2089X.sp
2090X.IP \fB\\n+(Qn) 0.3i
2091X..
2092X.de AA
2093X.IP \fR 0.75i
2094X..
2095X.Go 13 "QUESTIONS & ANSWERS"
2096X.QQ
2097XHow can I make elvis run faster under DOS?
2098X.AA
2099XThere are several things you can do.
2100XThe first thing to do is get a good screen driver such as NANSI.SYS.
2101XThis can speed up screen redrawing by as much as a factor of eight!
2102XThe DOS-specific part of section 12 tells you how to do this.
2103X.AA
2104XYou might also consider reducing the size of the blocks that elvis uses.
2105XYou'll need to recompile \*E to do this.
2106XThe default BLKSIZE is 1024 byte for the DOS version of \*E, which means
2107Xthat for each keystroke that you insert, elvis must shift an average of
2108Xabout 500 bytes.
2109XThat's a lot to ask from a little old 5MHz 8088.
2110XA BLKSIZE of 512 bytes might be more appropriate.
2111X.AA
2112XIf you're \fIreally\fR desperate for more speed, you might want to make
2113X\*E store its temporary files on a RAM disk.
2114XHowever, this limits the size of the file you can edit, and it eliminates any
2115Xchance you may have had to recover your work after a power failure
2116Xor system crash, but it might be worth it; you decide.
2117XTo do this, add ":set dir=R:\\" (or whatever your RAM disk's name is)
2118Xto the \fIelvis.rc\fP file.
2119X.AA
2120XNext, consider turning off the "sync" option.
2121XWhen the sync option is turned on, \*E will close the temporary file
2122Xand reopen it after every change, in order to force DOS to update
2123Xthe file's directory entry.
2124XIf you put ":set nosync" into the \fIelvis.rc\fP file, then elvis will
2125Xonly close the file when you start editing a different text file, or
2126Xwhen you're exiting \*E.
2127XConsequently, there is no chance that you'll be able to recover your
2128Xchanges after a power failure... so if you're going to this, then you
2129Xmight as well store the temp files on the RAM disk, too.
2130X.QQ
2131XWhere's the <Esc> key on a DEC keyboard?
2132X.AA
2133XI don't know. Maybe the <F11> key?
2134XYou could always use ":map!" to make some other key act like the <Esc> key.
2135XIf all else fails, use <Control><[>.
2136X.QQ
2137XIs there a way to show which keys do what?
2138X.AA
2139XYes. The command ":map" will show what each key does in command mode,
2140Xand ":map!" (with an exclamation mark) shows what each key does in
2141Xinput mode.
2142X.AA
2143XThe table is divided into three columns: the key's label, the characters
2144Xthat it sends, and the characters that \*E pretends you typed.
2145X.QQ
2146XHow can I make \*E display long lines like the real vi?
2147X.AA
2148XYou can't yet.
2149XThe next version of \*E shouldsupport this, though.
2150X.QQ
2151XI can't recover my text [under MS-DOS or Atari TOS].
2152XAccording to the directory listing, the temporary file is 0 bytes long.
2153XWhat went wrong?
2154X.AA
2155XMS-DOS and TOS only update a file's directory entry when the file is closed.
2156XIf the system crashes while the file is still open, then the file's length
2157Xis stored as 0 bytes.
2158XThe ":set sync" option is supposed to prevent this;
2159Xyou probably turned it off in the interest of speed, right?
2160X.AA
2161XUnder MS-DOS [I don't know about TOS], you should delete the empty
2162Xtemporary file, and then run CHKDSK/F.
2163XThis \fImight\fP find the data that belonged in the empty file,
2164Xand place it in a new file with a name like "000001.CHK" -- something like that.
2165XYou can then try to extract the text from that temporary file by giving the
2166Xcommand "elvprsv -R 000001.chk >goodnews.txt".
2167XIf you're lucky, then your text might be in GOODNEWS.TXT.
2168X.QQ
2169XWhat is the most current version of \*E?
2170X.AA
2171XEach version of \*E that is released to the public has a version number
2172Xof the form "number point number".
2173XAs I write this, the most current version of elvis is 1.5.
2174X.AA
2175XThe intermediate steps between one release and the next are labeled with
2176Xthe \fInext\fP version number, with a letter appended.
2177XFor example, after 1.4 was released, I started working on 1.5a.
2178XI am currently working on 2.0a.
2179XWhen \*E reaches a stable state, I'll call it 2.0 and release it.
2180X.AA
2181XSometimes a beta-test version of elvis will be available via anonymous FTP
2182Xfrom m2xenix.psg.com, in the directory "pub/elvis/beta".
2183X.QQ
2184XI only got executables, but now I want the source code.
2185XWhere can I get it?
2186X.AA
2187XIf you have access to the Internet, then you should be able to fetch it
2188Xfrom one of the public archives such as \fBplains.nodak.edu\fP.
2189XIt is accessible via anonymous FTP, or via an email server named
2190X"archive-server@plains.nodak.edu".
2191XElvis is located in the directory "/pub/Minix/all.contrib".
2192X.AA
2193XI will also offer it to the C Users' Group.
2194XThey sell C source code for us$8 per diskette
2195X(or slightly more outside North America).
2196XTheir phone number is (913) 841-1631,
2197Xand their address is:
2198X.ID
2199XThe C Users' Group
2200XPO Box 3127
2201XLawrence KS 66046-0127
2202X.DE
2203X.QQ
2204XIs this shareware, or public domain, or what?
2205X.AA
2206XIt is not public domain; it is copyrighted by me, Steve Kirkendall.
2207XHowever, this particular version is freely redistributable, in either
2208Xsource form or executable form.
2209X(I would prefer that you give copies away for free, complete with the
2210Xfull source code... but I'm not going to force you.)
2211X.AA
2212XIt is not shareware; you aren't expected to send me anything.
2213XYou can use it without guilt.
2214X.AA
2215XIt is not "copylefted."
2216XI hold a copyright, but currently I have not added any of the usual restrictions
2217Xthat you would find on copylefted software.
2218XIf people start doing really obnoxious things to \*E, then I will start
2219Xadding restrictions to subsequent versions, but earlier versions won't
2220Xbe affected.
2221X(So far, everybody has been pretty good about this so no restrictions
2222Xhave been necessary.)
2223X.QQ
2224XCan I reuse parts of your source code?
2225X.AA
2226XYes. Please be careful, though, to make sure that the code really is mine.
2227XSome of the code was contributed by other people, and I don't have the
2228Xauthority to give you permission to use it.
2229XThe author's name can be found near the top of each source file.
2230XIf it says "Steve Kirkendall" then you may use it;
2231Xotherwise, you'd better contact the author first.
2232X.AA
2233XPlease don't remove my name from the source code.
2234XIf you modify the source, please make a note of that fact in a comment
2235Xnear the top of the source code.
2236XAnd, finally, please mention my name in your documentation.
2237X.QQ
2238XCan \*E work with non-ASCII files?
2239X.AA
2240X\*E can't edit binary files because it can't handle the NUL character,
2241Xand because of line-length limitations.
2242XHowever, it is 8-bit clean so you should be able to edit any European
2243Xextended ASCII file without any surprises.
2244X.AA
2245X\*E has also been modified to work with 16-bit character sets.
2246XYongguang Zhang (ygz@cs.purdue.edu) has created a Chinese version of \*E
2247Xthat uses 16-bit characters and runs under cxterm (Chinese X-term)
2248Xon X-windows systems.
2249XJunichiro Itoh (itojun@foretune.co.jp) has modified \*E to edit Japanese
2250Xtext under MS-DOS.
2251/
2252echo x - regexp.ms
2253sed '/^X/s///' > regexp.ms << '/'
2254X.Go 4 "REGULAR EXPRESSIONS"
2255X
2256X.PP
2257X\*E uses regular expressions for searching and substututions.
2258XA regular expression is a text string in which some characters have
2259Xspecial meanings.
2260XThis is much more powerful than simple text matching.
2261X.SH
2262XSyntax
2263X.PP
2264X\*E' regexp package treats the following one- or two-character
2265Xstrings (called meta-characters) in special ways:
2266X.IP "\\\\\\\\(\fIsubexpression\fP\\\\\\\\)" 0.8i
2267XThe \\( and \\) metacharacters are used to delimit subexpressions.
2268XWhen the regular expression matches a particular chunk of text,
2269X\*E will remember which portion of that chunk matched the \fIsubexpression\fP.
2270XThe :s/regexp/newtext/ command makes use of this feature.
2271X.IP "^" 0.8i
2272XThe ^ metacharacter matches the beginning of a line.
2273XIf, for example, you wanted to find "foo" at the beginning of a line,
2274Xyou would use a regular expression such as /^foo/.
2275XNote that ^ is only a metacharacter if it occurs
2276Xat the beginning of a regular expression;
2277Xanyplace else, it is treated as a normal character.
2278X.IP "$" 0.8i
2279XThe $ metacharacter matches the end of a line.
2280XIt is only a metacharacter when it occurs at the end of a regular expression;
2281Xelsewhere, it is treated as a normal character.
2282XFor example, the regular expression /$$/ will search for a dollar sign at
2283Xthe end of a line.
2284X.IP "\\\\\\\\<" 0.8i
2285XThe \\< metacharacter matches a zero-length string at the beginning of
2286Xa word.
2287XA word is considered to be a string of 1 or more letters and digits.
2288XA word can begin at the beginning of a line
2289Xor after 1 or more non-alphanumeric characters.
2290X.IP "\\\\\\\\>" 0.8i
2291XThe \\> metacharacter matches a zero-length string at the end of a word.
2292XA word can end at the end of the line
2293Xor before 1 or more non-alphanumeric characters.
2294XFor example, /\\<end\\>/ would find any instance of the word "end",
2295Xbut would ignore any instances of e-n-d inside another word
2296Xsuch as "calendar".
2297X.IP "\&." 0.8i
2298XThe . metacharacter matches any single character.
2299X.IP "[\fIcharacter-list\fP]" 0.8i
2300XThis matches any single character from the \fIcharacter-list\fP.
2301XInside the \fIcharacter-list\fP, you can denote a span of characters
2302Xby writing only the first and last characters, with a hyphen between
2303Xthem.
2304XIf the \fIcharacter-list\fP is preceded by a ^ character, then the
2305Xlist is inverted -- it will match character that \fIisn't\fP mentioned
2306Xin the list.
2307XFor example, /[a-zA-Z]/ matches any letter, and /[^ ]/ matches anything
2308Xother than a blank.
2309X.IP "\\\\\\\\{\fIn\fP\\\\\\\\}" 0.8i
2310XThis is a closure operator,
2311Xwhich means that it can only be placed after something that matches a
2312Xsingle character.
2313XIt controls the number of times that the single-character expression
2314Xshould be repeated.
2315X.IP "" 0.8i
2316XThe \\{\fIn\fP\\} operator, in particular, means that the preceding
2317Xexpression should be repeated exactly \fIn\fP times.
2318XFor example, /^-\\{80\\}$/ matches a line of eighty hyphens, and
2319X/\\<[a-zA-Z]\\{4\\}\\>/ matches any four-letter word.
2320X.IP "\\\\\\\\{\fIn\fP,\fIm\fP\\\\\\\\}" 0.8i
2321XThis is a closure operator which means that the preceding single-character
2322Xexpression should be repeated between \fIn\fP and \fIm\fP times, inclusive.
2323XIf the \fIm\fP is omitted (but the comma is present) then \fIm\fP is
2324Xtaken to be inifinity.
2325XFor example, /"[^"]\\{3,5\\}"/ matches any pair of quotes which contains
2326Xthree, four, or five non-quote characters.
2327X.IP "*" 0.8i
2328XThe * metacharacter is a closure operator which means that the preceding
2329Xsingle-character expression can be repeated zero or more times.
2330XIt is equivelent to \\{0,\\}.
2331XFor example, /.*/ matches a whole line.
2332X.IP "\\\\\\\\+" 0.8i
2333XThe \\+ metacharacter is a closure operator which means that the preceding
2334Xsingle-character expression can be repeated one or more times.
2335XIt is equivelent to \\{1,\\}.
2336XFor example, /.\\+/ matches a whole line, but only if the line contains
2337Xat least one character.
2338XIt doesn't match empty lines.
2339X.IP "\\\\\\\\?" 0.8i
2340XThe \\? metacharacter is a closure operator which indicates that the
2341Xpreceding single-character expression is optional -- that is, that it
2342Xcan occur 0 or 1 times.
2343XIt is equivelent to \\{0,1\\}.
2344XFor example, /no[ -]\\?one/ matches "no one", "no-one", or "noone".
2345X.PP
2346XAnything else is treated as a normal character which must exactly match
2347Xa character from the scanned text.
2348XThe special strings may all be preceded by a backslash to
2349Xforce them to be treated normally.
2350X.SH
2351XSubstitutions
2352X.PP
2353XThe :s command has at least two arguments: a regular expression,
2354Xand a substitution string.
2355XThe text that matched the regular expression is replaced by text
2356Xwhich is derived from the substitution string.
2357X.br
2358X.ne 15 \" so we don't mess up the table
2359X.PP
2360XMost characters in the substitution string are copied into the
2361Xtext literally but a few have special meaning:
2362X.LD
2363X.ta 0.75i 1.3i
2364X & Insert a copy of the original text
2365X ~ Insert a copy of the previous replacement text
2366X \\1 Insert a copy of that portion of the original text which
2367X matched the first set of \\( \\) parentheses
2368X \\2-\\9 Do the same for the second (etc.) pair of \\( \\)
2369X \\U Convert all chars of any later & or \\# to uppercase
2370X \\L Convert all chars of any later & or \\# to lowercase
2371X \\E End the effect of \\U or \\L
2372X \\u Convert the first char of the next & or \\# to uppercase
2373X \\l Convert the first char of the next & or \\# to lowercase
2374X.TA
2375X.DE
2376X.PP
2377XThese may be preceded by a backslash to force them to be treated normally.
2378XIf "nomagic" mode is in effect,
2379Xthen & and ~ will be treated normally,
2380Xand you must write them as \\& and \\~ for them to have special meaning.
2381X.SH
2382XOptions
2383X.PP
2384X\*E has two options which affect the way regular expressions are used.
2385XThese options may be examined or set via the :set command.
2386X.PP
2387XThe first option is called "[no]magic".
2388XThis is a boolean option, and it is "magic" (TRUE) by default.
2389XWhile in magic mode, all of the meta-characters behave as described above.
2390XIn nomagic mode, only ^ and $ retain their special meaning.
2391X.PP
2392XThe second option is called "[no]ignorecase".
2393XThis is a boolean option, and it is "noignorecase" (FALSE) by default.
2394XWhile in ignorecase mode, the searching mechanism will not distinguish between
2395Xan uppercase letter and its lowercase form.
2396XIn noignorecase mode, uppercase and lowercase are treated as being different.
2397X.PP
2398XAlso, the "[no]wrapscan" option affects searches.
2399X.SH
2400XExamples
2401X.PP
2402XThis example changes every occurence of "utilize" to "use":
2403X.sp
2404X.ti +1i
2405X:%s/utilize/use/g
2406X.PP
2407XThis example deletes all whitespace that occurs at the end of a line anywhere
2408Xin the file.
2409X(The brackets contain a single space and a single tab.):
2410X.sp
2411X.ti +1i
2412X:%s/[ ]\\+$//
2413X.PP
2414XThis example converts the current line to uppercase:
2415X.sp
2416X.ti +1i
2417X:s/.*/\\U&/
2418X.PP
2419XThis example underlines each letter in the current line,
2420Xby changing it into an "underscore backspace letter" sequence.
2421X(The ^H is entered as "control-V backspace".):
2422X.sp
2423X.ti +1i
2424X:s/[a-zA-Z]/_^H&/g
2425X.PP
2426XThis example locates the last colon in a line,
2427Xand swaps the text before the colon with the text after the colon.
2428XThe first \\( \\) pair is used to delimit the stuff before the colon,
2429Xand the second pair delimit the stuff after.
2430XIn the substitution text, \\1 and \\2 are given in reverse order
2431Xto perform the swap:
2432X.sp
2433X.ti +1i
2434X:s/\\(.*\\):\\(.*\\)/\\2:\\1/
2435/
2436echo x - termcap.ms
2437sed '/^X/s///' > termcap.ms << '/'
2438X.Go 10 "TERMCAP"
2439X.PP
2440X\*E uses fairly standard termcap fields for most things.
2441XI invented the cursor shape names
2442Xbut other than that there should be few surprises.
2443X.SH
2444XRequired numeric fields
2445X.if n .ul 0
2446X.ID
2447X:co#: number of columns on the screen (chars per line)
2448X:li#: number of lines on the screen
2449X.DE
2450X.SH
2451XRequired string fields
2452X.ID
2453X.if n .ul 0
2454X:ce=: clear to end-of-line
2455X:cl=: home the cursor & clear the screen
2456X:cm=: move the cursor to a given row/column
2457X:up=: move the cursor up one line
2458X.DE
2459X.SH
2460XBoolean fields
2461X.if n .ul 0
2462X.ID
2463X:am: auto margins - wrap when char is written in last column?
2464X:xn: brain-damaged auto margins - newline ignored after wrap
2465X:pt: physical tabs?
2466X.DE
2467X.SH
2468XOptional string fields
2469X.if n .ul 0
2470X.ID
2471X:al=: insert a blank row on the screen
2472X:dl=: delete a row from the screen
2473X:cd=: clear to end of display
2474X:ei=: end insert mode
2475X:ic=: insert a blank character
2476X:im=: start insert mode
2477X:dc=: delete a character
2478X:sr=: scroll reverse (insert row at top of screen)
2479X:vb=: visible bell
2480X:ti=: terminal initialization string, to start full-screen mode
2481X:te=: terminal termination, to end full-screen mode
2482X:ks=: enables the cursor keypad
2483X:ke=: disables the cursor keypad
2484X.DE
2485X.SH
2486XOptional strings received from the keyboard
2487X.if n .ul 0
2488X.ID
2489X:kd=: sequence sent by the <down arrow> key
2490X:kl=: sequence sent by the <left arrow> key
2491X:kr=: sequence sent by the <right arrow> key
2492X:ku=: sequence sent by the <up arrow> key
2493X:kP=: sequence sent by the <PgUp> key
2494X:kN=: sequence sent by the <PgDn> key
2495X:kh=: sequence sent by the <Home> key
2496X:kH=: sequence sent by the <End> key
2497X:kI=: sequence sent by the <Insert> key
2498X.DE
2499X.PP
2500XOriginally, termcap didn't have any names for the <PgUp>, <PgDn>, <Home>,
2501Xand <End> keys.
2502XAlthough the capability names shown in the table above are the most common,
2503Xthey are \fInot\fR universal.
2504XSCO Xenix uses :PU=:PD=:HM=:EN=: for those keys.
2505XAlso, if the four arrow keys happen to be part of a 3x3 keypad,
2506Xthen the five non-arrow keys may be named :K1=: through :K5=:,
2507Xso an IBM PC keyboard may be described using those names instead.
2508X\*E can find any of these names.
2509X.SH
2510XOptional strings sent by function keys
2511X.if n .ul 0
2512X.ID
2513X:k1=:...:k9=:k0=: codes sent by <F1> through <F10> keys
2514X:s1=:...:s9=:s0=: codes sent by <Shift F1> ... <Shift F10>
2515X:c1=:...:c9=:c0=: codes sent by <Ctrl F1> ... <Ctrl F10>
2516X:a1=:...:a9=:a0=: codes sent by <Alt F1> ... <Alt F10>
2517X.DE
2518X.PP
2519XNote that :k0=: is used to describe the <F10> key.
2520XSome termcap documents recommend :ka=: or even :k;=: for describing
2521Xthe <F10> key, but \*E doesn't support that.
2522X.PP
2523XAlso, the :s1=:..., :c1=:..., and :a1=:... codes are very non-standard.
2524XThe terminfo library doesn't support them.
2525X.SH
2526XOptional fields that describe character attributes
2527X.if n .ul 0
2528X.ID
2529X:so=:se=: start/end standout mode (We don't care about :sg#:)
2530X:us=:ue=: start/end underlined mode
2531X:md=:me=: start/end boldface mode
2532X:as=:ae=: start/end alternate character set (italics)
2533X:ug#: visible gap left by :us=:ue=:md=:me=:as=:ae=:
2534X.DE
2535X.SH
2536XOptional fields that affect the cursor's shape
2537X.PP
2538XThe :cQ=: string is used by \*E immediately before exiting to undo
2539Xthe effects of the other cursor shape strings.
2540XIf :cQ=: is not given, then all other cursor shape strings are ignored.
2541X.ID
2542X:cQ=: normal cursor
2543X:cX=: cursor used for reading EX command
2544X:cV=: cursor used for reading VI commands
2545X:cI=: cursor used during VI input mode
2546X:cR=: cursor used during VI replace mode
2547X.DE
2548X.PP
2549XIf the capabilities above aren't given, then \*E will try to use the
2550Xfollowing values instead.
2551X.ID
2552X:ve=: normal cursor, used as :cQ=:cX=:cI=:cR=:
2553X:vs=: gaudy cursor, used as :cV=:
2554X.DE
2555X.SH
2556XAn example
2557X.PP
2558XHere's the termcap entry I use on my Minix-ST system.
2559XSome of the fields in it have nothing to do with \*E.
2560XSome can only work on my system;
2561XI have modified my kernel's screen driver.
2562X.sp
2563X.LD
2564X.ne 14
2565Xmx|minix|minixst|ansi:\\
2566X :is=\\E[0~:co#80:li#25:bs:pt:\\
2567X :cm=\\E[%i%d;%dH:up=\\E[A:do=^J:nd=\\E[C:sr=\\EM:\\
2568X :cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:\\
2569X :al=\\E[L:dl=\\E[M:ic=\\E[@:dc=\\E[P:im=:ei=:\\
2570X :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:\\
2571X :md=\\E[1m:me=\\E[m:as=\\E[1;3m:ae=\\E[m:\\
2572X :ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:\\
2573X :k1=\\E[1~:k2=\\E[2~:k3=\\E[3~:k4=\\E[4~:k5=\\E[5~:\\
2574X :k6=\\E[6~:k7=\\E[17~:k8=\\E[18~:k9=\\E[19~:k0=\\E[20~:\\
2575X :kU=\\E[36~:kQ=\\E[32~:kH=\\E[28~:\\
2576X :GV=3:GH=D:G1=?:G2=Z:G3=@:G4=Y:GC=E:GL=4:GR=C:GU=A:GD=B:\\
2577X :cQ=\\E[k:cX=\\E[2;0k:cV=\\E[16;0k:cI=\\E[k:cR=\\E[16;20k:
2578X.DE
2579/
2580echo x - title.ms
2581sed '/^X/s///' > title.ms << '/'
2582X.de tE
2583X.ps 80
2584X.ce 1
2585X\*E
2586X..
2587X.de nE
2588X.ce 7
2589X#######
2590X# # # # # ####
2591X# # # # # #
2592X##### # # # # ####
2593X# # # # # #
2594X# # # # # # #
2595X####### ###### ## # ####
2596X..
2597X.sp |2i
2598X.if t .tE
2599X.if n .nE
2600X.ps 10
2601X.sp 1
2602X.ce 2
2603X- a clone of vi/ex -
2604Xversion \*V
2605X.sp |7.5i
2606X.IP Author: 0.9i
2607XSteve Kirkendall
2608X.br
2609X14407 SW Teal Blvd., Apt C
2610X.br
2611XBeaverton, OR 97005
2612X.IP E-Mail: 0.9i
2613Xkirkenda@cs.pdx.edu
2614X.IP Phone: 0.9i
2615X(503) 643-6980
2616/
2617echo x - ver.ms
2618sed '/^X/s///' > ver.ms << '/'
2619X.ds V 1.5j-betatest
2620X.if t .ds E E\s-2LVIS\s+2
2621X.if n .ds E Elvis
2622X.\"
2623X.\" usage: .Go <section#> <title>
2624X.de Go
2625X.ds LH "\\$1-\\\\n%
2626X.ds RH "\\$1-\\\\n%
2627X.ds CH "\\$2
2628X.NH S \\$1
2629X\\$2
2630X.\"if !\\n%=1 .bp 1
2631X.if n .ul 0
2632X..
2633/
2634echo x - versions.ms
2635sed '/^X/s///' > versions.ms << '/'
2636X.Go 12 "VERSIONS"
2637X.PP
2638X\*E currently works under BSD UNIX, AT&T System-V UNIX, SCO XENIX,
2639XMinix, Coherent, MS-DOS, Atari TOS, OS9/68k, VAX/VMS, and AmigaDos.
2640XThis section of the manual provides special information that applies to each
2641Xparticular version of \*E.
2642X.PP
2643XFor all versions except MS-DOS,
2644Xthe file "Makefile.mix" should be copied to "Makefile",
2645Xand then edited to select the correct set of options for your system.
2646XThere is more information about this embedded in the file itself.
2647X.NH 2
2648XBSD UNIX
2649X.PP
2650XTemporary files are stored in /tmp.
2651X.PP
2652XYou should modify /etc/rc so that
2653Xthe temp files are preserved when the system is rebooted.
2654XFind a line in /etc/rc which reads
2655X.br
2656X.ti +0.5i
2657Xex4.3preserve /tmp
2658X.PP
2659Xor something like that, and append the following line after it:
2660X.br
2661X.ti +0.5i
2662Xelvprsv /tmp/elv*
2663X.PP
2664XIf you do not have permission to modify /etc/rc, don't fret.
2665XThe above modification is only needed to allow you to recover your changes
2666Xafter a system crash.
2667XYou can still run \*E without that modification,
2668Xand you can still recover your changes when \*E crashes
2669Xor when your dialup modem looses the carrier signal, or something like that.
2670XOnly a system crash or power failure could hurt you.
2671X.PP
2672XBoth \*E and the real Vi
2673Xread initialization commands from a file called ".exrc",
2674Xbut the commands in that file might work on one but not the other.
2675XFor example, "set keywordprg=man" will work for \*E,
2676Xbut Vi will complain because it doesn't have a "keywordprg" option.
2677XIf the warning messages annoy you, then you can edit the config.h file
2678Xto change the name of the initialization file ".exrc" to something else,
2679Xsuch as ".elvisrc".
2680X.PP
2681XIf you use X windows, you may wish to add "-DCS_LATIN1" to CFLAGS.
2682XThis will cause the digraph table and the flipcase option to have default
2683Xvalues that are appropriate for the LATIN-1 character set.
2684XThat's the standard character set for X.
2685X.PP
2686XThe default keyboard macro time-out value is larger for BSD than it is for
2687Xsome other systems, because I've had trouble running \*E via rlogin or Xterm.
2688XI guess it takes a while for those keystokes to squirt through the net.
2689X.NH 2
2690XSystem-V UNIX
2691X.PP
2692XMost SysV UNIX systems use terminfo instead of termcap,
2693Xbut the terminfo library doesn't seem to have a standard name.
2694XAs shipped, Elvis' Makefile.mix is configured with "LIBS=-lterm".
2695XYou may need to change it to "LIBS=-ltermcap" or "LIBS=-lterminfo"
2696Xor even "LIBS=-lcurses".
2697X.PP
2698XThe /etc/rc file should be modified as described for BSD systems, above.
2699XThe only difference is that SysV systems tend to have directories for
2700Xinitialization, instead of a single large /etc/rc file.
2701XEditor recovery is usually done somewhere in the /etc/rc2.d directory.
2702X.PP
2703XThe potential trouble with ".exrc" described above for BSD UNIX applies
2704Xto System-V UNIX as well.
2705X.PP
2706X\*E uses control-C as the interrupt key, not Delete.
2707X.NH 2
2708XSCO Xenix
2709X.PP
2710XFor Xenix-386, you can use the generic System-V settings.
2711XYou may wish to add "-DCS_IBMPC" to CFLAGS, to have the digraph table and
2712Xflipcase option start up in a mode that is appropriate for the console.
2713X
2714XThere is a separate group of settings for use with Xenix-286.
2715XIt already has "-DCS_IBMPC" in CFLAGS.
2716X.PP
2717XBecause Xenix is so similar to System-V, everything I said earlier about
2718XSystem-V applies to the Xenix version too, except that editor recovery
2719Xprobably belongs in a directory called /etc/rc.d/8.
2720X.NH 2
2721XMinix
2722X.PP
2723XThere are separate settings in Makefile.mix for Minix-PC and Minix-68k.
2724XThe differences between these two are that
2725Xthe 68k version uses ".o" for the object file extension where
2726Xthe PC version uses ".s", and
2727Xthe PC version has some extra flags in CFLAGS to reduce the size of \*E.
2728XThe PC version also uses tinytcap (instead of the full termcap) to make it smaller.
2729X.PP
2730XMinix-PC users should read the CFLAGS section of this manual very carefully.
2731XYou have some choices to make...
2732X.PP
2733XThe temporary files are stored in /usr/tmp.
2734XThe /usr/tmp directory must exist before you run \*E,
2735Xand it must be readable/writable by everybody.
2736XWe use /usr/tmp instead of /tmp because
2737Xafter a system crash or power failure,
2738Xyou can recover the altered version of a file from the temporary file
2739Xin /usr/tmp.
2740XIf it was stored in /tmp, though, then it would be lost because /tmp is
2741Xnormally located on the RAM disk.
2742X.PP
2743X\*E uses control-C as the interrupt key, not Delete.
2744X.NH 2
2745XCoherent
2746X.PP
2747X\*E was ported to Coherent by Esa Ahola.
2748X.PP
2749X\*E is too large to run under Coherent unless you eliminate some
2750Xfeatures via the CFLAGS setting.
2751XThe recommended settings, in Makefile.mix, produce a working version
2752Xof \*E which emulates Vi faithfully, but lacks most of the extensions.
2753XYou should read the CFLAGS section of this manual carefully.
2754X.PP
2755XYou can probably reduce the size of \*E by using tinytcap.c instead of -lterm.
2756XThis would allow you to keep most features of \*E,
2757Xat the expense of terminal independence.
2758X(Tinytcap.c has ANSI escape sequences hard-coded into it.)
2759XTo use tinytcap, just add "tinytcap.o" to the "EXTRA=" line in the Makefile,
2760Xand remove "-lterm" from the "LIBS=" line.
2761X.PP
2762XThe temporary files are stored in /tmp.
2763XYou should modify your /etc/rc file as described for BSD earlier.
2764X.NH 2
2765XMS-DOS
2766X.PP
2767X\*E was ported to MS-DOS by Guntram Blohm and Martin Patzel.
2768XWillett Kempton added support for the DEC Rainbow.
2769X.PP
2770XIdeally, \*E should be compiled with Microsoft C 5.10 and the standard
2771XMicrosoft Make utility,
2772Xvia the command "make elvis.mak".
2773XThis will compile \*E and all related utilities.
2774X.PP
2775XWith Microsoft C 6.00, you may have trouble compiling regexp.c.
2776XIf so, try compiling it without optimization.
2777X.PP
2778XThe "Makefile.mix" file contains a set of suggested settings for compiling
2779Xelvis with Turbo-C or Borland C.
2780X(If you have Turbo-C, but not the Make utility,
2781Xthen you can \fIalmost\fR use the "\*E.prj" file to compile \*E,
2782Xbut you must explicitly force Turbo-C to compile it with the "medium" memory model.
2783XMost of the related programs [ctags, ref, virec, refont, and wildcard] are
2784Xonly one file long, so you should have no trouble compiling them.)
2785XThe "alias.c" file is meant to be compiled once into an executable named
2786X"ex.exe".
2787XYou should then copy "ex.exe" to "vi.exe" and "view.exe".
2788X.PP
2789X\*E stores its temporary files in C:\\tmp.
2790XIf this is not satisfactory, then you should edit the CFLAGS line of
2791Xyour Makefile to change TMPDIR to something else before compiling.
2792XYou can also control the name of the temp directory via an environment
2793Xvariable named TMP or TEMP.
2794XThe directory must exist before you can run \*E.
2795X.PP
2796XThe TERM environment variable determines how elvis will write to the screen.
2797XIt can be set to any one of the following values:
2798X.LD
2799X.ta 1.5i 2.5i
2800X pcbios Use BIOS calls on an IBM-PC clone.
2801X rainbow Use DEC Rainbow interface.
2802X ansi Use ANSI.SYS driver.
2803X nansi User faster NANSI.SYS driver.
2804X.DE
2805X.PP
2806XIf the TERM variable isn't set, then elvis will automatically select either
2807Xthe "rainbow" interface (when run on a Rainbow) or "pcbios" (on an IBM clone).
2808X.PP
2809XYou may prefer to use NANSI.SYS for speed;
2810Xor you may NEED to use ANSI.SYS for a non-clone, such as a lap-top.
2811XIf so, you should
2812Xinstall one of these drivers by adding "driver = nansi.sys" (or whatever)
2813Xto your CONFIG.SYS file,
2814Xand then you should define TERM to be "nansi" (or whatever) by adding
2815X"set TERM=nansi" to your AUTOEXEC.BAT file.
2816XYou must then reboot for these changes to take effect.
2817XAfter that, \*E will notice the "TERM" setting and use the driver.
2818X.PP
2819XSince ".exrc" is not a valid DOS filename,
2820Xthe name of the initialization file has been changed to "elvis.rc".
2821XElvis will look for an "elvis.rc" file first in your home directory,
2822Xand then in the current directory.
2823XNote that you must set an environment variable named "HOME" to the
2824Xfull pathname of your home directory, for Elvis to check there;
2825Xif "HOME" isn't set, then Elvis will only look in the current directory.
2826XTo set "HOME", you would typically add the following line to your
2827XAUTOEXEC.BAT file:
2828X.br
2829X.ti +0.5i
2830Xset HOME c:\\
2831X.PP
2832XAn extra program, called "wildcard", is needed for MS-DOS.
2833XIt expands wildcard characters in file names.
2834XIf \*E flashes a "Bad command or filename" message when it starts,
2835Xthen you've probably lost the WILDCARD.EXE program somehow.
2836X.PP
2837X\*E can run under Windows, but only in full-screen mode.
2838XAlso, Windows uses an environment variable called TEMP which interferes with
2839Xelvis' usage of TEMP;
2840Xto work around this, you can simply set an environment variable named
2841XTMP (with no 'E') to the name of elvis' temporary directory.
2842XWhen TEMP and TMP are both set, \*E uses TMP and ignored TEMP.
2843X.NH 2
2844XAtari TOS
2845X.PP
2846X\*E was ported to Atari TOS by Guntram Blohm and Martin Patzel.
2847XIt is very similar to the MS-DOS version.
2848XIt has been tested with the Mark Williams C compiler and also GNU-C.
2849X.PP
2850XThe TERM environment variable is ignored;
2851Xthe ST port always assumes that TERM=vt52.
2852XThe SHELL (not COMSPEC!) variable should be set to
2853Xthe name of a line-oriented shell.
2854X.PP
2855XA simple shell in included with \*E.
2856XIts source is in "shell.c", and the name of the executable is "shell.ttp".
2857XThe file "profile.sh" should contain a set of instructions to be executed
2858Xwhen the shell first starts up.
2859XAn example of this file is included, but you will almost certainly want to
2860Xedit it right away to match your configuration.
2861X(If you already have a command-line shell,
2862Xthen you'll probably want to continue using it.
2863XThe shell that comes with \*E is very limited.)
2864X.PP
2865XCurrently, character attributes cannot be displayed on the screen.
2866X.PP
2867X\*E runs under MiNT (a free multi-tasking extension to TOS)
2868Xbut it can be a CPU hog because of the way that \*E reads from the
2869Xkeyboard with timeout.
2870XAlso, \*E doesn't use any of the special features of MiNT.
2871XI have received a set of patches that optimize \*E for MiNT,
2872Xbut they arrived too late to integrate into this release.
2873X.NH 2
2874XOS9/68k
2875X.PP
2876X\*E was ported to OS9/68k by Peter Reinig.
2877X.PP
2878XThe Makefile is currently configured to install \*E and the related
2879Xprograms in /dd/usr/cmds
2880XIf this this is unacceptable, then you should change the BIN setting
2881Xto some other directory.
2882XSimilarly, it expects the source code to reside in /dd/usr/src/elvis;
2883Xthe ODIR setting is used to control this.
2884X.PP
2885XTemporary files are stored in the /dd/tmp directory.
2886XYour /dd/startup file may need to be modified
2887Xto prevent it from deleting \*E' temporary files;
2888Xmake /dd/startup run the \fIelvprsv\fR program before it wipes out /dd/tmp.
2889X.PP
2890XThe program in alias.c is linked repeatedly to produce the
2891X"vi", "view", and "input" aliases for \*E.
2892XSadly, the "ex" alias is impossible to implement under OS9
2893Xbecause the shell has a built-in command by that name.
2894X.PP
2895XFor some purposes,
2896Xyou must give `make' the "-b" option.
2897XSpecifically, you need this for "make -b clean" and "make -b install".
2898X.NH 2
2899XVAX/VMS
2900X.PP
2901XJohn Campbell ported \*E to VAX/VMS.
2902X.PP
2903XA heavily laden VAX can take half an hour to compile elvis.
2904XThis is normal.
2905XDon't panic.
2906X.PP
2907XWhile running, elvis will create temporary files in SYS$SCRATCH.
2908XEnter SHOW LOGICAL SYS$SCRATCH to see what actual directory you are using.
2909XMany sites have SYS$SCRATCH equivalenced to SYS$LOGIN.
2910XThe elvis temporary files look like the following on VMS while elvis is running:
2911X.br
2912X.ti 0.75i
2913XELV_1123A.1;1 ELV_1123A.2;1 SO070202.;1
2914X.PP
2915XAlso, filtering commands (like !!dir and !}fmt) should work on VMS.
2916XThis assumes, however, that you can create temporary mailboxes and that
2917Xyour mailbox quota (a sysgen parameter) is at least 256 bytes for a
2918Xsingle write to the mailbox.
2919XThis is the default sysgen parameter,
2920Xso there should be few people who experience filter problems.
2921X.PP
2922XAdditionally, an attempt was made to support the standard terminals on VMS:
2923X"vt52", "vt100", "vt200", "vt300", "vt101", "vt102".
2924XNon-standard terminals could be supported by setting your terminal type to
2925XUNKNOWN (by entering SET TERM/UNKNOWN)
2926Xand defining the logical name ELVIS_TERM.
2927XWhatever ELVIS_TERM translates to, however, will have to be included in
2928Xtinytcap.c.
2929XNote that the upper/lowercase distinctions are significant,
2930Xand that DCL will upshift characters that are not quoted strings, so
2931Xenter DEFINE ELVIS_TERM "hp2621a".
2932XAs distributed, it would probably not be a good idea to have more than the
2933Xstandard terminals in tinytcap.c (else it wouldn't be tiny, would it?).
2934XChanges here, of course, would require a recompilation to take effect.
2935X.PP
2936XIf you have a version of the "termcap" library and database on your system,
2937Xthen you may wish to replace tinytcap with the real termcap.
2938X.NH 2
2939XAmigaDOS
2940X.PP
2941XMike Rieser and Dale Rahn ported \*E to AmigaDOS.
2942X.PP
2943XThe port was done using Manx Aztec C version 5.2b.
2944X\*E uses about as much space as it can and still be small code and data.
2945X\*E should also compile under DICE, though there may be a little trouble with
2946Xsigned versus unsigned chars.
2947X.PP
2948XThe port has been done so the same binary will run under both versions of AmigaDOS.
2949XUnder AmigaDOS 2.04, \*E supports all the documented features.
2950XIt also uses an external program ref to do tag lookup.
2951XSo, the accompanying programs: ref and ctags are recommended.
2952XUnder AmigaDOS 1.2/1.3 \*E works, buts lacks the more advanced features.
2953X.PP
2954XFor the port to AmigaDOS 2.04, we tried to use as many Native AmigaDOS
2955Xcalls as we could.
2956XThis should increase Elvis's chances at being compiled with other compilers.
2957XDICE seems to have a different default char type.
2958XYou may need to use the UCHAR() macro in tio.c.
2959XTo test it, try the :map command; if it looks right, things are cool.
2960X.PP
2961XFor the port to AmigaDOS 1.3, we tried to make sure the program was at
2962Xleast usable.
2963XMany features are missing, most notably running commands in subshells.
2964XAlso, what we could get working, we used Aztec functions to support them,
2965Xso this part is little more compiler dependent.
2966X.PP
2967XAztec is compatible with the SAS libcall #pragma.
2968XI personally prefer using the includes that come from Commodore over the ones
2969Xsupplied with Aztec, but for people with a straight Aztec installation,
2970XI went with the default names for the Aztec pragmas.
2971X.PP
2972XOne include you'll need is <sys/types.h>.
2973XIts a common include when porting software just make yourself one.
2974XIts a two line file that saves a lot of hassle especially in the elvis source.
2975XSo, make a directory where your includes are located called `sys'
2976Xand in a file below that type:
2977X.br
2978X.ti +0.8i
2979X/* sys/types.h */
2980X.br
2981X.ti +0.8i
2982X#include <exec/types.h>
2983X.PP
2984XWhen setting environment variables (either local or global) for
2985Xvariables that specify a directory, make sure the variable ends in `:'
2986Xor `/'.
2987XThis saved from having to change much of the way elvis works.
2988XThe default temporary directory (if TEMP and TMP aren't specified) is "T:".
2989XThe default if HOME directory (if no HOME environment variable is set) is "S:".
2990X.PP
2991XTo avoid conlict with other uses, \*E uses elvis.rc instead of .exrc or
2992Xwhere it looks for macros.
2993X.NH 2
2994XOther Systems
2995X.PP
2996XFor Sun workstations, use the BSD configuration.
2997XEarlier versions of elvis didn't link correctly due to a quirk in Sun's
2998Xversion of the "make" utility, but this version of elvis has a work-around
2999Xfor that quirk so you should have no trouble at all.
3000X.PP
3001XFor Linux, use the SysV settings.
3002XYou can probably just remove the "-lterm" from the "LIBS= -lterm" line,
3003Xsince linux keeps the termcap functions in the standard C library.
3004X.PP
3005XFor other UNIXoid systems, I suggest you start with the Minix-68k settings
3006Xand then grow from that.
3007XMinix is a nice starting point because it is a clone of Version 7 UNIX,
3008Xwhich was the last common ancestor of BSD UNIX and SysV UNIX.
3009XAny Operating System which claims any UNIX compatibility what so ever
3010Xwill therefore support V7/Minix code.
3011XYou may need to fiddle with #include directives or something, though.
3012XMinix-68k is a better starting point than Minix-PC because the PC compiler
3013Xhas some severe quirks.
3014/
3015echo x - visual.ms
3016sed '/^X/s///' > visual.ms << '/'
3017X.Go 2 "VISUAL MODE COMMANDS"
3018X.PP
3019XMost visual mode commands are one keystroke long.
3020XThe following table lists the operation performed by each keystroke,
3021Xand also denotes any options or arguments that it accepts.
3022XNotes at the end of the table describe the notation used in this table.
3023X.PP
3024XIn addition to the keys listed here, your keyboard's "arrow" keys
3025Xwill be interpretted as the appropriate cursor movement commands.
3026XThe same goes for <PgUp> and <PgDn>, if your keyboard has them.
3027XThe <Insert> key will toggle between insert mode and replace mode.
3028XThere is a colon mode command (":map", to be described later)
3029Xwhich will allow you to define other keys, such as function keys.
3030X.PP
3031XA tip: visual command mode looks a lot like text input mode.
3032XIf you forget which mode you're in, just hit the <Esc> key.
3033XIf \*E beeps, then you're in visual command mode.
3034XIf \*E does not beep, then you were in input mode,
3035Xbut by hitting <Esc> you will have switched to visual command mode.
3036XSo, one way or another, after <Esc> \*E will be ready for a command.
3037X.LD
3038X.ta 0.7i 1.3i
3039X\s+2COMMAND DESCRIPTION\s-2
3040X ^A Search for next occurence of word at cursor (MOVE)(EXT)
3041X ^B Move toward the top of the file by 1 screenful
3042X ^C --- (usually sends SIGINT, to interupt a command)
3043Xcount ^D Scroll down <count> lines (default 1/2 screen)
3044Xcount ^E Scroll up <count> lines
3045X ^F Move toward the bottom of the file by 1 screenful
3046X ^G Show file status, and the current line #
3047Xcount ^H Move left, like h (MOVE)
3048X ^I ---
3049Xcount ^J Move down (MOVE)
3050X ^K ---
3051X ^L Redraw the screen
3052Xcount ^M Move to the front of the next line (MOVE)
3053Xcount ^N Move down (MOVE)
3054X ^O ---
3055Xcount ^P Move up (MOVE)
3056X ^Q --- (typically XON, which restarts screen updates)
3057X ^R Redraw the screen
3058X ^S --- (typically XOFF, which stops screen updates)
3059X ^T ---
3060Xcount ^U Scroll up <count> lines (default 1/2 screen)
3061X ^V ---
3062X ^W ---
3063Xcount ^X Move to a physical column number on the screen (MOVE) (EXT)
3064Xcount ^Y Scroll down <count> lines
3065X ^Z --- (sometimes sends SIGSUSP, to suspend execution)
3066X ESC ---
3067X ^\\ --- (usually sends SIGQUIT, which is ignored)
3068X ^] If the cursor is on a tag name, go to that tag
3069X ^^ Switch to the previous file, like ":e #"
3070X ^_ ---
3071Xcount SPC Move right,like l (MOVE)
3072X ! \s-2mv\s+2 Run the selected lines thru an external filter program
3073X " \s-2key\s+2 Select which cut buffer to use next
3074Xcount # \s-2+\s+2 Increment a number (EDIT) (EXT)
3075X $ Move to the rear of the current line (MOVE)
3076Xcount % Move to matching (){}[] or to a given % of file (MOVE) (EXT)
3077Xcount & Repeat the previous ":s//" command here (EDIT)
3078X ' \s-2key\s+2 Move to a marked line (MOVE)
3079Xcount ( Move backward <count> sentences (MOVE)
3080Xcount ) Move forward <count> sentences (MOVE)
3081X * Go to the next error in the errlist (EXT)
3082Xcount + Move to the front of the next line (MOVE)
3083Xcount , Repeat the previous [fFtT] but in the other direction (MOVE)
3084Xcount - Move to the front of the preceding line (MOVE)
3085Xcount . Repeat the previous "edit" command
3086X / \s-2text\s+2 Search forward for a given regular expression (MOVE)
3087X 0 If not part of count, move to 1st char of this line (MOVE)
3088X 1 Part of count
3089X 2 Part of count
3090X 3 Part of count
3091X 4 Part of count
3092X 5 Part of count
3093X 6 Part of count
3094X 7 Part of count
3095X 8 Part of count
3096X 9 Part of count
3097X : \s-2text\s+2 Run single EX cmd
3098Xcount ; Repeat the previous [fFtT] cmd (MOVE)
3099X < \s-2mv\s+2 Shift text left (EDIT)
3100X = \s-2mv\s+2 Reformat
3101X > \s-2mv\s+2 Shift text right (EDIT)
3102X ? \s-2text\s+2 Search backward for a given regular expression (MOVE)
3103X @ \s-2key\s+2 Execute the contents of a cut-buffer as VI commands
3104Xcount A \s-2inp\s+2 Append at end of the line (EDIT)
3105Xcount B Move back Word (MOVE)
3106X C \s-2inp\s+2 Change text from the cursor through the end of the line (EDIT)
3107X D Delete text from the cursor through the end of the line (EDIT)
3108Xcount E Move end of Word (MOVE)
3109Xcount F \s-2key\s+2 Move leftward to a given character (MOVE)
3110Xcount G Move to line #<count> (default is the bottom line) (MOVE)
3111Xcount H Move to home row (the line at the top of the screen)
3112Xcount I \s-2inp\s+2 Insert at the front of the line (after indents) (EDIT)
3113Xcount J Join lines, to form one big line (EDIT)
3114X K Look up keyword (EXT)
3115Xcount L Move to last row (the line at the bottom of the screen)
3116X M Move to middle row
3117X N Repeat previous search, but in the opposite direction (MOVE)
3118Xcount O \s-2inp\s+2 Open up a new line above the current line (EDIT)
3119X P Paste text before the cursor (EDIT)
3120X Q Quit to EX mode
3121X R \s-2inp\s+2 Overtype (EDIT)
3122Xcount S \s-2inp\s+2 Change lines, like <count>cc
3123Xcount T \s-2key\s+2 Move leftward *almost* to a given character (MOVE)
3124X U Undo all recent changes to the current line
3125X V Start marking lines for c/d/y/</>/!/\\ (EXT)
3126Xcount W Move forward <count> Words (MOVE)
3127Xcount X Delete the character(s) to the left of the cursor (EDIT)
3128Xcount Y Yank text line(s) (copy them into a cut buffer)
3129X Z Z Save the file & exit
3130X [ [ Move back 1 section (MOVE)
3131X \\ \s-2mv\s+2 Pop-up menu for modifying text (EXT)
3132X ] ] Move forward 1 section (MOVE)
3133X ^ Move to the front of the current line (after indent) (MOVE)
3134Xcount _ Move to the current line
3135X ` \s-2key\s+2 Move to a marked character (MOVE)
3136Xcount a \s-2inp\s+2 Insert text after the cursor (EDIT)
3137Xcount b Move back <count> words (MOVE)
3138X c \s-2mv\s+2 Change text (EDIT)
3139X d \s-2mv\s+2 Delete text (EDIT)
3140Xcount e Move forward to the end of the current word (MOVE)
3141Xcount f \s-2key\s+2 Move rightward to a given character (MOVE)
3142X g ---
3143Xcount h Move left (MOVE)
3144Xcount i \s-2inp\s+2 Insert text at the cursor (EDIT)
3145Xcount j Move down (MOVE)
3146Xcount k Move up (MOVE)
3147Xcount l Move right (MOVE)
3148X m \s-2key\s+2 Mark a line or character
3149X n Repeat the previous search (MOVE)
3150Xcount o \s-2inp\s+2 Open a new line below the current line (EDIT)
3151X p Paste text after the cursor (EDIT)
3152X q ---
3153Xcount r \s-2key\s+2 Replace <count> chars by a given character (EDIT)
3154Xcount s \s-2inp\s+2 Replace <count> chars with text from the user (EDIT)
3155Xcount t \s-2key\s+2 Move rightward *almost* to a given character (MOVE)
3156X u Undo the previous edit command
3157X v Start marking characters for c/d/y/</>/!/\\ (EXT)
3158Xcount w Move forward <count> words (MOVE)
3159Xcount x Delete the character that the cursor's on (EDIT)
3160X y \s-2mv\s+2 Yank text (copy it into a cut buffer)
3161X z \s-2key\s+2 Scroll current line to the screen's +=top -=bottom .=middle
3162Xcount { Move back <count> paragraphs (MOVE)
3163Xcount | Move to column <count> (the leftmost column is 1)
3164Xcount } Move forward <count> paragraphs (MOVE)
3165Xcount ~ Switch a character between uppercase & lowercase (EDIT)
3166X DEL --- (usually mapped to shift-X, so it deletes one character)
3167X.DE
3168X.IP count
3169XMany commands may be preceded by a count. This is a sequence of digits
3170Xrepresenting a decimal number. For most commands that use a count,
3171Xthe command is repeated <count> times. The count is always optional,
3172Xand usually defaults to 1.
3173X.IP key
3174XSome commands require two keystrokes. The first key always determines
3175Xwhich command is to be executed. The second key is used as a parameter
3176Xto the command.
3177X.IP mv
3178XSome commands (! < > c d y \\ =) operate on text between the cursor and some
3179Xother position.
3180XThere are three ways that you can specifify that other position.
3181X.IP
3182XThe first way is to follow the command keystroke with a movement command.
3183XFor example, "dw" deletes a single word.
3184X"d3w" and "3dw" both delete three words.
3185X.IP
3186XThe second way is to type the command keystroke twice.
3187XThis causes whole lines to be acted upon.
3188XFor example, ">>" indents the current line.
3189X"3>>" indents the current line and the following two lines.
3190X.IP
3191XThe last way is to move the cursor to one end of the text,
3192Xtype 'v' or 'V' to start marking,
3193Xmove the cursor to the other end,
3194Xand then type the desired command key.
3195X.IP inp
3196XMany commands allow the user to interactively enter text.
3197XSee the discussion of "input mode" in the following section.
3198X.IP (EXT)
3199XThese commands are extensions -- the real vi doesn't have them.
3200X.IP (EDIT)
3201XThese commands affect text, and may be repeated by the "." command.
3202X.IP (MOVE)
3203XThese commands move the cursor, and may be used to specify the extent
3204Xof a member of the "mv" class of commands.
3205X.NH 2
3206XInput Mode
3207X.PP
3208XYou can't type text into your file directly from visual command mode.
3209XInstead, you must first give a command which will put you into input mode.
3210XThe commands to do this are A/C/I/O/R/S/a/i/o/s.
3211X.PP
3212XThe S/s/C/c commands temporarily place a $ at the end of the text that
3213Xthey are going to change.
3214X.PP
3215XIn input mode, all keystrokes are inserted into the text at the
3216Xcursor's position, except for the following:
3217X.ID
3218X^A insert a copy of the last input text
3219X^D delete one indent character
3220X^H (backspace) erase the character before the cursor
3221X^L redraw the screen
3222X^M (carriage return) insert a newline (^J, linefeed)
3223X^O execute next key as a visual command (limited!)
3224X^P insert the contents of the cut buffer
3225X^R redraw the screen, like ^L
3226X^T insert an indent character
3227X^U backspace to the beginning of the line
3228X^V insert the following keystroke, even if special
3229X^W backspace to the beginning of the current word
3230X^Z^Z write the file & exit \*E
3231X^[ (ESCape) exit from input mode, back to command mode
3232X.DE
3233X.PP
3234XAlso, on some systems, ^S may stop output, ^Q may restart output,
3235Xand ^C may interupt execution.
3236X^@ (the NUL character) cannot be inserted.
3237X.PP
3238XThe R visual command puts you in overtype mode,
3239Xwhich is a slightly different form of input mode.
3240XIn overtype mode, each time you insert a character,
3241Xone of the old characters is deleted from the file.
3242X.NH 2
3243XArrow keys in Input Mode
3244X.PP
3245XThe arrow keys can be used to move the cursor in input mode.
3246X(This is an extension; the real Vi doesn't support arrow keys in input mode.)
3247XThe <PgUp>, <PgDn>, <Home>, and <End> keys work in input mode, too.
3248XThe <Delete> key deletes a single character in input mode.
3249XThe <Insert> key toggles between input mode and replace mode.
3250X.PP
3251XThe best thing about allowing arrow keys to work in input mode is that
3252Xas long as you're in input mode,
3253X\*E seems to have a fairly ordinary user interface.
3254XWith most other text editors, you are always in either insert mode or
3255Xreplace mode, and you can use the arrow keys at any time to move the cursor.
3256XNow, \*E can act like that, too.
3257XIn fact, with the new "inputmode" option and the "control-Z control-Z" input
3258Xcommand, you may never have to go into visual command mode for simple edit
3259Xsessions.
3260X.NH 2
3261XDigraphs
3262X.PP
3263X\*E supports digraphs as a way to enter non-ASCII characters.
3264XA digraph is a character which is composed of two other characters.
3265XFor example, an apostrophe and the letter i could be defined as a digraph
3266Xwhich is to be stored & displayed as an accented i.
3267X.PP
3268XThere is no single standard for extended ASCII character sets.
3269X\*E can be compiled to fill the digraph with values appropriate for
3270Xeither the IBM PC character set, or the LATIN-1 character set used by
3271XX windows, or neither.
3272X(See the discussions of -DCS_IBMPC and -DCS_LATIN1 in the CFLAGS section
3273Xof this manual.)
3274XYou can view or edit the digraph table via the ":digraph" colon command.
3275X.PP
3276XDigraphs will not be recognized until you've entered ":set digraph".
3277X.PP
3278XTo actually use a digraph
3279Xtype the first character, then hit <Backspace>, and then type the
3280Xsecond character.
3281X\*E will then substitute the non-ASCII character in their place.
3282X.NH 2
3283XAbbreviations
3284X.PP
3285X\*E can expand abbreviations for you.
3286XYou define an abbreviation with the :abbr command,
3287Xand then whenever you type in the abbreviated form while in input mode,
3288X\*E will immediately replace it with the long form.
3289XCOBOL programmers should find this useful. :-)
3290X.PP
3291X\*E doesn't perform the substitution until you type a non-alphanumeric
3292Xcharacter to mark the end of the word.
3293XIf you type a control-V before that non-alphanumeric character, then
3294X\*E will not perform the substitution.
3295X.NH 2
3296XAuto-Indent
3297X.PP
3298XWith the ":set autoindent" option turned on,
3299X\*E will automatically insert leading whitespace at the beginning of each
3300Xnew line that you type in.
3301XThe leading whitespace is copied from the preceding line.
3302X.PP
3303XTo add more leading whitespace, type control-T.
3304XTo remove some whitespace, type control-D.
3305X.PP
3306XIf you ":set noautotab", then the whitespace generated by control-T will
3307Xalways consist of spaces -- never tabs.
3308XSome people seem to prefer this.
3309X.PP
3310X\*E' autoindent mode isn't 100% compatible with vi's.
3311XIn \*E, 0^D and ^^D don't work,
3312X^U can wipeout all indentation,
3313Xand sometimes \*E will use a different amount of indentation than vi would.
3314/
Note: See TracBrowser for help on using the repository browser.