Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .Go 7 "DIFFERENCES BETWEEN \*E & BSD VI/EX" |
2 | .PP | |
3 | \*E is not 100% compatible with the real vi/ex. | |
4 | \*E has many small extensions, some omissions, and a few features which | |
5 | are implemented in a slightly different manner. | |
6 | .NH 2 | |
7 | Extensions | |
8 | .IP "Save Configuration" 1i | |
78ed81a3 | 9 | The :mkexrc command saves the current :set, :map, :ab, :color, and :digraph |
10 | configurations in the ".exrc" file in your current directory. | |
15637ed4 RG |
11 | .IP "Previous File" 1i |
12 | The :N or :prev command moves backwards through the args list. | |
13 | .IP "Center Current Row" 1i | |
14 | In visual command mode, the (lowercase) "zz" command will center the current | |
15 | line on the screen, like "z=". | |
16 | .IP "Changing Repeat Count" 1i | |
17 | The default count value for . is the same as the previous command | |
18 | which . is meant to repeat. | |
19 | However, you can supply a new count if you wish. | |
20 | For example, after "3dw", "." will delete 3 words, | |
21 | but "5." will delete 5 words. | |
22 | .IP "Previous Text" 1i | |
23 | The text which was most recently input | |
24 | (via a "cw" command, or something similar) | |
25 | is saved in a cut buffer called ". (which | |
26 | is a pretty hard name to write in an English sentence). | |
27 | .IP "Keyword Lookup" 1i | |
28 | In visual command mode, you can move the cursor onto a word and press | |
29 | shift-K to have \*E run a reference program to look that word up. | |
30 | This command alone is worth the price of admission! | |
31 | See the ctags and ref programs. | |
32 | .IP "Increment/Decrement" 1i | |
33 | In visual command mode, you can move the cursor onto a number and | |
34 | then hit ## or #+ to increment that number by 1. | |
35 | To increment it by a larger amount, | |
36 | type in the increment value before hitting the initial #. | |
37 | The number can also be decremented or set by hitting #- or #=, respectively. | |
38 | .IP "Input Mode" 1i | |
39 | You can backspace past the beginning of the line. | |
40 | .IP "" 1i | |
41 | The arrow keys work in input mode. | |
42 | .IP "" 1i | |
43 | If you type control-A, then the text that you input last time is inserted. | |
44 | You will remain in input mode, so you can backspace over part of it, | |
45 | or add more to it. | |
46 | (This is sort of like control-@ on the real vi, | |
47 | except that control-A really works.) | |
48 | .IP "" 1i | |
49 | Control-P will insert the contents of the cut buffer. | |
50 | .IP "" 1i | |
51 | Real vi can only remember up to 128 characters of input, | |
52 | but \*E can remember any amount. | |
53 | .IP "" 1i | |
54 | The ^T and ^D keys can adjust the indent of a line no matter where | |
55 | the cursor happens to be in that line. | |
56 | .IP "" 1i | |
57 | You can save your file and exit \*E directly from input mode by hitting | |
58 | control-Z twice. | |
59 | .IP "" 1i | |
60 | \*E supports digraphs as a way to enter non-ASCII characters. | |
61 | .IP "Start in Input Mode" 1i | |
62 | If you ":set inputmode" in your .exrc file, then \*E will start up in | |
63 | input mode instead of visual command mode. | |
64 | .IP "Visible Fonts" 1i | |
65 | With ":set charattr", \*E can display "backslash-f" style character attributes on the | |
66 | screen as you edit. | |
67 | The following example shows the recognized atributes: | |
68 | .sp | |
69 | .ti +0.5i | |
70 | normal \\fBboldface\\fR \\fIitalics\\fR \\fUunderlined\\fR normal | |
71 | .sp | |
72 | NOTE: you must compile \*E without the -DNO_CHARATTR flag for | |
73 | this to work. | |
74 | .IP "File Syncing" 1i | |
75 | After a crash, you can usually recover the altered form of the file | |
76 | from the temporary file that \*E uses -- unless the temporary file was | |
77 | corrupted. | |
78 | .IP "" 1i | |
79 | UNIX systems use a delayed-write cache, which means that when \*E tries to | |
80 | write to the temporary file, the information might still be in RAM instead | |
81 | of on the disk. | |
82 | A power failure at that time would cause the in-RAM information to be lost. | |
83 | UNIX's sync() call will force all such information to disk. | |
84 | .IP "" 1i | |
85 | MS-DOS and Atari TOS don't write a file's length to disk until that file | |
86 | is closed. | |
87 | Consequently, the temporary file would appear to be 0 bytes long if power | |
88 | failed when we were editing. | |
89 | To avoid this problem, a sync() function has been written which will close | |
90 | the temporary file and then immediately reopen it. | |
91 | .IP "Cursor Shape" 1i | |
92 | \*E changes the shape of the cursor to indicate which mode you're in, | |
93 | if your terminal's termcap entry includes the necessary capabilities. | |
94 | .IP "Hide nroff Lines" 1i | |
78ed81a3 | 95 | The ":set hideformat" option hides nroff format control lines. |
15637ed4 RG |
96 | (They are displayed on the screen as blank lines.) |
97 | .ne 7 | |
98 | .IP "Compiler Interface" 1i | |
99 | \*E is clever enough to parse the error messages emitted by many compilers. | |
100 | To use this feature, | |
101 | you should collect your compiler's error messages into a file called "errlist"; | |
102 | \*E will read this file, | |
103 | determine which source file caused the error messages, | |
104 | start editing that file, | |
105 | move the cursor to the line where the error was detected, | |
106 | and display the error message on the status line. | |
107 | Nifty! | |
108 | .IP "Visible Text Selection" 1i | |
109 | In visual command mode, 'v' starts visibly selecting characters and | |
110 | \&'V' starts visibly selecting whole lines. | |
111 | The character or line where the cursor is located becomes one | |
112 | endpoint of the selection. | |
113 | You can then use the standard cursor movement commands to move the cursor | |
114 | to the other endpoint, and then press one of the operator commands | |
115 | (c/d/y/</>/!/=/\\). | |
116 | The operator will then immediately be applied to the selected text. | |
117 | .IP "Pop-up Menu Operator" 1i | |
118 | The '\\' key is a new operator, | |
78ed81a3 | 119 | similar in operation to the c/d/y/</>/! operators. |
15637ed4 RG |
120 | It conjures up a menu, from which you can select any of the other |
121 | operators plus a few other common commands. | |
122 | .IP "Preset Filter Operator" 1i | |
123 | The '=' key is another new operator. | |
124 | It is similar to the '!' operator, except that while | |
125 | \&'!' asks you to type in a filter command each time, | |
126 | \&'=' assumes it should always run the command stored in the \fIequalprg\fR option. | |
127 | .IP "Move to a Given Percentage" 1i | |
128 | The '%' movement key can now accept an optional count. | |
129 | Without a count, the '%' key still moves to a matching parenthesis | |
130 | like it always did. | |
131 | With a count somewhere between 1 and 100, though, it moves the cursor to | |
132 | approximately a given percentage of the way through the file. | |
133 | For example, typing "50%" will move the cursor to the middle of the file. | |
134 | .IP "Regular Expressions" | |
135 | In regular expressions, several new forms of closure operators are supported: | |
136 | \\{\fIn\fR}, \\{\fIn\fR,\fIm\fR}, \\+, and \\?. | |
137 | .NH 2 | |
138 | Omissions | |
139 | .PP | |
140 | The replace mode is a hack. | |
141 | It doesn't save the text that it overwrites. | |
142 | .PP | |
143 | Long lines are displayed differently -- where the real vi would | |
144 | wrap a long line onto several rows of the screen, \*E simply | |
145 | displays part of the line, and allows you to scroll the screen | |
146 | sideways to see the rest of it. | |
147 | .PP | |
148 | The ":preserve" and ":recover" commands are missing. | |
149 | So is the -r flag. | |
150 | I've never had a good reason to use ":preserve", | |
151 | and since ":recover" is used so rarely | |
152 | I decided to implement it as a separate program. | |
153 | There's no need to load the recovery code into memory every | |
154 | time you edit a file, I figured. | |
155 | .PP | |
156 | LISP support is missing. | |
157 | However, the = key is still an operator that reformats lines of text. | |
158 | By default, it reformats lines by sending them through the \fIfmt\fP filter, | |
159 | but you could write your own LISP beautifier and configure elvis to use it. | |
160 | Key mappings could take care of most other differences. | |
161 | Auto-indent is the only thing that is irrecoverably lost. | |
162 | .PP | |
163 | Autoindent mode acts a little different from the real vi, anyway. | |
164 | It doesn't handle ^^D or 0^D correctly. | |
165 | On the other hand, it \fIdoes\fP allow ^D and ^T to be used anywhere in the | |
166 | line, to adjust the indentation for the whole line. |