annotate runtime/doc/insert.txt @ 640:8a5a95f7ef2a v7.0185

updated for version 7.0185
author vimboss
date Sun, 22 Jan 2006 23:30:12 +0000
parents 81fe2ccc1207
children 9032e4668296
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1 *insert.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
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 *Insert* *Insert-mode*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 Inserting and replacing text *mode-ins-repl*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 Most of this file is about Insert and Replace mode. At the end are a few
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 commands for inserting text in other ways.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 An overview of the most often used commands can be found in chapter 24 of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 user manual |usr_24.txt|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 1. Special keys |ins-special-keys|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 2. Special special keys |ins-special-special|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 3. 'textwidth' and 'wrapmargin' options |ins-textwidth|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 4. 'expandtab', 'smarttab' and 'softtabstop' options |ins-expandtab|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 5. Replace mode |Replace-mode|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 6. Virtual Replace mode |Virtual-Replace-mode|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 7. Insert mode completion |ins-completion|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 8. Insert mode commands |inserting|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 9. Ex insert commands |inserting-ex|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 10. Inserting a file |inserting-file|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 Also see 'virtualedit', for moving the cursor to positions where there is no
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 character. Useful for editing a table.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 1. Special keys *ins-special-keys*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 In Insert and Replace mode, the following characters have a special meaning;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 other characters are inserted directly. To insert one of these special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 characters into the buffer, precede it with CTRL-V. To insert a <Nul>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 character use "CTRL-V CTRL-@" or "CTRL-V 000". On some systems, you have to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 use "CTRL-V 003" to insert a CTRL-C. Note: When CTRL-V is mapped you can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 often use CTRL-Q instead |i_CTRL-Q|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 If you are working in a special language mode when inserting text, see the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 'langmap' option, |'langmap'|, on how to avoid switching this mode on and off
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 all the time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 If you have 'insertmode' set, <Esc> and a few other keys get another meaning.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 See |'insertmode'|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 char action ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 -----------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 *i_CTRL-[* *i_<Esc>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 <Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode. Finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 abbreviation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 Note: If your <Esc> key is hard to hit on your keyboard, train
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 yourself to use CTRL-[.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 *i_CTRL-C*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 CTRL-C Quit insert mode, go back to Normal mode. Do not check for
140
8ecb0db93e9a updated for version 7.0045
vimboss
parents: 74
diff changeset
56 abbreviations. Does not trigger the |InsertLeave| autocommand
8ecb0db93e9a updated for version 7.0045
vimboss
parents: 74
diff changeset
57 event.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 *i_CTRL-@*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 CTRL-@ Insert previously inserted text and stop insert. {Vi: only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 when typed as first char, only up to 128 chars}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 *i_CTRL-A*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 CTRL-A Insert previously inserted text. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 *i_CTRL-H* *i_<BS>* *i_BS*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 <BS> or CTRL-H Delete the character before the cursor (see |i_backspacing|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 about joining lines).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 See |:fixdel| if your <BS> key does not do what you want.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 {Vi: does not delete autoindents}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 *i_<Del>* *i_DEL*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 <Del> Delete the character under the cursor. If the cursor is at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 the end of the line, and the 'backspace' option includes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 "eol", delete the <EOL>; the next line is appended after the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 current one.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 See |:fixdel| if your <Del> key does not do what you want.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 *i_CTRL-W*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 CTRL-W Delete the word before the cursor (see |i_backspacing| about
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 joining lines). See the section "word motions",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 |word-motions|, for the definition of a word.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 *i_CTRL-U*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 CTRL-U Delete all entered characters in the current line (see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 |i_backspacing| about joining lines).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 *i_CTRL-I* *i_<Tab>* *i_Tab*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 <Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 equivalent number of spaces is inserted (use CTRL-V <Tab> to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 avoid the expansion; use CTRL-Q <Tab> if CTRL-V is mapped
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 |i_CTRL-Q|). See also the 'smarttab' option and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 |ins-expandtab|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 *i_CTRL-J* *i_<NL>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 <NL> or CTRL-J Begin new line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 *i_CTRL-M* *i_<CR>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 <CR> or CTRL-M Begin new line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 *i_CTRL-K*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 CTRL-K {char1} [char2]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 Enter digraph (see |digraphs|). When {char1} is a special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 key, the code for that key is inserted in <> form. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 example, the string "<S-Space>" can be entered by typing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 <C-K><S-Space> (two keys). Neither char is considered for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 mapping. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 CTRL-N Find next keyword (see |i_CTRL-N|). {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 CTRL-P Find previous keyword (see |i_CTRL-P|). {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 Insert the contents of a register. Between typing CTRL-R and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 the second character, '"' will be displayed to indicate that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 you are expected to enter the name of a register.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 The text is inserted as if you typed it, but mappings and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 abbreviations are not used. If you have options like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 'textwidth', 'formatoptions', or 'autoindent' set, this will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 influence what will be inserted. This is different from what
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 happens with the "p" command and pasting with the mouse.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 Special registers:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 '"' the unnamed register, containing the text of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 the last delete or yank
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 '%' the current file name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 '#' the alternate file name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 '*' the clipboard contents (X11: primary selection)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 '+' the clipboard contents
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 '/' the last search pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 ':' the last command-line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 '.' the last inserted text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 '-' the last small (less than a line) delete
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 '=' the expression register: you are prompted to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 enter an expression (see |expression|)
36
125e80798a85 updated for version 7.0021
vimboss
parents: 14
diff changeset
128 Note that 0x80 (128 decimal) is used for
125e80798a85 updated for version 7.0021
vimboss
parents: 14
diff changeset
129 special keys, use CTRL-R CTRL-R to insert it
125e80798a85 updated for version 7.0021
vimboss
parents: 14
diff changeset
130 literally.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 See |registers| about registers. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 Insert the contents of a register. Works like using a single
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 CTRL-R, but the text is inserted literally, not as if typed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 This differs when the register contains characters like <BS>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 Example, where register a contains "ab^Hc": >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 CTRL-R a results in "ac".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 CTRL-R CTRL-R a results in "ab^Hc".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 < Options 'textwidth', 'formatoptions', etc. still apply. If
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 you also want to avoid these, use "<C-R><C-O>r", see below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 The '.' register (last inserted text) is still inserted as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 typed. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 Insert the contents of a register literally and don't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 auto-indent. Does the same as pasting with the mouse
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 |<MiddleMouse>|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 Does not replace characters!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 The '.' register (last inserted text) is still inserted as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 typed. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 CTRL-R CTRL-P {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-P*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 Insert the contents of a register literally and fix the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 indent, like |[<MiddleMouse>|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 Does not replace characters!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 The '.' register (last inserted text) is still inserted as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 typed. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 *i_CTRL-T*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 CTRL-T Insert one shiftwidth of indent at the start of the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 line. The indent is always rounded to a 'shiftwidth' (this is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 vi compatible). {Vi: only when in indent}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 *i_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 CTRL-D Delete one shiftwidth of indent at the start of the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 line. The indent is always rounded to a 'shiftwidth' (this is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 vi compatible). {Vi: CTRL-D works only when used after
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 autoindent}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 *i_0_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 0 CTRL-D Delete all indent in the current line. {Vi: CTRL-D works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 only when used after autoindent}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 *i_^_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 ^ CTRL-D Delete all indent in the current line. The indent is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 restored in the next line. This is useful when inserting a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 label. {Vi: CTRL-D works only when used after autoindent}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 *i_CTRL-V*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 CTRL-V Insert next non-digit literally. For special keys, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 terminal code is inserted. It's also possible to enter the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 decimal, octal or hexadecimal value of a character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 |i_CTRL-V_digit|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 The characters typed right after CTRL-V are not considered for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 mapping. {Vi: no decimal byte entry}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 Note: When CTRL-V is mapped (e.g., to paste text) you can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 often use CTRL-Q instead |i_CTRL-Q|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 *i_CTRL-Q*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 CTRL-Q Same as CTRL-V.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 Note: Some terminal connections may eat CTRL-Q, it doesn't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 work then. It does work in the GUI.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 CTRL-X Enter CTRL-X mode. This is a sub-mode where commands can
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
193 be given to complete words or scroll the window. See
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 |i_CTRL-X| and |ins-completion|. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 *i_CTRL-E*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 CTRL-E Insert the character which is below the cursor. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 *i_CTRL-Y*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 CTRL-Y Insert the character which is above the cursor. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 Note that for CTRL-E and CTRL-Y 'textwidth' is not used, to be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 able to copy characters from a long line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 *i_CTRL-_*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 CTRL-_ Switch between languages, as follows:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 - When in a rightleft window, revins and nohkmap are toggled,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 since English will likely be inserted in this case.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 - When in a norightleft window, revins and hkmap are toggled,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 since Hebrew will likely be inserted in this case.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 CTRL-_ moves the cursor to the end of the typed text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 This command is only available when the 'allowrevins' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 is set.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 Please refer to |rileft.txt| for more information about
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 right-to-left mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 Only if compiled with the |+rightleft| feature (which is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 the default).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 *i_CTRL-^*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 CTRL-^ Toggle the use of typing language characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 When language |:lmap| mappings are defined:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 - If 'iminsert' is 1 (langmap mappings used) it becomes 0 (no
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 langmap mappings used).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 - If 'iminsert' has another value it becomes 1, thus langmap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 mappings are enabled.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 When no language mappings are defined:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 - If 'iminsert' is 2 (Input Method used) it becomes 0 (no
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 Input Method used).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 - If 'iminsert' has another value it becomes 2, thus the Input
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 Method is enabled.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 When set to 1, the value of the "b:keymap_name" variable, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 'keymap' option or "<lang>" appears in the status line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 The language mappings are normally used to type characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 that are different from what the keyboard produces. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 'keymap' option can be used to install a whole number of them.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 *i_CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 CTRL-] Trigger abbreviation, without inserting a character. {not in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 *i_<Insert>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 <Insert> Toggle between Insert and Replace mode. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 -----------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 *i_backspacing*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 (unless 'revins' is set). This is a comma separated list of items:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 item action ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 indent allow backspacing over autoindent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 eol allow backspacing over end-of-line (join lines)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 start allow backspacing over the start position of insert; CTRL-W and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 CTRL-U stop once at the start position
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 When 'backspace' is empty, Vi compatible backspacing is used. You cannot
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 backspace over autoindent, before column 1 or before where insert started.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 For backwards compatibility the values "0", "1" and "2" are also allowed, see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 |'backspace'|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 If the 'backspace' option does contain "eol" and the cursor is in column 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 when one of the three keys is used, the current line is joined with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 previous line. This effectively deletes the <EOL> in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 {Vi: does not cross lines, does not delete past start position of insert}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 *i_CTRL-V_digit*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 With CTRL-V the decimal, octal or hexadecimal value of a character can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 entered directly. This way you can enter any character, except a line break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 (<NL>, value 10). There are five ways to enter the character value:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 first char mode max nr of chars max value ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 (none) decimal 3 255
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
274 o or O octal 3 377 (255)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 x or X hexadecimal 2 ff (255)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 u hexadecimal 4 ffff (65535)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 U hexadecimal 8 7fffffff (2147483647)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 Normally you would type the maximum number of characters. Thus to enter a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 space (value 32) you would type <C-V>032. You can omit the leading zero, in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 which case the character typed after the number must be a non-digit. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 happens for the other modes as well: As soon as you type a character that is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 invalid for the mode, the value before it will be used and the "invalid"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 character is dealt with in the normal way.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 If you enter a value of 10, it will end up in the file as a 0. The 10 is a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 <NL>, which is used internally to represent the <Nul> character. When writing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 the buffer to a file, the <NL> character is translated into <Nul>. The <NL>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 character is written at the end of each line. Thus if you want to insert a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 <NL> character in a file you will have to make a line break.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 *i_CTRL-X* *insert_expand*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 CTRL-X enters a sub-mode where several commands can be used. Most of these
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 commands do keyword completion; see |ins-completion|. These are not available
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 when Vim was compiled without the |+insert_expand| feature.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 Two commands can be used to scroll the window up or down, without exiting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 insert mode:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 *i_CTRL-X_CTRL-E*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 CTRL-X CTRL-E scroll window one line up.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 *i_CTRL-X_CTRL-Y*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 CTRL-X CTRL-Y scroll window one line down.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 After CTRL-X is pressed, each CTRL-E (CTRL-Y) scrolls the window up (down) by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 one line unless that would cause the cursor to move from its current position
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 in the file. As soon as another key is pressed, CTRL-X mode is exited and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 that key is interpreted as in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 2. Special special keys *ins-special-special*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 The following keys are special. They stop the current insert, do something,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 and then restart insertion. This means you can do something without getting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 out of Insert mode. This is very handy if you prefer to use the Insert mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 all the time, just like editors that don't have a separate Normal mode. You
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 may also want to set the 'backspace' option to "indent,eol,start" and set the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 'insertmode' option. You can use CTRL-O if you want to map a function key to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 a command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 The changes (inserted or deleted characters) before and after these keys can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 be undone separately. Only the last change can be redone and always behaves
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 like an "i" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 char action ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 -----------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 <Up> cursor one line up *i_<Up>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 <Down> cursor one line down *i_<Down>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 CTRL-G <Up> cursor one line up, insert start column *i_CTRL-G_<Up>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 CTRL-G k cursor one line up, insert start column *i_CTRL-G_k*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 CTRL-G CTRL-K cursor one line up, insert start column *i_CTRL-G_CTRL-K*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 CTRL-G <Down> cursor one line down, insert start column *i_CTRL-G_<Down>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 CTRL-G j cursor one line down, insert start column *i_CTRL-G_j*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 <Left> cursor one character left *i_<Left>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 <Right> cursor one character right *i_<Right>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 <S-Left> cursor one word back (like "b" command) *i_<S-Left>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 <C-Left> cursor one word back (like "b" command) *i_<C-Left>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 <S-Right> cursor one word forward (like "w" command) *i_<S-Right>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 <C-Right> cursor one word forward (like "w" command) *i_<C-Right>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 <Home> cursor to first char in the line *i_<Home>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 <End> cursor to after last char in the line *i_<End>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 <C-Home> cursor to first char in the file *i_<C-Home>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 <C-End> cursor to after last char in the file *i_<C-End>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 <LeftMouse> cursor to position of mouse click *i_<LeftMouse>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 <S-Up> move window one page up *i_<S-Up>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 <PageUp> move window one page up *i_<PageUp>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 <S-Down> move window one page down *i_<S-Down>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 <PageDown> move window one page down *i_<PageDown>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 <MouseDown> scroll three lines down *i_<MouseDown>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 <S-MouseDown> scroll a full page down *i_<S-MouseDown>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 <MouseUp> scroll three lines up *i_<MouseUp>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 <S-MouseUp> scroll a full page up *i_<S-MouseUp>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 CTRL-O execute one command, return to Insert mode *i_CTRL-O*
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
357 CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
477
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
358 CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 -----------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 Note: If the cursor keys take you out of Insert mode, check the 'noesckeys'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 The CTRL-O command sometimes has a side effect: If the cursor was beyond the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 end of the line, it will be put on the last character in the line. In
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 mappings it's often better to use <Esc> (first put an "x" in the text, <Esc>
477
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
368 will then always put the cursor on it). Or use CTRL-\ CTRL-O, but then
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
369 beware of the cursor possibly being beyond the end of the line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 The shifted cursor keys are not available on all terminals.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 Another side effect is that a count specified before the "i" or "a" command is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 ignored. That is because repeating the effect of the command after CTRL-O is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 too complicated.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 An example for using CTRL-G u: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 :inoremap <C-H> <C-G>u<C-H>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 This redefines the backspace key to start a new undo sequence. You can now
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 undo the effect of the backspace key, without changing what you typed before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 that, with CTRL-O u.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384
10
4e2284e71352 updated for version 7.0002
vimboss
parents: 9
diff changeset
385 Using CTRL-O splits undo: the text typed before and after it is undone
4e2284e71352 updated for version 7.0002
vimboss
parents: 9
diff changeset
386 separately. If you want to avoid this (e.g., in a mapping) you might be able
4e2284e71352 updated for version 7.0002
vimboss
parents: 9
diff changeset
387 to use CTRL-R = |i_CTRL-R|. E.g., to call a function: >
4e2284e71352 updated for version 7.0002
vimboss
parents: 9
diff changeset
388 :imap <F2> <C-R>=MyFunc()<CR>
4e2284e71352 updated for version 7.0002
vimboss
parents: 9
diff changeset
389
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 When the 'whichwrap' option is set appropriately, the <Left> and <Right>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 keys on the first/last character in the line make the cursor wrap to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 previous/next line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 The CTRL-G j and CTRL-G k commands can be used to insert text in front of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 column. Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 int i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 int j;
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
398 Position the cursor on the first "int", type "istatic <C-G>j ". The
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 result is: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 static int i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 int j;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 When inserting the same text in front of the column in every line, use the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 Visual blockwise command "I" |v_b_I|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 3. 'textwidth' and 'wrapmargin' options *ins-textwidth*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 The 'textwidth' option can be used to automatically break a line before it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 gets too long. Set the 'textwidth' option to the desired maximum line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 length. If you then type more characters (not spaces or tabs), the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 last word will be put on a new line (unless it is the only word on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 line). If you set 'textwidth' to 0, this feature is disabled.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 The 'wrapmargin' option does almost the same. The difference is that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 'textwidth' has a fixed width while 'wrapmargin' depends on the width of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 screen. When using 'wrapmargin' this is equal to using 'textwidth' with a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 value equal to (columns - 'wrapmargin'), where columns is the width of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 screen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 When 'textwidth' and 'wrapmargin' are both set, 'textwidth' is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 If you don't really want to break the line, but view the line wrapped at a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 convenient place, see the 'linebreak' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 The line is only broken automatically when using insert mode, or when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 appending to a line. When in replace mode and the line length is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 changed, the line will not be broken.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 Long lines are broken if you enter a non-white character after the margin.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 The situations where a line will be broken can be restricted by adding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 characters to the 'formatoptions' option:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 "l" Only break a line if it was not longer than 'textwidth' when the insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 started.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 "v" Only break at a white character that has been entered during the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 current insert command. This is mostly Vi-compatible.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 "lv" Only break if the line was not longer than 'textwidth' when the insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 started and only at a white character that has been entered during the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 current insert command. Only differs from "l" when entering non-white
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 characters while crossing the 'textwidth' boundary.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 If you want to format a block of text, you can use the "gq" operator. Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 "gq" and a movement command to move the cursor to the end of the block. In
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 many cases, the command "gq}" will do what you want (format until the end of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 paragraph). Alternatively, you can use "gqap", which will format the whole
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 paragraph, no matter where the cursor currently is. Or you can use Visual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 mode: hit "v", move to the end of the block, and type "gq". See also |gq|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 4. 'expandtab', 'smarttab' and 'softtabstop' options *ins-expandtab*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 If the 'expandtab' option is on, spaces will be used to fill the amount of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 whitespace of the tab. If you want to enter a real <Tab>, type CTRL-V first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 (use CTRL-Q when CTRL-V is mapped |i_CTRL-Q|).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 The 'expandtab' option is off by default. Note that in Replace mode, a single
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 character is replaced with several spaces. The result of this is that the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 number of characters in the line increases. Backspacing will delete one
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 space at a time. The original character will be put back for only one space
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 that you backspace over (the last one). {Vi does not have the 'expandtab'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 option}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 *ins-smarttab*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 When the 'smarttab' option is on, a <Tab> inserts 'shiftwidth' positions at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 the beginning of a line and 'tabstop' positions in other places. This means
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 that often spaces instead of a <Tab> character are inserted. When 'smarttab
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 is off, a <Tab> always inserts 'tabstop' positions, and 'shiftwidth' is only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 used for ">>" and the like. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 *ins-softtabstop*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 When the 'softtabstop' option is non-zero, a <Tab> inserts 'softtabstop'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 positions, and a <BS> used to delete white space, will delete 'softtabstop'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 positions. This feels like 'tabstop' was set to 'softtabstop', but a real
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 <Tab> character still takes 'tabstop' positions, so your file will still look
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 correct when used by other applications.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 If 'softtabstop' is non-zero, a <BS> will try to delete as much white space to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 move to the previous 'softtabstop' position, except when the previously
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 inserted character is a space, then it will only delete the character before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 the cursor. Otherwise you cannot always delete a single character before the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 cursor. You will have to delete 'softtabstop' characters first, and then type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 extra spaces to get where you want to be.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 5. Replace mode *Replace* *Replace-mode* *mode-replace*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 Enter Replace mode with the "R" command in normal mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 In Replace mode, one character in the line is deleted for every character you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 type. If there is no character to delete (at the end of the line), the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 typed character is appended (as in Insert mode). Thus the number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 characters in a line stays the same until you get to the end of the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 If a <NL> is typed, a line break is inserted and no character is deleted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 Be careful with <Tab> characters. If you type a normal printing character in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 its place, the number of characters is still the same, but the number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 columns will become smaller.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 If you delete characters in Replace mode (with <BS>, CTRL-W, or CTRL-U), what
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 happens is that you delete the changes. The characters that were replaced
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 are restored. If you had typed past the existing text, the characters you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 added are deleted. This is effectively a character-at-a-time undo.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 If the 'expandtab' option is on, a <Tab> will replace one character with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 several spaces. The result of this is that the number of characters in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 line increases. Backspacing will delete one space at a time. The original
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 character will be put back for only one space that you backspace over (the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 last one). {Vi does not have the 'expandtab' option}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 6. Virtual Replace mode *vreplace-mode* *Virtual-Replace-mode*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 Enter Virtual Replace mode with the "gR" command in normal mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 {not available when compiled without the +vreplace feature}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 {Vi does not have Virtual Replace mode}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 Virtual Replace mode is similar to Replace mode, but instead of replacing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 actual characters in the file, you are replacing screen real estate, so that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 characters further on in the file never appear to move.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 So if you type a <Tab> it may replace several normal characters, and if you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 type a letter on top of a <Tab> it may not replace anything at all, since the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 <Tab> will still line up to the same place as before.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 Typing a <NL> still doesn't cause characters later in the file to appear to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 move. The rest of the current line will be replaced by the <NL> (that is,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 they are deleted), and replacing continues on the next line. A new line is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 NOT inserted unless you go past the end of the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 Interesting effects are seen when using CTRL-T and CTRL-D. The characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 before the cursor are shifted sideways as normal, but characters later in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 line still remain still. CTRL-T will hide some of the old line under the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 shifted characters, but CTRL-D will reveal them again.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 As with Replace mode, using <BS> etc will bring back the characters that were
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 replaced. This still works in conjunction with 'smartindent', CTRL-T and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 CTRL-D, 'expandtab', 'smarttab', 'softtabstop', etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 In 'list' mode, Virtual Replace mode acts as if it was not in 'list' mode,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 unless "L" is in 'cpoptions'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 Note that the only times characters beyond the cursor should appear to move
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 are in 'list' mode, and occasionally when 'wrap' is set (and the line changes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 length to become shorter or wider than the width of the screen), or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 momentarily when typing over a CTRL character. A CTRL character takes up two
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 screen spaces. When replacing it with two normal characters, the first will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 be inserted and the second will replace the CTRL character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 This mode is very useful for editing <Tab> separated columns in tables, for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 entering new data while keeping all the columns aligned.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 7. Insert mode completion *ins-completion*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
553 In Insert and Replace mode, there are several commands to complete part of a
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 keyword or line that has been typed. This is useful if you are using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 complicated keywords (e.g., function names with capitals and underscores).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 These commands are not available when the |+insert_expand| feature was
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 disabled at compile time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 Completion can be done for:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 1. Whole lines |i_CTRL-X_CTRL-L|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 2. keywords in the current file |i_CTRL-X_CTRL-N|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 3. keywords in 'dictionary' |i_CTRL-X_CTRL-K|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 4. keywords in 'thesaurus', thesaurus-style |i_CTRL-X_CTRL-T|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 5. keywords in the current and included files |i_CTRL-X_CTRL-I|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 6. tags |i_CTRL-X_CTRL-]|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 7. file names |i_CTRL-X_CTRL-F|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 8. definitions or macros |i_CTRL-X_CTRL-D|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 9. Vim command-line |i_CTRL-X_CTRL-V|
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
571 10. User defined completion |i_CTRL-X_CTRL-U|
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
572 11. omni completion |i_CTRL-X_CTRL-O|
477
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
573 12. Spelling suggestions |i_CTRL-X_s|
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
574 13. keywords in 'complete' |i_CTRL-N|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 and CTRL-P (previous).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 Also see the 'infercase' option if you want to adjust the case of the match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 Note: The keys that are valid in CTRL-X mode are not mapped. This allows for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 ":map ^F ^X^F" to work (where ^F is CTRL-F and ^X is CTRL-X). The key that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 ends CTRL-X mode (any key that is not a valid CTRL-X mode command) is mapped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 Also, when doing completion with 'complete' mappings apply as usual.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 The following mappings are suggested to make typing the completion commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 a bit easier (although they will hide other commands): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 :inoremap ^] ^X^]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 :inoremap ^F ^X^F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 :inoremap ^D ^X^D
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 :inoremap ^L ^X^L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 As a special case, typing CTRL-R to perform register insertion (see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 |i_CTRL-R|) will not exit CTRL-X mode. This is primarily to allow the use of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 the '=' register to call some function to determine the next operation. If
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 the contents of the register (or result of the '=' register evaluation) are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 not valid CTRL-X mode keys, then CTRL-X mode will be exited as if those keys
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 had been typed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 For example, the following will map <Tab> to either actually insert a <Tab> if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 the current line is currently only whitespace, or start/continue a CTRL-N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 completion operation: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607 function! CleverTab()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 return "\<Tab>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 return "\<C-N>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 inoremap <Tab> <C-R>=CleverTab()<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 Completing whole lines *compl-whole-line*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 *i_CTRL-X_CTRL-L*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 CTRL-X CTRL-L Search backwards for a line that starts with the
459
d9d38102399f updated for version 7.0122
vimboss
parents: 449
diff changeset
621 same characters as those in the current line before
d9d38102399f updated for version 7.0122
vimboss
parents: 449
diff changeset
622 the cursor. Indent is ignored. The matching line is
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 inserted in front of the cursor.
459
d9d38102399f updated for version 7.0122
vimboss
parents: 449
diff changeset
624 The 'complete' option is used to decide which buffers
d9d38102399f updated for version 7.0122
vimboss
parents: 449
diff changeset
625 are searched for a match. Only loaded buffers are
d9d38102399f updated for version 7.0122
vimboss
parents: 449
diff changeset
626 used.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 CTRL-L or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 CTRL-P Search backwards for next matching line. This line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 replaces the previous matching line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 CTRL-N Search forward for next matching line. This line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 replaces the previous matching line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 CTRL-X CTRL-L After expanding a line you can additionally get the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 line next to it by typing CTRL-X CTRL-L again, unless
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 a double CTRL-X is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 Completing keywords in current file *compl-current*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 *i_CTRL-X_CTRL-P*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 *i_CTRL-X_CTRL-N*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 CTRL-X CTRL-N Search forwards for words that start with the keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 in front of the cursor. The found keyword is inserted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 CTRL-X CTRL-P Search backwards for words that start with the keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 in front of the cursor. The found keyword is inserted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 CTRL-N Search forward for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 CTRL-P Search backwards for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 CTRL-X CTRL-N or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 copy the words following the previous expansion in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 other contexts unless a double CTRL-X is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 If there is a keyword in front of the cursor (a name made out of alphabetic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 characters and characters in 'iskeyword'), it is used as the search pattern,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 with "\<" prepended (meaning: start of a word). Otherwise "\<\k\k" is used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 as search pattern (start of any keyword of at least two characters).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 In Replace mode, the number of characters that are replaced depends on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 length of the matched string. This works like typing the characters of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 matched string in Replace mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 If there is not a valid keyword character before the cursor, any keyword of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 at least two characters is matched.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 e.g., to get:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 printf("(%g, %g, %g)", vector[0], vector[1], vector[2]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 just type:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
677 The search wraps around the end of the file, the value of 'wrapscan' is not
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
678 used here.
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
679
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 Multiple repeats of the same completion are skipped; thus a different match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 will be inserted at each CTRL-N and CTRL-P (unless there is only one
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682 matching keyword).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 Single character matches are never included, as they usually just get in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 the way of what you were really after.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 e.g., to get:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 printf("name = %s\n", name);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 just type:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 printf("name = %s\n", n^P);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 or even:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 printf("name = %s\n", ^P);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 The 'n' in '\n' is skipped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 After expanding a word, you can use CTRL-X CTRL-P or CTRL-X CTRL-N to get the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 word following the expansion in other contexts. These sequences search for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 the text just expanded and further expand by getting an extra word. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 useful if you need to repeat a sequence of complicated words. Although CTRL-P
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 and CTRL-N look just for strings of at least two characters, CTRL-X CTRL-P and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 CTRL-X CTRL-N can be used to expand words of just one character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 e.g., to get:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 M&eacute;xico
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 you can type:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 M^N^P^X^P^X^P
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 CTRL-N starts the expansion and then CTRL-P takes back the single character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 "M", the next two CTRL-X CTRL-P's get the words "&eacute" and ";xico".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 If the previous expansion was split, because it got longer than 'textwidth',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 then just the text in the current line will be used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 If the match found is at the end of a line, then the first word in the next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 line will be inserted and the message "word from next line" displayed, if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 for those lines starting with this word.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 Completing keywords in 'dictionary' *compl-dictionary*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 *i_CTRL-X_CTRL-K*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 CTRL-X CTRL-K Search the files given with the 'dictionary' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 for words that start with the keyword in front of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 cursor. This is like CTRL-N, but only the dictionary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 files are searched, not the current file. The found
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 keyword is inserted in front of the cursor. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 could potentially be pretty slow, since all matches
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 are found before the first match is used. By default,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 the 'dictionary' option is empty.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 For suggestions where to find a list of words, see the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 'dictionary' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 CTRL-K or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 CTRL-N Search forward for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 CTRL-P Search backwards for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 *i_CTRL-X_CTRL-T*
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
738 CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 the 'thesaurus' option instead of 'dictionary'. If a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 match is found in the thesaurus file, all the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 remaining words on the same line are included as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 matches, even though they don't complete the word.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 Thus a word can be completely replaced.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 For an example, imagine the 'thesaurus' file has a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 line like this: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 angry furious mad enraged
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 < Placing the cursor after the letters "ang" and typing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 CTRL-X CTRL-T would complete the word "angry";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 subsequent presses would change the word to "furious",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 "mad" etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 Other uses include translation between two languages,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 or grouping API functions by keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 CTRL-T or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 CTRL-N Search forward for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 CTRL-P Search backwards for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 Completing keywords in the current and included files *compl-keyword*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 The 'include' option is used to specify a line that contains an include file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 name. The 'path' option is used to search for include files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 *i_CTRL-X_CTRL-I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 CTRL-X CTRL-I Search for the first keyword in the current and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 included files that starts with the same characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 as those before the cursor. The matched keyword is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772 inserted in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 CTRL-N Search forwards for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 Note: CTRL-I is the same as <Tab>, which is likely to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 be typed after a successful completion, therefore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 CTRL-I is not used for searching for the next match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 CTRL-P Search backward for previous matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 CTRL-X CTRL-I Further use of CTRL-X CTRL-I will copy the words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 following the previous expansion in other contexts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 unless a double CTRL-X is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 Completing tags *compl-tag*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 *i_CTRL-X_CTRL-]*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 CTRL-X CTRL-] Search for the first tag that starts with the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 characters as before the cursor. The matching tag is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 inserted in front of the cursor. Alphabetic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 characters and characters in 'iskeyword' are used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 to decide which characters are included in the tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794 name (same as for a keyword). See also |CTRL-]|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 The 'showfulltag' option can be used to add context
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 from around the tag definition.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 CTRL-] or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 CTRL-N Search forwards for next matching tag. This tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 replaces the previous matching tag.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801 CTRL-P Search backward for previous matching tag. This tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 replaces the previous matching tag.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 Completing file names *compl-filename*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 *i_CTRL-X_CTRL-F*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 CTRL-X CTRL-F Search for the first file name that starts with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 same characters as before the cursor. The matching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 file name is inserted in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 Alphabetic characters and characters in 'isfname'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 are used to decide which characters are included in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 the file name. Note: the 'path' option is not used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 here (yet).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814 CTRL-F or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 CTRL-N Search forwards for next matching file name. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 file name replaces the previous matching file name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 CTRL-P Search backward for previous matching file name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 This file name replaces the previous matching file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 Completing definitions or macros *compl-define*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 The 'define' option is used to specify a line that contains a definition.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 The 'include' option is used to specify a line that contains an include file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827 name. The 'path' option is used to search for include files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 *i_CTRL-X_CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 CTRL-X CTRL-D Search in the current and included files for the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 first definition (or macro) name that starts with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 the same characters as before the cursor. The found
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 definition name is inserted in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 CTRL-D or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 CTRL-N Search forwards for next matching macro name. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 macro name replaces the previous matching macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837 name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 CTRL-P Search backward for previous matching macro name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 This macro name replaces the previous matching macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 CTRL-X CTRL-D Further use of CTRL-X CTRL-D will copy the words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 following the previous expansion in other contexts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 unless a double CTRL-X is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848 Completing Vim commands *compl-vim*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
850 Completion is context-sensitive. It works like on the Command-line. It
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
851 completes an Ex command as well as its arguments. This is useful when writing
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
852 a Vim script.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 *i_CTRL-X_CTRL-V*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855 CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856 find the first match for it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857 Note: When CTRL-V is mapped you can often use CTRL-Q
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 instead |i_CTRL-Q|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859 CTRL-V or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 CTRL-N Search forwards for next match. This match replaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861 the previous one.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 CTRL-P Search backward for previous match. This match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864 replaces the previous one.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866 CTRL-X CTRL-V Further use of CTRL-X CTRL-V will do the same as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 CTRL-V. This allows mapping a key to do Vim command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868 completion, for example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 :imap <Tab> <C-X><C-V>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
871 User defined completion *compl-function*
12
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
872
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
873 Completion is done by a function that can be defined by the user with the
502
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 483
diff changeset
874 'completefunc' option. See the 'completefunc' help for how the function
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 483
diff changeset
875 is called and an example.
12
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
876
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
877 *i_CTRL-X_CTRL-U*
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
878 CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
879 find the first match for it.
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
880 CTRL-U or
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
881 CTRL-N Use the next match. This match replaces the previous
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
882 one.
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
883
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
884 CTRL-P Use the previous match. This match replaces the
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
885 previous one.
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
886
bdeee1504ac1 updated for version 7.0004
vimboss
parents: 10
diff changeset
887
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
888 Omni completion *compl-omni*
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
889
502
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 483
diff changeset
890 Completion is done by a function that can be defined by the user with the
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
891 'omnifunc' option. This is to be used for filetype-specific completion.
502
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 483
diff changeset
892
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 483
diff changeset
893 See the 'completefunc' help for how the function is called and an example.
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
894 For remarks about specific filetypes see |compl-omni-filetypes|.
449
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
895
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
896 *i_CTRL-X_CTRL-O*
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
897 CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
898 find the first match for it.
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
899 CTRL-O or
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
900 CTRL-N Use the next match. This match replaces the previous
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
901 one.
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
902
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
903 CTRL-P Use the previous match. This match replaces the
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
904 previous one.
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
905
3709cf52b9b5 updated for version 7.0119
vimboss
parents: 446
diff changeset
906
477
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
907 Spelling suggestions *compl-spelling*
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
908
483
70afa17bfc01 updated for version 7.0132
vimboss
parents: 477
diff changeset
909 A word before or at the cursor is located and correctly spelled words are
70afa17bfc01 updated for version 7.0132
vimboss
parents: 477
diff changeset
910 suggested to replace it. If there is a badly spelled word in the line, before
70afa17bfc01 updated for version 7.0132
vimboss
parents: 477
diff changeset
911 or under the cursor, the cursor is moved to after it. Otherwise the word just
70afa17bfc01 updated for version 7.0132
vimboss
parents: 477
diff changeset
912 before the cursor is used for suggestions, even though it isn't badly spelled.
70afa17bfc01 updated for version 7.0132
vimboss
parents: 477
diff changeset
913
477
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
914 NOTE: CTRL-S suspends display in many Unix terminals. Use 's' instead. Type
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
915 CTRL-Q to resume displaying.
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
916
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
917 *i_CTRL-X_CTRL-S* *i_CTRL-X_s*
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
918 CTRL-X CTRL-S or
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
919 CTRL-X s Locate the word in front of the cursor and find the
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
920 first spell suggestion for it.
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
921 CTRL-S or
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
922 CTRL-N Use the next suggestion. This replaces the previous
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
923 one. Note that you can't use 's' here.
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
924
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
925 CTRL-P Use the previous suggestion. This replaces the
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
926 previous one.
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
927
f8b75b8f1988 updated for version 7.0128
vimboss
parents: 459
diff changeset
928
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
929 Completing keywords from different sources *compl-generic*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
930
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
931 *i_CTRL-N*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
932 CTRL-N Find next match for words that start with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
933 keyword in front of the cursor, looking in places
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
934 specified with the 'complete' option. The found
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
935 keyword is inserted in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
936
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
937 *i_CTRL-P*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
938 CTRL-P Find previous match for words that start with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
939 keyword in front of the cursor, looking in places
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
940 specified with the 'complete' option. The found
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
941 keyword is inserted in front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
942
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
943 CTRL-N Search forward for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
944 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 CTRL-P Search backwards for next matching keyword. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 keyword replaces the previous matching keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 CTRL-X CTRL-N or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951 copy the words following the previous expansion in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
952 other contexts unless a double CTRL-X is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953
519
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
954
540
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
955 INSERT COMPLETION POPUP MENU *ins-completion-menu*
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 609
diff changeset
956 *popupmenu-completion*
540
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
957 Vim can display the matches in a simplistic popup menu.
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
958
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
959 The menu is used when:
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
960 - The 'completeopt' option contains "menu".
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
961 - The terminal supports at least 8 colors.
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
962 - There are at least two matches.
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
963
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
964 While the menu is displayed these keys have a special meaning:
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
965 <CR> and <Enter>: Accept the currently selected match
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
966 <Up>: Select the previous match, as if CTRL-P was used
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
967 <Down>: Select the next match, as if CTRL-N was used
609
ba54311bc43e updated for version 7.0173
vimboss
parents: 599
diff changeset
968 <PageUp>: Select a match several entries back
ba54311bc43e updated for version 7.0173
vimboss
parents: 599
diff changeset
969 <PageDown>: Select a match several entries further
540
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
970
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
971 The colors of the menu can be changed with these highlight groups:
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
972 Pmenu normal item |hl-Pmenu|
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
973 PmenuSel selected item |hl-PmenuSel|
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
974 PmenuSbar scrollbar |hl-PmenuSbar|
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
975 PmenuThumb thumb of the scrollbar |hl-PmenuThumb|
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
976
2df7f3a5eb96 updated for version 7.0153
vimboss
parents: 532
diff changeset
977
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
978 Filetype-specific remarks for omni completion *compl-omni-filetypes*
519
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
979
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
980
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
981 C *ft-c-omni*
519
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
982
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
983 Completion of C code requires a tags file. You should use Exuberant ctags,
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
984 because it adds extra information that is needed for completion. You can find
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
985 it here: http://ctags.sourceforge.net/
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
986 For version 5.5.4 you should add a patch that adds the "typename:" field:
519
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
987 ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
988
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
989 If you want to complete system functions you can do something like this. Use
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
990 ctags to generate a tags file for all the system header files: >
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
991 % ctags -R -f ~/.vim/systags /usr/include /usr/local/include
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
992 In your vimrc file add this tags file to the 'tags' option: >
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
993 set tags+=~/.vim/systags
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
994
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
995 When using CTRL-X CTRL-O after a name without any "." or "->" it is completed
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
996 from the tags file directly. This works for any identifier, also function
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
997 names. If you want to complete a local variable name, which does not appear
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
998 in the tags file, use CTRL-P instead.
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
999
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1000 When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1001 to recognize the type of the variable and figure out what members it has.
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1002 This means only members valid for the variable will be listed.
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1003
523
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
1004 When a member name already was complete, CTRL-X CTRL-O will add a "." or
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
1005 "->" for composite types.
a7ae7e043e43 updated for version 7.0146
vimboss
parents: 519
diff changeset
1006
519
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1007 Vim doesn't include a C compiler, only the most obviously formatted
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1008 declarations are recognized. Preprocessor stuff may cause confusion.
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1009 When the same structure name appears in multiple places all possible members
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1010 are included.
d50452846776 updated for version 7.0145
vimboss
parents: 502
diff changeset
1011
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1012
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1013 CSS *ft-css-omni*
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1014
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1015 Complete properties and their appropriate values according to CSS 2.1
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1016 specification.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1017
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1018
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1019 (X)HTML *ft-html-omni*
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1020 *ft-xhtml-omni*
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1021
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1022 CTRL-X CTRL-O provides completion of various elements of (X)HTML files.
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1023 It is designed to support writing of XHTML 1.0 Strict files but will
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1024 also works for other versions of HTML. Features:
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1025
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1026 - after "<" complete tag name depending on context (no div suggest
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1027 inside of an a tag)
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1028 - inside of tag complete proper attributes (no width attribute for an
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1029 a tag)
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1030 - when attribute has limited number of possible values help to complete
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1031 them
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1032 - complete names of entities
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1033 - complete values of "class" and "id" attributes with data obtained from
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1034 style tag and included CSS files
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1035 - when completing "style" attribute or working inside of "style" tag
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1036 switch to |ft-css-omni| completion
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1037 - when used after "</" CTRL-X CTRL-O will close the last opened tag
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1038
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1039 Note: When used first time completion menu will be shown with little delay
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1040 - this is time needed for loading of data file.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1041
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1042
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1043 SYNTAX *ft-syntax-omni*
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1044
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1045 This uses the current syntax highlighting for completion. It can be used for
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1046 any filetype and provides a minimal language-sensitive completion.
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1047
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1048 To enable code completion do: >
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1049 source $VIMRUNTIME/autoload/syntaxcomplete.vim
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1050
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1051 You can automate this by placing this in your vimrc (after any ":filetype"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1052 command): >
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1053 autocmd Filetype *
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1054 \ if exists('&ofu') && &ofu == "" |
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1055 \ source $VIMRUNTIME/autoload/syntaxcomplete.vim |
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1056 \ endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1057
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1058 The above will set completion to this script only if a proper one does not
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1059 already exist for that filetype.
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1060
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1061
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1062 XML *ft-xml-omni*
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1063
592
6a91f35b354d updated for version 7.0168
vimboss
parents: 557
diff changeset
1064 Vim 7 provides mechanism to context aware completion of XML files. It depends
6a91f35b354d updated for version 7.0168
vimboss
parents: 557
diff changeset
1065 on special |xml-omni-datafile| and two commands: |:XMLns| and |:XMLent|.
6a91f35b354d updated for version 7.0168
vimboss
parents: 557
diff changeset
1066 Features are:
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1067
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1068 - after "<" complete tag name depending on context (no div suggest
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1069 inside of an a tag)
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1070 - inside of tag complete proper attributes (no width attribute for an
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1071 a tag)
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1072 - when attribute has limited number of possible values help to complete
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1073 them
592
6a91f35b354d updated for version 7.0168
vimboss
parents: 557
diff changeset
1074 - complete names of entities (defined in |xml-omni-datafile| and in current file
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1075 with "<!ENTITY" declarations
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1076 - when used after "</" CTRL-X CTRL-O will close the last opened tag
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1077
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1078 Format of XML data file *xml-omni-datafile*
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1079
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1080 Vim distribution provides two data files as examples (xhtml10s.vim, xsl.vim)
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1081
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1082 XML data files are stored in "autoload/xml" directory in 'runtimepath'. They
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1083 have meaningful name which will be used in commands. It should be unique name
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1084 which will not create conflicts in future. For example name xhtml10s.vim means
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1085 it is data file for XHTML 1.0 Strict.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1086
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1087 File contains one variable with fixed name: g:xmldata_xhtml10s . It is
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1088 compound from two parts:
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1089
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1090 1. "g:xmldata_" general prefix
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1091 2. "xhtml10s" name of file and name of described XML dialect
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1092
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1093 Part two must be exactly the same as name of file.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1094
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1095 Variable is data structure in form of |Dictionary|. Keys are tag names and
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1096 values are two element |List|. First element of List is also List with
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1097 names of possible children, second element is |Dictionary| with names of
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1098 attributes as keys and possible values of attributes as values. Example: >
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1099
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1100 let g:xmldata_crippledhtml = {
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1101 \ "html":
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1102 \ [ ["body", "head"], {"id": [], "xmlns": ["http://www.w3.org/1999/xhtml"],
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1103 \ "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}],
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1104 \ "script":
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1105 \ [ [], {"id": [], "charset": [], "type": ["text/javascript"], "src": [],
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1106 \ "defer": ["BOOL"], "xml:space": ["preserve"]}],
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1107 \ "meta":
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1108 \ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme":
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1109 \ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}]
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1110 \ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]}
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1111
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1112 This example should be put in "autoload/xml/crippledhtml.vim" file.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1113
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1114 In example are visible two special elements:
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1115
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1116 1. "vimxmlentities" - special key with List containing entities of this XML
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1117 dialect.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1118 2. "BOOL" - value of attribute key showing if attribute should be inserted
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1119 bare ("defer" vs. 'defer="'). It can be the only element of List of
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1120 attribute values.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1121
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1122 Note: Tag names in data file MUST not contain namespace description. Check
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1123 xsl.vim for example.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1124
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1125 Commands
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1126
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1127 :XMLns {name} [{namespace}] *:XMLns*
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1128
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1129 Vim has to know which data file should be used and with which namespace. For
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1130 loading of data file and connecting data with prope namespace use |:XMLns|
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1131 command. First (obligatory) argument is name of data (xhtml10s, xsl). Second
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1132 argument is code of namespace (h, xsl). When used without second argument
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1133 dialect will be used as default - without namespace declaration. For example
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1134 to use XML completion in .xsl files: >
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1135
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1136 :XMLns xhtml10s
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1137 :XMLns xsl xsl
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1138
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1139
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1140 :XMLent {name} *:XMLent*
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1141
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1142 By default entities will be completed from data file of default
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1143 namespace. XMLent command should be used in case when there is no
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1144 default namespace: >
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1145
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1146 :XMLent xhtml10s
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1147
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1148 Usage
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1149
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1150 While used in situation (after declarations from previous part, | is
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1151 cursor position): >
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1152
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1153 <|
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1154
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1155 Will complete to appropriate XHTML tag, and in this situation: >
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1156
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1157 <xsl:|
557
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1158
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1159 Will complete to appropriate XSL tag.
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1160
862863033fdd updated for version 7.0158
vimboss
parents: 540
diff changeset
1161 File xmlcomplete.vim provides through |autoload| mechanism
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1162 GetLastOpenTag function which can be used in XML files to get name of
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1163 last open tag with (b:unaryTagsStack has to be defined): >
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1164
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
1165 :echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
531
da9142bd190a updated for version 7.0149
vimboss
parents: 529
diff changeset
1166
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents: 523
diff changeset
1167
532
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1168
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1169
7052f11a3dc9 updated for version 7.0150
vimboss
parents: 531
diff changeset
1170
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1171 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1172 8. Insert mode commands *inserting*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1174 The following commands can be used to insert new text into the buffer. They
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1175 can all be undone and repeated with the "." command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1177 *a*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1178 a Append text after the cursor [count] times. If the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1179 cursor is in the first column of an empty line Insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1180 starts there. But not when 'virtualedit' is set!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1182 *A*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1183 A Append text at the end of the line [count] times.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1185 <insert> or *i* *insert* *<Insert>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1186 i Insert text before the cursor [count] times.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1187 When using CTRL-O in Insert mode |i_CTRL-O| the count
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1188 is not supported.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1190 *I*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1191 I Insert text before the first non-blank in the line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1192 [count] times.
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1193 When the 'H' flag is present in 'cpoptions' and the
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1194 line only contains blanks, insert start just before
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1195 the last blank.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1197 *gI*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1198 gI Insert text in column 1 [count] times. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1200 *gi*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1201 gi Insert text in the same position as where Insert mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1202 was stopped last time in the current buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1203 This uses the |'^| mark. It's different from "`^i"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1204 when the mark is past the end of the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1205 The position is corrected for inserted/deleted lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1206 but NOT for inserted/deleted characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1207 When the |:keepjumps| command modifier is used the |'^|
9
4102fb4ea781 updated for version 7.0002
vimboss
parents: 7
diff changeset
1208 mark won't be changed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1209 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1211 *o*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1212 o Begin a new line below the cursor and insert text,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1213 repeat [count] times. {Vi: blank [count] screen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1214 lines}
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1215 When the '#' flag is in 'cpoptions' the count is
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1216 ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1218 *O*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1219 O Begin a new line above the cursor and insert text,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1220 repeat [count] times. {Vi: blank [count] screen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1221 lines}
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1222 When the '#' flag is in 'cpoptions' the count is
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 140
diff changeset
1223 ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1225 These commands are used to start inserting text. You can end insert mode with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1226 <Esc>. See |mode-ins-repl| for the other special characters in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1227 The effect of [count] takes place after Insert mode is exited.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1229 When 'autoindent' is on, the indent for a new line is obtained from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1230 previous line. When 'smartindent' or 'cindent' is on, the indent for a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1231 is automatically adjusted for C programs.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1232
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1233 'textwidth' can be set to the maximum width for a line. When a line becomes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1234 too long when appending characters a line break is automatically inserted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1236
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1237 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1238 9. Ex insert commands *inserting-ex*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1239
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1240 *:a* *:append*
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1241 :{range}a[ppend][!] Insert several lines of text below the specified
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1242 line. If the {range} is missing, the text will be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1243 inserted after the current line.
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1244 Adding [!] toggles 'autoindent' for the time this
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1245 command is executed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1247 *:i* *:in* *:insert*
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1248 :{range}i[nsert][!] Insert several lines of text above the specified
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1249 line. If the {range} is missing, the text will be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1250 inserted before the current line.
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1251 Adding [!] toggles 'autoindent' for the time this
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1252 command is executed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1253
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1254 These two commands will keep on asking for lines, until you type a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1255 containing only a ".". Watch out for lines starting with a backslash, see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1256 |line-continuation|.
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1257 When these commands are used with |:global| or |:vglobal| then the lines are
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1258 obtained from the text following the command. Separate lines with a NL
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1259 escaped with a backslash: >
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1260 :global/abc/insert\
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1261 one line\
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1262 another line
c93c9cad9618 updated for version 7.0051
vimboss
parents: 164
diff changeset
1263 The final "." is not needed then.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1264 NOTE: ":append" and ":insert" don't work properly in between ":if" and
74
1154524da1cd updated for version 7.0031
vimboss
parents: 40
diff changeset
1265 ":endif", ":for" and ":endfor", ":while" and ":endwhile".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1267 *:start* *:startinsert*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1268 :star[tinsert][!] Start Insert mode just after executing this command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1269 Works like typing "i" in Normal mode. When the ! is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1270 included it works like "A", append to the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1271 Otherwise insertion starts at the cursor position.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1272 Note that when using this command in a function or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1273 script, the insertion only starts after the function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1274 or script is finished.
446
7472c565592a updated for version 7.0117
vimboss
parents: 236
diff changeset
1275 This command does not work from |:normal|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1276 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1277 {not available when compiled without the +ex_extra
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1278 feature}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1279
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1280 *:stopi* *:stopinsert*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1281 :stopi[nsert] Stop Insert mode as soon as possible. Works like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1282 typing <Esc> in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1283 Can be used in an autocommand, example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1284 :au BufEnter scratch stopinsert
14
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1285 <
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1286 *replacing-ex* *:startreplace*
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1287 :startr[eplace][!] Start Replace mode just after executing this command.
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1288 Works just like typing "R" in Normal mode. When the
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1289 ! is included it acts just like "$R" had been typed
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1290 (ie. begin replace mode at the end-of-line). Other-
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1291 wise replacement begins at the cursor position.
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1292 Note that when using this command in a function or
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1293 script that the replacement will only start after
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1294 the function or script is finished.
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1295 {not in Vi}
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1296 {not available when compiled without the +ex_extra
946da5994c01 updated for version 7.0006
vimboss
parents: 12
diff changeset
1297 feature}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1298
599
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1299 *:startgreplace*
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1300 :startg[replace][!] Just like |:startreplace|, but use Virtual Replace
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1301 mode, like with |gR|.
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1302 {not in Vi}
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1303 {not available when compiled without the +ex_extra
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1304 feature}
2aac9eed5fbb updated for version 7.0170
vimboss
parents: 592
diff changeset
1305
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1306 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1307 10. Inserting a file *inserting-file*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1309 *:r* *:re* *:read*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1310 :r[ead] [name] Insert the file [name] (default: current file) below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1311 the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1312
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1313 :{range}r[ead] [name] Insert the file [name] (default: current file) below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1314 the specified line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1316 *:r!* *:read!*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1317 :r[ead] !{cmd} Execute {cmd} and insert its standard output below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1318 the cursor. A temporary file is used to store the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1319 output of the command which is then read into the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1320 buffer. 'shellredir' is used to save the output of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1321 the command, which can be set to include stderr or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1322 not. {cmd} is executed like with ":!{cmd}", any '!'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1323 is replaced with the previous command |:!|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1325 These commands insert the contents of a file, or the output of a command,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1326 into the buffer. They can be undone. They cannot be repeated with the "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1327 command. They work on a line basis, insertion starts below the line in which
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1328 the cursor is, or below the specified line. To insert text above the first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1329 line use the command ":0r {name}".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1331 After the ":read" command, the cursor is left on the first non-blank in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1332 first new line. Unless in Ex mode, then the cursor is left on the last new
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1333 line (sorry, this is Vi compatible).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1335 If a file name is given with ":r", it becomes the alternate file. This can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1336 used, for example, when you want to edit that file instead: ":e! #". This can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1337 be switched off by removing the 'a' flag from the 'cpoptions' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1339 *file-read*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1340 The 'fileformat' option sets the <EOL> style for a file:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1341 'fileformat' characters name ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1342 "dos" <CR><NL> or <NL> DOS format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1343 "unix" <NL> Unix format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1344 "mac" <CR> Mac format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1345 Previously 'textmode' was used. It is obsolete now.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1347 If 'fileformat' is "dos", a <CR> in front of an <NL> is ignored and a CTRL-Z
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1348 at the end of the file is ignored.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1350 If 'fileformat' is "mac", a <NL> in the file is internally represented by a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1351 <CR>. This is to avoid confusion with a <NL> which is used to represent a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1352 <NUL>. See |CR-used-for-NL|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1353
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1354 If the 'fileformats' option is not empty Vim tries to recognize the type of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1355 <EOL> (see |file-formats|). However, the 'fileformat' option will not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1356 changed, the detected format is only used while reading the file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1357 A similar thing happens with 'fileencodings'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1358
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1359 On non-MS-DOS, Win32, and OS/2 systems the message "[dos format]" is shown if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1360 a file is read in DOS format, to remind you that something unusual is done.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1361 On Macintosh, MS-DOS, Win32, and OS/2 the message "[unix format]" is shown if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1362 a file is read in Unix format.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1363 On non-Macintosh systems, the message "[Mac format]" is shown if a file is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1364 read in Mac format.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1366 An example on how to use ":r !": >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1367 :r !uuencode binfile binfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1368 This command reads "binfile", uuencodes it and reads it into the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1369 buffer. Useful when you are editing e-mail and want to include a binary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1370 file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1371
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1372 *read-messages*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1373 When reading a file Vim will display a message with information about the read
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1374 file. In the table is an explanation for some of the items. The others are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1375 self explanatory. Using the long or the short version depends on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1376 'shortmess' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1378 long short meaning ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1379 [readonly] {RO} the file is write protected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1380 [fifo/socket] using a stream
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1381 [fifo] using a fifo stream
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1382 [socket] using a socket stream
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1383 [CR missing] reading with "dos" 'fileformat' and a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1384 NL without a preceding CR was found.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1385 [NL found] reading with "mac" 'fileformat' and a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1386 NL was found (could be "unix" format)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1387 [long lines split] at least one line was split in two
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1388 [NOT converted] conversion from 'fileencoding' to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1389 'encoding' was desired but not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1390 possible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1391 [converted] conversion from 'fileencoding' to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1392 'encoding' done
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1393 [crypted] file was decrypted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1394 [READ ERRORS] not all of the file could be read
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1395
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1396
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1397 vim:tw=78:ts=8:ft=help:norl: