Mercurial > vim
annotate runtime/doc/usr_02.txt @ 14207:72a425590918
Added tag v8.1.0120 for changeset f2ab259ef88aba927521c529eeae5b84ed45a063
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Jun 2018 11:30:07 +0200 |
parents | 1174611ad715 |
children | 5c5908e81e93 |
rev | line source |
---|---|
13963 | 1 *usr_02.txt* For Vim version 8.1. Last change: 2017 Mar 14 |
7 | 2 |
3 VIM USER MANUAL - by Bram Moolenaar | |
4 | |
5 The first steps in Vim | |
6 | |
7 | |
8 This chapter provides just enough information to edit a file with Vim. Not | |
9 well or fast, but you can edit. Take some time to practice with these | |
10 commands, they form the base for what follows. | |
11 | |
12 |02.1| Running Vim for the First Time | |
13 |02.2| Inserting text | |
14 |02.3| Moving around | |
15 |02.4| Deleting characters | |
16 |02.5| Undo and Redo | |
17 |02.6| Other editing commands | |
18 |02.7| Getting out | |
19 |02.8| Finding help | |
20 | |
21 Next chapter: |usr_03.txt| Moving around | |
22 Previous chapter: |usr_01.txt| About the manuals | |
23 Table of contents: |usr_toc.txt| | |
24 | |
25 ============================================================================== | |
26 *02.1* Running Vim for the First Time | |
27 | |
28 To start Vim, enter this command: > | |
29 | |
30 gvim file.txt | |
31 | |
32 In UNIX you can type this at any command prompt. If you are running Microsoft | |
33 Windows, open an MS-DOS prompt window and enter the command. | |
34 In either case, Vim starts editing a file called file.txt. Because this | |
35 is a new file, you get a blank window. This is what your screen will look | |
36 like: | |
37 | |
38 +---------------------------------------+ | |
39 |# | | |
40 |~ | | |
41 |~ | | |
42 |~ | | |
43 |~ | | |
44 |"file.txt" [New file] | | |
45 +---------------------------------------+ | |
46 ('#" is the cursor position.) | |
47 | |
48 The tilde (~) lines indicate lines not in the file. In other words, when Vim | |
49 runs out of file to display, it displays tilde lines. At the bottom of the | |
50 screen, a message line indicates the file is named file.txt and shows that you | |
51 are creating a new file. The message information is temporary and other | |
52 information overwrites it. | |
53 | |
54 | |
55 THE VIM COMMAND | |
56 | |
57 The gvim command causes the editor to create a new window for editing. If you | |
58 use this command: > | |
59 | |
60 vim file.txt | |
61 | |
62 the editing occurs inside your command window. In other words, if you are | |
63 running inside an xterm, the editor uses your xterm window. If you are using | |
64 an MS-DOS command prompt window under Microsoft Windows, the editing occurs | |
65 inside this window. The text in the window will look the same for both | |
66 versions, but with gvim you have extra features, like a menu bar. More about | |
67 that later. | |
68 | |
69 ============================================================================== | |
70 *02.2* Inserting text | |
71 | |
72 The Vim editor is a modal editor. That means that the editor behaves | |
73 differently, depending on which mode you are in. The two basic modes are | |
74 called Normal mode and Insert mode. In Normal mode the characters you type | |
75 are commands. In Insert mode the characters are inserted as text. | |
76 Since you have just started Vim it will be in Normal mode. To start Insert | |
77 mode you type the "i" command (i for Insert). Then you can enter | |
78 the text. It will be inserted into the file. Do not worry if you make | |
79 mistakes; you can correct them later. To enter the following programmer's | |
80 limerick, this is what you type: > | |
81 | |
82 iA very intelligent turtle | |
83 Found programming UNIX a hurdle | |
84 | |
85 After typing "turtle" you press the <Enter> key to start a new line. Finally | |
86 you press the <Esc> key to stop Insert mode and go back to Normal mode. You | |
87 now have two lines of text in your Vim window: | |
88 | |
89 +---------------------------------------+ | |
90 |A very intelligent turtle | | |
91 |Found programming UNIX a hurdle | | |
92 |~ | | |
93 |~ | | |
94 | | | |
95 +---------------------------------------+ | |
96 | |
97 | |
98 WHAT IS THE MODE? | |
99 | |
100 To be able to see what mode you are in, type this command: > | |
101 | |
102 :set showmode | |
103 | |
104 You will notice that when typing the colon Vim moves the cursor to the last | |
105 line of the window. That's where you type colon commands (commands that start | |
106 with a colon). Finish this command by pressing the <Enter> key (all commands | |
107 that start with a colon are finished this way). | |
108 Now, if you type the "i" command Vim will display --INSERT-- at the bottom | |
109 of the window. This indicates you are in Insert mode. | |
110 | |
111 +---------------------------------------+ | |
112 |A very intelligent turtle | | |
113 |Found programming UNIX a hurdle | | |
114 |~ | | |
115 |~ | | |
116 |-- INSERT -- | | |
117 +---------------------------------------+ | |
118 | |
119 If you press <Esc> to go back to Normal mode the last line will be made blank. | |
120 | |
121 | |
122 GETTING OUT OF TROUBLE | |
123 | |
124 One of the problems for Vim novices is mode confusion, which is caused by | |
125 forgetting which mode you are in or by accidentally typing a command that | |
126 switches modes. To get back to Normal mode, no matter what mode you are in, | |
127 press the <Esc> key. Sometimes you have to press it twice. If Vim beeps back | |
128 at you, you already are in Normal mode. | |
129 | |
130 ============================================================================== | |
131 *02.3* Moving around | |
132 | |
133 After you return to Normal mode, you can move around by using these keys: | |
134 | |
135 h left *hjkl* | |
136 j down | |
137 k up | |
138 l right | |
139 | |
140 At first, it may appear that these commands were chosen at random. After all, | |
141 who ever heard of using l for right? But actually, there is a very good | |
142 reason for these choices: Moving the cursor is the most common thing you do in | |
143 an editor, and these keys are on the home row of your right hand. In other | |
144 words, these commands are placed where you can type them the fastest | |
145 (especially when you type with ten fingers). | |
146 | |
147 Note: | |
148 You can also move the cursor by using the arrow keys. If you do, | |
149 however, you greatly slow down your editing because to press the arrow | |
150 keys, you must move your hand from the text keys to the arrow keys. | |
151 Considering that you might be doing it hundreds of times an hour, this | |
152 can take a significant amount of time. | |
153 Also, there are keyboards which do not have arrow keys, or which | |
154 locate them in unusual places; therefore, knowing the use of the hjkl | |
155 keys helps in those situations. | |
156 | |
157 One way to remember these commands is that h is on the left, l is on the | |
158 right and j points down. In a picture: > | |
159 | |
160 k | |
161 h l | |
162 j | |
163 | |
164 The best way to learn these commands is by using them. Use the "i" command to | |
165 insert some more lines of text. Then use the hjkl keys to move around and | |
166 insert a word somewhere. Don't forget to press <Esc> to go back to Normal | |
167 mode. The |vimtutor| is also a nice way to learn by doing. | |
168 | |
169 For Japanese users, Hiroshi Iwatani suggested using this: | |
170 | |
171 Komsomolsk | |
172 ^ | |
173 | | |
174 Huan Ho <--- ---> Los Angeles | |
175 (Yellow river) | | |
176 v | |
177 Java (the island, not the programming language) | |
178 | |
179 ============================================================================== | |
180 *02.4* Deleting characters | |
181 | |
182 To delete a character, move the cursor over it and type "x". (This is a | |
183 throwback to the old days of the typewriter, when you deleted things by typing | |
184 xxxx over them.) Move the cursor to the beginning of the first line, for | |
185 example, and type xxxxxxx (seven x's) to delete "A very ". The result should | |
186 look like this: | |
187 | |
188 +---------------------------------------+ | |
189 |intelligent turtle | | |
190 |Found programming UNIX a hurdle | | |
191 |~ | | |
192 |~ | | |
193 | | | |
194 +---------------------------------------+ | |
195 | |
196 Now you can insert new text, for example by typing: > | |
197 | |
198 iA young <Esc> | |
199 | |
200 This begins an insert (the i), inserts the words "A young", and then exits | |
201 insert mode (the final <Esc>). The result: | |
202 | |
203 +---------------------------------------+ | |
204 |A young intelligent turtle | | |
205 |Found programming UNIX a hurdle | | |
206 |~ | | |
207 |~ | | |
208 | | | |
209 +---------------------------------------+ | |
210 | |
211 | |
212 DELETING A LINE | |
213 | |
214 To delete a whole line use the "dd" command. The following line will | |
215 then move up to fill the gap: | |
216 | |
217 +---------------------------------------+ | |
218 |Found programming UNIX a hurdle | | |
219 |~ | | |
220 |~ | | |
221 |~ | | |
222 | | | |
223 +---------------------------------------+ | |
224 | |
225 | |
226 DELETING A LINE BREAK | |
227 | |
228 In Vim you can join two lines together, which means that the line break | |
229 between them is deleted. The "J" command does this. | |
230 Take these two lines: | |
231 | |
232 A young intelligent ~ | |
233 turtle ~ | |
234 | |
235 Move the cursor to the first line and press "J": | |
236 | |
237 A young intelligent turtle ~ | |
238 | |
239 ============================================================================== | |
240 *02.5* Undo and Redo | |
241 | |
242 Suppose you delete too much. Well, you can type it in again, but an easier | |
243 way exists. The "u" command undoes the last edit. Take a look at this in | |
244 action: After using "dd" to delete the first line, "u" brings it back. | |
245 Another one: Move the cursor to the A in the first line: | |
246 | |
247 A young intelligent turtle ~ | |
248 | |
249 Now type xxxxxxx to delete "A young". The result is as follows: | |
250 | |
251 intelligent turtle ~ | |
252 | |
253 Type "u" to undo the last delete. That delete removed the g, so the undo | |
254 restores the character. | |
255 | |
256 g intelligent turtle ~ | |
257 | |
258 The next u command restores the next-to-last character deleted: | |
259 | |
260 ng intelligent turtle ~ | |
261 | |
262 The next u command gives you the u, and so on: | |
263 | |
264 ung intelligent turtle ~ | |
265 oung intelligent turtle ~ | |
266 young intelligent turtle ~ | |
267 young intelligent turtle ~ | |
268 A young intelligent turtle ~ | |
269 | |
270 Note: | |
271 If you type "u" twice, and the result is that you get the same text | |
272 back, you have Vim configured to work Vi compatible. Look here to fix | |
273 this: |not-compatible|. | |
274 This text assumes you work "The Vim Way". You might prefer to use | |
275 the good old Vi way, but you will have to watch out for small | |
276 differences in the text then. | |
277 | |
278 | |
279 REDO | |
280 | |
281 If you undo too many times, you can press CTRL-R (redo) to reverse the | |
282 preceding command. In other words, it undoes the undo. To see this in | |
283 action, press CTRL-R twice. The character A and the space after it disappear: | |
284 | |
285 young intelligent turtle ~ | |
286 | |
287 There's a special version of the undo command, the "U" (undo line) command. | |
288 The undo line command undoes all the changes made on the last line that was | |
289 edited. Typing this command twice cancels the preceding "U". | |
290 | |
291 A very intelligent turtle ~ | |
292 xxxx Delete very | |
293 | |
294 A intelligent turtle ~ | |
295 xxxxxx Delete turtle | |
296 | |
297 A intelligent ~ | |
298 Restore line with "U" | |
299 A very intelligent turtle ~ | |
300 Undo "U" with "u" | |
301 A intelligent ~ | |
302 | |
303 The "U" command is a change by itself, which the "u" command undoes and CTRL-R | |
304 redoes. This might be a bit confusing. Don't worry, with "u" and CTRL-R you | |
2281
e41433ea71df
Added ":earlier 1f" and ":later 1f".
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
305 can go to any of the situations you had. More about that in section |32.2|. |
7 | 306 |
307 ============================================================================== | |
308 *02.6* Other editing commands | |
309 | |
310 Vim has a large number of commands to change the text. See |Q_in| and below. | |
311 Here are a few often used ones. | |
312 | |
313 | |
314 APPENDING | |
315 | |
316 The "i" command inserts a character before the character under the cursor. | |
317 That works fine; but what happens if you want to add stuff to the end of the | |
318 line? For that you need to insert text after the cursor. This is done with | |
319 the "a" (append) command. | |
320 For example, to change the line | |
321 | |
322 and that's not saying much for the turtle. ~ | |
323 to | |
324 and that's not saying much for the turtle!!! ~ | |
325 | |
326 move the cursor over to the dot at the end of the line. Then type "x" to | |
327 delete the period. The cursor is now positioned at the end of the line on the | |
328 e in turtle. Now type > | |
329 | |
330 a!!!<Esc> | |
331 | |
332 to append three exclamation points after the e in turtle: | |
333 | |
334 and that's not saying much for the turtle!!! ~ | |
335 | |
336 | |
337 OPENING UP A NEW LINE | |
338 | |
339 The "o" command creates a new, empty line below the cursor and puts Vim in | |
340 Insert mode. Then you can type the text for the new line. | |
341 Suppose the cursor is somewhere in the first of these two lines: | |
342 | |
343 A very intelligent turtle ~ | |
344 Found programming UNIX a hurdle ~ | |
345 | |
346 If you now use the "o" command and type new text: > | |
347 | |
348 oThat liked using Vim<Esc> | |
349 | |
350 The result is: | |
351 | |
352 A very intelligent turtle ~ | |
353 That liked using Vim ~ | |
354 Found programming UNIX a hurdle ~ | |
355 | |
356 The "O" command (uppercase) opens a line above the cursor. | |
357 | |
358 | |
359 USING A COUNT | |
360 | |
361 Suppose you want to move up nine lines. You can type "kkkkkkkkk" or you can | |
362 enter the command "9k". In fact, you can precede many commands with a number. | |
363 Earlier in this chapter, for instance, you added three exclamation points to | |
364 the end of a line by typing "a!!!<Esc>". Another way to do this is to use the | |
365 command "3a!<Esc>". The count of 3 tells the command that follows to triple | |
366 its effect. Similarly, to delete three characters, use the command "3x". The | |
367 count always comes before the command it applies to. | |
368 | |
369 ============================================================================== | |
370 *02.7* Getting out | |
371 | |
372 To exit, use the "ZZ" command. This command writes the file and exits. | |
373 | |
374 Note: | |
375 Unlike many other editors, Vim does not automatically make a backup | |
376 file. If you type "ZZ", your changes are committed and there's no | |
377 turning back. You can configure the Vim editor to produce backup | |
378 files, see |07.4|. | |
379 | |
380 | |
381 DISCARDING CHANGES | |
382 | |
383 Sometimes you will make a sequence of changes and suddenly realize you were | |
384 better off before you started. Not to worry; Vim has a | |
385 quit-and-throw-things-away command. It is: > | |
386 | |
387 :q! | |
388 | |
389 Don't forget to press <Enter> to finish the command. | |
390 | |
391 For those of you interested in the details, the three parts of this command | |
392 are the colon (:), which enters Command-line mode; the q command, which tells | |
393 the editor to quit; and the override command modifier (!). | |
394 The override command modifier is needed because Vim is reluctant to throw | |
395 away changes. If you were to just type ":q", Vim would display an error | |
396 message and refuse to exit: | |
397 | |
398 E37: No write since last change (use ! to override) ~ | |
399 | |
400 By specifying the override, you are in effect telling Vim, "I know that what | |
401 I'm doing looks stupid, but I'm a big boy and really want to do this." | |
402 | |
403 If you want to continue editing with Vim: The ":e!" command reloads the | |
404 original version of the file. | |
405 | |
406 ============================================================================== | |
407 *02.8* Finding help | |
408 | |
409 Everything you always wanted to know can be found in the Vim help files. | |
410 Don't be afraid to ask! | |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
411 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
412 If you know what you are looking for, it is usually easier to search for it |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
413 using the help system, instead of using Google. Because the subjects follow |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
414 a certain style guide. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
415 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
416 Also the help has the advantage of belonging to your particular Vim version. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
417 You won't see help for commands added later. These would not work for you. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
418 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
419 To get generic help use this command: > |
7 | 420 |
421 :help | |
422 | |
423 You could also use the first function key <F1>. If your keyboard has a <Help> | |
424 key it might work as well. | |
425 If you don't supply a subject, ":help" displays the general help window. | |
426 The creators of Vim did something very clever (or very lazy) with the help | |
427 system: They made the help window a normal editing window. You can use all | |
428 the normal Vim commands to move through the help information. Therefore h, j, | |
429 k, and l move left, down, up and right. | |
430 To get out of the help window, use the same command you use to get out of | |
431 the editor: "ZZ". This will only close the help window, not exit Vim. | |
432 | |
433 As you read the help text, you will notice some text enclosed in vertical bars | |
434 (for example, |help|). This indicates a hyperlink. If you position the | |
435 cursor anywhere between the bars and press CTRL-] (jump to tag), the help | |
236 | 436 system takes you to the indicated subject. (For reasons not discussed here, |
7 | 437 the Vim terminology for a hyperlink is tag. So CTRL-] jumps to the location |
438 of the tag given by the word under the cursor.) | |
439 After a few jumps, you might want to go back. CTRL-T (pop tag) takes you | |
440 back to the preceding position. CTRL-O (jump to older position) also works | |
441 nicely here. | |
442 At the top of the help screen, there is the notation *help.txt*. This name | |
443 between "*" characters is used by the help system to define a tag (hyperlink | |
444 destination). | |
445 See |29.1| for details about using tags. | |
446 | |
447 To get help on a given subject, use the following command: > | |
448 | |
449 :help {subject} | |
450 | |
451 To get help on the "x" command, for example, enter the following: > | |
452 | |
453 :help x | |
454 | |
455 To find out how to delete text, use this command: > | |
456 | |
457 :help deleting | |
458 | |
459 To get a complete index of all Vim commands, use the following command: > | |
460 | |
461 :help index | |
462 | |
463 When you need to get help for a control character command (for example, | |
464 CTRL-A), you need to spell it with the prefix "CTRL-". > | |
465 | |
466 :help CTRL-A | |
467 | |
468 The Vim editor has many different modes. By default, the help system displays | |
469 the normal-mode commands. For example, the following command displays help | |
470 for the normal-mode CTRL-H command: > | |
471 | |
472 :help CTRL-H | |
473 | |
474 To identify other modes, use a mode prefix. If you want the help for the | |
475 insert-mode version of a command, use "i_". For CTRL-H this gives you the | |
476 following command: > | |
477 | |
478 :help i_CTRL-H | |
479 | |
480 When you start the Vim editor, you can use several command-line arguments. | |
481 These all begin with a dash (-). To find what the -t argument does, for | |
482 example, use the command: > | |
483 | |
484 :help -t | |
485 | |
486 The Vim editor has a number of options that enable you to configure and | |
487 customize the editor. If you want help for an option, you need to enclose it | |
488 in single quotation marks. To find out what the 'number' option does, for | |
489 example, use the following command: > | |
490 | |
491 :help 'number' | |
492 | |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
493 The table with all mode prefixes can be found below: |help-summary|. |
7 | 494 |
236 | 495 Special keys are enclosed in angle brackets. To find help on the up-arrow key |
7 | 496 in Insert mode, for instance, use this command: > |
497 | |
498 :help i_<Up> | |
499 | |
500 If you see an error message that you don't understand, for example: | |
501 | |
502 E37: No write since last change (use ! to override) ~ | |
503 | |
504 You can use the error ID at the start to find help about it: > | |
505 | |
506 :help E37 | |
507 | |
1121 | 508 |
509 Summary: *help-summary* > | |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
510 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
511 1) Use Ctrl-D after typing a topic and let Vim show all available topics. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
512 Or press Tab to complete: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
513 :help some<Tab> |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
514 < More information on how to use the help: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
515 :help helphelp |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
516 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
517 2) Follow the links in bars to related help. You can go from the detailed |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
518 help to the user documentation, which describes certain commands more from |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
519 a user perspective and less detailed. E.g. after: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
520 :help pattern.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
521 < You can see the user guide topics |03.9| and |usr_27.txt| in the |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
522 introduction. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
523 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
524 3) Options are enclosed in single apostrophes. To go to the help topic for the |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
525 list option: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
526 :help 'list' |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
527 < If you only know you are looking for a certain option, you can also do: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
528 :help options.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
529 < to open the help page which describes all option handling and then search |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
530 using regular expressions, e.g. textwidth. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
531 Certain options have their own namespace, e.g.: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
532 :help cpo-<letter> |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
533 < for the corresponding flag of the 'cpoptions' settings, substitute <letter> |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
534 by a specific flag, e.g.: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
535 :help cpo-; |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
536 < And for the guioption flags: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
537 :help go-<letter> |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
538 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
539 4) Normal mode commands do not have a prefix. To go to the help page for the |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
540 "gt" command: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
541 :help gt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
542 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
543 5) Insert mode commands start with i_. Help for deleting a word: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
544 :help i_CTRL-W |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
545 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
546 6) Visual mode commands start with v_. Help for jumping to the other side of |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
547 the Visual area: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
548 :help v_o |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
549 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
550 7) Command line editing and arguments start with c_. Help for using the |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
551 command argument %: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
552 :help c_% |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
553 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
554 8) Ex-commands always start with ":", so to go to the :s command help: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
555 :help :s |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
556 |
11160 | 557 9) Commands specifically for debugging start with ">". To go to the help |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
558 for the "cont" debug command: > |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
559 :help >cont |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
560 |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
561 10) Key combinations. They usually start with a single letter indicating |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
562 the mode for which they can be used. E.g.: > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
563 :help i_CTRL-X |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
564 < takes you to the family of Ctrl-X commands for insert mode which can be |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
565 used to auto complete different things. Note, that certain keys will |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
566 always be written the same, e.g. Control will always be CTRL. |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
567 For normal mode commands there is no prefix and the topic is available at |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
568 :h CTRL-<Letter>. E.g. > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
569 :help CTRL-W |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
570 < In contrast > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
571 :help c_CTRL-R |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
572 < will describe what the Ctrl-R does when entering commands in the Command |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
573 line and > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
574 :help v_Ctrl-A |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
575 < talks about incrementing numbers in visual mode and > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
576 :help g_CTRL-A |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
577 < talks about the g<C-A> command (e.g. you have to press "g" then <Ctrl-A>). |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
578 Here the "g" stand for the normal command "g" which always expects a second |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
579 key before doing something similar to the commands starting with "z" |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
580 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
581 11) Regexp items always start with /. So to get help for the "\+" quantifier |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
582 in Vim regexes: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
583 :help /\+ |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
584 < If you need to know everything about regular expressions, start reading |
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
585 at: > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
586 :help pattern.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
587 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
588 12) Registers always start with "quote". To find out about the special ":" |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
589 register: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
590 :help quote: |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
591 |
10942
e05695e59f6d
patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
592 13) Vim script is available at > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
593 :help eval.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
594 < Certain aspects of the language are available at :h expr-X where "X" is a |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
595 single letter. E.g. > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
596 :help expr-! |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
597 < will take you to the topic describing the "!" (Not) operator for |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
598 VimScript. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
599 Also important is > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
600 :help function-list |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
601 < to find a short description of all functions available. Help topics for |
10942
e05695e59f6d
patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
602 Vim script functions always include the "()", so: > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
603 :help append() |
10942
e05695e59f6d
patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
604 < talks about the append Vim script function rather than how to append text |
e05695e59f6d
patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
605 in the current buffer. |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
606 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
607 14) Mappings are talked about in the help page :h |map.txt|. Use > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
608 :help mapmode-i |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
609 < to find out about the |:imap| command. Also use :map-topic |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
610 to find out about certain subtopics particular for mappings. e.g: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
611 :help :map-local |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
612 < for buffer-local mappings or > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
613 :help map-bar |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
614 < for how the '|' is handled in mappings. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
615 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
616 15) Command definitions are talked about :h command-topic, so use > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
617 :help command-bar |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
618 < to find out about the '!' argument for custom commands. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
619 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
620 16) Window management commands always start with CTRL-W, so you find the |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
621 corresponding help at :h CTRL-W_letter. E.g. > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
622 :help CTRL-W_p |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
623 < for moving the previous accessed window. You can also access > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
624 :help windows.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
625 < and read your way through if you are looking for window handling |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
626 commands. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
627 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
628 17) Use |:helpgrep| to search in all help pages (and also of any installed |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
629 plugins). See |:helpgrep| for how to use it. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
630 To search for a topic: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
631 :helpgrep topic |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
632 < This takes you to the first match. To go to the next one: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
633 :cnext |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
634 < All matches are available in the quickfix window which can be opened |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
635 with: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
636 :copen |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
637 < Move around to the match you like and press Enter to jump to that help. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
638 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
639 18) The user manual. This describes help topics for beginners in a rather |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
640 friendly way. Start at |usr_toc.txt| to find the table of content (as you |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
641 might have guessed): > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
642 :help usr_toc.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
643 < Skim over the contents to find interesting topics. The "Digraphs" and |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
644 "Entering special characters" items are in chapter 24, so to go to that |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
645 particular help page: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
646 :help usr_24.txt |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
647 < Also if you want to access a certain chapter in the help, the chapter |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
648 number can be accessed directly like this: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
649 :help 10.1 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
650 < goes to chapter 10.1 in |usr_10.txt| and talks about recording macros. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
651 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
652 19) Highlighting groups. Always start with hl-groupname. E.g. > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
653 :help hl-WarningMsg |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
654 < talks about the WarningMsg highlighting group. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
655 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
656 20) Syntax highlighting is namespaced to :syn-topic e.g. > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
657 :help :syn-conceal |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
658 < talks about the conceal argument for the :syn command. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
659 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
660 21) Quickfix commands usually start with :c while location list commands |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
661 usually start with :l |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
662 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
663 22) Autocommand events can be found by their name: > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
664 :help BufWinLeave |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
665 < To see all possible events: > |
11062 | 666 :help autocommand-events |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
667 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
668 23) Command-line switches always start with "-". So for the help of the -f |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
669 command switch of Vim use: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
670 :help -f |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
671 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
672 24) Optional features always start with "+". To find out about the |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
673 conceal feature use: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
674 :help +conceal |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
675 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
676 25) Documentation for included filetype specific functionality is usually |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
677 available in the form ft-<filetype>-<functionality>. So > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
678 :help ft-c-syntax |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
679 < talks about the C syntax file and the option it provides. Sometimes, |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
680 additional sections for omni completion > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
681 :help ft-php-omni |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
682 < or filetype plugins > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
683 :help ft-tex-plugin |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
684 < are available. |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
685 |
7659
07f11de5efca
commit https://github.com/vim/vim/commit/85084ef1e999dcf50e8d466106a33bac24a0febb
Christian Brabandt <cb@256bit.org>
parents:
7597
diff
changeset
|
686 26) Error and Warning codes can be looked up directly in the help. So > |
7597
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
687 :help E297 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
688 < takes you exactly to the description of the swap error message and > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
689 :help W10 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
690 < talks about the warning "Changing a readonly file". |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
691 Sometimes however, those error codes are not described, but rather are |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
692 listed at the Vim command that usually causes this. So: > |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
693 :help E128 |
3012eaddb6b2
commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937
Christian Brabandt <cb@256bit.org>
parents:
6741
diff
changeset
|
694 < takes you to the |:function| command |
1121 | 695 |
696 | |
7 | 697 ============================================================================== |
698 | |
699 Next chapter: |usr_03.txt| Moving around | |
700 | |
701 Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: |