annotate runtime/doc/usr_24.txt @ 19663:f43c0e669bd6 v8.2.0388

patch 8.2.0388: printmbcharset option not tested Commit: https://github.com/vim/vim/commit/833805a4867cf5f93b3ef91227d1f1a98f553dff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 15 18:27:43 2020 +0100 patch 8.2.0388: printmbcharset option not tested Problem: Printmbcharset option not tested. Solution: Add a test. Enable PostScript for AppVeyor build. (Dominique Pelle, closes #5783)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Mar 2020 18:30:05 +0100
parents 130acb903dbe
children f8116058ca76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18879
af69c9335223 Vim 8.2 release
Bram Moolenaar <Bram@vim.org>
parents: 14519
diff changeset
1 *usr_24.txt* For Vim version 8.2. Last change: 2018 Mar 18
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 VIM USER MANUAL - by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 Inserting quickly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 When entering text, Vim offers various ways to reduce the number of keystrokes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 and avoid typing mistakes. Use Insert mode completion to repeat previously
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 typed words. Abbreviate long words to short ones. Type characters that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 aren't on your keyboard.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 |24.1| Making corrections
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 |24.2| Showing matches
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 |24.3| Completion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 |24.4| Repeating an insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 |24.5| Copying from another line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 |24.6| Inserting a register
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 |24.7| Abbreviations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 |24.8| Entering special characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 |24.9| Digraphs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 |24.10| Normal mode commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 Next chapter: |usr_25.txt| Editing formatted text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 Previous chapter: |usr_23.txt| Editing other files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 Table of contents: |usr_toc.txt|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 *24.1* Making corrections
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 The <BS> key was already mentioned. It deletes the character just before the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 cursor. The <Del> key does the same for the character under (after) the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 When you typed a whole word wrong, use CTRL-W:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 The horse had fallen to the sky ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 CTRL-W
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 The horse had fallen to the ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 If you really messed up a line and want to start over, use CTRL-U to delete
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 it. This keeps the text after the cursor and the indent. Only the text from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 the first non-blank to the cursor is deleted. With the cursor on the "f" of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 "fallen" in the next line pressing CTRL-U does this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 The horse had fallen to the ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 CTRL-U
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 fallen to the ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 When you spot a mistake a few words back, you need to move the cursor there to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 correct it. For example, you typed this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 The horse had follen to the ground ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 You need to change "follen" to "fallen". With the cursor at the end, you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 would type this to correct it: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 <Esc>4blraA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 < get out of Insert mode <Esc>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 four words back 4b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 move on top of the "o" l
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 replace with "a" ra
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 restart Insert mode A
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 Another way to do this: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 <C-Left><C-Left><C-Left><C-Left><Right><Del>a<End>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 < four words back <C-Left><C-Left><C-Left><C-Left>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 move on top of the "o" <Right>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 delete the "o" <Del>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 insert an "a" a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 go to end of the line <End>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 This uses special keys to move around, while remaining in Insert mode. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 resembles what you would do in a modeless editor. It's easier to remember,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 but takes more time (you have to move your hand from the letters to the cursor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 keys, and the <End> key is hard to press without looking at the keyboard).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 These special keys are most useful when writing a mapping that doesn't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 leave Insert mode. The extra typing doesn't matter then.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 An overview of the keys you can use in Insert mode:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 <C-Home> to start of the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 <PageUp> a whole screenful up
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 <Home> to start of line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 <S-Left> one word left
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 <C-Left> one word left
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 <S-Right> one word right
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 <C-Right> one word right
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 <End> to end of the line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 <PageDown> a whole screenful down
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 <C-End> to end of the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 There are a few more, see |ins-special-special|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 *24.2* Showing matches
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 When you type a ) it would be nice to see with which ( it matches. To make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 Vim do that use this command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 :set showmatch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 When you now type a text like "(example)", as soon as you type the ) Vim will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 briefly move the cursor to the matching (, keep it there for half a second,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 and move back to where you were typing.
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
107 In case there is no matching (, Vim will beep. Then you know that you
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 might have forgotten the ( somewhere, or typed a ) too many.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 The match will also be shown for [] and {} pairs. You don't have to wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 with typing the next character, as soon as Vim sees it the cursor will move
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 back and inserting continues as before.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 You can change the time Vim waits with the 'matchtime' option. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 example, to make Vim wait one and a half second: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 :set matchtime=15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 The time is specified in tenths of a second.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 *24.3* Completion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 Vim can automatically complete words on insertion. You type the first part of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 a word, press CTRL-P, and Vim guesses the rest.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 Suppose, for example, that you are creating a C program and want to type in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 the following:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 total = ch_array[0] + ch_array[1] + ch_array[2]; ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 You start by entering the following:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 total = ch_array[0] + ch_ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 At this point, you tell Vim to complete the word using the command CTRL-P.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 Vim searches for a word that starts with what's in front of the cursor. In
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 this case, it is "ch_", which matches with the word ch_array. So typing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 CTRL-P gives you the following:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 total = ch_array[0] + ch_array ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 After a little more typing, you get this (ending in a space):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 total = ch_array[0] + ch_array[1] + ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 If you now type CTRL-P Vim will search again for a word that completes the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 word before the cursor. Since there is nothing in front of the cursor, it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 finds the first word backwards, which is "ch_array". Typing CTRL-P again
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 gives you the next word that matches, in this case "total". A third CTRL-P
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 searches further back. If there is nothing else, it causes the editor to run
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 out of words, so it returns to the original text, which is nothing. A fourth
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 CTRL-P causes the editor to start over again with "ch_array".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 To search forward, use CTRL-N. Since the search wraps around the end of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 file, CTRL-N and CTRL-P will find the same matches, but in a different
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 sequence. Hint: CTRL-N is Next-match and CTRL-P is Previous-match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 The Vim editor goes through a lot of effort to find words to complete. By
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 default, it searches the following places:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 1. Current file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 2. Files in other windows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 3. Other loaded files (hidden buffers)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 4. Files which are not loaded (inactive buffers)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 5. Tag files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 6. All files #included by the current file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 OPTIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 You can customize the search order with the 'complete' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 The 'ignorecase' option is used. When it is set, case differences are ignored
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 when searching for matches.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 A special option for completion is 'infercase'. This is useful to find
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 matches while ignoring case ('ignorecase' must be set) but still using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 case of the word typed so far. Thus if you type "For" and Vim finds a match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 "fortunately", it will result in "Fortunately".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 COMPLETING SPECIFIC ITEMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 If you know what you are looking for, you can use these commands to complete
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 with a certain type of item:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 CTRL-X CTRL-F file names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 CTRL-X CTRL-L whole lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 CTRL-X CTRL-D macro definitions (also in included files)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 CTRL-X CTRL-I current and included files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 CTRL-X CTRL-K words from a dictionary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 CTRL-X CTRL-T words from a thesaurus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 CTRL-X CTRL-] tags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 CTRL-X CTRL-V Vim command line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 After each of them CTRL-N can be used to find the next match, CTRL-P to find
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 the previous match.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 More information for each of these commands here: |ins-completion|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 COMPLETING FILE NAMES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 Let's take CTRL-X CTRL-F as an example. This will find file names. It scans
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 the current directory for files and displays each one that matches the word in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 front of the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 Suppose, for example, that you have the following files in the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 directory:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 main.c sub_count.c sub_done.c sub_exit.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 Now enter Insert mode and start typing:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 The exit code is in the file sub ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 At this point, you enter the command CTRL-X CTRL-F. Vim now completes the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 current word "sub" by looking at the files in the current directory. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 first match is sub_count.c. This is not the one you want, so you match the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 next file by typing CTRL-N. This match is sub_done.c. Typing CTRL-N again
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 takes you to sub_exit.c. The results:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 The exit code is in the file sub_exit.c ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 If the file name starts with / (Unix) or C:\ (MS-Windows) you can find all
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 files in the file system. For example, type "/u" and CTRL-X CTRL-F. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 will match "/usr" (this is on Unix):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 the file is found in /usr/ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 If you now press CTRL-N you go back to "/u". Instead, to accept the "/usr/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 and go one directory level deeper, use CTRL-X CTRL-F again:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 the file is found in /usr/X11R6/ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 The results depend on what is found in your file system, of course. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 matches are sorted alphabetically.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
235
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
236 COMPLETING IN SOURCE CODE
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
237
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
238 Source code files are well structured. That makes it possible to do
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
239 completion in an intelligent way. In Vim this is called Omni completion. In
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
240 some other editors it's called intellisense, but that is a trademark.
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
241
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
242 The key to Omni completion is CTRL-X CTRL-O. Obviously the O stands for Omni
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
243 here, so that you can remember it easier. Let's use an example for editing C
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
244 source:
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
245
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
246 { ~
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
247 struct foo *p; ~
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
248 p-> ~
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
249
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
250 The cursor is after "p->". Now type CTRL-X CTRL-O. Vim will offer you a list
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
251 of alternatives, which are the items that "struct foo" contains. That is
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
252 quite different from using CTRL-P, which would complete any word, while only
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
253 members of "struct foo" are valid here.
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
254
1122
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
255 For Omni completion to work you may need to do some setup. At least make sure
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
256 filetype plugins are enabled. Your vimrc file should contain a line like
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
257 this: >
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
258 filetype plugin on
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
259 Or: >
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
260 filetype plugin indent on
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
261
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
262 For C code you need to create a tags file and set the 'tags' option. That is
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
263 explained |ft-c-omni|. For other filetypes you may need to do something
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
264 similar, look below |compl-omni-filetypes|. It only works for specific
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
265 filetypes. Check the value of the 'omnifunc' option to find out if it would
2ad54fcf37e3 updated for version 7.1a
vimboss
parents: 874
diff changeset
266 work.
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 810
diff changeset
267
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 *24.4* Repeating an insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 If you press CTRL-A, the editor inserts the text you typed the last time you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 were in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 Assume, for example, that you have a file that begins with the following:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 "file.h" ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 /* Main program begins */ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 You edit this file by inserting "#include " at the beginning of the first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 line:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 #include "file.h" ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 /* Main program begins */ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 You go down to the beginning of the next line using the commands "j^". You
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 now start to insert a new "#include" line. So you type: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 i CTRL-A
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 The result is as follows:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 #include "file.h" ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 #include /* Main program begins */ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 The "#include " was inserted because CTRL-A inserts the text of the previous
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 insert. Now you type "main.h"<Enter> to finish the line:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 #include "file.h" ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 #include "main.h" ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 /* Main program begins */ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 The CTRL-@ command does a CTRL-A and then exits Insert mode. That's a quick
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 way of doing exactly the same insertion again.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 *24.5* Copying from another line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 The CTRL-Y command inserts the character above the cursor. This is useful
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 when you are duplicating a previous line. For example, you have this line of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 C code:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 b_array[i]->s_next = a_array[i]->s_next; ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 Now you need to type the same line, but with "s_prev" instead of "s_next".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 Start the new line, and press CTRL-Y 14 times, until you are at the "n" of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 "next":
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 b_array[i]->s_next = a_array[i]->s_next; ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 b_array[i]->s_ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 Now you type "prev":
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 b_array[i]->s_next = a_array[i]->s_next; ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 b_array[i]->s_prev ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 Continue pressing CTRL-Y until the following "next":
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 b_array[i]->s_next = a_array[i]->s_next; ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 b_array[i]->s_prev = a_array[i]->s_ ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 Now type "prev;" to finish it off.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 The CTRL-E command acts like CTRL-Y except it inserts the character below the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 *24.6* Inserting a register
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 The command CTRL-R {register} inserts the contents of the register. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 useful to avoid having to type a long word. For example, you need to type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 r = VeryLongFunction(a) + VeryLongFunction(b) + VeryLongFunction(c) ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 The function name is defined in a different file. Edit that file and move the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 cursor on top of the function name there, and yank it into register v: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 "vyiw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 "v is the register specification, "yiw" is yank-inner-word. Now edit the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 where the new line is to be inserted, and type the first letters:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 r = ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 Now use CTRL-R v to insert the function name:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 r = VeryLongFunction ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 You continue to type the characters in between the function name, and use
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 CTRL-R v two times more.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 You could have done the same with completion. Using a register is useful
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 when there are many words that start with the same characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 If the register contains characters such as <BS> or other special characters,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 they are interpreted as if they had been typed from the keyboard. If you do
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 not want this to happen (you really want the <BS> to be inserted in the text),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 use the command CTRL-R CTRL-R {register}.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 *24.7* Abbreviations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 An abbreviation is a short word that takes the place of a long one. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 example, "ad" stands for "advertisement". Vim enables you to type an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 abbreviation and then will automatically expand it for you.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 To tell Vim to expand "ad" into "advertisement" every time you insert it,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 use the following command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 :iabbrev ad advertisement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 Now, when you type "ad", the whole word "advertisement" will be inserted into
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 the text. This is triggered by typing a character that can't be part of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 word, for example a space:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 What Is Entered What You See
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 I saw the a I saw the a ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 I saw the ad I saw the ad ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 I saw the ad<Space> I saw the advertisement<Space> ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 The expansion doesn't happen when typing just "ad". That allows you to type a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 word like "add", which will not get expanded. Only whole words are checked
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 for abbreviations.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 ABBREVIATING SEVERAL WORDS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 It is possible to define an abbreviation that results in multiple words. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 example, to define "JB" as "Jack Benny", use the following command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 :iabbrev JB Jack Benny
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 As a programmer, I use two rather unusual abbreviations: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 :iabbrev #b /****************************************
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 :iabbrev #e <Space>****************************************/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 These are used for creating boxed comments. The comment starts with #b, which
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 draws the top line. I then type the comment text and use #e to draw the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 bottom line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 Notice that the #e abbreviation begins with a space. In other words, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 first two characters are space-star. Usually Vim ignores spaces between the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 abbreviation and the expansion. To avoid that problem, I spell space as seven
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 characters: <, S, p, a, c, e, >.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 Note:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 ":iabbrev" is a long word to type. ":iab" works just as well.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 That's abbreviating the abbreviate command!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 FIXING TYPING MISTAKES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 It's very common to make the same typing mistake every time. For example,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 typing "teh" instead of "the". You can fix this with an abbreviation: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 :abbreviate teh the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 You can add a whole list of these. Add one each time you discover a common
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 mistake.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 LISTING ABBREVIATIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 The ":abbreviate" command lists the abbreviations:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 :abbreviate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 i #e ****************************************/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 i #b /****************************************
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 i JB Jack Benny
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 i ad advertisement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 ! teh the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 The "i" in the first column indicates Insert mode. These abbreviations are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 only active in Insert mode. Other possible characters are:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 c Command-line mode :cabbrev
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 ! both Insert and Command-line mode :abbreviate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 Since abbreviations are not often useful in Command-line mode, you will mostly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 use the ":iabbrev" command. That avoids, for example, that "ad" gets expanded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 when typing a command like: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 :edit ad
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 DELETING ABBREVIATIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 To get rid of an abbreviation, use the ":unabbreviate" command. Suppose you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 have the following abbreviation: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 :abbreviate @f fresh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 You can remove it with this command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 :unabbreviate @f
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 While you type this, you will notice that @f is expanded to "fresh". Don't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 worry about this, Vim understands it anyway (except when you have an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 abbreviation for "fresh", but that's very unlikely).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 To remove all the abbreviations: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 :abclear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 ":unabbreviate" and ":abclear" also come in the variants for Insert mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 (":iunabbreviate and ":iabclear") and Command-line mode (":cunabbreviate" and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 ":cabclear").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 REMAPPING ABBREVIATIONS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 There is one thing to watch out for when defining an abbreviation: The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 resulting string should not be mapped. For example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 :abbreviate @a adder
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 :imap dd disk-door
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 When you now type @a, you will get "adisk-doorer". That's not what you want.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 To avoid this, use the ":noreabbrev" command. It does the same as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 ":abbreviate", but avoids that the resulting string is used for mappings: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 :noreabbrev @a adder
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 Fortunately, it's unlikely that the result of an abbreviation is mapped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 *24.8* Entering special characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 The CTRL-V command is used to insert the next character literally. In other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 words, any special meaning the character has, it will be ignored. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 CTRL-V <Esc>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 Inserts an escape character. Thus you don't leave Insert mode. (Don't type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 the space after CTRL-V, it's only to make this easier to read).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 Note:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 On MS-Windows CTRL-V is used to paste text. Use CTRL-Q instead of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 CTRL-V. On Unix, on the other hand, CTRL-Q does not work on some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 terminals, because it has a special meaning.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 You can also use the command CTRL-V {digits} to insert a character with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 decimal number {digits}. For example, the character number 127 is the <Del>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 character (but not necessarily the <Del> key!). To insert <Del> type: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 CTRL-V 127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 You can enter characters up to 255 this way. When you type fewer than two
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 digits, a non-digit will terminate the command. To avoid the need of typing a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 non-digit, prepend one or two zeros to make three digits.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 All the next commands insert a <Tab> and then a dot:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 CTRL-V 9.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 CTRL-V 09.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 CTRL-V 009.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 To enter a character in hexadecimal, use an "x" after the CTRL-V: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 CTRL-V x7f
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 This also goes up to character 255 (CTRL-V xff). You can use "o" to type a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 character as an octal number and two more methods allow you to type up to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 a 16 bit and a 32 bit number (e.g., for a Unicode character): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 CTRL-V o123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 CTRL-V u1234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 CTRL-V U12345678
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 *24.9* Digraphs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 Some characters are not on the keyboard. For example, the copyright character
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
541 (©). To type these characters in Vim, you use digraphs, where two characters
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
542 represent one. To enter a ©, for example, you press three keys: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 CTRL-K Co
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 To find out what digraphs are available, use the following command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 :digraphs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 Vim will display the digraph table. Here are three lines of it:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
552 AC ~_ 159 NS | 160 !I ¡ 161 Ct ¢ 162 Pd £ 163 Cu ¤ 164 Ye ¥ 165 ~
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
553 BB ¦ 166 SE § 167 ': ¨ 168 Co © 169 -a ª 170 << « 171 NO ¬ 172 ~
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
554 -- ­ 173 Rg ® 174 'm ¯ 175 DG ° 176 +- ± 177 2S ² 178 3S ³ 179 ~
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 This shows, for example, that the digraph you get by typing CTRL-K Pd is the
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
557 character (£). This is character number 163 (decimal).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 Pd is short for Pound. Most digraphs are selected to give you a hint about
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 the character they will produce. If you look through the list you will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 understand the logic.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 You can exchange the first and second character, if there is no digraph for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 that combination. Thus CTRL-K dP also works. Since there is no digraph for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 "dP" Vim will also search for a "Pd" digraph.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 Note:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 The digraphs depend on the character set that Vim assumes you are
18972
130acb903dbe Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
567 using. Always use ":digraphs" to find out which digraphs are currently
130acb903dbe Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
568 available.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 You can define your own digraphs. Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
572 :digraph a" ä
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573
13482
9eebe457eb3c Update runtime files. Convert a couple of help files to utf-8.
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
574 This defines that CTRL-K a" inserts an ä character. You can also specify the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 character with a decimal number. This defines the same digraph: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 :digraph a" 228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 More information about digraphs here: |digraphs|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 Another way to insert special characters is with a keymap. More about that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 here: |45.5|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 *24.10* Normal mode commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 Insert mode offers a limited number of commands. In Normal mode you have many
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 more. When you want to use one, you usually leave Insert mode with <Esc>,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 execute the Normal mode command, and re-enter Insert mode with "i" or "a".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 There is a quicker way. With CTRL-O {command} you can execute any Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 mode command from Insert mode. For example, to delete from the cursor to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 end of the line: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 CTRL-O D
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 You can execute only one Normal mode command this way. But you can specify a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 register or a count. A more complicated example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 CTRL-O "g3dw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 This deletes up to the third word into register g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 Next chapter: |usr_25.txt| Editing formatted text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605
14519
5c5908e81e93 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
606 Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: