version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
VIM |
|
|
2 |
!!!VIM |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
ON-LINE HELP |
|
|
8 |
FILES |
|
|
9 |
SEE ALSO |
|
|
10 |
AUTHOR |
|
|
11 |
BUGS |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
vim - Vi IMproved, a programmers text editor |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__vim__ [[options] [[file ..]__ |
|
|
21 |
vim__ [[options] -__ |
|
|
22 |
vim__ [[options] -t tag__ |
|
|
23 |
vim__ [[options] -q [[errorfile] |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__ex |
|
|
27 |
view |
|
|
28 |
gvim gview |
|
|
29 |
rvim rview rgvim rgview__ |
|
|
30 |
!!DESCRIPTION |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
__Vim__ is a text editor that is upwards compatible to |
|
|
34 |
Vi. It can be used to edit all kinds of plain text. It is |
|
|
35 |
especially useful for editing programs. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
There are a lot of enhancements above Vi: multi level undo, |
|
|
39 |
multi windows and buffers, syntax highlighting, command line |
|
|
40 |
editing, filename completion, on-line help, visual |
|
|
41 |
selection, etc.. See |
|
|
42 |
Vim__ and |
|
|
43 |
Vi. |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
While running __Vim__ a lot of help can be obtained from |
|
|
47 |
the on-line help system, with the |
|
|
48 |
__ |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
Most often __Vim__ is started to edit a single file with |
|
|
52 |
the command |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
vim file |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
More generally __Vim__ is started with: |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
vim [[options] [[filelist] |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
If the filelist is missing, the editor will start with an |
|
|
65 |
empty buffer. Otherwise exactly one out of the following |
|
|
66 |
four may be used to choose one or more files to be |
|
|
67 |
edited. |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
file .. |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
A list of filenames. The first one will be the current file |
|
|
74 |
and read into the buffer. The cursor will be positioned on |
|
|
75 |
the first line of the buffer. You can get to the other files |
|
|
76 |
with the |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
- The file to edit is read from stdin. Commands are read |
|
|
80 |
from stderr, which should be a tty. |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
-t {tag} |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
The file to edit and the initial cursor position depends on |
|
|
87 |
a |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
-q [[errorfile] |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
Start in quickFix mode. The file [[errorfile] is read and the |
|
|
94 |
first error is displayed. If [[errorfile] is omitted, the |
|
|
95 |
filename is obtained from the 'errorfile' option (defaults |
|
|
96 |
to |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
__Vim__ behaves differently, depending on the name of the |
|
|
100 |
command (the executable may still be the same |
|
|
101 |
file). |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
vim |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
The |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
ex Start in Ex mode. Go to Normal mode with the |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
view |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
Start in read-only mode. You will be protected from writing |
|
|
117 |
the files. Can also be done with the |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
gvim gview |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
The GUI version. Starts a new window. Can also be done with |
|
|
124 |
the |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
rvim rview rgvim rgview |
|
|
128 |
|
|
|
129 |
|
|
|
130 |
Like the above, but with restrictions. It will not be |
|
|
131 |
possible to start shell commands, or suspend __Vim.__ Can |
|
|
132 |
also be done with the __ |
|
|
133 |
!!OPTIONS |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
The options may be given in any order, before or after |
|
|
137 |
filenames. Options without an argument can be combined after |
|
|
138 |
a single dash. |
|
|
139 |
|
|
|
140 |
|
|
|
141 |
+[[num] |
|
|
142 |
|
|
|
143 |
|
|
|
144 |
For the first file the cursor will be positioned on line |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
+/{pat} |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
For the first file the cursor will be positioned on the |
|
|
151 |
first occurrence of {pat}. See |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
+{command} |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
-c {command} |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
{command} will be executed after the first file has been |
|
|
161 |
read. {command} is interpreted as an Ex command. If the |
|
|
162 |
{command} contains spaces it must be enclosed in double |
|
|
163 |
quotes (this depends on the shell that is used). Example: |
|
|
164 |
Vim |
|
|
165 |
Note: You can use up to 10 |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
--cmd {command} |
|
|
169 |
|
|
|
170 |
|
|
|
171 |
Like using |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
-b Binary mode. A few options will be set that makes it |
|
|
175 |
possible to edit a binary or executable file. |
|
|
176 |
|
|
|
177 |
|
|
|
178 |
-C Compatible. Set the 'compatible' option. This will make |
|
|
179 |
__Vim__ behave mostly like Vi, even though a .vimrc file |
|
|
180 |
exists. |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
-d Start in diff mode. There should be two or three file |
|
|
184 |
name arguments. __Vim__ will open all the files and show |
|
|
185 |
differences between them. Works like |
|
|
186 |
vimdiff(1). |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
-d {device} |
|
|
190 |
|
|
|
191 |
|
|
|
192 |
Open {device} for use as a terminal. Only on the Amiga. |
|
|
193 |
Example: |
|
|
194 |
|
|
|
195 |
|
|
|
196 |
-e Start __Vim__ in Ex mode, just like the executable was |
|
|
197 |
called __ |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
-f Foreground. For the GUI version, __Vim__ will not fork |
|
|
201 |
and detach from the shell it was started in. On the Amiga, |
|
|
202 |
__Vim__ is not restarted to open a new window. This |
|
|
203 |
option should be used when __Vim__ is executed by a |
|
|
204 |
program that will wait for the edit session to finish (e.g. |
|
|
205 |
mail). On the Amiga the |
|
|
206 |
__ |
|
|
207 |
|
|
|
208 |
|
|
|
209 |
-F If __Vim__ has been compiled with FKMAP support for |
|
|
210 |
editing right-to-left oriented files and Farsi keyboard |
|
|
211 |
mapping, this option starts __Vim__ in Farsi mode, i.e. |
|
|
212 |
'fkmap' and 'rightleft' are set. Otherwise an error message |
|
|
213 |
is given and __Vim__ aborts. |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
-g If __Vim__ has been compiled with GUI support, this |
|
|
217 |
option enables the GUI. If no GUI support was compiled in, |
|
|
218 |
an error message is given and __Vim__ |
|
|
219 |
aborts. |
|
|
220 |
|
|
|
221 |
|
|
|
222 |
-h Give a bit of help about the command line arguments and |
|
|
223 |
options. After this __Vim__ exits. |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
-H If __Vim__ has been compiled with RIGHTLEFT support |
|
|
227 |
for editing right-to-left oriented files and Hebrew keyboard |
|
|
228 |
mapping, this option starts __Vim__ in Hebrew mode, i.e. |
|
|
229 |
'hkmap' and 'rightleft' are set. Otherwise an error message |
|
|
230 |
is given and __Vim__ aborts. |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
-i {viminfo} |
|
|
234 |
|
|
|
235 |
|
|
|
236 |
When using the viminfo file is enabled, this option sets the |
|
|
237 |
filename to use, instead of the default |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
-L Same as -r. |
|
|
241 |
|
|
|
242 |
|
|
|
243 |
-l Lisp mode. Sets the 'lisp' and 'showmatch' options |
|
|
244 |
on. |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
-m Modifying files is disabled. Resets the 'write' option, |
|
|
248 |
so that writing files is not possible. |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
-N No-compatible mode. Reset the 'compatible' option. This |
|
|
252 |
will make __Vim__ behave a bit better, but less Vi |
|
|
253 |
compatible, even though a .vimrc file does not |
|
|
254 |
exist. |
|
|
255 |
|
|
|
256 |
|
|
|
257 |
-n No swap file will be used. Recovery after a crash will be |
|
|
258 |
impossible. Handy if you want to edit a file on a very slow |
|
|
259 |
medium (e.g. floppy). Can also be done with |
|
|
260 |
|
|
|
261 |
|
|
|
262 |
-o[[N] |
|
|
263 |
|
|
|
264 |
|
|
|
265 |
Open N windows. When N is omitted, open one window for each |
|
|
266 |
file. |
|
|
267 |
|
|
|
268 |
|
|
|
269 |
-R Read-only mode. The 'readonly' option will be set. You |
|
|
270 |
can still edit the buffer, but will be prevented from |
|
|
271 |
accidently overwriting a file. If you do want to overwrite a |
|
|
272 |
file, add an exclamation mark to the Ex command, as in |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
-r List swap files, with information about using them for |
|
|
276 |
recovery. |
|
|
277 |
|
|
|
278 |
|
|
|
279 |
-r {file} |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
Recovery mode. The swap file is used to recover a crashed |
|
|
283 |
editing session. The swap file is a file with the same |
|
|
284 |
filename as the text file with |
|
|
285 |
|
|
|
286 |
|
|
|
287 |
-s Silent mode. Only when started as |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
-s {scriptin} |
|
|
291 |
|
|
|
292 |
|
|
|
293 |
The script file {scriptin} is read. The characters in the |
|
|
294 |
file are interpreted as if you had typed them. The same can |
|
|
295 |
be done with the command |
|
|
296 |
|
|
|
297 |
|
|
|
298 |
-T {terminal} |
|
|
299 |
|
|
|
300 |
|
|
|
301 |
Tells __Vim__ the name of the terminal you are using. |
|
|
302 |
Only required when the automatic way doesn't work. Should be |
|
|
303 |
a terminal known to __Vim__ (builtin) or defined in the |
|
|
304 |
termcap or terminfo file. |
|
|
305 |
|
|
|
306 |
|
|
|
307 |
-u {vimrc} |
|
|
308 |
|
|
|
309 |
|
|
|
310 |
Use the commands in the file {vimrc} for initializations. |
|
|
311 |
All the other initializations are skipped. Use this to edit |
|
|
312 |
a special kind of files. It can also be used to skip all |
|
|
313 |
initializations by giving the name |
|
|
314 |
|
|
|
315 |
|
|
|
316 |
-U {gvimrc} |
|
|
317 |
|
|
|
318 |
|
|
|
319 |
Use the commands in the file {gvimrc} for GUI |
|
|
320 |
initializations. All the other GUI initializations are |
|
|
321 |
skipped. It can also be used to skip all GUI initializations |
|
|
322 |
by giving the name |
|
|
323 |
|
|
|
324 |
|
|
|
325 |
-V Verbose. Give messages about which files are sourced and |
|
|
326 |
for reading and writing a viminfo file. |
|
|
327 |
|
|
|
328 |
|
|
|
329 |
-v Start __Vim__ in Vi mode, just like the executable was |
|
|
330 |
called |
|
|
331 |
__ |
|
|
332 |
|
|
|
333 |
|
|
|
334 |
-w {scriptout} |
|
|
335 |
|
|
|
336 |
|
|
|
337 |
All the characters that you type are recorded in the file |
|
|
338 |
{scriptout}, until you exit __Vim.__ This is useful if |
|
|
339 |
you want to create a script file to be used with |
|
|
340 |
__ |
|
|
341 |
|
|
|
342 |
|
|
|
343 |
-W {scriptout} |
|
|
344 |
|
|
|
345 |
|
|
|
346 |
Like -w, but an existing file is overwritten. |
|
|
347 |
|
|
|
348 |
|
|
|
349 |
-x Use encryption when writing files. Will prompt for a |
|
|
350 |
crypt key. |
|
|
351 |
|
|
|
352 |
|
|
|
353 |
-Z Restricted mode. Works like the executable starts with |
|
|
354 |
|
|
|
355 |
|
|
|
356 |
-- Denotes the end of the options. Arguments after this will |
|
|
357 |
be handled as a file name. This can be used to edit a |
|
|
358 |
filename that starts with a '-'. |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
--help |
|
|
362 |
|
|
|
363 |
|
|
|
364 |
Give a help message and exit, just like |
|
|
365 |
|
|
|
366 |
|
|
|
367 |
--version |
|
|
368 |
|
|
|
369 |
|
|
|
370 |
Print version information and exit. |
|
|
371 |
|
|
|
372 |
|
|
|
373 |
--remote |
|
|
374 |
|
|
|
375 |
|
|
|
376 |
Connect to a Vim server and make it edit the files given in |
|
|
377 |
the rest of the arguments. |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
--serverlist |
|
|
381 |
|
|
|
382 |
|
|
|
383 |
List the names of all Vim servers that can be |
|
|
384 |
found. |
|
|
385 |
|
|
|
386 |
|
|
|
387 |
--servername {name} |
|
|
388 |
|
|
|
389 |
|
|
|
390 |
Use {name} as the server name. Used for the current Vim, |
|
|
391 |
unless used with a --serversend or --remote, then it's the |
|
|
392 |
name of the server to connect to. |
|
|
393 |
|
|
|
394 |
|
|
|
395 |
--serversend {keys} |
|
|
396 |
|
|
|
397 |
|
|
|
398 |
Connect to a Vim server and send {keys} to it. |
|
|
399 |
|
|
|
400 |
|
|
|
401 |
--socketid {id} |
|
|
402 |
|
|
|
403 |
|
2 |
perry |
404 |
GTK GUI only: Use the !GtkPlug mechanism to run gvim in |
1 |
perry |
405 |
another window. |
|
|
406 |
|
|
|
407 |
|
|
|
408 |
--echo-wid |
|
|
409 |
|
|
|
410 |
|
|
|
411 |
GTK GUI only: Echo the Window ID on stdout |
|
|
412 |
!!ON-LINE HELP |
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Type Vim__ to get started. Type |
|
|
416 |
__ |
|
|
417 |
!!FILES |
|
|
418 |
|
|
|
419 |
|
|
|
420 |
/usr/share/vim/vim61/doc/*.txt |
|
|
421 |
|
|
|
422 |
|
|
|
423 |
The __Vim__ documentation files. Use |
|
|
424 |
__ |
|
|
425 |
|
|
|
426 |
|
|
|
427 |
/usr/share/vim/vim61/doc/tags |
|
|
428 |
|
|
|
429 |
|
|
|
430 |
The tags file used for finding information in the |
|
|
431 |
documentation files. |
|
|
432 |
|
|
|
433 |
|
|
|
434 |
/usr/share/vim/vim61/syntax/syntax.vim |
|
|
435 |
|
|
|
436 |
|
|
|
437 |
System wide syntax initializations. |
|
|
438 |
|
|
|
439 |
|
|
|
440 |
/usr/share/vim/vim61/syntax/*.vim |
|
|
441 |
|
|
|
442 |
|
|
|
443 |
Syntax files for various languages. |
|
|
444 |
|
|
|
445 |
|
|
|
446 |
/usr/share/vim/vimrc |
|
|
447 |
|
|
|
448 |
|
|
|
449 |
System wide __Vim__ initializations. |
|
|
450 |
|
|
|
451 |
|
|
|
452 |
/usr/share/vim/gvimrc |
|
|
453 |
|
|
|
454 |
|
|
|
455 |
System wide gvim initializations. |
|
|
456 |
|
|
|
457 |
|
|
|
458 |
/usr/share/vim/vim61/optwin.vim |
|
|
459 |
|
|
|
460 |
|
|
|
461 |
Script used for the |
|
|
462 |
|
|
|
463 |
|
|
|
464 |
/usr/share/vim/vim61/menu.vim |
|
|
465 |
|
|
|
466 |
|
|
|
467 |
System wide menu initializations for gvim. |
|
|
468 |
|
|
|
469 |
|
|
|
470 |
/usr/share/vim/vim61/bugreport.vim |
|
|
471 |
|
|
|
472 |
|
|
|
473 |
Script to generate a bug report. See |
|
|
474 |
|
|
|
475 |
|
|
|
476 |
/usr/share/vim/vim61/filetype.vim |
|
|
477 |
|
|
|
478 |
|
|
|
479 |
Script to detect the type of a file by its name. See |
|
|
480 |
|
|
|
481 |
|
|
|
482 |
/usr/share/vim/vim61/scripts.vim |
|
|
483 |
|
|
|
484 |
|
|
|
485 |
Script to detect the type of a file by its contents. See |
|
|
486 |
|
|
|
487 |
|
|
|
488 |
/usr/share/vim/vim61/*.ps |
|
|
489 |
|
|
|
490 |
|
2 |
perry |
491 |
Files used for !PostScript printing. |
1 |
perry |
492 |
|
|
|
493 |
|
|
|
494 |
For recent info read the VIM home page: |
|
|
495 |
!!SEE ALSO |
|
|
496 |
|
|
|
497 |
|
|
|
498 |
vimtutor(1) |
|
|
499 |
!!AUTHOR |
|
|
500 |
|
|
|
501 |
|
|
|
502 |
Most of __Vim__ was made by Bram Moolenaar, with a lot of |
|
|
503 |
help from others. See |
|
|
504 |
__Vim. |
|
|
505 |
Vim__ is based on Stevie, worked on by: Tim Thompson, Tony |
|
|
506 |
Andrews and G.R. (Fred) Walter. Although hardly any of the |
|
|
507 |
original code remains. |
|
|
508 |
!!BUGS |
|
|
509 |
|
|
|
510 |
|
|
|
511 |
Probably. See |
|
|
512 |
|
|
|
513 |
|
|
|
514 |
Note that a number of things that may be regarded as bugs by |
|
|
515 |
some, are in fact caused by a too-faithful reproduction of |
|
|
516 |
Vi's behaviour. And if you think other things are bugs |
|
|
517 |
---- |