Mercurial > vim
annotate runtime/doc/intro.txt @ 10855:0beffabed338 v8.0.0317
patch 8.0.0317: no test for setting 'guifont'
commit https://github.com/vim/vim/commit/43dded8c59c0647a70dd52c3125783945d90ae5a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 9 16:06:17 2017 +0100
patch 8.0.0317: no test for setting 'guifont'
Problem: No test for setting 'guifont'.
Solution: Add a test for X11 GUIs. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Feb 2017 16:15:05 +0100 |
parents | 74effdaa369e |
children | bd6ff5246c71 |
rev | line source |
---|---|
10228
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
1 *intro.txt* For Vim version 8.0. Last change: 2016 Sep 24 |
7 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
7 Introduction to Vim *ref* *reference* | |
8 | |
9 1. Introduction |intro| | |
10 2. Vim on the internet |internet| | |
11 3. Credits |credits| | |
12 4. Notation |notation| | |
13 5. Modes, introduction |vim-modes-intro| | |
14 6. Switching from mode to mode |mode-switching| | |
15 7. The window contents |window-contents| | |
16 8. Definitions |definitions| | |
17 | |
18 ============================================================================== | |
19 1. Introduction *intro* | |
20 | |
21 Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many | |
22 improvements that a name change was appropriate. Vim is a text editor which | |
23 includes almost all the commands from the Unix program "Vi" and a lot of new | |
24 ones. It is very useful for editing programs and other plain text. | |
25 All commands are given with the keyboard. This has the advantage that you | |
26 can keep your fingers on the keyboard and your eyes on the screen. For those | |
27 who want it, there is mouse support and a GUI version with scrollbars and | |
28 menus (see |gui.txt|). | |
29 | |
30 An overview of this manual can be found in the file "help.txt", |help.txt|. | |
31 It can be accessed from within Vim with the <Help> or <F1> key and with the | |
32 |:help| command (just type ":help", without the bars or quotes). | |
33 The 'helpfile' option can be set to the name of the help file, in case it | |
34 is not located in the default place. You can jump to subjects like with tags: | |
35 Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back. | |
36 | |
37 Throughout this manual the differences between Vi and Vim are mentioned in | |
38 curly braces, like this: {Vi does not have on-line help}. See |vi_diff.txt| | |
39 for a summary of the differences between Vim and Vi. | |
40 | |
41 This manual refers to Vim on various machines. There may be small differences | |
42 between different computers and terminals. Besides the remarks given in this | |
43 document, there is a separate document for each supported system, see | |
44 |sys-file-list|. | |
45 | |
2033
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
46 *pronounce* |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
47 Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
48 capital, since it's a name, again like Jim. |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
49 |
7 | 50 This manual is a reference for all the Vim commands and options. This is not |
51 an introduction to the use of Vi or Vim, it gets a bit complicated here and | |
52 there. For beginners, there is a hands-on |tutor|. To learn using Vim, read | |
53 the user manual |usr_toc.txt|. | |
54 | |
55 *book* | |
56 There are many books on Vi that contain a section for beginners. There are | |
57 two books I can recommend: | |
58 | |
59 "Vim - Vi Improved" by Steve Oualline | |
60 | |
61 This is the very first book completely dedicated to Vim. It is very good for | |
62 beginners. The most often used commands are explained with pictures and | |
63 examples. The less often used commands are also explained, the more advanced | |
64 features are summarized. There is a comprehensive index and a quick | |
65 reference. Parts of this book have been included in the user manual | |
66 |frombook|. | |
67 Published by New Riders Publishing. ISBN: 0735710015 | |
68 For more information try one of these: | |
69 http://iccf-holland.org/click5.html | |
70 http://www.vim.org/iccf/click5.html | |
71 | |
72 "Learning the Vi editor" by Linda Lamb and Arnold Robbins | |
73 | |
74 This is a book about Vi that includes a chapter on Vim (in the sixth edition). | |
75 The first steps in Vi are explained very well. The commands that Vim adds are | |
76 only briefly mentioned. There is also a German translation. | |
77 Published by O'Reilly. ISBN: 1-56592-426-6. | |
78 | |
79 ============================================================================== | |
80 2. Vim on the internet *internet* | |
81 | |
838 | 82 *www* *WWW* *faq* *FAQ* *distribution* *download* |
7 | 83 The Vim pages contain the most recent information about Vim. They also |
84 contain links to the most recent version of Vim. The FAQ is a list of | |
85 Frequently Asked Questions. Read this if you have problems. | |
86 | |
87 VIM home page: http://www.vim.org/ | |
88 VIM FAQ: http://vimdoc.sf.net/ | |
89 Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS | |
90 | |
91 | |
92 Usenet News group where Vim is discussed: *news* *usenet* | |
93 comp.editors | |
94 This group is also for other editors. If you write about Vim, don't forget to | |
95 mention that. | |
96 | |
97 *mail-list* *maillist* | |
98 There are several mailing lists for Vim: | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10228
diff
changeset
|
99 <vim@vim.org> *vim-use* *vim_use* |
7 | 100 For discussions about using existing versions of Vim: Useful mappings, |
824 | 101 questions, answers, where to get a specific version, etc. There are |
102 quite a few people watching this list and answering questions, also | |
103 for beginners. Don't hesitate to ask your question here. | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10228
diff
changeset
|
104 <vim-dev@vim.org> *vim-dev* *vim_dev* *vimdev* |
7 | 105 For discussions about changing Vim: New features, porting, patches, |
106 beta-test versions, etc. | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10228
diff
changeset
|
107 <vim-announce@vim.org> *vim-announce* *vim_announce* |
7 | 108 Announcements about new versions of Vim; also for beta-test versions |
824 | 109 and ports to different systems. This is a read-only list. |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10228
diff
changeset
|
110 <vim-mac@vim.org> *vim-mac* *vim_mac* |
7 | 111 For discussions about using and improving the Macintosh version of |
112 Vim. | |
113 | |
114 See http://www.vim.org/maillist.php for the latest information. | |
115 | |
116 NOTE: | |
117 - You can only send messages to these lists if you have subscribed! | |
118 - You need to send the messages from the same location as where you subscribed | |
119 from (to avoid spam mail). | |
120 - Maximum message size is 40000 characters. | |
121 | |
122 *subscribe-maillist* | |
123 If you want to join, send a message to | |
1624 | 124 <vim-subscribe@vim.org> |
7 | 125 Make sure that your "From:" address is correct. Then the list server will |
126 give you help on how to subscribe. | |
127 | |
1624 | 128 *maillist-archive* |
129 For more information and archives look on the Vim maillist page: | |
130 http://www.vim.org/maillist.php | |
7 | 131 |
132 | |
133 Bug reports: *bugs* *bug-reports* *bugreport.vim* | |
134 | |
10228
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
135 There are two ways to report bugs, both work: |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
136 1. Send bug reports to: Vim Developers <vim-dev@vim.org> |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
137 This is a maillist, you need to become a member first and many people will |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
138 see the message. If you don't want that, e.g. because it is a security |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
139 issue, send it to <bugs@vim.org>, this only goes to the Vim maintainer |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
140 (that's Bram). |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
141 2. Open issue on GitHub: https://github.com/vim/vim/issues |
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
142 The text will be forwarded to the vim-dev maillist. |
5968 | 143 |
7 | 144 Please be brief; all the time that is spent on answering mail is subtracted |
145 from the time that is spent on improving Vim! Always give a reproducible | |
146 example and try to find out which settings or other things influence the | |
147 appearance of the bug. Try different machines, if possible. Send me patches | |
148 if you can! | |
149 | |
502 | 150 It will help to include information about the version of Vim you are using and |
151 your setup. You can get the information with this command: > | |
7 | 152 :so $VIMRUNTIME/bugreport.vim |
153 This will create a file "bugreport.txt" in the current directory, with a lot | |
154 of information of your environment. Before sending this out, check if it | |
155 doesn't contain any confidential information! | |
156 | |
502 | 157 If Vim crashes, please try to find out where. You can find help on this here: |
158 |debug.txt|. | |
7 | 159 |
502 | 160 In case of doubt or when you wonder if the problem has already been fixed but |
161 you can't find a fix for it, become a member of the vim-dev maillist and ask | |
162 your question there. |maillist| | |
7 | 163 |
164 *year-2000* *Y2K* | |
165 Since Vim internally doesn't use dates for editing, there is no year 2000 | |
166 problem to worry about. Vim does use the time in the form of seconds since | |
167 January 1st 1970. It is used for a time-stamp check of the edited file and | |
168 the swap file, which is not critical and should only cause warning messages. | |
169 | |
170 There might be a year 2038 problem, when the seconds don't fit in a 32 bit int | |
171 anymore. This depends on the compiler, libraries and operating system. | |
172 Specifically, time_t and the ctime() function are used. And the time_t is | |
173 stored in four bytes in the swap file. But that's only used for printing a | |
174 file date/time for recovery, it will never affect normal editing. | |
175 | |
176 The Vim strftime() function directly uses the strftime() system function. | |
177 localtime() uses the time() system function. getftime() uses the time | |
178 returned by the stat() system function. If your system libraries are year | |
179 2000 compliant, Vim is too. | |
180 | |
181 The user may create scripts for Vim that use external commands. These might | |
182 introduce Y2K problems, but those are not really part of Vim itself. | |
183 | |
184 ============================================================================== | |
323 | 185 3. Credits *credits* *author* *Bram* *Moolenaar* |
7 | 186 |
187 Most of Vim was written by Bram Moolenaar <Bram@vim.org>. | |
188 | |
189 Parts of the documentation come from several Vi manuals, written by: | |
190 W.N. Joy | |
191 Alan P.W. Hewett | |
192 Mark Horton | |
193 | |
194 The Vim editor is based on Stevie and includes (ideas from) other software, | |
195 worked on by the people mentioned here. Other people helped by sending me | |
196 patches, suggestions and giving feedback about what is good and bad in Vim. | |
197 | |
198 Vim would never have become what it is now, without the help of these people! | |
199 | |
200 Ron Aaron Win32 GUI changes | |
2246
1e48f569b03d
Move text from various.txt to a new helphelp.txt help file.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
201 Mohsin Ahmed encryption |
7 | 202 Zoltan Arpadffy work on VMS port |
203 Tony Andrews Stevie | |
204 Gert van Antwerpen changes for DJGPP on MS-DOS | |
205 Berkeley DB(3) ideas for swap file implementation | |
206 Keith Bostic Nvi | |
207 Walter Briscoe Makefile updates, various patches | |
208 Ralf Brown SPAWNO library for MS-DOS | |
209 Robert Colon many useful remarks | |
210 Marcin Dalecki GTK+ GUI port, toolbar icons, gettext() | |
211 Kayhan Demirel sent me news in Uganda | |
212 Chris & John Downey xvi (ideas for multi-windows version) | |
213 Henk Elbers first VMS port | |
29 | 214 Daniel Elstner GTK+ 2 port |
7 | 215 Eric Fischer Mac port, 'cindent', and other improvements |
216 Benji Fisher Answering lots of user questions | |
217 Bill Foster Athena GUI port | |
1624 | 218 Google Lets me work on Vim one day a week |
7 | 219 Loic Grenie xvim (ideas for multi windows version) |
1668 | 220 Sven Guckes Vim promoter and previous WWW page maintainer |
7 | 221 Darren Hiebert Exuberant ctags |
29 | 222 Jason Hildebrand GTK+ 2 port |
7 | 223 Bruce Hunsaker improvements for VMS port |
224 Andy Kahn Cscope support, GTK+ GUI port | |
225 Oezguer Kesim Maintainer of Vim Mailing Lists | |
226 Axel Kielhorn work on the Macintosh port | |
227 Steve Kirkendall Elvis | |
228 Roger Knobbe original port to Windows NT | |
229 Sergey Laskavy Vim's help from Moscow | |
1624 | 230 Felix von Leitner Previous maintainer of Vim Mailing Lists |
7 | 231 David Leonard Port of Python extensions to Unix |
232 Avner Lottem Edit in right-to-left windows | |
233 Flemming Madsen X11 client-server, various features and patches | |
2246
1e48f569b03d
Move text from various.txt to a new helphelp.txt help file.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
234 Tony Mechelynck answers many user questions |
7 | 235 Paul Moore Python interface extensions, many patches |
236 Katsuhito Nagano Work on multi-byte versions | |
237 Sung-Hyun Nam Work on multi-byte versions | |
238 Vince Negri Win32 GUI and generic console enhancements | |
239 Steve Oualline Author of the first Vim book |frombook| | |
2246
1e48f569b03d
Move text from various.txt to a new helphelp.txt help file.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
240 Dominique Pelle valgrind reports and many fixes |
1624 | 241 A.Politz Many bug reports and some fixes |
7 | 242 George V. Reilly Win32 port, Win32 GUI start-off |
243 Stephen Riehm bug collector | |
244 Stefan Roemer various patches and help to users | |
245 Ralf Schandl IBM OS/390 port | |
246 Olaf Seibert DICE and BeBox version, regexp improvements | |
247 Mortaza Shiran Farsi patches | |
248 Peter da Silva termlib | |
249 Paul Slootman OS/2 port | |
250 Henry Spencer regular expressions | |
251 Dany St-Amant Macintosh port | |
252 Tim Thompson Stevie | |
253 G. R. (Fred) Walter Stevie | |
254 Sven Verdoolaege Perl interface | |
255 Robert Webb Command-line completion, GUI versions, and | |
256 lots of patches | |
257 Ingo Wilken Tcl interface | |
258 Mike Williams PostScript printing | |
259 Juergen Weigert Lattice version, AUX improvements, UNIX and | |
260 MS-DOS ports, autoconf | |
261 Stefan 'Sec' Zehl Maintainer of vim.org | |
262 | |
263 I wish to thank all the people that sent me bug reports and suggestions. The | |
264 list is too long to mention them all here. Vim would not be the same without | |
265 the ideas from all these people: They keep Vim alive! | |
4992 | 266 *love* *peace* *friendship* *gross-national-happiness* |
7 | 267 |
268 | |
269 In this documentation there are several references to other versions of Vi: | |
39 | 270 *Vi* *vi* |
7 | 271 Vi "the original". Without further remarks this is the version |
272 of Vi that appeared in Sun OS 4.x. ":version" returns | |
273 "Version 3.7, 6/7/85". Sometimes other versions are referred | |
274 to. Only runs under Unix. Source code only available with a | |
275 license. More information on Vi can be found through: | |
276 http://vi-editor.org [doesn't currently work...] | |
277 *Posix* | |
278 Posix From the IEEE standard 1003.2, Part 2: Shell and utilities. | |
279 Generally known as "Posix". This is a textual description of | |
280 how Vi is supposed to work. | |
161 | 281 See |posix-compliance|. |
7 | 282 *Nvi* |
283 Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD. | |
284 Very good compatibility with the original Vi, with a few extensions. | |
285 The version used is 1.79. ":version" returns "Version 1.79 | |
286 (10/23/96)". There has been no release the last few years, although | |
287 there is a development version 1.81. | |
288 Source code is freely available. | |
289 *Elvis* | |
290 Elvis Another Vi clone, made by Steve Kirkendall. Very compact but isn't | |
291 as flexible as Vim. | |
292 The version used is 2.1. It is still being developed. Source code is | |
293 freely available. | |
294 | |
295 ============================================================================== | |
296 4. Notation *notation* | |
297 | |
298 When syntax highlighting is used to read this, text that is not typed | |
299 literally is often highlighted with the Special group. These are items in [], | |
300 {} and <>, and CTRL-X. | |
301 | |
302 Note that Vim uses all possible characters in commands. Sometimes the [], {} | |
303 and <> are part of what you type, the context should make this clear. | |
304 | |
305 | |
306 [] Characters in square brackets are optional. | |
307 | |
2596 | 308 *count* *[count]* |
7 | 309 [count] An optional number that may precede the command to multiply |
310 or iterate the command. If no number is given, a count of one | |
311 is used, unless otherwise noted. Note that in this manual the | |
312 [count] is not mentioned in the description of the command, | |
313 but only in the explanation. This was done to make the | |
314 commands easier to look up. If the 'showcmd' option is on, | |
315 the (partially) entered count is shown at the bottom of the | |
316 window. You can use <Del> to erase the last digit (|N<Del>|). | |
317 | |
318 *[quotex]* | |
319 ["x] An optional register designation where text can be stored. | |
320 See |registers|. The x is a single character between 'a' and | |
321 'z' or 'A' and 'Z' or '"', and in some cases (with the put | |
237 | 322 command) between '0' and '9', '%', '#', or others. The |
7 | 323 uppercase and lowercase letter designate the same register, |
324 but the lowercase letter is used to overwrite the previous | |
325 register contents, while the uppercase letter is used to | |
237 | 326 append to the previous register contents. Without the ""x" or |
7 | 327 with """" the stored text is put into the unnamed register. |
328 | |
329 *{}* | |
330 {} Curly braces denote parts of the command which must appear, | |
331 but which can take a number of different values. The | |
332 differences between Vim and Vi are also given in curly braces | |
333 (this will be clear from the context). | |
334 | |
335 *{char1-char2}* | |
336 {char1-char2} A single character from the range char1 to char2. For | |
337 example: {a-z} is a lowercase letter. Multiple ranges may be | |
338 concatenated. For example, {a-zA-Z0-9} is any alphanumeric | |
339 character. | |
340 | |
36 | 341 *{motion}* *movement* |
7 | 342 {motion} A command that moves the cursor. These are explained in |
343 |motion.txt|. Examples: | |
344 w to start of next word | |
345 b to begin of current word | |
346 4j four lines down | |
347 /The<CR> to next occurrence of "The" | |
348 This is used after an |operator| command to move over the text | |
349 that is to be operated upon. | |
350 - If the motion includes a count and the operator also has a | |
351 count, the two counts are multiplied. For example: "2d3w" | |
352 deletes six words. | |
353 - The motion can be backwards, e.g. "db" to delete to the | |
354 start of the word. | |
355 - The motion can also be a mouse click. The mouse is not | |
356 supported in every terminal though. | |
357 - The ":omap" command can be used to map characters while an | |
358 operator is pending. | |
359 - Ex commands can be used to move the cursor. This can be | |
360 used to call a function that does some complicated motion. | |
361 The motion is always characterwise exclusive, no matter | |
362 what ":" command is used. This means it's impossible to | |
363 include the last character of a line without the line break | |
364 (unless 'virtualedit' is set). | |
365 If the Ex command changes the text before where the operator | |
366 starts or jumps to another buffer the result is | |
367 unpredictable. It is possible to change the text further | |
368 down. Jumping to another buffer is possible if the current | |
369 buffer is not unloaded. | |
370 | |
371 *{Visual}* | |
372 {Visual} A selected text area. It is started with the "v", "V", or | |
373 CTRL-V command, then any cursor movement command can be used | |
374 to change the end of the selected text. | |
375 This is used before an |operator| command to highlight the | |
376 text that is to be operated upon. | |
377 See |Visual-mode|. | |
378 | |
379 *<character>* | |
380 <character> A special character from the table below, optionally with | |
381 modifiers, or a single ASCII character with modifiers. | |
382 | |
383 *'character'* | |
384 'c' A single ASCII character. | |
385 | |
386 *CTRL-{char}* | |
387 CTRL-{char} {char} typed as a control character; that is, typing {char} | |
388 while holding the CTRL key down. The case of {char} does not | |
389 matter; thus CTRL-A and CTRL-a are equivalent. But on some | |
390 terminals, using the SHIFT key will produce another code, | |
391 don't use it then. | |
392 | |
393 *'option'* | |
394 'option' An option, or parameter, that can be set to a value, is | |
395 enclosed in single quotes. See |options|. | |
396 | |
397 *quotecommandquote* | |
398 "command" A reference to a command that you can type is enclosed in | |
399 double quotes. | |
4119 | 400 `command` New style command, this distinguishes it from other quoted |
401 text and strings. | |
7 | 402 |
403 *key-notation* *key-codes* *keycodes* | |
404 These names for keys are used in the documentation. They can also be used | |
405 with the ":map" command (insert the key name by pressing CTRL-K and then the | |
406 key you want the name for). | |
407 | |
408 notation meaning equivalent decimal value(s) ~ | |
409 ----------------------------------------------------------------------- | |
410 <Nul> zero CTRL-@ 0 (stored as 10) *<Nul>* | |
411 <BS> backspace CTRL-H 8 *backspace* | |
412 <Tab> tab CTRL-I 9 *tab* *Tab* | |
413 *linefeed* | |
414 <NL> linefeed CTRL-J 10 (used for <Nul>) | |
415 <FF> formfeed CTRL-L 12 *formfeed* | |
416 <CR> carriage return CTRL-M 13 *carriage-return* | |
417 <Return> same as <CR> *<Return>* | |
418 <Enter> same as <CR> *<Enter>* | |
419 <Esc> escape CTRL-[ 27 *escape* *<Esc>* | |
420 <Space> space 32 *space* | |
421 <lt> less-than < 60 *<lt>* | |
422 <Bslash> backslash \ 92 *backslash* *<Bslash>* | |
423 <Bar> vertical bar | 124 *<Bar>* | |
424 <Del> delete 127 | |
425 <CSI> command sequence intro ALT-Esc 155 *<CSI>* | |
426 <xCSI> CSI when typed in the GUI *<xCSI>* | |
427 | |
428 <EOL> end-of-line (can be <CR>, <LF> or <CR><LF>, | |
429 depends on system and 'fileformat') *<EOL>* | |
430 | |
431 <Up> cursor-up *cursor-up* *cursor_up* | |
432 <Down> cursor-down *cursor-down* *cursor_down* | |
433 <Left> cursor-left *cursor-left* *cursor_left* | |
434 <Right> cursor-right *cursor-right* *cursor_right* | |
435 <S-Up> shift-cursor-up | |
436 <S-Down> shift-cursor-down | |
437 <S-Left> shift-cursor-left | |
438 <S-Right> shift-cursor-right | |
439 <C-Left> control-cursor-left | |
440 <C-Right> control-cursor-right | |
441 <F1> - <F12> function keys 1 to 12 *function_key* *function-key* | |
442 <S-F1> - <S-F12> shift-function keys 1 to 12 *<S-F1>* | |
443 <Help> help key | |
444 <Undo> undo key | |
445 <Insert> insert key | |
446 <Home> home *home* | |
447 <End> end *end* | |
448 <PageUp> page-up *page_up* *page-up* | |
449 <PageDown> page-down *page_down* *page-down* | |
450 <kHome> keypad home (upper left) *keypad-home* | |
451 <kEnd> keypad end (lower left) *keypad-end* | |
452 <kPageUp> keypad page-up (upper right) *keypad-page-up* | |
453 <kPageDown> keypad page-down (lower right) *keypad-page-down* | |
454 <kPlus> keypad + *keypad-plus* | |
455 <kMinus> keypad - *keypad-minus* | |
456 <kMultiply> keypad * *keypad-multiply* | |
457 <kDivide> keypad / *keypad-divide* | |
458 <kEnter> keypad Enter *keypad-enter* | |
459 <kPoint> keypad Decimal point *keypad-point* | |
460 <k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9* | |
461 <S-...> shift-key *shift* *<S-* | |
462 <C-...> control-key *control* *ctrl* *<C-* | |
463 <M-...> alt-key or meta-key *meta* *alt* *<M-* | |
464 <A-...> same as <M-...> *<A-* | |
465 <D-...> command-key (Macintosh only) *<D-* | |
466 <t_xx> key with "xx" entry in termcap | |
467 ----------------------------------------------------------------------- | |
468 | |
469 Note: The shifted cursor keys, the help key, and the undo key are only | |
470 available on a few terminals. On the Amiga, shifted function key 10 produces | |
471 a code (CSI) that is also used by key sequences. It will be recognized only | |
472 after typing another key. | |
473 | |
474 Note: There are two codes for the delete key. 127 is the decimal ASCII value | |
475 for the delete key, which is always recognized. Some delete keys send another | |
476 value, in which case this value is obtained from the termcap entry "kD". Both | |
477 values have the same effect. Also see |:fixdel|. | |
478 | |
479 Note: The keypad keys are used in the same way as the corresponding "normal" | |
480 keys. For example, <kHome> has the same effect as <Home>. If a keypad key | |
481 sends the same raw key code as its non-keypad equivalent, it will be | |
482 recognized as the non-keypad code. For example, when <kHome> sends the same | |
483 code as <Home>, when pressing <kHome> Vim will think <Home> was pressed. | |
484 Mapping <kHome> will not work then. | |
485 | |
486 *<>* | |
487 Examples are often given in the <> notation. Sometimes this is just to make | |
488 clear what you need to type, but often it can be typed literally, e.g., with | |
489 the ":map" command. The rules are: | |
490 1. Any printable characters are typed directly, except backslash and '<' | |
491 2. A backslash is represented with "\\", double backslash, or "<Bslash>". | |
492 3. A real '<' is represented with "\<" or "<lt>". When there is no | |
493 confusion possible, a '<' can be used directly. | |
494 4. "<key>" means the special key typed. This is the notation explained in | |
495 the table above. A few examples: | |
496 <Esc> Escape key | |
497 <C-G> CTRL-G | |
498 <Up> cursor up key | |
499 <C-LeftMouse> Control- left mouse click | |
500 <S-F11> Shifted function key 11 | |
501 <M-a> Meta- a ('a' with bit 8 set) | |
502 <M-A> Meta- A ('A' with bit 8 set) | |
503 <t_kd> "kd" termcap entry (cursor down key) | |
504 | |
505 If you want to use the full <> notation in Vim, you have to make sure the '<' | |
506 flag is excluded from 'cpoptions' (when 'compatible' is not set, it already is | |
507 by default). > | |
508 :set cpo-=< | |
509 The <> notation uses <lt> to escape the special meaning of key names. Using a | |
510 backslash also works, but only when 'cpoptions' does not include the 'B' flag. | |
511 | |
512 Examples for mapping CTRL-H to the six characters "<Home>": > | |
513 :imap <C-H> \<Home> | |
514 :imap <C-H> <lt>Home> | |
515 The first one only works when the 'B' flag is not in 'cpoptions'. The second | |
516 one always works. | |
517 To get a literal "<lt>" in a mapping: > | |
518 :map <C-L> <lt>lt> | |
519 | |
520 For mapping, abbreviation and menu commands you can then copy-paste the | |
521 examples and use them directly. Or type them literally, including the '<' and | |
522 '>' characters. This does NOT work for other commands, like ":set" and | |
523 ":autocmd"! | |
524 | |
525 ============================================================================== | |
526 5. Modes, introduction *vim-modes-intro* *vim-modes* | |
527 | |
528 Vim has six BASIC modes: | |
529 | |
530 *Normal* *Normal-mode* *command-mode* | |
531 Normal mode In Normal mode you can enter all the normal editor | |
532 commands. If you start the editor you are in this | |
533 mode (unless you have set the 'insertmode' option, | |
534 see below). This is also known as command mode. | |
535 | |
536 Visual mode This is like Normal mode, but the movement commands | |
537 extend a highlighted area. When a non-movement | |
538 command is used, it is executed for the highlighted | |
539 area. See |Visual-mode|. | |
540 If the 'showmode' option is on "-- VISUAL --" is shown | |
541 at the bottom of the window. | |
542 | |
543 Select mode This looks most like the MS-Windows selection mode. | |
544 Typing a printable character deletes the selection | |
545 and starts Insert mode. See |Select-mode|. | |
546 If the 'showmode' option is on "-- SELECT --" is shown | |
547 at the bottom of the window. | |
548 | |
549 Insert mode In Insert mode the text you type is inserted into the | |
550 buffer. See |Insert-mode|. | |
551 If the 'showmode' option is on "-- INSERT --" is shown | |
552 at the bottom of the window. | |
553 | |
554 Command-line mode In Command-line mode (also called Cmdline mode) you | |
555 Cmdline mode can enter one line of text at the bottom of the | |
556 window. This is for the Ex commands, ":", the pattern | |
557 search commands, "?" and "/", and the filter command, | |
558 "!". |Cmdline-mode| | |
559 | |
560 Ex mode Like Command-line mode, but after entering a command | |
561 you remain in Ex mode. Very limited editing of the | |
562 command line. |Ex-mode| | |
563 | |
1624 | 564 There are six ADDITIONAL modes. These are variants of the BASIC modes: |
7 | 565 |
566 *Operator-pending* *Operator-pending-mode* | |
567 Operator-pending mode This is like Normal mode, but after an operator | |
568 command has started, and Vim is waiting for a {motion} | |
569 to specify the text that the operator will work on. | |
570 | |
571 Replace mode Replace mode is a special case of Insert mode. You | |
572 can do the same things as in Insert mode, but for | |
573 each character you enter, one character of the existing | |
574 text is deleted. See |Replace-mode|. | |
575 If the 'showmode' option is on "-- REPLACE --" is | |
576 shown at the bottom of the window. | |
577 | |
1624 | 578 Virtual Replace mode Virtual Replace mode is similar to Replace mode, but |
579 instead of file characters you are replacing screen | |
580 real estate. See |Virtual-Replace-mode|. | |
581 If the 'showmode' option is on "-- VREPLACE --" is | |
582 shown at the bottom of the window. | |
583 | |
7 | 584 Insert Normal mode Entered when CTRL-O given in Insert mode. This is |
585 like Normal mode, but after executing one command Vim | |
586 returns to Insert mode. | |
587 If the 'showmode' option is on "-- (insert) --" is | |
588 shown at the bottom of the window. | |
589 | |
590 Insert Visual mode Entered when starting a Visual selection from Insert | |
591 mode, e.g., by using CTRL-O and then "v", "V" or | |
592 CTRL-V. When the Visual selection ends, Vim returns | |
593 to Insert mode. | |
594 If the 'showmode' option is on "-- (insert) VISUAL --" | |
595 is shown at the bottom of the window. | |
596 | |
597 Insert Select mode Entered when starting Select mode from Insert mode. | |
598 E.g., by dragging the mouse or <S-Right>. | |
599 When the Select mode ends, Vim returns to Insert mode. | |
600 If the 'showmode' option is on "-- (insert) SELECT --" | |
601 is shown at the bottom of the window. | |
602 | |
603 ============================================================================== | |
604 6. Switching from mode to mode *mode-switching* | |
605 | |
606 If for any reason you do not know which mode you are in, you can always get | |
607 back to Normal mode by typing <Esc> twice. This doesn't work for Ex mode | |
608 though, use ":visual". | |
609 You will know you are back in Normal mode when you see the screen flash or | |
610 hear the bell after you type <Esc>. However, when pressing <Esc> after using | |
611 CTRL-O in Insert mode you get a beep but you are still in Insert mode, type | |
612 <Esc> again. | |
613 | |
614 *i_esc* | |
615 TO mode ~ | |
616 Normal Visual Select Insert Replace Cmd-line Ex ~ | |
617 FROM mode ~ | |
1624 | 618 Normal v V ^V *4 *1 R gR : / ? ! Q |
7 | 619 Visual *2 ^G c C -- : -- |
620 Select *5 ^O ^G *6 -- -- -- | |
621 Insert <Esc> -- -- <Insert> -- -- | |
622 Replace <Esc> -- -- <Insert> -- -- | |
623 Command-line *3 -- -- :start -- -- | |
624 Ex :vi -- -- -- -- -- | |
625 | |
626 -- not possible | |
627 | |
628 *1 Go from Normal mode to Insert mode by giving the command "i", "I", "a", | |
629 "A", "o", "O", "c", "C", "s" or S". | |
630 *2 Go from Visual mode to Normal mode by giving a non-movement command, which | |
631 causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V" | |
632 (see |v_v|), which just stops Visual mode without side effects. | |
633 *3 Go from Command-line mode to Normal mode by: | |
634 - Hitting <CR> or <NL>, which causes the entered command to be executed. | |
635 - Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>. | |
636 - Hitting CTRL-C or <Esc>, which quits the command-line without executing | |
637 the command. | |
638 In the last case <Esc> may be the character defined with the 'wildchar' | |
639 option, in which case it will start command-line completion. You can | |
640 ignore that and type <Esc> again. {Vi: when hitting <Esc> the command-line | |
641 is executed. This is unexpected for most people; therefore it was changed | |
642 in Vim. But when the <Esc> is part of a mapping, the command-line is | |
643 executed. If you want the Vi behaviour also when typing <Esc>, use ":cmap | |
644 ^V<Esc> ^V^M"} | |
645 *4 Go from Normal to Select mode by: | |
646 - use the mouse to select text while 'selectmode' contains "mouse" | |
647 - use a non-printable command to move the cursor while keeping the Shift | |
648 key pressed, and the 'selectmode' option contains "key" | |
649 - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd" | |
650 - use "gh", "gH" or "g CTRL-H" |g_CTRL-H| | |
651 *5 Go from Select mode to Normal mode by using a non-printable command to move | |
652 the cursor, without keeping the Shift key pressed. | |
653 *6 Go from Select mode to Insert mode by typing a printable character. The | |
654 selection is deleted and the character is inserted. | |
655 | |
656 If the 'insertmode' option is on, editing a file will start in Insert mode. | |
657 | |
658 *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N* | |
659 Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to | |
660 Normal mode from any other mode. This can be used to make sure Vim is in | |
661 Normal mode, without causing a beep like <Esc> would. However, this does not | |
662 work in Ex mode. When used after a command that takes an argument, such as | |
663 |f| or |m|, the timeout set with 'ttimeoutlen' applies. | |
664 | |
665 *CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G* | |
666 The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when | |
667 'insertmode' is set. Otherwise it goes to Normal mode. This can be used to | |
668 make sure Vim is in the mode indicated by 'insertmode', without knowing in | |
669 what mode Vim currently is. | |
670 | |
671 *Q* *mode-Ex* *Ex-mode* *Ex* *EX* *E501* | |
672 Q Switch to "Ex" mode. This is a bit like typing ":" | |
673 commands one after another, except: | |
674 - You don't have to keep pressing ":". | |
675 - The screen doesn't get updated after each command. | |
676 - There is no normal command-line editing. | |
677 - Mappings and abbreviations are not used. | |
678 In fact, you are editing the lines with the "standard" | |
679 line-input editing commands (<Del> or <BS> to erase, | |
680 CTRL-U to kill the whole line). | |
681 Vim will enter this mode by default if it's invoked as | |
682 "ex" on the command-line. | |
683 Use the ":vi" command |:visual| to exit "Ex" mode. | |
684 Note: In older versions of Vim "Q" formatted text, | |
685 that is now done with |gq|. But if you use the | |
686 |vimrc_example.vim| script "Q" works like "gq". | |
687 | |
688 *gQ* | |
161 | 689 gQ Switch to "Ex" mode like with "Q", but really behave |
690 like typing ":" commands after another. All command | |
691 line editing, completion etc. is available. | |
7 | 692 Use the ":vi" command |:visual| to exit "Ex" mode. |
693 {not in Vi} | |
694 | |
695 ============================================================================== | |
696 7. The window contents *window-contents* | |
697 | |
698 In Normal mode and Insert/Replace mode the screen window will show the current | |
699 contents of the buffer: What You See Is What You Get. There are two | |
700 exceptions: | |
701 - When the 'cpoptions' option contains '$', and the change is within one line, | |
702 the text is not directly deleted, but a '$' is put at the last deleted | |
703 character. | |
704 - When inserting text in one window, other windows on the same text are not | |
705 updated until the insert is finished. | |
706 {Vi: The screen is not always updated on slow terminals} | |
707 | |
708 Lines longer than the window width will wrap, unless the 'wrap' option is off | |
709 (see below). The 'linebreak' option can be set to wrap at a blank character. | |
710 | |
711 If the window has room after the last line of the buffer, Vim will show '~' in | |
2642 | 712 the first column of the last lines in the window, like this: |
7 | 713 |
714 +-----------------------+ | |
715 |some line | | |
716 |last line | | |
717 |~ | | |
718 |~ | | |
719 +-----------------------+ | |
720 | |
721 Thus the '~' lines indicate that the end of the buffer was reached. | |
722 | |
723 If the last line in a window doesn't fit, Vim will indicate this with a '@' in | |
2642 | 724 the first column of the last lines in the window, like this: |
7 | 725 |
726 +-----------------------+ | |
727 |first line | | |
728 |second line | | |
729 |@ | | |
730 |@ | | |
731 +-----------------------+ | |
732 | |
733 Thus the '@' lines indicate that there is a line that doesn't fit in the | |
734 window. | |
735 | |
736 When the "lastline" flag is present in the 'display' option, you will not see | |
737 '@' characters at the left side of window. If the last line doesn't fit | |
738 completely, only the part that fits is shown, and the last three characters of | |
2662 | 739 the last line are replaced with "@@@", like this: |
7 | 740 |
741 +-----------------------+ | |
742 |first line | | |
743 |second line | | |
744 |a very long line that d| | |
745 |oesn't fit in the wi@@@| | |
746 +-----------------------+ | |
747 | |
748 If there is a single line that is too long to fit in the window, this is a | |
749 special situation. Vim will show only part of the line, around where the | |
750 cursor is. There are no special characters shown, so that you can edit all | |
751 parts of this line. | |
752 {Vi: gives an "internal error" on lines that do not fit in the window} | |
753 | |
754 The '@' occasion in the 'highlight' option can be used to set special | |
755 highlighting for the '@' and '~' characters. This makes it possible to | |
756 distinguish them from real characters in the buffer. | |
757 | |
758 The 'showbreak' option contains the string to put in front of wrapped lines. | |
759 | |
760 *wrap-off* | |
761 If the 'wrap' option is off, long lines will not wrap. Only the part that | |
762 fits on the screen is shown. If the cursor is moved to a part of the line | |
763 that is not shown, the screen is scrolled horizontally. The advantage of | |
764 this method is that columns are shown as they are and lines that cannot fit | |
765 on the screen can be edited. The disadvantage is that you cannot see all the | |
766 characters of a line at once. The 'sidescroll' option can be set to the | |
767 minimal number of columns to scroll. {Vi: has no 'wrap' option} | |
768 | |
769 All normal ASCII characters are displayed directly on the screen. The <Tab> | |
770 is replaced with the number of spaces that it represents. Other non-printing | |
771 characters are replaced with "^{char}", where {char} is the non-printing | |
772 character with 64 added. Thus character 7 (bell) will be shown as "^G". | |
773 Characters between 127 and 160 are replaced with "~{char}", where {char} is | |
774 the character with 64 subtracted. These characters occupy more than one | |
775 position on the screen. The cursor can only be positioned on the first one. | |
776 | |
777 If you set the 'number' option, all lines will be preceded with their | |
778 number. Tip: If you don't like wrapping lines to mix with the line numbers, | |
779 set the 'showbreak' option to eight spaces: | |
780 ":set showbreak=\ \ \ \ \ \ \ \ " | |
781 | |
782 If you set the 'list' option, <Tab> characters will not be shown as several | |
783 spaces, but as "^I". A '$' will be placed at the end of the line, so you can | |
784 find trailing blanks. | |
785 | |
786 In Command-line mode only the command-line itself is shown correctly. The | |
787 display of the buffer contents is updated as soon as you go back to Command | |
788 mode. | |
789 | |
790 The last line of the window is used for status and other messages. The | |
791 status messages will only be used if an option is on: | |
792 | |
793 status message option default Unix default ~ | |
794 current mode 'showmode' on on | |
795 command characters 'showcmd' on off | |
796 cursor position 'ruler' off off | |
797 | |
798 The current mode is "-- INSERT --" or "-- REPLACE --", see |'showmode'|. The | |
799 command characters are those that you typed but were not used yet. {Vi: does | |
800 not show the characters you typed or the cursor position} | |
801 | |
802 If you have a slow terminal you can switch off the status messages to speed | |
803 up editing: | |
804 :set nosc noru nosm | |
805 | |
806 If there is an error, an error message will be shown for at least one second | |
807 (in reverse video). {Vi: error messages may be overwritten with other | |
808 messages before you have a chance to read them} | |
809 | |
810 Some commands show how many lines were affected. Above which threshold this | |
811 happens can be controlled with the 'report' option (default 2). | |
812 | |
813 On the Amiga Vim will run in a CLI window. The name Vim and the full name of | |
814 the current file name will be shown in the title bar. When the window is | |
815 resized, Vim will automatically redraw the window. You may make the window as | |
816 small as you like, but if it gets too small not a single line will fit in it. | |
817 Make it at least 40 characters wide to be able to read most messages on the | |
818 last line. | |
819 | |
820 On most Unix systems, resizing the window is recognized and handled correctly | |
821 by Vim. {Vi: not ok} | |
822 | |
823 ============================================================================== | |
824 8. Definitions *definitions* | |
825 | |
826 screen The whole area that Vim uses to work in. This can be | |
827 a terminal emulator window. Also called "the Vim | |
828 window". | |
829 window A view on a buffer. | |
830 | |
831 A screen contains one or more windows, separated by status lines and with the | |
832 command line at the bottom. | |
833 | |
834 +-------------------------------+ | |
835 screen | window 1 | window 2 | | |
836 | | | | |
837 | | | | |
838 |= status line =|= status line =| | |
839 | window 3 | | |
840 | | | |
841 | | | |
842 |==== status line ==============| | |
843 |command line | | |
844 +-------------------------------+ | |
845 | |
846 The command line is also used for messages. It scrolls up the screen when | |
847 there is not enough room in the command line. | |
848 | |
849 A difference is made between four types of lines: | |
850 | |
851 buffer lines The lines in the buffer. This is the same as the | |
852 lines as they are read from/written to a file. They | |
853 can be thousands of characters long. | |
854 logical lines The buffer lines with folding applied. Buffer lines | |
855 in a closed fold are changed to a single logical line: | |
856 "+-- 99 lines folded". They can be thousands of | |
857 characters long. | |
858 window lines The lines displayed in a window: A range of logical | |
859 lines with wrapping, line breaks, etc. applied. They | |
860 can only be as long as the width of the window allows, | |
861 longer lines are wrapped or truncated. | |
862 screen lines The lines of the screen that Vim uses. Consists of | |
863 the window lines of all windows, with status lines | |
864 and the command line added. They can only be as long | |
865 as the width of the screen allows. When the command | |
866 line gets longer it wraps and lines are scrolled to | |
867 make room. | |
868 | |
869 buffer lines logical lines window lines screen lines ~ | |
870 | |
871 1. one 1. one 1. +-- folded 1. +-- folded | |
872 2. two 2. +-- folded 2. five 2. five | |
873 3. three 3. five 3. six 3. six | |
874 4. four 4. six 4. seven 4. seven | |
875 5. five 5. seven 5. === status line === | |
876 6. six 6. aaa | |
877 7. seven 7. bbb | |
878 8. ccc ccc c | |
879 1. aaa 1. aaa 1. aaa 9. cc | |
880 2. bbb 2. bbb 2. bbb 10. ddd | |
881 3. ccc ccc ccc 3. ccc ccc ccc 3. ccc ccc c 11. ~ | |
882 4. ddd 4. ddd 4. cc 12. === status line === | |
883 5. ddd 13. (command line) | |
884 6. ~ | |
885 | |
886 ============================================================================== | |
887 vim:tw=78:ts=8:ft=help:norl: |