annotate runtime/doc/vi_diff.txt @ 548:f43150a669dc

updated for version 7.0155
author vimboss
date Mon, 10 Oct 2005 20:59:28 +0000
parents 23d380e32c95
children 81fe2ccc1207
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
235
23d380e32c95 updated for version 7.0066
vimboss
parents: 166
diff changeset
1 *vi_diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Differences between Vim and Vi *vi-differences*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 Throughout the help files differences between Vim and Vi/Ex are given in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 curly braces, like "{not in Vi}". This file only lists what has not been
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 mentioned in other files and gives an overview.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 Vim is mostly POSIX 1003.2-1 compliant. The only command known to be missing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 is ":open". There are probably a lot of small differences (either because Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 is missing something or because Posix is beside the mark).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
17 1. Simulated command |simulated-command|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 2. Missing options |missing-options|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 3. Limits |limits|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 4. The most interesting additions |vim-additions|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 5. Other vim features |other-features|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 6. Command-line arguments |cmdline-arguments|
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
23 7. POSIX compliance |posix-compliance|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 ==============================================================================
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
26 1. Simulated command *simulated-command*
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
27
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
28 This command is in Vi, but Vim only simuates it:
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
29
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
30 *:o* *:op* *:open*
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
31 :[range]o[pen] Works like |:visual|: end Ex mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
32 {Vi: start editing in open mode}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
34 :[range]o[pen] /pattern/ As above, additionally move the cursor to the
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
35 column where "pattern" matches in the cursor
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
36 line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
38 Vim does not support open mode, since it's not really useful. For those
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
39 situations where ":open" would start open mode Vim will leave Ex mode, which
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
40 allows executing the same commands, but updates the whole screen instead of
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
41 only one line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 2. Missing options *missing-options*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 These options are in the Unix Vi, but not in Vim. If you try to set one of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 them you won't get an error message, but the value is not used and cannot be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 printed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 autoprint (ap) boolean (default on) *'autoprint'* *'ap'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 beautify (bf) boolean (default off) *'beautify'* *'bf'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 flash (fl) boolean (default ??) *'flash'* *'fl'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 graphic (gr) boolean (default off) *'graphic'* *'gr'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 hardtabs (ht) number (default 8) *'hardtabs'* *'ht'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 number of spaces that a <Tab> moves on the display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 mesg boolean (default on) *'mesg'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 novice boolean (default off) *'novice'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 open boolean (default on) *'open'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 optimize (op) boolean (default off) *'optimize'* *'op'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 redraw boolean (default off) *'redraw'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 slowopen (slow) boolean (default off) *'slowopen'* *'slow'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 sourceany boolean (default off) *'sourceany'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 w300 number (default 23) *'w300'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 w1200 number (default 23) *'w1200'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 w9600 number (default 23) *'w9600'*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 3. Limits *limits*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 Vim has only a few limits for the files that can be edited {Vi: can not handle
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 <Nul> characters and characters above 128, has limited line length, many other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 limits}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 *E340*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 Maximum line length On machines with 16-bit ints (Amiga and MS-DOS real
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 mode): 32767, otherwise 2147483647 characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 Longer lines are split.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 Maximum number of lines 2147483647 lines.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 32 bits. Much more for 64 bit longs. Also limited
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 by available disk space for the |swap-file|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 *E75*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 Length of a file path Unix and Win32: 1024 characters, otherwise 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 characters (or as much as the system supports).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 Length of an expanded string option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 Unix and Win32: 1024 characters, otherwise 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 Maximum display width Unix and Win32: 1024 characters, otherwise 255
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 Maximum lhs of a mapping 50 characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 Number of highlighting different types: 223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 Information for undo and text in registers is kept in memory, thus when making
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 (big) changes the amount of (virtual) memory available limits the number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 undo levels and the text that can be kept in registers. Other things are also
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 kept in memory: Command-line history, error messages for Quickfix mode, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 Memory usage limits
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 -------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 The option 'maxmem' ('mm') is used to set the maximum memory used for one
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 all buffers (in kilobytes). The defaults depend on the system used. For the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 available. If you don't like Vim to swap to a file, set 'maxmem' and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 'maxmemtot' to a very large value. The swap file will then only be used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 recovery. If you don't want a swap file at all, set 'updatecount' to 0, or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 use the "-n" argument when starting Vim. Note that the 'maxmem' option is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 only used when a buffer is created. Changing this option does not affect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 buffers that have already been loaded. Thus you can set it to different
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 values for different files. 'maxmemtot' works always.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 4. The most interesting additions *vim-additions*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 Vi compatibility. |'compatible'|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 Although Vim is 99% Vi compatible, some things in Vi can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 considered to be a bug, or at least need improvement. But still, Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 starts in a mode which behaves like the "real" Vi as much as possible.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 To make Vim behave a little bit better, try resetting the 'compatible'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 option:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 :set nocompatible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 Or start Vim with the "-N" argument:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 vim -N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 This is done automatically if you have a .vimrc file. See |startup|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 The 'cpoptions' option can be used to set Vi compatibility on/off for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 a number of specific items.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 Support for different systems.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 Vim can be used on:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 - All Unix systems (it works on all systems it was tested on, although
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 the GUI and Perl interface may not work everywhere).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 - MS-DOS in real-mode (no additional drivers required).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 - Windows 95 and Windows NT, with support for long file names.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 - OS/2 (needs emx.dll)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 - Atari MiNT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 - VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 - BeOS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 - Macintosh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 - Risc OS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 - IBM OS/390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 Multi level undo. |undo|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 'u' goes backward in time, 'CTRL-R' goes forward again. Set option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 'undolevels' to the number of changes to be remembered (default 1000).
235
23d380e32c95 updated for version 7.0066
vimboss
parents: 166
diff changeset
147 Set 'undolevels' to 0 for a vi-compatible one level undo. Set it to
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 -1 for no undo at all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 When all changes in a buffer have been undone, the buffer is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 considered changed anymore. You can exit it with :q, without <!>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 Graphical User Interface (GUI) |gui|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 Included support for GUI: menu's, mouse, scrollbars, etc. You can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 define your own menus. Better support for CTRL/SHIFT/ALT keys in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 combination with special keys and mouse. Supported for various
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 (Windows 95 and later), BeOS, Amiga and Macintosh.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 Multiple windows and buffers. |windows.txt|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 Vim can split the screen into several windows, each editing a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 different buffer or the same buffer at a different location. Buffers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 can still be loaded (and changed) but not displayed in a window. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 is called a hidden buffer. Many commands and options have been added
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 for this facility.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 Syntax highlighting. |:syntax|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 Vim can highlight keywords, patterns and other things. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 defined by a number of ":syntax" commands, and can be made to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 highlight most languages and file types. A number of files are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 included for highlighting the most common languages, like C, C++,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 Java, Pascal, Makefiles, shell scripts, etc. The colors used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 highlighting can be defined for ordinary terminals, color terminals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 and the GUI with the ":highlight" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 Folding |folding|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 A range of lines can be shown as one "folded" line. This allows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 overviewing a file and moving blocks of text around quickly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 Folds can be created manually, from the syntax of the file, by indent,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 Plugins |add-plugin|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 The functionality can be extended by dropping a plugin file in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 right directory. That's an easy way to start using Vim scripts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 written by others. Plugins can be for all kind of files, or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 specifically for a filetype.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 Repeat a series of commands. |q|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 "q{c}" starts recording typed characters into named register {c}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 (append to the register if register name is uppercase). A subsequent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 "q" stops recording. The register can then be executed with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 "@{c}" command. This is very useful to repeat a complex action.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 Flexible insert mode. |ins-special-special|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 The arrow keys can be used in insert mode to move around in the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 This breaks the insert in two parts as far as undo and redo is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 concerned.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 CTRL-O can be used to execute a single command-mode command. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 almost the same as hitting <Esc>, typing the command and doing "a".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 Visual mode. |Visual-mode|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 Visual can be used to first highlight a piece of text and then give a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 command to do something with it. This is an (easy to use) alternative
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 to first giving the operator and then moving to the end of the text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 to be operated upon. "v" and "V" are used to start Visual mode. "v"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 works on characters and 'V' on lines. Move the cursor to extend the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 Visual part. It is shown highlighted on the screen. By typing "o"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 the other end of the Visual text can be moved. The Visual text can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 be affected by an operator:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 d delete
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 c change
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 y yank
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 > or < insert or delete indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 ! filter through external program
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 = filter through indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 : start ":" command for the Visual lines.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 gq format text to 'textwidth' columns
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 J join lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 ~ swap case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 u make lowercase
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 U make uppercase
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 Block operators. |visual-block|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 With Visual a rectangular block of text can be selected. Start Visual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 with CTRL-V. The block can be deleted ("d"), yanked ("y") or its case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 can be changed ("~", "u" and "U"). A deleted or yanked block can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 put into the text with the "p" and "P" commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 Online help system. |:help|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 Help is displayed in a window. The usual commands can be used to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 move around, search for a string, etc. Tags can be used to jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 around in the help files, just like hypertext links. The ":help"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 command takes an argument to quickly jump to the info on a subject.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 <F1> is the quick access to the help system. The name of the help
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 index file can be set with the 'helpfile' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 Command-line editing and history. |cmdline-editing|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 You can insert or delete at any place in the command-line using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 cursor keys. The right/left cursor keys can be used to move
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 forward/backward one character. The shifted right/left cursor keys
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 can be used to move forward/backward one word. CTRL-B/CTRL-E can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 used to go to the begin/end of the command-line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 |cmdline-history|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 The command-lines are remembered. The up/down cursor keys can be used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 to recall previous command-lines. The 'history' option can be set to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 the number of lines that will be remembered. There is a separate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 history for commands and for search patterns.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 Command-line completion. |cmdline-completion|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 While entering a command-line (on the bottom line of the screen)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 <Tab> can be typed to complete
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 what example ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 - command :e<Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 - tag :ta scr<Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 - option :set sc<Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 - option value :set hf=<Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 - file name :e ve<Tab>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 - etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 will walk through the matches. <Tab> works like CTRL-N, but wraps
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 around to the first match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 The 'wildchar' option can be set to the character for command-line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 completion, <Tab> is the default. CTRL-D can be typed after an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 (incomplete) wildcard; all matches will be listed. CTRL-A will insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 all matches. CTRL-L will insert the longest common part of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 matches.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 Insert-mode completion |ins-completion|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 In insert mode the CTRL-N and CTRL-P keys can be used to complete a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 word that has previously been used. |i_CTRL-N|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 With CTRL-X another mode is entered, through which completion can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 done for:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 |i_CTRL-X_CTRL-F| file names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 |i_CTRL-X_CTRL-K| words from 'dictionary' files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 |i_CTRL-X_CTRL-T| words from 'thesaurus' files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 |i_CTRL-X_CTRL-I| words from included files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 |i_CTRL-X_CTRL-L| whole lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 |i_CTRL-X_CTRL-]| words from the tags file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 |i_CTRL-X_CTRL-D| definitions or macros
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 Long line support |'wrap'| |'linebreak'|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 If the 'wrap' option is off, long lines will not wrap and only part
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 of them will be shown. When the cursor is moved to a part that is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 shown, the screen will scroll horizontally. The minimum number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 columns to scroll can be set with the 'sidescroll' option. The "zh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 and "zl" commands can be used to scroll sideways.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 Alternatively, long lines are broken in between words when the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 'linebreak' option is set. This allows editing a single-line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 paragraph conveniently (e.g. when the text is later read into a DTP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 program). Move the cursor up/down with the "gk" and "gj" commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 Text formatting. |formatting|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 The 'textwidth' option can be used to automatically limit the line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 length. This supplements the 'wrapmargin' option of Vi, which was not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 very useful. The "gq" operator can be used to format a piece of text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 (for example, "gqap" formats the current paragraph). Commands for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 text alignment: ":center", ":left" and ":right".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 Extended search patterns |pattern|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 There are many extra items to match various text items. Examples:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 A "\n" can be used in a search pattern to match a line break.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 "x\{2,4}" matches "x" 2 to 4 times.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 "\s" matches a white space character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 Edit-compile-edit speedup. |quickfix|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 The ":make" command can be used to run the compilation and jump to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 the first error. Alternatively Vim can be started with the "-q"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 option from the compiler. A file with compiler error messages is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 interpreted. Vim starts editing at the first error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 Each line in the error file is scanned for the name of a file, line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 number and error message. The 'errorformat' option can be set to a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 list of scanf-like strings to handle output from many compilers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 The ":cn" command can be used to jump to the next error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 ":cl" lists all the error messages. Other commands are available
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 (almost the same as with Manx's Z editor on the Amiga).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 The 'makeef' option has the name of the file with error messages.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 The 'makeprg' option contains the name of the program to be executed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 with the ":make" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 The 'shellpipe' option contains the string to be used to put the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 output of the compiler into the errorfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 Improved indenting for C programs |'cindent'|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 When the 'cindent' option is on the indent of each line is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 automatically adjusted. C syntax is mostly recognized. The indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 for various styles can be set with 'cinoptions'. The keys to trigger
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 indenting can be set with 'cinkeys'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 Comments can be automatically formatted. The 'comments' option can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 set to the characters that start and end a comment. This works best
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 for C code, but also works for e-mail (">" at start of the line) and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 other types of text. The "=" operator can be used to re-indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 lines.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 Searching for words in include files |include-search|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 The "[i" command can be used to search for a match of the word under
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 the cursor in the current and included files. The 'include' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 can be set the a pattern that describes a command to include a file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 (the default is for C programs).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 The "[I" command lists all matches, the "[ CTRL-I" command jumps to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 a match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 The "[d", "[D" and "[ CTRL-D" commands do the same, but only for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 lines where the pattern given with the 'define' option matches.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 Automatic commands |autocommand|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 Commands can be automatically executed when reading a file, writing a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 file, jumping to another buffer, etc., depending on the file name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 This is useful to set options and mappings for C programs,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 documentation, plain text, e-mail, etc. This also makes it possible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 to edit compressed files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 Scripts and Expressions |expression|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 Commands have been added to form up a simple but powerful script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 language.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 |:if| Conditional execution, which can be used for example
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 to set options depending on the value of $TERM.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 |:while| Repeat a number of commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 |:echo| Print the result of an expression.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 |:let| Assign a value to an internal variable, option, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 |:execute| Execute a command formed by an expression.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 Viminfo |viminfo-file|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 The command-line history, marks and registers can be stored in a file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 that is read on startup. This can be used to repeat a search command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 or command-line command after exiting and restarting Vim. It is also
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 possible to jump right back to where the last edit stopped with "'0".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 The 'viminfo' option can be set to select which items to store in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 .viminfo file. This is off by default.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 Mouse support |mouse-using|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 The mouse is supported in the GUI version, in an xterm for Unix, for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 Linux with gpm, for MS-DOS, and Win32. It can be used to position the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 cursor, select the visual area, paste a register, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 Usage of key names |<>| |key-notation|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 Special keys now all have a name like <Up>, <End>, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 This name can be used in mappings, to make it easy to edit them.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 Editing binary files |edit-binary|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 Vim can edit binary files. You can change a few characters in an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 executable file, without corrupting it. Vim doesn't remove NUL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 characters (they are represented as <NL> internally).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 |-b| command-line argument to start editing a binary file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 |'binary'| Option set by "-b". Prevents adding an <EOL> for the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 last line in the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 Multi-language support |multi-lang|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 Files in double-byte or multi-byte encodings can be edited. There is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 UTF-8 support to be able to edit various languages at the same time,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 without switching fonts. |UTF-8|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 Messages and menus are available in different languages.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 5. Other vim features *other-features*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 A random collection of nice extra features.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 When Vim is started with "-s scriptfile", the characters read from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 "scriptfile" are treated as if you typed them. If end of file is reached
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 before the editor exits, further characters are read from the console.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 The "-w" option can be used to record all typed characters in a script file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 This file can then be used to redo the editing, possibly on another file or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 after changing some commands in the script file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 The "-o" option opens a window for each argument. "-o4" opens four windows.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 Vi requires several termcap entries to be able to work full-screen. Vim only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 requires the "cm" entry (cursor motion).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 In command mode:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 When the 'showcmd' option is set, the command characters are shown in the last
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 line of the screen. They are removed when the command is finished.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 If the 'ruler' option is set, the current cursor position is shown in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 last line of the screen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 "U" still works after having moved off the last changed line and after "u".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 Characters with the 8th bit set are displayed. The characters between '~' and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 0xa0 are displayed as "~?", "~@", "~A", etc., unless they are included in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 'isprint' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 "][" goes to the next ending of a C function ('}' in column 1).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 "[]" goes to the previous ending of a C function ('}' in column 1).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 "]f", "[f" and "gf" start editing the file whose name is under the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 CTRL-W f splits the window and starts editing the file whose name is under
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 "*" searches forward for the identifier under the cursor, "#" backward.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 "K" runs the program defined by the 'keywordprg' option, with the identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 under the cursor as argument.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 "%" can be preceded with a count. The cursor jumps to the line that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 percentage down in the file. The normal "%" function to jump to the matching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 brace skips braces inside quotes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 With the CTRL-] command, the cursor may be in the middle of the identifier.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 The used tags are remembered. Commands that can be used with the tag stack
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 The 'tags' option can be set to a list of tag file names. Thus multiple
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 tag files can be used. For file names that start with "./", the "./" is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 replaced with the path of the current file. This makes it possible to use a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 tags file in the same directory as the file being edited.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 Previously used file names are remembered in the alternate file name list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 CTRL-^ accepts a count, which is an index in this list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 ":files" command shows the list of alternate file names.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 "#<N>" is replaced with the <N>th alternate file name in the list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 "#<" is replaced with the current file name without extension.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 Search patterns have more features. The <NL> character is seen as part of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 search pattern and the substitute string of ":s". Vi sees it as the end of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 the command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 Searches can put the cursor on the end of a match and may include a character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 offset.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 Count added to "~", ":next", ":Next", "n" and "N".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 The command ":next!" with 'autowrite' set does not write the file. In vi the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 file was written, but this is considered to be a bug, because one does not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 expect it and the file is not written with ":rewind!".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 In Vi when entering a <CR> in replace mode deletes a character only when 'ai'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 is set (but does not show it until you hit <Esc>). Vim always deletes a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 character (and shows it immediately).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 Added :wnext command. Same as ":write" followed by ":next".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 The ":w!" command always writes, also when the file is write protected. In Vi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 you would have to do ":!chmod +w %" and ":set noro".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 When 'tildeop' has been set, "~" is an operator (must be followed by a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 movement command).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 With the "J" (join) command you can reset the 'joinspaces' option to have only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 one space after a period (Vi inserts two spaces).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 "cw" can be used to change white space formed by several characters (Vi is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 confusing: "cw" only changes one space, while "dw" deletes all white space).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 "o" and "O" accept a count for repeating the insert (Vi clears a part of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 display).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 Flags after Ex commands not supported (no plans to include it).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 On non-UNIX systems ":cd" command shows current directory instead of going to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 the home directory (there isn't one). ":pwd" prints the current directory on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 all systems.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 After a ":cd" command the file names (in the argument list, opened files)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 still point to the same files. In Vi ":cd" is not allowed in a changed file;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 otherwise the meaning of file names change.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 ":source!" command reads Vi commands from a file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 ":mkexrc" command writes current modified options and mappings to a ".exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 file. ":mkvimrc" writes to a ".vimrc" file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 No check for "tail recursion" with mappings. This allows things like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 ":map! foo ^]foo".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 When a mapping starts with number, vi loses the count typed before it (e.g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 when using the mapping ":map g 4G" the command "7g" goes to line 4). This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 considered a vi bug. Vim concatenates the counts (in the example it becomes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 "74G"), as most people would expect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 The :put! command inserts the contents of a register above the current line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 The "p" and "P" commands of vi cannot be repeated with "." when the putted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 text is less than a line. In Vim they can always be repeated.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 ":noremap" command can be used to enter a mapping that will not be remapped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 This is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 ":cnoremap" can be used for mapping in command-line editing only. ":imap",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 ":iunmap" and ":inoremap" can be used for mapping in insert mode only.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 ":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 In Vi the command ":map foo bar" would remove a previous mapping
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 ":map bug foo". This is considered a bug, so it is not included in Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 ":unmap! foo" does remove ":map! bug foo", because unmapping would be very
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 difficult otherwise (this is vi compatible).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 The ':' register contains the last command-line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 The '%' register contains the current file name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 The '.' register contains the last inserted text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 ":dis" command shows the contents of the yank registers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 same positions as used with the '' command, but may be in another file. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 ":jumps" command lists the older positions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 If the 'shiftround' option is set, an indent is rounded to a multiple of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 'shiftwidth' with ">" and "<" commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 The 'scrolljump' option can be set to the minimum number of lines to scroll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 when the cursor gets off the screen. Use this when scrolling is slow.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 The 'scrolloff' option can be set to the minimum number of lines to keep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 above and below the cursor. This gives some context to where you are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 editing. When set to a large number the cursor line is always in the middle
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 of the window.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 Uppercase marks can be used to jump between files. The ":marks" command lists
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 all currently set marks. The commands "']" and "`]" jump to the end of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 previous operator or end of the text inserted with the put command. "'[" and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 "`[" do jump to the start.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 The 'shelltype' option can be set to reflect the type of shell used on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 Amiga.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 The 'highlight' option can be set for the highlight mode to be used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 several commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 The CTRL-A (add) and CTRL-X (subtract) commands are new. The count to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 command (default 1) is added to/subtracted from the number at or after the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 cursor. That number may be decimal, octal (starts with a '0') or hexadecimal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 (starts with '0x'). Very useful in macros.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 With the :set command the prefix "inv" can be used to invert boolean options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 In both Vi and Vim you can create a line break with the ":substitute" command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 by using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 text. With Vim you can put a real CTRL-M in the text by preceding it with a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 CTRL-V.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 In Insert mode:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 If the 'revins' option is set, insert happens backwards. This is for typing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 Hebrew. When inserting normal characters the cursor will not be shifted and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 the text moves rightwards. Backspace, CTRL-W and CTRL-U will also work in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 the opposite direction. CTRL-B toggles the 'revins' option. In replace mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 'revins' has no effect. Only when enabled at compile time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 The backspace key can be used just like CTRL-D to remove auto-indents.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 You can backspace, CTRL-U and CTRL-W over line breaks if the 'backspace' (bs)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 option includes "eol". You can backspace over the start of insert if the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 'backspace' option includes "start".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 When the 'paste' option is set, a few option are reset and mapping in insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 mode and abbreviation are disabled. This allows for pasting text in windowing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 systems without unexpected results. When the 'paste' option is reset, the old
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 option values are restored.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 what column the cursor is in.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 CTRL-@ (insert previously inserted text) works always (Vi: only when typed as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 first character).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 CTRL-A works like CTRL-@ but does not leave insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 CTRL-R {0-9a-z..} can be used to insert the contents of a register.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 When the 'smartindent' option is set, C programs will be better auto-indented.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 With 'cindent' even more.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 CTRL-Y and CTRL-E can be used to copy a character from above/below the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 current cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 After CTRL-V you can enter a three digit decimal number. This byte value is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 inserted in the text as a single character. Useful for international
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 characters that are not on your keyboard.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 When the 'expandtab' (et) option is set, a <Tab> is expanded to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 appropriate number of spaces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 The window always reflects the contents of the buffer (Vi does not do this
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 when changing text and in some other cases).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 normal digraphs is included. They are shown with the ":digraph" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 More can be added with ":digraph {char1}{char2} {number}". A digraph is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 'digraph' option is set).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 for the first insert. Vim does it for all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 A count to the "i" or "a" command is used for all the text. Vi uses the count
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 only for one line. "3iabc<NL>def<Esc>" would insert "abcabcabc<NL>def" in Vi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 but "abc<NL>defabc<NL>defabc<NL>def" in Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 In Command-line mode:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643
235
23d380e32c95 updated for version 7.0066
vimboss
parents: 166
diff changeset
644 <Esc> terminates the command-line without executing it. In vi the command
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 line would be executed, which is not what most people expect (hitting <Esc>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 should always get you back to command mode). To avoid problems with some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 obscure macros, an <Esc> in a macro will execute the command. If you want a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 typed <Esc> to execute the command like vi does you can fix this with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 ":cmap ^V<Esc> ^V<CR>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 General:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 The 'ttimeout' option is like 'timeout', but only works for cursor and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 function keys, not for ordinary mapped characters. The 'timeoutlen' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 gives the number of milliseconds that is waited for. If the 'esckeys' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 is not set, cursor and function keys that start with <Esc> are not recognized
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 in insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 There is an option for each terminal string. Can be used when termcap is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 supported or to change individual strings.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 <NL> or "mac" <CR>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 When the 'fileformats' option is not empty, Vim tries to detect the type of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 <EOL> automatically. The 'fileformat' option is set accordingly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 On systems that have no job control (older Unix systems and non-Unix systems)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 the CTRL-Z, ":stop" or ":suspend" command starts a new shell.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 If Vim is started on the Amiga without an interactive window for output, a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 window is opened (and :sh still works). You can give a device to use for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 editing with the |-d| argument, e.g. "-d con:20/20/600/150".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 The 'columns' and 'lines' options are used to set or get the width and height
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 of the display.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 Option settings are read from the first and last few lines of the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 Option 'modelines' determines how many lines are tried (default is 5). Note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 that this is different from the Vi versions that can execute any Ex command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 in a modeline (a major security problem). |trojan-horse|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682 If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 And it comes back there, when pressing <Esc>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 Undo information is kept in memory. Available memory limits the number and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 size of change that can be undone. This may be a problem with MS-DOS, is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 hardly a problem on the Amiga and almost never with Unix and Win32.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 If the 'backup' or 'writebackup' option is set: Before a file is overwritten,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 a backup file (.bak) is made. If the "backup" option is set it is left
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 behind.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 Vim creates a file ending in ".swp" to store parts of the file that have been
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 changed or that do not fit in memory. This file can be used to recover from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 an aborted editing session with "vim -r file". Using the swap file can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 switched off by setting the 'updatecount' option to 0 or starting Vim with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 the "-n" option. Use the 'directory' option for placing the .swp file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 somewhere else.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 Vim is able to work correctly on filesystems with 8.3 file names, also when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 filesystem under Unix. See |'shortname'|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 Error messages are shown at least one second (Vi overwrites error messages).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 If Vim gives the |hit-enter| prompt, you can hit any key. Characters other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 than <CR>, <NL> and <Space> are interpreted as the (start of) a command. (Vi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 only accepts a command starting with ':').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 The contents of the numbered and unnamed registers is remembered when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 changing files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 The "No lines in buffer" message is a normal message instead of an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 message, since that may cause a mapping to be aborted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 The AUX: device of the Amiga is supported.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 6. Command-line arguments *cmdline-arguments*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 Different versions of Vi have different command-line arguments. This can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 confusing. To help you, this section gives an overview of the differences.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 Five variants of Vi will be considered here:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 Elvis Elvis version 2.1b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 Nvi Nvi version 1.79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 Posix Posix 1003.2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 Vi Vi version 3.7 (for Sun 4.1.x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 Vile Vile version 7.4 (incomplete)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 Vim Vim version 5.2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 Only Vim is able to accept options in between and after the file names.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 +{command} Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 - Nvi, Posix, Vi: Run Ex in batch mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 Vim: Read file from stdin (use -s for batch mode).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 -- Vim: End of options, only file names are following.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 --cmd {command} Vim: execute {command} before sourcing vimrc files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 --echo-wid Vim: GTK+ echoes the Window ID on stdout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 --help Vim: show help message and exit.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 --literal Vim: take file names literally, don't expand wildcards.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 --nofork Vim: same as |-f|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 --noplugin[s] Vim: Skip loading plugins.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 --remote Vim: edit the files in another Vim server
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 --remote-expr {expr} Vim: evaluate {expr} in another Vim server
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 --remote-send {keys} Vim: send {keys} to a Vim server and exit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 --remote-silent {file} Vim: edit the files in another Vim server if possible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 --remote-wait Vim: edit the files in another Vim server and wait for it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 --remote-wait-silent Vim: like --remote-wait, no complaints if not possible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 --role {role} Vim: GTK+ 2: set role of main window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 --serverlist Vim: Output a list of Vim servers and exit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 --servername {name} Vim: Specify Vim server name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 --socketid {id} Vim: GTK window socket to run Vim in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 --version Vim: show version message and exit.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 -? Vile: print usage summary and exit.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 -a Elvis: Load all specified file names into a window (use -o for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 Vim).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 -A Vim: Start in Arabic mode (when compiled with Arabic).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 -b {blksize} Elvis: Use {blksize} blocksize for the session file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 -b Vim: set 'binary' mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 -C Vim: Compatible mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 -c {command} Elvis, Nvi, Posix, Vim: run {command} as an Ex command after
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 loading the edit buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 Vim: allow up to 10 "-c" arguments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 -d {device} Vim: Use {device} for I/O (Amiga only). {only when compiled
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 without the |+diff| feature}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 -d Vim: start with 'diff' set. |vimdiff|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 -dev {device} Vim: Use {device} for I/O (Amiga only).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 -D Vim: debug mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 -e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 called "ex".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 -E Vim: Start in improved Ex mode |gQ|, like "exim".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804 -f Vim: Run GUI in foreground (Amiga: don't open new window).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 -f {session} Elvis: Use {session} as the session file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 -F Vim: Start in Farsi mode (when compiled with Farsi).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 Nvi: Fast start, don't read the entire file when editing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 starts.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 -G {gui} Elvis: Use the {gui} as user interface.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 -g Vim: Start GUI.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814 -g N Vile: start editing at line N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 -h Vim: Give help message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 Vile: edit the help file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 -H Vim: start Hebrew mode (when compiled with it).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821 -i Elvis: Start each window in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822 -i {viminfo} Vim: Use {viminfo} for viminfo file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 -L Vim: Same as "-r" (also in some versions of Vi).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 -l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 -m Vim: Modifications not allowed to be written, resets 'write'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 -M Vim: Modifications not allowed, resets 'modifiable' and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 'write' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 -N Vim: No-compatible mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 -n Vim: No swap file used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 -nb[args] Vim: open a NetBeans interface connection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 -O[N] Vim: Like -o, but use vertically split windows.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 -o[N] Vim: Open [N] windows, or one for each file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 -P {parent-title} Win32 Vim: open Vim inside a parent application window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846 -q {name} Vim: Use {name} for quickfix error file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847 -q{name} Vim: Idem.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 -R Elvis, Nvi, Posix, Vile, Vim: Set the 'readonly' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
850
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851 -r Elvis, Nvi, Posix, Vi, Vim: Recovery mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853 -S Nvi: Set 'secure' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 -S {script} Vim: source script after starting up.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856 -s Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857 Elvis: Sets the 'safer' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 -s {scriptin} Vim: Read from script file {scriptin}; only when not in Ex
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859 mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 -s {pattern} Vile: search for {pattern}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 -t {tag} Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 -t{tag} Vim: Idem.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865 -T {term} Vim: Set terminal name to {term}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 -u {vimrc} Vim: Read initializations from {vimrc} file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 -U {gvimrc} Vim: Read GUI initializations from {gvimrc} file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871 -v Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
872 terms).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
873 Vile: View mode, no changes possible.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
874
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
875 -V Elvis, Vim: Verbose mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
876 -V{nr} Vim: Verbose mode with specified level.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
877
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
878 -w {size} Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
879 -w{size} Nvi, Vi: Same as "-w {size}".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
880 -w {name} Vim: Write to script file {name} (must start with non-digit).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
881
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882 -W {name} Vim: Append to script file {name}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
883
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
884 -x Vi, Vim: Ask for encryption key. See |encryption|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
886 -X Vim: Don't connect to the X server.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
887
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
888 -y Vim: Start in easy mode, like |evim|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
889
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
890 -Z Vim: restricted mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
891
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
892 @{cmdfile} Vile: use {cmdfile} as startup file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
893
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
894 ==============================================================================
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
895 7. POSIX compliance *posix* *posix-compliance*
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
896
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
897 In 2005 the POSIX test suite was run to check the compatiblity of Vim. Most
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
898 of the test was executed properly. There are the few things where Vim
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
899 is not POSIX compliant, even when run in Vi compatibility mode.
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
900
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
901 Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
902 flags when Vim starts up. This makes Vim run as POSIX as it can. That's
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
903 a bit different from being Vi compatible.
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
904
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
905 This is where Vim does not behave as POSIX specifies and why:
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
906
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
907 *posix-screen-size*
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
908 The $COLUMNS and $LINES environment variables are ignored by Vim if
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
909 the size can be obtained from the terminal in a more reliable way.
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
910 Add the '|' flag to 'cpoptions' to have $COLUMNS and $LINES overrule
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
911 sizes obtained in another way.
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
912
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
913 The "{" and "}" commands don't stop at a "{" in the original Vi, but
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
914 POSIX specifies it does. Add the '{' flag to 'cpoptions' if you want
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
915 it the POSIX way.
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
916
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
917 The "D", "o" and "O" commands accept a count. Also when repeated.
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 160
diff changeset
918 Add the '#' flag to 'cpoptions' if you want to ignore the count.
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
919
166
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
920 The ":cd" command fails if the current buffer is modified when the '.'
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
921 flag is present in 'cpoptions'.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
922
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
923 There is no ATTENTION message, the "A" flag is added to 'shortmess'.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
924
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
925 These are remarks about running the POSIX test suite:
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
926 - vi test 33 sometimes fails for unknown reasons
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
927 - vi test 250 fails; behavior will be changed in a new revision
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
928 http://www.opengroup.org/austin/mailarchives/ag-review/msg01710.html
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
929 - vi test 310 fails; exit code non-zero when any error occurred?
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
930 - ex test 24 fails because test is wrong. Changed between SUSv2 and SUSv3.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
931 - ex tests 47, 48, 49, 72, 73 fail because .exrc file isn't read in silent
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
932 mode and $EXINIT isn't used.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
933 - ex tests 76, 78 fail because echo is used instead of printf. (fixed)
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
934 Also: problem with \s not changed to space.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
935 - ex test 355 fails because 'window' isn't used for "30z".
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
936 - ex test 368 fails because shell command isn't echoed in silent mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
937 - ex test 394 fails because "=" command output isn't visible in silent mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
938 - ex test 411 fails because test file is wrong, contains stray ':'.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
939 - ex test 475 and 476 fail because reprint output isn't visible in silent mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
940 - ex test 480 and 481 fail because the tags file has spaces instead of a tab.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
941 - ex test 502 fails because .exrc isn't read in silent mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
942 - ex test 509 fails because .exrc isn't read in silent mode. and exit code is
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
943 1 instead of 2.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
944 - ex test 534 fails because .exrc isn't read in silent mode.
3a28ed993bbe updated for version 7.0051
vimboss
parents: 164
diff changeset
945
160
7c0820eed232 updated for version 7.0049
vimboss
parents: 7
diff changeset
946
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 vim:tw=78:ts=8:ft=help:norl: