source: trunk/minix/man/man9/elvis.9@ 15

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

Minix 3.1.2a

File size: 36.4 KB
Line 
1.so mnx.mac
2.TH ELVIS 9
3.CD "elvis \(en clone of the Berkeley vi editor"
4.SX "elvis \fR[\fB\(enRerv\fR] [\fB\(ent \fItag\fR] \fR[\fIfile\fR] ..."
5.FL "\(enR" "Set the read-only option"
6.FL "\(ene" "Start up emulating \fIex\fR"
7.FL "\(enr" "Tell the user to use \fIelvrec\fR instead
8.FL "\(ent" "Start editing at the given tag"
9.FL "\(env" "Start up emulating \fIvi\fR"
10.EX "elvis" "Call the editor"
11.EX "elvis prog.c" "edit \fIprog.c\fR"
12.PP
13\fIElvis\fR is a full-screen editor closely modeled on the famous Berkeley
14\fIvi\fR editor.
15It provides essentially the same interface to the user as \fIvi\fR, but the
16code is completely new, written from scratch.
17This document provides a brief introduction to \fIvi\fR.
18It is not intended as a tutorial for beginners.
19Most books on
20.Ux
21cover \fIvi\fR.
22.PP
23Like \fIvi\fR, \fIelvis\fR can operate as a screen editor
24(\fIvi\fR mode) or as a line editor (\fIex\fR) mode.
25It can be called either as \fIelvis\fR \fIvi\fR,or as \fIex\fR,
26depending on which is desired.
27They are all links to the same file.
28.SS "Vi Commands"
29.PP
30Below is a list of the \fIvi\fR commands supported.
31The following symbols are used in the table:
32.HS
33.in +1.25i
34.ta +1.0i
35.ti -1.0i
36count Integer parameter telling how many or how much
37.ti -1.0i
38key One character parameter to the command
39.ti -1.0i
40inp Interactive input expected
41.ti -1.0i
42mv Indicates how much for commands like \fIdelete\fR and \fIchange\fR:
43.in +0.8i
44.ta +0.3i
45.ti -0.3i
46( Previous sentence
47.ti -0.3i
48) Next sentence
49.ti -0.3i
50{ Previous paragraph
51.ti -0.3i
52} Next paragraph (delimited by blank line, \fI.PP, .LP, .IP\fR etc.)
53.ti -0.3i
54[ Previous section (delimited by \fI.SH\fR or \fI.NH\fR)
55.br
56A repeated command character means the scope is this line
57.in -0.8i
58.ta +1.0i
59.ti -1.0i
60MOVE Indicates commands that may also be used where \fImv\fR is specified
61.ti -1.0i
62EDIT These commands affect text and may be repeated by the \fI.\fR command
63.in -1.25i
64.HS
65In addition to the above notation, the caret (^) is used as an abbreviation
66for CTRL.
67For example, ^A means CTRL-A.
68.HS
69.in +2i
70.ta +1i +1i +3.3i
71.ti -2i
72\fBCount~~~~ Command Description Type\fR
73.ti -2i
74 ^A (Not defined)
75.ti -2i
76 ^B Move toward the top of the file by 1 screenful
77.ti -2i
78 ^C (Not defined)
79.ti -2i
80count ^D Scroll down \fIcount\fR lines (default 1/2 screen)
81.ti -2i
82count ^E Scroll up \fIcount\fR lines
83.ti -2i
84 ^F Move toward the bottom of the file by 1 screenful
85.ti -2i
86 ^G Show file status, and the current line
87.ti -2i
88count ^H Move left, like \fIh\fR MOVE
89.ti -2i
90 ^I (Not defined)
91.ti -2i
92count ^J Move down MOVE
93.ti -2i
94 ^K (Not defined)
95.ti -2i
96 ^l Redraw the screen
97.ti -2i
98count ^M Move to the front of the next line MOVE
99.ti -2i
100count ^N Move down MOVE
101.ti -2i
102 ^O (Not defined)
103.ti -2i
104count ^P Move up MOVE
105.ti -2i
106 ^Q (Not defined)
107.ti -2i
108 ^R Redraw the screen
109.ti -2i
110 ^S (Not defined)
111.ti -2i
112 ^T (Not defined)
113.ti -2i
114count ^U Scroll up \fIcount\fR lines (default 1/2 screen)
115.ti -2i
116 ^V (Not defined)
117.ti -2i
118 ^W (Not defined)
119.ti -2i
120 ^X (Not defined)
121.ti -2i
122count ^Y Scroll down \fIcount\fR lines
123.ti -2i
124 ^Z (Not defined)
125.ti -2i
126 ESC (Not defined)
127.ti -2i
128 ^\e (Not defined)
129.ti -2i
130 ^] If the cursor is on a tag name, go to that tag
131.ti -2i
132 ^^ Save this file and edit the previous file
133.ti -2i
134 ^_ (Not defined)
135.ti -2i
136count SPACE Move right,like \fIl\fR MOVE
137.ti -2i
138 ! mv Run the selected lines thru an external filter program
139.ti -2i
140 " key Select which cut buffer to use next
141.ti -2i
142 # (Not defined)
143.ti -2i
144 $ Move to the rear of the current line MOVE
145.ti -2i
146 % move to the matching (){}[] character MOVE
147.ti -2i
148 & (Not defined)
149.ti -2i
150 ' key Move to a marked line MOVE
151.ti -2i
152count ( Move backward \fIcount\fR sentences MOVE
153.ti -2i
154count ) Move forward \fIcount\fR sentences MOVE
155.ti -2i
156 * (Not defined)
157.ti -2i
158count + Move to the front of the next line MOVE
159.ti -2i
160count , Repeat the previous [\fIfFtT\fR] but the other way MOVE
161.ti -2i
162count \(en Move to the front of the preceding line MOVE
163.ti -2i
164 . Repeat the previous \*(OQedit\*(CQ command
165.ti -2i
166 / Text search forward for a given regular expr MOVE
167.ti -2i
168 0 If not part of count, move to 1st char of this line MOVE
169.ti -2i
170 1 Part of count
171.ti -2i
172 2 Part of count
173.ti -2i
174 3 Part of count
175.ti -2i
176 4 Part of count
177.ti -2i
178 5 Part of count
179.ti -2i
180 6 Part of count
181.ti -2i
182 7 Part of count
183.ti -2i
184 8 Part of count
185.ti -2i
186 9 Part of count
187.ti -2i
188 : Text. Run single \fIex\fR cmd
189.ti -2i
190count ; Repeat the previous [fFtT] cmd MOVE
191.ti -2i
192count < mv Shift text left EDIT
193.ti -2i
194 = (Not defined)
195.ti -2i
196count > mv Shift text right EDIT
197.ti -2i
198 ? text Search backward for a given regular expression MOVE
199.ti -2i
200 @ (Not defined)
201.ti -2i
202count A inp Append at end of the line EDIT
203.ti -2i
204count B Move back Word MOVE
205.ti -2i
206 C inp Change text from cursor through end of line EDIT
207.ti -2i
208 D Delete text from cursor through end of line EDIT
209.ti -2i
210count E Move end of Word MOVE
211.ti -2i
212count F key Move leftward to a given character MOVE
213.ti -2i
214count G Move to line #\fIcount\fR (default is the bottom line) MOVE
215.ti -2i
216count H Move to home row (the line at the top of the screen)
217.ti -2i
218count I inp Insert at the front of the line (after indents) EDIT
219.ti -2i
220count J Join lines, to form one big line EDIT
221.ti -2i
222 K Look up keyword
223.ti -2i
224count L Move to last row (the line at the bottom of the screen)
225.ti -2i
226 M Move to middle row (the line in the middle)
227.ti -2i
228 N Repeat previous search, but the opposite way MOVE
229.ti -2i
230count O inp Open up a new line above the current line EDIT
231.ti -2i
232 P Paste text before the cursor
233.ti -2i
234 Q Quit to EX mode
235.ti -2i
236 R inp Overtype EDIT
237.ti -2i
238count S inp Change lines, like \fIcount\fRcc
239.ti -2i
240count T key Move leftward \fIalmost\fR to a given character MOVE
241.ti -2i
242 U Undo all recent changes to the current line
243.ti -2i
244 V (Not defined)
245.ti -2i
246count W Move forward \fIcount\fR Words MOVE
247.ti -2i
248count X Delete the character(s) to the left of the cursor EDIT
249.ti -2i
250count Y Yank text line(s) (copy them into a cut buffer)
251.ti -2i
252 Z Z Save the file & exit
253.ti -2i
254 [ [ Move back 1 section MOVE
255.ti -2i
256 \e (Not defined)
257.ti -2i
258 ] ] Move forward 1 section MOVE
259.ti -2i
260 ^ Move to the front of the current line (after indent) MOVE
261.ti -2i
262 \(ul (Not defined)
263.ti -2i
264 ` key Move to a marked character MOVE
265.ti -2i
266count a inp Insert text after the cursor EDIT
267.ti -2i
268count b Move back \fIcount\fR words MOVE
269.ti -2i
270 c mv Change text EDIT
271.ti -2i
272 d mv Delete text EDIT
273.ti -2i
274count e Move forward to the end of the current word MOVE
275.ti -2i
276count f key Move rightward to a given character MOVE
277.ti -2i
278 g (Not defined)
279.ti -2i
280count h Move left MOVE
281.ti -2i
282count i inp Insert text at the cursor EDIT
283.ti -2i
284count j Move down MOVE
285.ti -2i
286count k Move up MOVE
287.ti -2i
288count l Move right MOVE
289.ti -2i
290 m key Mark a line or character
291.ti -2i
292 n Repeat the previous search MOVE
293.ti -2i
294count o inp Open a new line below the current line EDIT
295.ti -2i
296 p Paste text after the cursor
297.ti -2i
298 q (Not defined)
299.ti -2i
300count r key Replace \fIcount\fR chars by a given character EDIT
301.ti -2i
302count s inp Replace \fIcount\fR chars with text from the user EDIT
303.ti -2i
304count t key Move rightward \fIalmost\fR to a given character MOVE
305.ti -2i
306 u Undo the previous edit command
307.ti -2i
308 v (Not defined)
309.ti -2i
310count w Move forward \fIcount\fR words MOVE
311.ti -2i
312count x Delete the character that the cursor's on EDIT
313.ti -2i
314 y mv Yank text (copy it into a cut buffer)
315.ti -2i
316 z key Scroll current line to the screen's +=top -=bottom .=middle
317.ti -2i
318count { Move back \fIcount\fR paragraphs MOVE
319.ti -2i
320count | Move to column \fIcount\fR (the leftmost column is 1)
321.ti -2i
322count } Move forward \fIcount\fR paragraphs MOVE
323.ti -2i
324.tr ~~
325count \(ap Switch a character between upper & lower case EDIT
326.tr ~
327.ti -2i
328 DEL (Not defined)
329.in -2i
330.SS "Ex Commands"
331.PP
332Below is a list of the \fIex\fR commands supported. All can be abbreviated.
333.UU "General"
334.LP
335.nf
336.ta 1.2i 2.4i
337[line] append
338 args [files]
339 cd [directory]
340 chdir [directory]
341[line][,line] change
342[line][,line] copy line
343[line][,line] debug[!]
344[line][,line] Delete [\*(CQx]
345 edit[!] [file]
346 ex[!] [file]
347 file
348[line][,line] global /regexp/ command
349[line] Insert
350[line][,line] join
351[line][,line] list
352 map[!] key mapped_to
353[line] mark x
354 mkexrc
355[line][,line] Move line
356 next[!] [files]
357 Next[!]
358 previous[!]
359[line][,line] print
360[line] put [\*(CQx]
361 quit[!]
362[line] read file
363 rewind[!]
364 set [options]
365[line][,line] substitute /regexp/replacement/[p][g]
366 tag[!] tagname
367[line][,line] to line
368 Undo
369 unmap[!] key
370 validate[!]
371 version
372[line][,line] vglobal /regexp/ command
373 visual
374 wq
375[line][,line] write[!] [[>>]file]
376 xit[!]
377[line][,line] yank [\*(CQx]
378[line][,line] ! command
379[line][,line] <
380[line][,line] =
381[line][,line] >
382.SP 0.25
383.UU "Text Entry"
384.SP 0.25
385.LP
386.ta 1.2i 2.4i
387.nf
388[line] append
389[line][,line] change [\*(CQx]
390[line] Insert
391.fi
392
393The (a)ppend command inserts text after the specified line.
394
395The (i)nsert command inserts text before the specified line.
396
397The (c)hange command copies the range of lines into a cut buffer,
398deletes them, and inserts new text where the old text used to be.
399
400For all of these commands, you indicate the end of the text you're
401inserting by hitting ^D or by entering a line which contains only
402a period.
403.SP 0.25
404.UU "Cut & Paste"
405.SP 0.25
406.LP
407.ta 1.2i 2.4i
408.nf
409[line][,line] Delete [\*(CQx]
410[line][,line] yank [\*(CQx]
411[line] put[!] [\*(CQx]
412[line][,line] copy line
413[line][,line] to line
414[line][,line] Move line
415
416.fi
417The (d)elete command copies the specified range of lines into a
418cut buffer, and then deletes them.
419
420The (y)ank command copies the specified range of lines into a cut
421buffer, but does \fInot\fR delete them.
422
423The (pu)t command inserts text from a cut buffer after the specified
424line\(emor before it if the ! is present.
425
426The (co)py and (t)o commands yank the specified range of lines and then
427immediately paste them after some other line.
428
429The (m)ove command deletes the specified range of lines and then
430immediately pastes them after some other line. If the destination
431line comes after the deleted text, then it will be adjusted
432automatically to account for the deleted lines.
433.UU "Displaying Text"
434.LP
435.ta 1.2i 2.4i
436.nf
437[line][,line] print
438[line][,line] list
439
440.fi
441The (p)rint command displays the specified range of lines.
442
443The (l)ist command also displays them, but it is careful to make
444control characters visible.
445.UU "Global Operations"
446.LP
447.ta 1.2i 2.4i
448.nf
449[line][,line] global /regexp/ command
450[line][,line] vglobal /regexp/ command
451
452.fi
453The (g)lobal command searches through the lines of the specified range
454(or through the whole file if no range is specified) for lines that
455contain a given regular expression. It then moves the cursor to each
456of these lines and runs some other command on them.
457
458The (v)global command is similar, but it searches for lines that
459\fIdo not\fR contain the regular expression.
460.UU "Line Editing"
461.LP
462.ta 1.2i 2.4i
463.nf
464[line][,line] join
465[line][,line] ! program
466[line][,line] <
467[line][,line] >
468[line][,line] substitute /regexp/replacement/[p][g]
469
470.fi
471The (j)oin command concatenates all lines in the specified range together
472to form one big line. If only a single line is specified, then the
473following line is catenated onto it.
474
475The ! command runs an external filter program, and feeds the specified
476range of lines to it's stdin. The lines are then replaced by the
477output of the filter. A typical example would be \*(OQ:'a,'z!sort -n\*(CQ to
478sort the lines 'a,'z according to their numeric values.
479
480The < and > commands shift the specified range of lines left or right,
481normally by the width of 1 tab character. The \*(OQshiftwidth\*(CQ option
482determines the shifting amount.
483
484The (s)ubstitute command finds the regular expression in each line,
485and replaces it with the replacement text. The \*(OQp\*(CQ option causes
486the altered lines to be printed, and the \*(OQg\*(CQ option permits all
487instances of the regular expression to be found & replaced. (Without
488\*(OQg\*(CQ, only the first occurrence is replaced.)
489.SP 0.25
490.UU "Undo"
491.SP 0.25
492.LP
493.ta 1.2i 2.4i
494.nf
495 undo
496
497.fi
498The (u)ndo command restores the file to the state it was in before your
499most recent command which changed text.
500.SP 0.25
501.UU "Configuration & Status"
502.SP 0.25
503.LP
504.ta 1.2i 2.4i
505.nf
506 map[!] [key mapped_to]
507 unmap[!] key
508 set [options]
509 mkexrc
510[line] mark x
511 visual
512 version
513[line][,line] =
514 file
515
516.fi
517The (ma)p command allows you to configure \fIelvis\fR to recognize your
518function keys, and treat them as though they transmitted some other
519sequence of characters. Normally this mapping is done only when in
520the visual command mode, but with the [!] present it will map keys
521under all contexts. When this command is given with no arguments,
522it prints a table showing all mappings currently in effect. When
523called with two arguments, the first is the sequence that your
524function key really sends, and the second is the sequence that you
525want \fIelvis\fR to treat it as having sent.
526
527The (unm)ap command removes key definitions that were made via the
528map command.
529
530The (se)t command allows you examine or set various options. With
531no arguments, it displays the values of options that have been
532changed. With the single argument \*(OQall\*(CQ it displays the values of
533all options, regardless of whether they've been explicitly set or
534not. Otherwise, the arguments are treated as options to be set.
535
536The (mk)exrc command saves the current configuration to a file
537called \fI.exrc\fR in the current directory.
538
539The mar(k) command defines a named mark to refer to a specific place
540in the file. This mark may be used later to specify lines for other
541commands.
542
543The (vi)sual command puts the editor into visual mode. Instead of
544emulating ex, \fIelvis\fR will start emulating vi.
545
546The (ve)rsion command tells you that what version of \fIelvis\fR this is.
547
548The = command tells you what line you specified, or, if you specified
549a range of lines, it will tell you both endpoints and the number of
550lines included in the range.
551
552The file command tells you the name of the file, whether it has been
553modified, the number of lines in the file, and the current line number.
554.UU "Multiple Files"
555.LP
556.ta 1.2i 2.4i
557.nf
558 args [files]
559 next[!] [files]
560 Next[!]
561 previous[!]
562 rewind[!]
563
564.fi
565When you invoke \fIelvis\fR from your shell's command line, any filenames
566that you give to \fIelvis\fR as arguments are stored in the args list. The
567(ar)gs command will display this list, or define a new one.
568
569The (n)ext command switches from the current file to the next one in
570the args list. You may specify a new args list here, too.
571
572The (N)ext and (pre)vious commands (they're really aliases for the same
573command) switch from the current file to the preceding file in the
574args list.
575
576The (rew)ind command switches from the current file to the first file
577in the args list.
578.SP 1
579.UU "Switching Files"
580.SP 1
581.LP
582.ta 1.2i 2.4i
583.nf
584 edit[!] [file]
585 tag[!] tagname
586
587.fi
588The (e)dit command allows to switch from the current file to some other
589file. This has nothing to do with the args list, by the way.
590
591The (ta)g command looks up a given tagname in a file called \*(OQtags".
592This tells it which file the tag is in, and how to find it in that file.
593\fIElvis\fR then switches to the tag's file and finds the tag.
594.SP 1
595.UU "Exiting"
596.SP 1
597.LP
598.ta 1.2i 2.4i
599.nf
600 quit[!]
601 wq
602 xit
603
604.fi
605The (q)uit command exits from the editor without saving your file.
606
607The (wq) and (x)it commands (really two names for the same command)
608both write the file before exiting.
609.UU "File I/O"
610.LP
611.ta 1.2i 2.4i
612.nf
613[line] read file
614[line][,line] write[!][[>>]file]
615
616.fi
617The (r)ead command gets text from another file and inserts it after
618the specified line.
619
620.fi
621The (w)rite command writes the whole file, or just part of it, to
622some other file. The !, if present, will permit the lines to be
623written even if you've set the readonly option. If you precede the
624filename by >> then the lies will be appended to the file.
625.UU "Directory"
626.LP
627.ta 1.2i 2.4i
628.nf
629 cd [directory]
630 chdir [directory]
631 shell
632
633.fi
634The (cd) and (chd)ir commands (really two names for one command)
635switch the current working directory.
636
637The (sh)ell command starts an interactive shell.
638.SP 0.5
639.UU "Debugging"
640.SP 0.5
641.LP
642.ta 1.2i 2.4i
643.nf
644[line][,line] debug[!]
645 validate[!]
646
647.fi
648These commands are only available if you compile \fIelvis\fR with the
649\fB-DDEBUG\fR flag.
650
651The de(b)ug command lists stats for the blocks which contain the
652specified range of lines. If the ! is present, then the contents
653of those blocks is displayed, too.
654
655The (va)lidate command checks certain variables for internal
656consistency. Normally it does not output anything unless it detects
657a problem. With the !, though, it will always produce *some*
658output.
659.SP 0.5
660.SS "Extensions"
661.SP 0.5
662.PP.
663.ta 1i
664.in +0.25i
665In addition to the standard commands, a variety of extra features are
666present in \fIelvis\fR that are not present in \fIvi\fR.
667They are described below.
668
669.ti -0.25i
670.B .exrc
671.br
672\fIElvis\fR first runs a \fI.exrc\fR file (if there is one) from your $HOME
673directory. After that, it runs a \fI.exrc\fR (if there is one) from the
674current directory. The one in the current directory may override
675settings made by the one in the $HOME directory.
676
677.ti -0.25i
678.B :mkexrc
679.ti -0.25i
680.B :mk
681.br
682This EX command saves the current :set and :map configurations in
683the \*(OQ.exrc\*(CQ file in your current directory.
684
685.ti -0.25i
686.B :args
687.ti -0.25i
688.B :ar
689.br
690You can use the :args command to define a new args list, as in:
691
692 :args *.h
693
694After you have defined a new args list, the next time you issue a
695:next command \fIelvis\fR will switch to the first file of the new list.
696
697.ti -0.25i
698.B :Next
699.ti -0.25i
700.B :previous
701.ti -0.25i
702.B :N
703.ti -0.25i
704.B :pre
705.br
706These commands move backwards through the args list.
707
708.ti -0.25i
709.B zz
710.br
711In VI, the (lowercase) \*(OQzz\*(CQ command will center the current line on
712the screen, like \*(OQz="
713
714.ti -0.25i
715.B .
716.br
717The default count value for . is the same as the previous command
718which . is meant to repeat. However, you can supply a new count
719if you wish.
720For example, after \*(OQ3dw\*(CQ, \*(OQ.\*(CQ will delete 3 words,
721but \*(OQ5.\*(CQ will delete 5 words.
722
723.ti -0.25i
724\fB"\fR
725.br
726The text which was most recently input (via a \*(OQcw\*(CQ command, or
727something similar) is saved in a cut buffer called ". (which is a
728pretty hard name to write in an English sentence). You can use this
729with the \*(OQp\*(CQ or \*(OQP\*(CQ commands thusly:
730.HS
731 ".p
732.HS
733.ti -0.25i
734.B K
735.br
736You can move the cursor onto a word and press shift-K to have \fIelvis\fR
737run a reference program to look that word up. This command alone is
738worth the price of admission! See the ctags and ref programs.
739
740.ti -0.25i
741.B input
742.br
743You can backspace back past the beginning of the line.
744If you type CTRL-A, then the text that you input last time is
745inserted. You will remain in input mode, so you can backspace over
746part of it, or add more to it. (This is sort of like CTRL-@ on
747the real vi, except that CTRL-A really works.)
748
749Real \fIvi\fR can only remember up to 128 characters of input, but \fIelvis\fR
750can remember any amount.
751
752.ti -0.25i
753.B :set
754charattr
755.ti -0.25i
756.B :se
757ca
758.br
759\fIElvis\fR can display \*(OQbackslash-f\*(CQ style character attributes on the
760screen as you edit. The following example shows the recognized
761attributes:
762
763 normal \fBboldface\fR \fIitalics\fR
764
765NOTE: you must compile \fIelvis\fR without the \(enDSET_NOCHARATTR flag for
766this to work.
767.in -0.25i
768.SS "Omissions"
769.PP
770A few \fIvi\fR features are missing.
771The replace mode is a hack. It does not save the text that it overwrites.
772.PP
773Long lines are displayed differently\(emwhere the real vi would wrap a long
774line onto several rows of the screen, \fIelvis\fR simply displays part of the line,
775and allows you to scroll the screen sideways to see the rest of it.
776.PP
777The \*(OQ:preserve\*(CQ and \*(OQ:recover\*(CQ commands are missing, as
778is the \fB\(enr\fR flag.
779\*(OQ:Preserve" is practically never used and since use of \*(OQ:recover\\*(CQ
780is so rare, it was decided to implement it as a separate program. There's no
781need to load the recovery code into memory every time you edit a file.
782.PP
783LISP support is missing.
784The \*(OQ@\*(CQ and \*(OQ:@\*(CQ commands are missing.
785You cannot APPEND to a cut buffer.
786.SS "Options"
787.PP
788A variety of options can be set as described below:
789.HS
790.nf
791.in +0.25i
792.ta 0.9i 1.35i 2.1i 3.0i
793\fBName Abbr Type Default Description\fR
794autoindent as Bool FALSE autoindent during input?
795autowrite aw Bool FALSE write file for :n command?
796charattr ca Bool FALSE display bold & underline chars?
797columns co Number 80 width of screen, in characters
798directory dir String /usr/tmp where tmp files are kept
799errorbells eb Bool TRUE ring bell on error?
800exrefresh er Bool TRUE EX mode calls write() often?
801ignorecase ic Bool FALSE searches: upper/lowercase OK?
802keytime kt Number 1 allow slow receipt of ESC seq?
803keywordprg kp String /usr/bin/ref program to run for shift-K
804lines ln Number 25 height of screen, in lines
805list li Bool FALSE show tabs as \*(OQ^I\*(CQ?
806magic ma Bool TRUE searches: allow metacharacters?
807paragraphs pa String PPppPApa paragraphs start with .PP, etc.
808readonly ro Bool FALSE no file should be written back?
809report re Number 5 report changes to X lines?
810scroll sc Number 12 default #lines for ^U and ^D
811sections se String SEseSHsh sections start with .SE, etc.
812shell sh String \fI/bin/sh\fR shell program, from environment
813shiftwidth sw Number 8 width of < or > commands
814sidescroll ss Number 8 #chars to scroll sideways by
815sync sy Bool FALSE call sync() after each change?
816tabstop ts Number 8 width of a tab character
817term te String "?" terminal type, from environment
818vbell vb Bool TRUE use visible bell if possible?
819warn wa Bool TRUE warn if file not saved for :!cmd
820wrapmargin wm Number 0 Insert newline after which col?
821wrapscan ws Bool TRUE searches: wrap at EOF?
822
823.fi
824.ti -0.25i
825.B autoindent
826.br
827During input mode, the autoindent option will cause each added line
828to begin with the same amount of leading whitespace as the line above
829it. Without autoindent, added lines are initially empty.
830
831.ti -0.25i
832.B autowrite
833.br
834When you're editing one file and decide to switch to another\(emvia
835the :tag command, or :next command, perhaps\(emif your current
836file has been modified, then \fIelvis\fR will normally print an error
837message and refuse to switch.
838
839However, if the autowrite option is on, then \fIelvis\fR will write the
840modified version of the current file and successfully switch to the
841new file.
842
843.ti -0.25i
844.B charattr
845.br
846Many text formatting programs allow you to designate portions of
847your text to be underlined, italicized, or boldface by embedding
848the special strings \\fU, \\fI, and \\fB in your text. The special
849string \\fR marks the end of underlined or boldface text.
850
851\fIElvis\fR normally treats those special strings just like any other
852text.
853However, if the \fIcharattr\fR option is on, then \fIelvis\fR will interpret
854those special strings correctly, to display underlined or boldface
855text on the screen. (This only works, of course, if your terminal
856can display underlined and boldface, and if the TERMCAP entry says
857how to do it.)
858
859.ti -0.25i
860.B columns
861.br
862This is a \*(OQread only\*(CQ option. You cannot change its value, but you
863can have \fIelvis\fR print it. It shows how wide your screen is.
864
865.ti -0.25i
866.B directory
867.br
868Elvis uses temporary files to store changed text.
869This option allows you to control where those temporary files will be.
870Ideally, you should store them on in fast non-volatile memory,
871such as a hard disk.
872
873This option can only be set in the ".exrc" file.
874
875.ti -0.25i
876.B errorbells
877.br
878Normally, \fIelvis\fR will ring your terminal's bell if you make an error.
879However, in noerrorbells mode, your terminal will remain silent.
880
881.ti -0.25i
882.B exrefresh
883.br
884The EX mode of \fIelvis\fR writes many lines to the screen. You can make
885\fIelvis\fR either write each line to the screen separately, or save up
886many lines and write them all at once.
887
888The exrefresh option is normally on, so each line is written to the
889screen separately.
890
891You may wish to turn the exrefresh option off (:se noer) if the
892\*(OQwrite\*(CQ system call is costly on your machine, or if you're using a
893windowing environment. (Windowing environments scroll text a lot
894faster when you write many lines at once.)
895
896This option has no effect in \fIvi\fR mode.
897
898.ti -0.25i
899.B ignorecase
900.br
901Normally, when \fIelvis\fR searches for text, it treats uppercase letters
902as being different for lowercase letters.
903
904When the ignorecase option is on, uppercase and lowercase are treated
905as equal.
906
907.ti -0.25i
908.B keytime
909.br
910The arrow keys of most terminals send a multi-character sequence.
911It takes a measurable amount of time for these sequences to be
912transmitted. The keytime option allows you to control the maximum
913amount of time to allow for an arrow key (or other mapped key) to
914be received in full.
915
916The default keytime value is 2. Because of the way
917.Ux
918timekeeping works, the actual amount of time allowed will vary slightly, but it
919will always be between 1 and 2 seconds.
920
921If you set keytime to 1, then the actual amount of time allowed will
922be between 0 and 1 second. This will generally make the keyboard's
923response be a little faster (mostly for the ESC key), but on those
924occasions where the time allowed happens to be closer to 0 than 1
925second, \fIelvis\fR may fail to allow enough time for an arrow key's
926sequence to be received fully. Ugh.
927
928As a special case, you can set keytime to 0 to disable this time
929limit stuff altogether. The big problem here is: If your arrow
930keys' sequences start with an ESC, then every time you hit your ESC
931key \fIelvis\fR will wait... and wait... to see if maybe that ESC was
932part of an arrow key's sequence.
933
934NOTE: this option is a generalization of the timeout option of the
935real vi.
936
937.ti -0.25i
938.B keywordprg
939.br
940\fIElvis\fR has a special keyword lookup feature. You move the cursor
941onto a word, and hit shift-K, and \fIelvis\fR uses another program to
942look up the word and display information about it.
943
944This option says which program gets run. It should contain the full
945pathname of the program; your whole execution path is \fInot\fR checked.
946
947The default value of this option is \fI/usr/bin/ref\fR, which is a
948program that looks up the definition of a function in C. It looks
949up the function name in a file called \*(OQrefs\*(CQ which is created by
950ctags.
951
952You can substitute other programs, such as an English dictionary
953program or the online manual. \fIelvis\fR runs the program, using the
954keyword as its only argument. The program should write information
955to stdout. The program's exit status should be 0, unless you want
956\fIelvis\fR to print \*(OQ<<< failed >>>".
957
958.ti -0.25i
959.B lines
960.br
961This \*(OQread only\*(CQ option shows how many lines you screen has.
962
963.ti -0.25i
964.B list
965.br
966Normally (in \*(OQnolist" mode) \fIelvis\fR will expand tabs to the proper
967number of spaces on the screen, so that the file appears the same would it would
968be if you printed it or looked at it with \fImore\fR.
969
970Sometimes, though, it can be handy to have the tabs displayed as \*(OQ^I".
971In \*(OQlist" mode, \fIelvis\fR does this, and also displays a \*(OQ$"
972after the end of the line.
973
974.ti -0.25i
975.B magic
976.br
977The search mechanism in \fIelvis\fR can accept \*(OQregular
978expressions\*(CQ\(emstrings in which certain characters have special meaning.
979The magic option is normally on, which causes these characters to
980be treated specially.
981If you turn the magic option off (:se noma), then all characters
982except ^ and $ are treated literally. ^ and $ retain their special
983meanings regardless of the setting of magic.
984
985.ti -0.25i
986.B paragraphs
987.br
988The { and } commands move the cursor forward or backward in increments
989of one paragraph. Paragraphs may be separated by blank lines, or by
990a \*(OQdot\*(CQ command of a text formatter. Different text formatters use
991different \*(OQdot\*(CQ commands. This option allows you to configure \fIelvis\fR
992to work with your text formatter.
993
994It is assumed that your formatter uses commands that start with a
995".\*(CQ character at the front of a line, and then have a one- or
996two-character command name.
997
998The value of the paragraphs option is a string in which each pair
999of characters is one possible form of your text formatter's paragraph
1000command.
1001
1002.ti -0.25i
1003.B readonly
1004.br
1005Normally, \fIelvis\fR will let you write back any file to which you have
1006write permission. If you do not have write permission, then you
1007can only write the changed version of the file to a \fIdifferent\fR
1008file.
1009
1010If you set the readonly option, then \fIelvis\fR will pretend you do not
1011have write permission to \fIany\fR file you edit. It is useful when
1012you really only mean to use \fIelvis\fR to look at a file, not to change
1013it. This way you cannot change it accidentally.
1014
1015This option is normally off, unless you use the \*(OQview\*(CQ alias of \fIelvis\fR.
1016\*(OQView\*(CQ is like \fIvi\fR except that the readonly option is on.
1017
1018.ti -0.25i
1019.B report
1020.br
1021Commands in \fIelvis\fR may affect many lines. For commands that affect
1022a lot of lines, \fIelvis\fR will output a message saying what was done and
1023how many lines were affected. This option allows you to define
1024what \*(OQa lot of lines\*(CQ means. The default is 5, so any command which
1025affects 5 or more lines will cause a message to be shown.
1026
1027.ti -0.25i
1028.B scroll
1029.br
1030The CTRL-U and CTRL-D keys normally scroll backward or forward
1031by half a screenful, but this is adjustable. The value of this option
1032says how many lines those keys should scroll by.
1033
1034.ti -0.25i
1035.B sections
1036.br
1037The [[ and ]] commands move the cursor backward or forward in
1038increment of 1 section. Sections may be delimited by a { character
1039in column 1 (which is useful for C source code) or by means of
1040a text formatter's \*(OQdot\*(CQ commands.
1041
1042This option allows you to configure \fIelvis\fR to work with your text
1043formatter's \*(OQsection\*(CQ command, in exactly the same way that the
1044paragraphs option makes it work with the formatter's \*(OQparagraphs"
1045command.
1046
1047.ti -0.25i
1048.B shell
1049.br
1050When \fIelvis\fR forks a shell (perhaps for the :! or :shell commands)
1051this is the program that is uses as a shell. This is \fI/bin/sh\fR
1052by default, unless you have set the SHELL environment variable,
1053it which case the default value is copied from the environment.
1054
1055.ti -0.25i
1056.B shiftwidth
1057.br
1058The < and > commands shift text left or right by some uniform number
1059of columns. The shiftwidth option defines that uniform number.
1060The default is 8.
1061
1062.ti -0.25i
1063.B sidescroll
1064.br
1065For long lines, \fIelvis\fR scrolls sideways. (This is different from
1066the real \fIvi\fR, which wraps a single long line onto several rows of
1067the screen.)
1068To minimize the number of scrolls needed, \fIelvis\fR moves the screen
1069sideways by several characters at a time. The value of this option
1070says how many characters' widths to scroll at a time.
1071Generally, the faster your screen can be redrawn, the lower the value
1072you will want in this option.
1073
1074.ti -0.25i
1075.B sync
1076.br
1077If the system crashes during an edit session, then most of your work
1078can be recovered from the temporary file that \fIelvis\fR uses to store
1079changes. However, sometimes
1080.MX
1081will not copy changes to the
1082hard disk immediately, so recovery might not be possible. The [no]sync
1083option lets you control this.
1084In nosync mode (which is the default), \fIelvis\fR lets the operating system
1085control when data is written to the disk. This is generally faster.
1086In sync mode, \fIelvis\fR forces all changes out to disk every time you make
1087a change. This is generally safer, but slower.
1088
1089.ti -0.25i
1090.B tabstop
1091.br
1092Tab characters are normally 8 characters wide, but you can change
1093their widths by means of this option.
1094
1095.ti -0.25i
1096.B term
1097.br
1098This \*(OQread only\*(CQ option shows the name of the termcap entry that
1099\fIelvis\fR is using for your terminal.
1100
1101.ti -0.25i
1102.B vbell
1103.br
1104If your termcap entry describes a visible alternative to ringing
1105your terminal's bell, then this option will say whether the visible
1106version gets used or not. Normally it will be.
1107
1108If your termcap does NOT include a visible bell capability, then
1109the vbell option will be off, and you cannot turn it on.
1110
1111.ti -0.25i
1112.B warn
1113.br
1114\fIElvis\fR will normally warn you if you run a shell command without saving
1115your changed version of a file.
1116The \*(OQnowarn" option prevents this warning.
1117
1118.ti -0.25i
1119.B wrapmargin
1120.br
1121Normally (with wrapmargin=0) \fIelvis\fR will let you type in extremely long
1122lines, if you wish.
1123However, with wrapmargin set to something other that 0 (wrapmargin=65
1124is nice), \fIelvis\fR will automatically cause long lines to be \*(OQwrapped"
1125on a word break for lines longer than wrapmargin's setting.
1126
1127.ti -0.25i
1128.B wrapscan
1129.br
1130Normally, when you search for something, \fIelvis\fR will find it no matter
1131where it is in the file. \fIelvis\fR starts at the cursor position, and
1132searches forward. If \fIelvis\fR hits EOF without finding what you're
1133looking for, then it wraps around to continue searching from line 1.
1134
1135If you turn off the wrapscan option (:se nows), then when \fIelvis\fR hits
1136EOF during a search, it will stop and say so.
1137.in -0.25i
1138.SS "Cflags"
1139.PP
1140\fIElvis\fR uses many preprocessor symbols to control compilation.
1141Most of these flags allow you to disable small sets of features.
1142\s-2MINIX\s0-ST users will probably want all features enabled, but
1143\s-2MINIX\s0-PC users will have to disable one or two feature sets
1144because otherwise \fIelvis\fR would be too large to compile and run.
1145
1146These symbols can be defined via flags passed to the compiler.
1147The best way to do this is to edit the Makefile, and append the flag
1148to the \*(OQCFLAGS=\*(CQ line.
1149After you do that, you must recompile elvis completely by saying
1150.HS
1151.Cx "make clean"
1152.br
1153.Cx "make"
1154.HS
1155.in +0.25i
1156.ti -0.25i
1157.B \(enDM_SYSV
1158.br
1159This flag causes \fIelvis\fR to use System-V ioctl() calls for controlling
1160your terminal; normally it uses v7/BSD/\s-2MINIX\s0 ioctl() calls.
1161
1162.ti -0.25i
1163.B \(enDDATE
1164.br
1165The symbol DATE should be defined to look like a string constant,
1166giving the date when \fIelvis\fR was compiled.
1167This date is reported by the \*(OQ:version\*(CQ command.
1168
1169You can also leave DATE undefined, in which case \*(OQ:version\*(CQ will not
1170report the compilation date.
1171
1172.ti -0.25i
1173.B \(enDCRUNCH
1174.br
1175This flag causes several large often-used macros to be replaced by
1176equivalent functions.
1177This saves about 4K of space in the \*(OQ.text\*(CQ segment, and it does not
1178cost you any features.
1179
1180.ti -0.25i
1181.B \(enDDEBUG
1182.br
1183This adds many internal consistency checks and the \*(OQ:debug\*(CQ
1184and \*(OQ:validate\*(CQ
1185commands. It increases the size of \*(OQtext\*(CQ by about 5K bytes.
1186
1187.ti -0.25i
1188.B \(enDNO_CHARATTR
1189.br
1190This permanenently disables the \*(OQcharattr\*(CQ option.
1191It reduces the size of \*(OQ.text\*(CQ by about 850 bytes.
1192
1193.ti -0.25i
1194.B \(enDNO_RECYCLE
1195.br
1196Normally, \fIelvis\fR will recycle space in the temporary file which contains
1197totally obsolete text.
1198The \fB\(enDNO_RECYCLE\fR option disables this, making your \*(OQ.text\*(CQ segment
1199smaller by about 1K but also permitting the temporary file to grow very
1200quickly.
1201If you have less than two megabytes of free space on your disk,
1202then do not even consider using this flag.
1203
1204.ti -0.25i
1205.B \(enDNO_SENTENCE
1206.br
1207This leaves out the \*(OQ(\*(CQ and \*(OQ)\*(CQ visual commands, and
1208removes the code that allows the \*(OQ[[\*(CQ, \*(OQ]]\*(CQ, \*(OQ{\*(CQ,
1209and \*(OQ}\*(CQ commands to recognize \fRnroff\fR macros.
1210The \*(OQ[[\*(CQ and \*(OQ]]\*(CQ commands will still move to the start of
1211the previous/next C function source code, though, and \*(OQ{\*(CQ
1212and \*(OQ}\*(CQ will move to the previous/next blank line.
1213This saves about 650 bytes from the \*(OQ.text\*(CQ segment.
1214
1215.ti -0.25i
1216.B \(enDNO_CHARSEARCH
1217.br
1218This leaves out the visual commands which locate a given character in the
1219current line: \*(OQf\*(CQ, \*(OQt\*(CQ, \*(OQF\*(CQ, \*(OQT\*(CQ, \*(OQ;\*(CQ, and \*(OQ,\*(CQ.
1220This saves about 900 bytes.
1221
1222.ti -0.25i
1223.B \(enDNO_EXTENSIONS
1224.br
1225This leaves out the \*(OQ:mkexrc\*(CQ command, and the \*(OQK\*(CQ and \*(OQ#\*(CQ visual commands.
1226Other extensions are either inherent in the design of \fIelvis\fR,
1227or are too tiny to be worth removing.
1228This saves about 500 bytes.
1229
1230.ti -0.25i
1231.B \(enDNO_MAGIC
1232.br
1233This permanently disables the \*(OQmagic\*(CQ option, so that most
1234meta-characters in a regular expression are not recognized.
1235This saves about 3K bytes from the \*(OQ.text\*(CQ segment.
1236.HS
1237.in -0.25i
1238.SS "Termcap"
1239\fIElvis\fR can use standard termcap entries,
1240but it also recognizes and uses several extra capabilities, if you give them.
1241All of these are optional.
1242.nf
1243.in +0.25i
1244.ta 1.5i
1245.HS
1246\fBCapability Description\fR
1247:PU=: sequence received from the <PgUp> key
1248:PD=: sequence received from the <PgDn> key
1249:HM=: sequence received from the <Home> key
1250:EN=: sequence received from the <End> key
1251:VB=: sequence sent to start bold printing
1252:Vb=: sequence sent to end bold printing
1253.in -0.25i
1254.SS "Author"
1255.PP
1256\fIElvis\fR was written by Steve Kirkendall.
1257He can be reached by email at: kirkenda@cs.pdx.edu
1258for comments regarding \fIelvis\fR.
Note: See TracBrowser for help on using the repository browser.