1 *help.txt* For Vim version 5.8. Last change: 2000 Jan 01
5 Move around: Use the cursor keys, or "h" to go left, h l
6 "j" to go down, "k" to go up, "l" to go right. j
7 Close this window: Use ":q<Enter>".
8 Get out of Vim: Use ":qa!<Enter>" (careful, all changes are lost!).
9 Jump to a subject: Position the cursor on a tag between |bars| and hit CTRL-].
10 With the mouse: ":set mouse=a" to enable the mouse (in xterm or GUI).
11 Double-click the left mouse button on a tag between |bars|.
12 jump back: Type CTRL-T or CTRL-O.
13 Get specific help: It is possible to go directly to whatever you want help
14 on, by giving an argument to the ":help" command |:help|.
15 It is possible to further specify the context:
16 WHAT PREPEND EXAMPLE ~
17 Normal mode commands (nothing) :help x
18 Visual mode commands v_ :help v_u
19 Insert mode commands i_ :help i_<Esc>
20 Command-line commands : :help :quit
21 Command-line editing c_ :help c_<Del>
22 Vim command arguments - :help -r
23 options ' :help 'textwidth'
24 Search for help: Type ":help word", then hit CTRL-D to see matching
25 help entries for "word".
27 VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
28 through the help of a lot of people. See |credits|.
29 ------------------------------------------------------------------------------
30 tag subject tag subject ~
32 |X_ct| detailed help files |X_re| Repeating commands
33 |X_lr| motion: Left-right |X_km| Key mapping
34 |X_ud| motion: Up-down |X_ab| Abbreviations
35 |X_tm| motion: Text object |X_op| Options
36 |X_pa| motion: Pattern searches |X_ur| Undo/Redo commands
37 |X_ma| motion: Marks |X_et| External commands
38 |X_vm| motion: Various |X_qf| Quickfix commands
39 |X_ta| motion: Using tags |X_vc| Various commands
40 |X_sc| Scrolling |X_ce| Ex: Command-line editing
41 |X_in| insert: Inserting text |X_ra| Ex: Ranges
42 |X_ai| insert: Keys |X_ex| Ex: Special characters
43 |X_ss| insert: Special keys |X_ed| Editing a file
44 |X_di| insert: Digraphs |X_fl| Using the argument list
45 |X_si| insert: Special inserts |X_wq| Writing and quitting
46 |X_de| change: Deleting text |X_st| Starting VIM
47 |X_cm| change: Copying and moving |X_ac| Automatic commands
48 |X_ch| change: Changing text |X_wi| Multi-window functions
49 |X_co| change: Complex |X_bu| Buffer list functions
50 |X_vi| Visual mode |X_sy| Syntax highlighting
51 |X_to| Text objects |X_gu| GUI commands
53 |tutor| 30 minutes training course for beginners
54 |copying| About copyrights and Uganda
55 |www| Vim on the World Wide Web
56 |bugs| Where to send bug reports
57 ------------------------------------------------------------------------------
58 Detailed documentation files: *doc-file-list* *X_ct*
61 |intro.txt| general introduction to Vim; notation used in help files
62 |help.txt| overview and quick reference (this file)
63 |index.txt| alphabetical index of all commands
64 |help-tags| all the tags you can jump to (index of tags)
65 |howto.txt| how to do the most common editing tasks
66 |tips.txt| various tips on using Vim
67 |message.txt| (error) messages and explanations
68 |quotes.txt| remarks from users of Vim
69 |todo.txt| known problems and desired extensions
70 |develop.txt| development of Vim
71 |uganda.txt| Vim distribution conditions and what to do with your money
74 |starting.txt| starting Vim, Vim command arguments, initialisation
75 |editing.txt| editing and writing files
76 |motion.txt| commands for moving around
77 |scroll.txt| scrolling the text in the window
78 |insert.txt| Insert and Replace mode
79 |change.txt| deleting and replacing text
80 |undo.txt| Undo and Redo
81 |repeat.txt| repeating commands
82 |visual.txt| using the Visual mode (selecting a text area)
83 |various.txt| various remaining commands
84 |recover.txt| recovering from a crash
87 |cmdline.txt| Command-line editing
88 |options.txt| description of all options
89 |pattern.txt| regexp patterns and search commands
90 |map.txt| key mapping and abbreviations
91 |tagsearch.txt| tags and special searches
92 |quickfix.txt| commands for a quick edit-compile-fix cycle
93 |windows.txt| commands for using multiple windows and buffers
94 |syntax.txt| syntax highlighting
95 |autocmd.txt| automatically executing commands on an event
96 |eval.txt| expression evaluation, conditional commands
99 |term.txt| using different terminals and mice
100 |digraph.txt| list of available digraphs
101 |multibyte.txt| multi-byte text support
102 |farsi.txt| Farsi (Persian) editing
103 |hangulin.txt| Hangul (Korean) input mode
104 |rightleft.txt| right-to-left editing
107 |gui.txt| Graphical User Interface (GUI)
108 |gui_w32.txt| Win32 GUI
109 |gui_x11.txt| X11 GUI
112 |if_cscope.txt| using cscope with Vim
113 |if_perl.txt| Perl interface
114 |if_python.txt| Python interface
115 |if_sniff.txt| SNiFF+ interface
116 |if_tcl.txt| Tcl interface
117 |if_ole.txt| OLE automation interface for Win32
120 |vi_diff.txt| main differences between Vim and Vi
121 |version4.txt| differences between Vim version 3.0 and 4.x
122 |version5.txt| differences between Vim version 4.6 and 5.x
124 Remarks about specific systems ~
126 |os_beos.txt| BeOS and BeBox
127 |os_dos.txt| MS-DOS and MS-Windows NT/95 common items
128 |os_mac.txt| Macintosh
129 |os_mint.txt| Atari MiNT
130 |os_msdos.txt| MS-DOS (plain DOS and DOS box under Windows)
132 |os_riscos.txt| RISC-OS
135 |os_win32.txt| MS-Windows 95/98/NT
136 ------------------------------------------------------------------------------
137 N is used to indicate an optional count that can be given before the command.
138 ------------------------------------------------------------------------------
139 *X_lr* Left-right motions
141 |h| N h left (also: CTRL-H, <BS>, or <Left> key)
142 |l| N l right (also: <Space> or <Right> key)
143 |0| 0 to first character in the line (also: <Home> key)
144 |^| ^ to first non-blank character in the line
145 |$| N $ to the last character in the line (N-1 lines lower)
147 |g0| N g0 to first character in screen line (differs from "0"
149 |g^| N g^ to first non-blank character in screen line (differs
150 from "^" when lines wrap)
151 |g$| N g$ to last character in screen line (differs from "$"
153 |gm| N gm to middle of the screen line
154 |bar| N | to column N (default: 1)
155 |f| N f{char} to the Nth occurrence of {char} to the right
156 |F| N F{char} to the Nth occurrence of {char} to the left
157 |t| N t{char} till before the Nth occurrence of {char} to the right
158 |T| N T{char} till before the Nth occurrence of {char} to the left
159 |;| N ; repeat the last "f", "F", "t", or "T" N times
160 |,| N , repeat the last "f", "F", "t", or "T" N times in
162 ------------------------------------------------------------------------------
163 *X_ud* Up-down motions
165 |k| N k up N lines (also: CTRL-P and <Up>)
166 |j| N j down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
167 |-| N - up N lines, on the first non-blank character
168 |+| N + down N lines, on the first non-blank character (also:
170 |_| N _ down N-1 lines, on the first non-blank character
171 |G| N G goto line N (default: last line), on the first
173 |gg| N gg goto line N (default: first line), on the first
175 |N%| N % goto line N percentage down in the file. N must be
176 given, otherwise it is the |%| command.
177 |gk| N gk up N screen lines (differs from "k" when line wraps)
178 |gj| N gj down N screen lines (differs from "j" when line wraps)
179 ------------------------------------------------------------------------------
180 *X_tm* Text object motions
182 |w| N w N words forward
183 |W| N W N blank-separated WORDS forward
184 |e| N e forward to the end of the Nth word
185 |E| N E forward to the end of the Nth blank-separated WORD
186 |b| N b N words backward
187 |B| N B N blank-separated WORDS backward
188 |ge| N ge backward to the end of the Nth word
189 |gE| N gE backward to the end of the Nth blank-separated WORD
191 |)| N ) N sentences forward
192 |(| N ( N sentences backward
193 |}| N } N paragraphs forward
194 |{| N { N paragraphs backward
195 |]]| N ]] N sections forward, at start of section
196 |[[| N [[ N sections backward, at start of section
197 |][| N ][ N sections forward, at end of section
198 |[]| N [] N sections backward, at end of section
199 |[(| N [( N times back to unclosed '('
200 |[{| N [{ N times back to unclosed '{'
201 |[m| N [m N times back to start method (for Java)
202 |])| N ]) N times forward to unclosed ')'
203 |]}| N ]} N times forward to unclosed '}'
204 |]m| N ]m N times forward to end method (for Java)
205 |[#| N [# N times back to unclosed "#if" or "#else"
206 |]#| N ]# N times forward to unclosed "#else" or "#endif"
207 |[star| N [* N times back to start of comment "/*"
208 |]star| N ]* N times forward to end of comment "*/"
209 ------------------------------------------------------------------------------
210 *X_pa* Pattern searches
212 |/| N /{pattern}[/[offset]]<CR>
213 search forward for the Nth occurrence of {pattern}
214 |?| N ?{pattern}[?[offset]]<CR>
215 search backward for the Nth occurrence of {pattern}
216 |/<CR>| N /<CR> repeat last search, in the forward direction
217 |?<CR>| N ?<CR> repeat last search, in the backward direction
218 |n| N n repeat last search
219 |N| N N repeat last search, in opposite direction
220 |star| N * search forward for the identifier under the cursor
221 |#| N # search backward for the identifier under the cursor
222 |gstar| N g* like "*", but also find partial matches
223 |g#| N g# like "#", but also find partial matches
224 |gd| gd goto local declaration of identifier under the cursor
225 |gD| gD goto global declaration of identifier under the cursor
227 |pattern| Special characters in search patterns
229 meaning magic nomagic ~
230 matches any single character . \.
231 matches start of line ^ ^
233 matches start of word \< \<
234 matches end of word \> \>
235 matches a single char from the range [a-z] \[a-z]
236 matches a single char not in the range [^a-z] \[^a-z]
237 matches an identifier char \i \i
238 idem but excluding digits \I \I
239 matches a keyword character \k \k
240 idem but excluding digits \K \K
241 matches a file name character \f \f
242 idem but excluding digits \F \F
243 matches a printable character \p \p
244 idem but excluding digits \P \P
245 matches a white space character \s \s
246 matches a non-white space character \S \S
253 matches 0 or more of the preceding atom * \*
254 matches 1 or more of the preceding atom \+ \+
255 matches 0 or 1 of the preceding atom \= \=
256 separates two branches \| \|
257 group a pattern into an atom \(\) \(\)
259 |search-offset| Offsets allowed after search command
261 [num] [num] lines downwards, in column 1
262 +[num] [num] lines downwards, in column 1
263 -[num] [num] lines upwards, in column 1
264 e[+num] [num] characters to the right of the end of the match
265 e[-num] [num] characters to the left of the end of the match
266 s[+num] [num] characters to the right of the start of the match
267 s[-num] [num] characters to the left of the start of the match
268 b[+num] [num] characters to the right of the start (begin) of the match
269 b[-num] [num] characters to the left of the start (begin) of the match
270 ;{search-command} execute {search-command} next
271 ------------------------------------------------------------------------------
272 *X_ma* Marks and motions
274 |m| m{a-zA-Z} mark current position with mark {a-zA-Z}
275 |`a| `{a-z} go to mark {a-z} within current file
276 |`A| `{A-Z} go to mark {A-Z} in any file
277 |`0| `{0-9} go to the position where Vim was previously exited
278 |``| `` go to the position before the last jump
279 |`quote| `" go to the position when last editing this file
280 |`[| `[ go to the start of the previously operated or put text
281 |`]| `] go to the end of the previously operated or put text
282 |`<| `< go to the start of the (previous) Visual area
283 |`>| `> go to the end of the (previous) Visual area
284 |'| '{a-zA-Z0-9[]'"<>}
285 same as `, but on the first non-blank in the line
286 |:marks| :marks print the active marks
287 |CTRL-O| N CTRL-O go to Nth older position in jump list
288 |CTRL-I| N CTRL-I go to Nth newer position in jump list
289 |:ju| :ju[mps] print the jump list
290 ------------------------------------------------------------------------------
291 *X_vm* Various motions
293 |%| % find the next brace, bracket, comment, or "#if"/
294 "#else"/"#endif" in this line and go to its match
295 |H| N H go to the Nth line in the window, on the first
297 |M| M go to the middle line in the window, on the first
299 |L| N L go to the Nth line from the bottom, on the first
302 |go| N go go to Nth byte in the buffer
303 |:go| :[range]go[to] [off] go to [off] byte in the buffer
304 ------------------------------------------------------------------------------
307 |:ta| :ta[g][!] {tag} Jump to tag {tag}
308 |:ta| :[count]ta[g][!] Jump to [count]'th newer tag in tag list
309 |CTRL-]| CTRL-] Jump to the tag under cursor, unless changes
311 |:ts| :ts[elect][!] [tag] List matching tags and select one to jump to
312 |:tjump| :tj[ump][!] [tag] Jump to tag [tag] or select from list when
313 there are multiple matches
315 |:tags| :tags Print tag list
316 |CTRL-T| N CTRL-T Jump back from Nth older tag in tag list
317 |:po| :[count]po[p][!] Jump back from [count]'th older tag in tag list
318 |:tnext| :[count]tn[ext][!] Jump to [count]'th next matching tag
319 |:tp| :[count]tp[revious][!] Jump to [count]'th previous matching tag
320 |:tr| :[count]tr[ewind][!] Jump to [count]'th matching tag
321 |:tl| :tl[ast][!] Jump to last matching tag
323 |:ptag| :pt[ag] {tag} open a preview window to show tag {tag}
324 |CTRL-W_}| CTRL-W } like CTRL-] but show tag in preview window
325 |:pts| :pts[elect] like ":tselect" but show tag in preview window
326 |:ptjump| :ptj[ump] like ":tjump" but show tag in preview window
327 |:pclose| :pc[lose] close tag preview window
328 |CTRL-W_z| CTRL-W z close tag preview window
329 ------------------------------------------------------------------------------
332 |CTRL-E| N CTRL-E window N lines downwards (default: 1)
333 |CTRL-D| N CTRL-D window N lines Downwards (default: 1/2 window)
334 |CTRL-F| N CTRL-F window N pages Forwards (downwards)
335 |CTRL-Y| N CTRL-Y window N lines upwards (default: 1)
336 |CTRL-U| N CTRL-U window N lines Upwards (default: 1/2 window)
337 |CTRL-B| N CTRL-B window N pages Backwards (upwards)
338 |z<CR>| z<CR> or zt redraw, current line at top of window
339 |z.| z. or zz redraw, current line at center of window
340 |z-| z- or zb redraw, current line at bottom of window
342 These only work when 'wrap' is off:
343 |zh| N zh scroll screen N characters to the right
344 |zl| N zl scroll screen N characters to the left
345 |zH| N zH scroll screen half a screenwidth to the right
346 |zL| N zL scroll screen half a screenwidth to the left
347 ------------------------------------------------------------------------------
348 *X_in* Inserting text
350 |a| N a append text after the cursor (N times)
351 |A| N A append text at the end of the line (N times)
352 |i| N i insert text before the cursor (N times) (also: <Insert>)
353 |I| N I insert text before the first non-blank in the line (N times)
354 |gI| N gI insert text in column 1 (N times)
355 |o| N o open a new line below the current line, append text (N times)
356 |O| N O open a new line above the current line, append text (N times)
357 |:startinsert| :star[tinsert][!] start Insert mode, append when [!] used
359 in Visual block mode:
360 |v_b_I| I insert the same text in front of all the selected lines
361 |v_b_A| A append the same text after all the selected lines
362 ------------------------------------------------------------------------------
363 *X_ai* Insert mode keys
365 |insert-index| alphabetical index of Insert mode commands
368 |i_<Esc>| <Esc> end Insert mode, back to Normal mode
369 |i_CTRL-C| CTRL-C like <Esc>, but do not use an abbreviation
370 |i_CTRL-O| CTRL-O {command} execute {command} and return to Insert mode
373 |i_<Up>| cursor keys move cursor left/right/up/down
374 |i_<S-Left>| shift-left/right one word left/right
375 |i_<S-Up>| shift-up/down one screenful backward/forward
376 |i_<End>| <End> cursor after last character in the line
377 |i_<Home>| <Home> cursor to first character in the line
378 ------------------------------------------------------------------------------
379 *X_ss* Special keys in Insert mode
381 |i_CTRL-V| CTRL-V {char}.. insert character literally, or enter decimal
383 |i_<NL>| <NL> or <CR> or CTRL-M or CTRL-J
385 |i_CTRL-E| CTRL-E insert the character from below the cursor
386 |i_CTRL-Y| CTRL-Y insert the character from above the cursor
388 |i_CTRL-A| CTRL-A insert previously inserted text
389 |i_CTRL-@| CTRL-@ insert previously inserted text and stop
391 |i_CTRL-R| CTRL-R {0-9a-z%#:.-="} insert the contents of a register
393 |i_CTRL-N| CTRL-N insert next match of identifier before the
395 |i_CTRL-P| CTRL-P insert previous match of identifier before
397 |i_CTRL-X| CTRL-X ... complete the word before the cursor in
400 |i_<BS>| <BS> or CTRL-H delete the character before the cursor
401 |i_<Del>| <Del> delete the character under the cursor
402 |i_CTRL-W| CTRL-W delete word before the cursor
403 |i_CTRL-U| CTRL-U delete all entered characters in the current
405 |i_CTRL-T| CTRL-T insert one shiftwidth of indent in front of
407 |i_CTRL-D| CTRL-D delete one shiftwidth of indent in front of
409 |i_0_CTRL-D| 0 CTRL-D delete all indent in the current line
410 |i_^_CTRL-D| ^ CTRL-D delete all indent in the current line,
411 restore indent in next line
412 ------------------------------------------------------------------------------
415 |:dig| :dig[raphs] show current list of digraphs
416 |:dig| :dig[raphs] {char1}{char2} {number} ...
417 add digraph(s) to the list
419 In Insert or Command-line mode:
420 |i_CTRL-K| CTRL-K {char1} {char2}
422 |i_digraph| {char1} <BS> {char2}
423 enter digraph if 'digraph' option set
424 ------------------------------------------------------------------------------
425 *X_si* Special inserts
427 |:r| :r [file] insert the contents of [file] below the cursor
428 |:r!| :r! {command} insert the standard output of {command} below the
430 ------------------------------------------------------------------------------
433 |x| N x delete N characters under and after the cursor
434 |<Del>| N <Del> delete N characters under and after the cursor
435 |X| N X delete N characters before the cursor
436 |d| N d{motion} delete the text that is moved over with {motion}
437 |v_d| {visual}d delete the highlighted text
438 |dd| N dd delete N lines
439 |D| N D delete to the end of the line (and N-1 more lines)
440 |J| N J join N-1 lines (delete <EOL>s)
441 |v_J| {visual}J join the highlighted lines
442 |gJ| N gJ like "J", but without inserting spaces
443 |v_gJ| {visual}gJ like "{visual}J", but without inserting spaces
444 |:d| :[range]d [x] delete [range] lines [into register x]
445 ------------------------------------------------------------------------------
446 *X_cm* Copying and moving text
448 |quote| "{char} use register {char} for the next delete, yank, or put
449 |:reg| :reg show the contents of all registers
450 |:reg| :reg {arg} show the contents of registers mentioned in {arg}
451 |y| N y{motion} yank the text moved over with {motion} into a register
452 |v_y| {visual}y yank the highlighted text into a register
453 |yy| N yy yank N lines into a register
454 |Y| N Y yank N lines into a register
455 |p| N p put a register after the cursor position (N times)
456 |P| N P put a register before the cursor position (N times)
457 |]p| N ]p like p, but adjust indent to current line
458 |[p| N [p like P, but adjust indent to current line
459 |gp| N gp like p, but leave cursor after the new text
460 |gP| N gP like P, but leave cursor after the new text
461 ------------------------------------------------------------------------------
464 |r| N r{char} replace N characters with {char}
465 |gr| N gr{char} replace N characters without affecting layout
466 |R| N R enter Replace mode (repeat the entered text N times)
467 |gR| N gR enter virtual Replace mode: Like Replace mode but
468 without affecting layout
469 |v_b_r| {visual}r{char}
470 in Visual block mode: Replace each char of the
471 selected text with {char}
473 (change = delete text and enter Insert mode)
474 |c| N c{motion} change the text that is moved over with {motion}
475 |v_c| {visual}c change the highlighted text
476 |cc| N cc change N lines
477 |S| N S change N lines
478 |C| N C change to the end of the line (and N-1 more lines)
479 |s| N s change N characters
480 |v_b_c| {visual}c in Visual block mode: Change each of the selected
481 lines with the entered text
482 |v_b_C| {visual}C in Visual block mode: Change each of the selected
483 lines until end-of-line with the entered text
485 |~| N ~ switch case for N characters and advance cursor
486 |v_~| {visual}~ switch case for highlighted text
487 |v_u| {visual}u make highlighted text lowercase
488 |v_U| {visual}U make highlighted text uppercase
489 |g~| g~{motion} switch case for the text that is moved over with
491 |gu| gu{motion} make the text that is moved over with {motion}
493 |gU| gU{motion} make the text that is moved over with {motion}
495 |v_g?| {visual}g? perform rot13 encoding on highlighted text
496 |g?| g?{motion} perform rot13 encoding on the text that is moved over
499 |CTRL-A| N CTRL-A add N to the number at or after the cursor
500 |CTRL-X| N CTRL-X subtract N from the number at or after the cursor
502 |<| N <{motion} move the lines that are moved over with {motion} one
504 |<<| N << move N lines one shiftwidth left
505 |>| N >{motion} move the lines that are moved over with {motion} one
507 |>>| N >> move N lines one shiftwidth right
508 |gq| N gq{motion} format the lines that are moved over with {motion} to
510 |:ce| :[range]ce[nter] [width]
511 center the lines in [range]
512 |:le| :[range]le[ft] [indent]
513 left-align the lines in [range] (with [indent])
514 |:ri| :[range]ri[ght] [width]
515 right-align the lines in [range]
516 ------------------------------------------------------------------------------
517 *X_co* Complex changes
519 |!| N !{motion}{command}<CR>
520 filter the lines that are moved over through {command}
521 |!!| N !!{command}<CR>
522 filter N lines through {command}
523 |v_!| {visual}!{command}<CR>
524 filter the highlighted lines through {command}
525 |:range!| :[range]! {command}<CR>
526 filter [range] lines through {command}
528 filter the lines that are moved over through 'equalprg'
529 |==| N == filter N lines through 'equalprg'
531 filter the highlighted lines through 'equalprg'
532 |:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c]
533 substitute {pattern} by {string} in [range] lines;
534 with [g], replace all occurrences of {pattern};
535 with [c], confirm each replacement
536 |:s| :[range]s[ubstitute] [g][c]
537 repeat previous ":s" with new range and options
538 |&| & Repeat previous ":s" on current line without options
539 |:ret| :[range]ret[ab][!] [tabstop]
540 set 'tabstop' to new value and adjust white space
542 ------------------------------------------------------------------------------
545 |visual-index| list of Visual mode commands.
547 |v| v start highlighting characters } move cursor and use
548 |V| V start highlighting linewise } operator to affect
549 |CTRL-V| CTRL-V start highlighting blockwise } highlighted text
550 |v_o| o exchange cursor position with start of highlighting
551 |gv| gv start highlighting on previous visual area
552 |v_v| v highlight characters or stop highlighting
553 |v_V| V highlight linewise or stop highlighting
554 |v_CTRL-V| CTRL-V highlight blockwise or stop highlighting
555 ------------------------------------------------------------------------------
556 *X_to* Text objects (only in Visual mode or after an operator)
558 |v_aw| N aw Select "a word"
559 |v_iw| N iw Select "inner word"
560 |v_aW| N aW Select "a WORD"
561 |v_iW| N iW Select "inner WORD"
562 |v_as| N as Select "a sentence"
563 |v_is| N is Select "inner sentence"
564 |v_ap| N ap Select "a paragraph"
565 |v_ip| N ip Select "inner paragraph"
566 |v_ab| N ab Select "a block" (from "[(" to "])")
567 |v_ib| N ib Select "inner block" (from "[(" to "])")
568 |v_aB| N aB Select "a Block" (from "[{" to "]}")
569 |v_iB| N iB Select "inner Block" (from "[{" to "]}")
570 ------------------------------------------------------------------------------
571 *X_re* Repeating commands
573 |.| N . repeat last change (with count replaced with N)
574 |q| q{a-z} record typed characters into register {a-z}
575 |q| q{A-Z} record typed characters, appended to register {a-z}
577 |@| N @{a-z} execute the contents of register {a-z} (N times)
578 |@@| N @@ repeat previous @{a-z} (N times)
579 |:@| :@{a-z} execute the contents of register {a-z} as an Ex
581 |:@@| :@@ repeat previous :@{a-z}
582 |:g| :[range]g[lobal]/{pattern}/[cmd]
583 Execute Ex command [cmd] (default: ":p") on the lines
584 within [range] where {pattern} matches.
585 |:g| :[range]g[lobal]!/{pattern}/[cmd]
586 Execute Ex command [cmd] (default: ":p") on the lines
587 within [range] where {pattern} does NOT match.
588 |:so| :so[urce] {file}
589 Read Ex commands from {file}.
590 |:so| :so[urce]! {file}
591 Read Vim commands from {file}.
593 don't do anything for [sec] seconds
594 |gs| N gs Goto Sleep for N seconds
595 ------------------------------------------------------------------------------
598 |:map| :ma[p] {lhs} {rhs} Map {lhs} to {rhs} in Normal and Visual
600 |:map!| :ma[p]! {lhs} {rhs} Map {lhs} to {rhs} in Insert and Command-line
602 |:noremap| :no[remap][!] {lhs} {rhs}
603 Same as ":map", no remapping for this {rhs}
604 |:unmap| :unm[ap] {lhs} Remove the mapping of {lhs} for Normal and
606 |:unmap!| :unm[ap]! {lhs} Remove the mapping of {lhs} for Insert and
608 |:map_l| :ma[p] [lhs] List mappings (starting with [lhs]) for
609 Normal and Visual mode.
610 |:map_l!| :ma[p]! [lhs] List mappings (starting with [lhs]) for
611 Insert and Command-line mode.
612 |:cmap| :cmap/:cunmap/:cnoremap
613 like ":map!"/":unmap!"/":noremap!" but for
614 Command-line mode only
615 |:imap| :imap/:iunmap/:inoremap
616 like ":map!"/":unmap!"/":noremap!" but for
618 |:nmap| :nmap/:nunmap/:nnoremap
619 like ":map"/":unmap"/":noremap" but for
621 |:vmap| :vmap/:vunmap/:vnoremap
622 like ":map"/":unmap"/":noremap" but for
624 |:omap| :omap/:ounmap/:onoremap
625 like ":map"/":unmap"/":noremap" but only for
626 when an operator is pending
627 |:mapc| :mapc[lear] remove mappings for Normal and Visual mode
628 |:mapc| :mapc[lear]! remove mappings for Insert and Cmdline mode
629 |:imapc| :imapc[lear] remove mappings for Insert mode
630 |:vmapc| :vmapc[lear] remove mappings for Visual mode
631 |:omapc| :omapc[lear] remove mappings for Operator-pending mode
632 |:nmapc| :nmapc[lear] remove mappings for Normal mode
633 |:cmapc| :cmapc[lear] remove mappings for Cmdline mode
634 |:mkexrc| :mk[exrc][!] [file] write current mappings, abbreviations, and
635 settings to [file] (default: ".exrc";
637 |:mkvimrc| :mkv[imrc][!] [file]
638 same as ":mkexrc", but with default ".vimrc"
639 |:mksession| :mks[ession][!] [file]
640 like ":mkvimrc", but store current files,
641 windows, etc. too, to be able to continue
643 ------------------------------------------------------------------------------
646 |:abbreviate| :ab[breviate] {lhs} {rhs} add abbreviation for {lhs} to {rhs}
647 |:abbreviate| :ab[breviate] {lhs} show abbr's that start with {lhs}
648 |:abbreviate| :ab[breviate] show all abbreviations
649 |:unabbreviate| :una[bbreviate] {lhs} remove abbreviation for {lhs}
650 |:noreabbrev| :norea[bbrev] [lhs] [rhs] like ":ab", but don't remap [rhs]
651 |:iabbrev| :iab/:iunab/:inoreab like ":ab", but only for Insert mode
652 |:cabbrev| :cab/:cunab/:cnoreab like ":ab", but only for
654 |:abclear| :abc[lear] remove all abbreviations
655 |:cabclear| :cabc[lear] remove all abbr's for Cmdline mode
656 |:iabclear| :iabc[lear] remove all abbr's for Insert mode
657 ------------------------------------------------------------------------------
660 |:set| :se[t] Show all modified options.
661 |:set| :se[t] all Show all options.
662 |:set| :se[t] {option} Set boolean option (switch it on), show string
664 |:set| :se[t] no{option} Reset boolean option (switch it off).
665 |:set| :se[t] inv{option} invert boolean option.
666 |:set| :se[t] {option}={value} Set string or number option to {value}.
667 |:set| :se[t] {option}+={value} append {value} to string option, add {value}
669 |:set| :se[t] {option}-={value} remove {value} to string option, subtract
670 {value} from number option
671 |:set| :se[t] {option}? Show value of {option}.
672 |:set| :se[t] {option}& Reset {option} to its default value.
674 |:fix| :fix[del] Set value of 't_kD' according to value of
676 |:options| :opt[ions] Open a new window to view and set options,
677 grouped by functionality and with short help
679 Short explanation of each option: *option-list*
680 |'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew)
681 |'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode
682 |'altkeymap'| |'akm'| for default second language (Farsi/Hebrew)
683 |'autoindent'| |'ai'| take indent for new line from previous line
684 |'autowrite'| |'aw'| automatically write file if changed
685 |'background'| |'bg'| "dark" or "light", used for highlight colors
686 |'backspace'| |'bs'| how backspace works at start of line
687 |'backup'| |'bk'| keep backup file after overwriting a file
688 |'backupdir'| |'bdir'| list of directories for the backup file
689 |'backupext'| |'bex'| extension used for the backup file
690 |'binary'| |'bin'| read/write/edit file in binary mode
691 |'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters
692 |'breakat'| |'brk'| characters that may cause a line break
693 |'browsedir'| |'bsdir'| which directory to start browsing in
694 |'cindent'| |'cin'| do C program indenting
695 |'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set
696 |'cinoptions'| |'cino'| how to do indenting when 'cindent' is set
697 |'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent
698 |'clipboard'| |'cb'| use the clipboard as the unnamed register
699 |'cmdheight'| |'ch'| number of lines to use for the command-line
700 |'columns'| |'co'| number of columns in the display
701 |'comments'| |'com'| patterns that can start a comment line
702 |'compatible'| |'cp'| behave Vi-compatible as much as possible
703 |'complete'| |'cpt'| specify how Insert mode completion works
704 |'confirm'| |'cf'| ask what to do about unsaved/read-only files
705 |'conskey'| |'consk'| get keys directly from console (MS-DOS only)
706 |'cpoptions'| |'cpo'| flags for Vi-compatible behavior
707 |'cscopeprg'| |'csprg'| command to execute cscope
708 |'cscopetag'| |'cst'| use cscope for tag commands
709 |'cscopetagorder'| |'csto'| determines ":cstag" search order
710 |'cscopeverbose'| |'csverb'| give messages when adding a cscope database
711 |'define'| |'def'| pattern to be used to find a macro definition
712 |'dictionary'| |'dict'| list of file names used for keyword completion
713 |'digraph'| |'dg'| enable the entering of digraphs in Insert mode
714 |'directory'| |'dir'| list of directory names for the swap file
715 |'display'| |'dy'| list of flags for how to display text
716 |'edcompatible'| |'ed'| toggle flags of ":substitute" command
717 |'endofline'| |'eol'| write <EOL> for last line in file
718 |'equalalways'| |'ea'| windows are automatically made the same size
719 |'equalprg'| |'ep'| external program to use for "=" command
720 |'errorbells'| |'eb'| ring the bell for error messages
721 |'errorfile'| |'ef'| name of the errorfile for the QuickFix mode
722 |'errorformat'| |'efm'| description of the lines in the error file
723 |'esckeys'| |'ek'| recognize function keys in Insert mode
724 |'eventignore'| |'ei'| autocommand events that are ignored
725 |'expandtab'| |'et'| use spaces when <Tab> is inserted
726 |'exrc'| |'ex'| read .vimrc and .exrc in the current directory
727 |'fileencoding'| |'fe'| file encoding for multi-byte text
728 |'fileformat'| |'ff'| file format used for file I/O
729 |'fileformats'| |'ffs'| automatically detected values for 'fileformat'
730 |'filetype'| |'ft'| type of file, used for autocommands
731 |'fkmap'| |'fk'| Farsi keyboard mapping
732 |'formatoptions'| |'fo'| how automatic formatting is to be done
733 |'formatprg'| |'fp'| name of external program used with "gq" command
734 |'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
735 |'grepformat'| |'gfm'| format of 'grepprg' output
736 |'grepprg'| |'gp'| program to use for ":grep"
737 |'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking
738 |'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used
739 |'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used
740 |'guiheadroom'| |'ghr'| GUI: pixels room for window decorations
741 |'guioptions'| |'go'| GUI: Which components and options are used
742 |'guipty'| GUI: try to use a pseudo-tty for ":!" commands
743 |'helpfile'| |'hf'| name of this help file
744 |'helpheight'| |'hh'| minimum height of a new help window
745 |'hidden'| |'hid'| don't unload buffer when it is |abandon|ed
746 |'highlight'| |'hl'| sets highlighting mode for various occasions
747 |'hlsearch'| |'hls'| highlight matches with last search pattern
748 |'history'| |'hi'| number of command-lines that are remembered
749 |'hkmap'| |'hk'| Hebrew keyboard mapping
750 |'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping
751 |'icon'| let Vim set the text of the window icon
752 |'iconstring'| string to use for the Vim icon text
753 |'ignorecase'| |'ic'| ignore case in search patterns
754 |'include'| |'inc'| pattern to be used to find an include file
755 |'incsearch'| |'is'| highlight match while typing search pattern
756 |'infercase'| |'inf'| adjust case of match for keyword completion
757 |'insertmode'| |'im'| start the edit of a file in Insert mode
758 |'isfname'| |'isf'| characters included in file names and pathnames
759 |'isident'| |'isi'| characters included in identifiers
760 |'iskeyword'| |'isk'| characters included in keywords
761 |'isprint'| |'isp'| printable characters
762 |'joinspaces'| |'js'| two spaces after a period with a join command
763 |'key'| encryption key
764 |'keymodel'| |'km'| enable starting/stopping selection with keys
765 |'keywordprg'| |'kp'| program to use for the "K" command
766 |'langmap'| |'lmap'| alphabetic characters for other language mode
767 |'laststatus'| |'ls'| tells when last window has status lines
768 |'lazyredraw'| |'lz'| don't redraw while executing macros
769 |'linebreak'| |'lbr'| wrap long lines at a blank
770 |'lines'| number of lines in the display
771 |'lisp'| automatic indenting for Lisp
772 |'list'| show <Tab> and <EOL>
773 |'listchars'| |'lcs'| characters for displaying in list mode
774 |'magic'| changes special characters in search patterns
775 |'makeef'| |'mef'| name of the errorfile for ":make"
776 |'makeprg'| |'mp'| program to use for the ":make" command
777 |'matchpairs'| |'mps'| pairs of characters that "%" can match
778 |'matchtime'| |'mat'| tenths of a second to show matching paren
779 |'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions
780 |'maxmapdepth'| |'mmd'| maximum recursive depth for mapping
781 |'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer
782 |'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
783 |'modeline'| |'ml'| recognize modelines at start or end of file
784 |'modelines'| |'mls'| number of lines checked for modelines
785 |'modified'| |'mod'| buffer has been modified
786 |'more'| pause listings when the whole screen is filled
787 |'mouse'| enable the use of mouse clicks
788 |'mousefocus'| |'mousef'| keyboard focus follows the mouse
789 |'mousehide'| |'mh'| hide mouse pointer while typing
790 |'mousemodel'| |'mousem'| changes meaning of mouse buttons
791 |'mousetime'| |'mouset'| max time between mouse double-click
792 |'nrformats'| |'nf'| number formats recognized for CTRL-A command
793 |'number'| |'nu'| print the line number in front of each line
794 |'osfiletype'| |'oft'| operating system-specific filetype information
795 |'paragraphs'| |'para'| nroff macros that separate paragraphs
796 |'paste'| allow pasting text
797 |'pastetoggle'| |'pt'| key code that causes 'paste' to toggle
798 |'patchmode'| |'pm'| keep the oldest version of a file
799 |'path'| |'pa'| list of directories searched with "gf" et.al.
800 |'previewheight'| |'pvh'| height of the preview window
801 |'readonly'| |'ro'| disallow writing the buffer
802 |'remap'| allow mappings to work recursively
803 |'report'| threshold for reporting nr. of lines changed
804 |'restorescreen'| |'rs'| Win32: restore screen when exiting
805 |'revins'| |'ri'| inserting characters will work backwards
806 |'rightleft'| |'rl'| window is right-to-left oriented
807 |'ruler'| |'ru'| show cursor line and column in the status line
808 |'rulerformat'| |'ruf'| custom format for the ruler
809 |'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D
810 |'scrollbind'| |'scb'| scroll in window as other windows scroll
811 |'scrolljump'| |'sj'| minimum number of lines to scroll
812 |'scrolloff'| |'so'| minimum nr. of lines above and below cursor
813 |'scrollopt'| |'sbo'| how 'scrollbind' should behave
814 |'sections'| |'sect'| nroff macros that separate sections
815 |'secure'| secure mode for reading .vimrc in current dir
816 |'selection'| |'sel'| what type of selection to use
817 |'selectmode'| |'slm'| when to use Select mode instead of Visual mode
818 |'sessionoptions'| |'ssop'| options for |:mksession|
819 |'shell'| |'sh'| name of shell to use for external commands
820 |'shellcmdflag'| |'shcf'| flag to shell to execute one command
821 |'shellpipe'| |'sp'| string to put output of ":make" in error file
822 |'shellquote'| |'shq'| quote character(s) for around shell command
823 |'shellredir'| |'srr'| string to put output of filter in a temp file
824 |'shellslash'| |'ssl'| use forward slash for shell file names
825 |'shelltype'| |'st'| Amiga: influences how to use a shell
826 |'shellxquote'| |'sxq'| like 'shellquote', but include redirection
827 |'shiftround'| |'sr'| round indent to multiple of shiftwidth
828 |'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step
829 |'shortmess'| |'shm'| list of flags, reduce length of messages
830 |'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars
831 |'showbreak'| |'sbr'| string to use at the start of wrapped lines
832 |'showcmd'| |'sc'| show (partial) command in status line
833 |'showfulltag'| |'sft'| show full tag pattern when completing tag
834 |'showmatch'| |'sm'| briefly jump to matching bracket if insert one
835 |'showmode'| |'smd'| message on status line to show current mode
836 |'sidescroll'| |'ss'| minimum number of columns to scroll horizontal
837 |'smartcase'| |'scs'| no ignore case when pattern has uppercase
838 |'smartindent'| |'si'| smart autoindenting for C programs
839 |'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
840 |'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
841 |'splitbelow'| |'sb'| new window from split is below the current one
842 |'startofline'| |'sol'| commands move cursor to first blank in line
843 |'statusline'| |'stl'| custom format for the status line
844 |'suffixes'| |'su'| suffixes that are ignored with multiple match
845 |'swapfile'| |'swf'| whether to use a swapfile for a buffer
846 |'swapsync'| |'sws'| how to sync the swap file
847 |'switchbuf'| |'swb'| sets behavior when switching to another buffer
848 |'syntax'| |'syn'| syntax to be loaded for current buffer
849 |'tabstop'| |'ts'| number of spaces that <Tab> in file uses
850 |'tagbsearch'| |'tbs'| use binary searching in tags files
851 |'taglength'| |'tl'| number of significant characters for a tag
852 |'tagrelative'| |'tr'| file names in tag file are relative
853 |'tags'| |'tag'| list of file names used by the tag command
854 |'tagstack'| |'tgst'| push tags onto the tag stack
855 |'term'| name of the terminal
856 |'terse'| shorten some messages
857 |'textauto'| |'ta'| obsolete, use 'fileformats'
858 |'textmode'| |'tx'| obsolete, use 'fileformat'
859 |'textwidth'| |'tw'| maximum width of text that is being inserted
860 |'tildeop'| |'top'| tilde command "~" behaves like an operator
861 |'timeout'| |'to'| time out on mappings and key codes
862 |'timeoutlen'| |'tm'| time out time in milliseconds
863 |'title'| let Vim set the title of the window
864 |'titlelen'| percentage of 'columns' used for window title
865 |'titleold'| old title, restored when exiting
866 |'titlestring'| string to use for the Vim window title
867 |'toolbar'| |'tb'| GUI: which items to show in the toolbar
868 |'ttimeout'| time out on mappings
869 |'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds
870 |'ttybuiltin'| |'tbi'| use built-in termcap before external termcap
871 |'ttyfast'| |'tf'| indicates a fast terminal connection
872 |'ttymouse'| |'ttym'| type of mouse codes generated
873 |'ttyscroll'| |'tsl'| maximum number of lines for a scroll
874 |'ttytype'| |'tty'| alias for 'term'
875 |'undolevels'| |'ul'| maximum number of changes that can be undone
876 |'updatecount'| |'uc'| after this many characters flush swap file
877 |'updatetime'| |'ut'| after this many milliseconds flush swap file
878 |'verbose'| |'vbs'| give informative messages
879 |'viminfo'| |'vi'| use .viminfo file upon startup and exiting
880 |'visualbell'| |'vb'| use visual bell instead of beeping
881 |'warn'| warn for shell command when buffer was changed
882 |'weirdinvert'| |'wi'| for terminals that have weird inversion method
883 |'whichwrap'| |'ww'| allow specified keys to cross line boundaries
884 |'wildchar'| |'wc'| command-line character for wildcard expansion
885 |'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped
886 |'wildignore'| |'wig'| files matching these patterns are not completed
887 |'wildmenu'| |'wmnu'| use menu for command line completion
888 |'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
889 |'winaltkeys'| |'wak'| when the windows system handles ALT keys
890 |'winheight'| |'wh'| minimum number of lines for the current window
891 |'winminheight'| |'wmh'| minimum number of lines for any window
892 |'wrap'| long lines wrap and continue on the next line
893 |'wrapmargin'| |'wm'| chars from the right where wrapping starts
894 |'wrapscan'| |'ws'| searches wrap around the end of the file
895 |'write'| writing to a file is allowed
896 |'writeany'| |'wa'| write to file with no need for "!" override
897 |'writebackup'| |'wb'| make a backup before overwriting a file
898 |'writedelay'| |'wd'| delay this many msec for each char (for debug)
899 ------------------------------------------------------------------------------
900 *X_ur* Undo/Redo commands
902 |u| N u undo last N changes
903 |CTRL-R| N CTRL-R redo last N undone changes
904 |U| U restore last changed line
905 ------------------------------------------------------------------------------
906 *X_et* External commands
908 |:shell| :sh[ell] start a shell
909 |:!| :!{command} execute {command} with a shell
910 |K| K lookup keyword under the cursor with
911 'keywordprg' program (default: "man")
912 ------------------------------------------------------------------------------
913 *X_qf* Quickfix commands
915 |:cc| :cc [nr] display error [nr] (default is the same again)
916 |:cnext| :cn display the next error
917 |:cprevious| :cp display the previous error
918 |:clist| :cl list all errors
919 |:cfile| :cf read errors from the file 'errorfile'
920 |:cquit| :cq quit without writing and return error code (to
922 |:make| :make [args] start make, read errors, and jump to first
924 |:grep| :gr[ep] [args] execute 'grepprg' to find matches and jump to
926 ------------------------------------------------------------------------------
927 *X_vc* Various commands
929 |CTRL-L| CTRL-L Clear and redraw the screen.
930 |CTRL-G| CTRL-G show current file name (with path) and cursor
932 |ga| ga show ascii value of character under cursor in
933 decimal, hex, and octal
934 |g_CTRL-G| g CTRL-G show cursor column, line, and character
936 |CTRL-C| CTRL-C during searches: Interrupt the search
937 |dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search
938 |<Del>| <Del> while entering a count: delete last character
939 |:version| :ve[rsion] show version information
940 |:mode| :mode N MS-DOS: set screen mode to N (number, C80,
942 |:normal| :norm[al][!] {commands}
943 Execute Normal mode commands.
944 |Q| Q switch to "Ex" mode
945 |:redir| :redir >{file} redirect messages to {file}
946 |:confirm| :confirm {command} quit, write, etc., asking about
947 unsaved changes or read-only files.
948 ------------------------------------------------------------------------------
949 *X_ce* Command-line editing
951 |c_<Esc>| <Esc> abandon command-line (if 'wildchar' is
952 <Esc>, type it twice)
954 |c_CTRL-V| CTRL-V {char} insert {char} literally
955 |c_CTRL-V| CTRL-V {number} enter decimal value of character (up to
957 |c_CTRL-K| CTRL-K {char1} {char2}
958 enter digraph (See |X_di|)
959 |c_CTRL-R| CTRL-R {0-9a-z"%#:-=}
960 insert the contents of a register
962 |c_<Left>| <Left>/<Right> cursor left/right
963 |c_<S-Left>| <S-Left>/<S-Right> cursor one word left/right
964 |c_CTRL-B| CTRL-B/CTRL-E cursor to beginning/end of command-line
966 |c_<BS>| <BS> delete the character in front of the cursor
967 |c_<Del>| <Del> delete the character under the cursor
968 |c_CTRL-W| CTRL-W delete the word in front of the cursor
969 |c_CTRL-U| CTRL-U remove all characters
971 |c_<Up>| <Up>/<Down> recall older/newer command-line that starts
973 |c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
974 |:history| :his[tory] show older command-lines
976 Context-sensitive completion on the command-line:
978 |c_wildchar| 'wildchar' (default: <Tab>)
979 do completion on the pattern in front of the
980 cursor. If there are multiple matches,
981 beep and show the first one; further
982 'wildchar' will show the next ones.
983 |c_CTRL-D| CTRL-D list all names that match the pattern in
985 |c_CTRL-A| CTRL-A insert all names that match pattern in front
987 |c_CTRL-L| CTRL-L insert longest common part of names that
989 |c_CTRL-N| CTRL-N after 'wildchar' with multiple matches: go
991 |c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go
993 ------------------------------------------------------------------------------
996 |:range| , separates two line numbers
997 |:range| ; idem, set cursor to the first line number
998 before interpreting the second one
1000 |:range| {number} an absolute line number
1001 |:range| . the current line
1002 |:range| $ the last line in the file
1003 |:range| % equal to 1,$ (the entire file)
1004 |:range| * equal to '<,'> (visual area)
1005 |:range| 't position of mark t
1006 |:range| /{pattern}[/] the next line where {pattern} matches
1007 |:range| ?{pattern}[?] the previous line where {pattern} matches
1009 |:range| +[num] add [num] to the preceding line number
1011 |:range| -[num] subtract [num] from the preceding line
1013 ------------------------------------------------------------------------------
1014 *X_ex* Special Ex characters
1016 |:bar| | separates two commands (not for ":global" and ":!")
1017 |:quote| " begins comment
1019 |:_%| % current file name (only where a file name is expected)
1020 |:_#| #[num] alternate file name [num] (only where a file name is
1022 Note: The next four are typed literally; these are not special keys!
1023 |:<cword>| <cword> word under the cursor (only where a file name is
1025 |:<cWORD>| <cWORD> WORD under the cursor (only where a file name is
1026 expected) (see |WORD|)
1027 |:<cfile>| <cfile> file name under the cursor (only where a file name is
1029 |:<afile>| <afile> file name for autocommand (only where a file name is
1031 |:<sfile>| <sfile> file name of a ":source"d file, within that file (only
1032 where a file name is expected)
1034 After "%", "#", "<cfile>", "<sfile>" or "<afile>"
1036 |::h| :h head (file name removed)
1037 |::t| :t tail (file name only)
1038 |::r| :r root (extension removed)
1040 |::s| :s/{pat}/{repl}/ substitute {pat} with {repl}
1041 ------------------------------------------------------------------------------
1042 *X_ed* Editing a file
1044 |:edit_f| :e[dit] {file} Edit {file}, unless changes have been made.
1045 |:edit!_f| :e[dit]! {file} Edit {file} always. Discard any changes.
1046 |:edit| :e[dit] Reload the current file, unless changes have
1048 |:edit!| :e[dit]! Reload the current file always. Discard any
1050 |:find| :fin[d][!] {file} Find {file} in 'path' and edit it.
1051 |CTRL-^| N CTRL-^ Edit alternate file N (equivalent to ":e #N").
1052 |gf| gf or ]f Edit the file whose name is under the cursor
1053 |:pwd| :pwd Print the current directory name.
1054 |:cd| :cd [path] Change the current directory to [path].
1055 |:cd-| :cd - Back to previous current directory.
1056 |:file| :f[ile] Print the current file name and the cursor
1058 |:file| :f[ile] {name} Set the current file name to {name}.
1059 |:files| :files Show alternate file names.
1060 ------------------------------------------------------------------------------
1061 *X_fl* Using the argument list |argument-list|
1063 |:args| :ar[gs] Print the argument list, with the current file
1065 |:all| :all or :sall Open a window for every file in the arg list.
1066 |:wn| :wn[ext][!] Write file and edit next file.
1067 |:wn| :wn[ext][!] {file} Write to {file} and edit next file, unless
1068 {file} exists. With !, overwrite existing
1070 |:wN| :wN[ext][!] [file] Write file and edit previous file.
1072 in current window in new window ~
1073 |:argument| :argu[ment] N :sar[gument] N Edit file N
1074 |:next| :n[ext] :sn[ext] Edit next file
1075 |:next_f| :n[ext] {arglist} :sn[ext] {arglist} define new arg list
1077 |:Next| :N[ext] :sN[ext] Edit previous file
1078 |:rewind| :rew[ind][!] :srew[ind] Edit first file
1079 |:last| :last :slast Edit last file
1080 ------------------------------------------------------------------------------
1081 *X_wq* Writing and quitting
1083 |:w| :[range]w[rite][!] Write to the current file.
1084 |:w_f| :[range]w[rite] {file} Write to {file}, unless it already
1086 |:w_f| :[range]w[rite]! {file} Write to {file}. Overwrite an existing
1088 |:w_a| :[range]w[rite][!] >> Append to the current file.
1089 |:w_a| :[range]w[rite][!] >> {file} Append to {file}.
1090 |:w_c| :[range]w[rite] !{cmd} Execute {cmd} with [range] lines as
1092 |:up| :[range]up[date][!] write to current file if modified
1093 |:wall| :wall[!] write all changed buffers
1095 |:q| :q[uit] Quit current buffer, unless changes have been
1096 made. Exit Vim when there are no other
1098 |:q| :q[uit]! Quit current buffer always, discard any
1099 changes. Exit Vim when there are no other
1101 |:qa| :qall Exit Vim, unless changes have been made.
1102 |:qa| :qall! Exit Vim always, discard any changes.
1103 |:cq| :cq Quit without writing and return error code.
1105 |:wq| :wq[!] Write the current file and exit.
1106 |:wq| :wq[!] {file} Write to {file} and exit.
1107 |:xit| :x[it][!] [file] Like ":wq" but write only when changes have
1109 |ZZ| ZZ Same as ":x".
1110 |ZQ| ZQ Same as ":q!".
1111 |:xall| :xall[!] or :wqall[!]
1112 Write all changed buffers and exit
1114 |:stop| :st[op][!] Suspend VIM or start new shell. If 'aw' option
1115 is set and [!] not given write the buffer.
1116 |CTRL-Z| CTRL-Z Same as ":stop"
1117 ------------------------------------------------------------------------------
1120 |-vim| vim [options] start editing with an empty buffer
1121 |-file| vim [options] {file} .. start editing one or more files
1122 |--| vim [options] - read file from stdin
1123 |-tag| vim [options] -t {tag} edit the file associated with {tag}
1124 |-qf| vim [options] -q [fname] start editing in QuickFix mode,
1125 display the first error
1129 |-gui| -g start GUI (also allows other options)
1131 |-+| +[num] put the cursor at line [num] (default: last line)
1132 |-+c| +{command} execute {command} after loading the file
1133 |-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat}
1134 |-v| -v Vi mode, start ex in Normal mode
1135 |-e| -e Ex mode, start vim in Ex mode
1136 |-R| -R Read-only mode, implies -n
1137 |-m| -m modifications not allowed (resets 'write' option)
1140 |-F| -F Farsi mode ('fkmap' and 'rightleft' are set)
1141 |-H| -H Hebrew mode ('hkmap' and 'rightleft' are set)
1142 |-V| -V Verbose, give informative messages
1143 |-C| -C Compatible, set the 'compatible' option
1144 |-N| -N Nocompatible, reset the 'compatible' option
1145 |-r| -r give list of swap files
1146 |-r| -r {file} .. recover aborted edit session
1147 |-n| -n do not create a swap file
1148 |-o| -o [num] open [num] windows (default: one for each file)
1149 |-f| -f GUI: foreground process, don't fork
1150 Amiga: do not restart VIM to open a window (for
1152 |-s| -s {scriptin} first read commands from the file {scriptin}
1153 |-w| -w {scriptout} write typed chars to file {scriptout} (append)
1154 |-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)
1155 |-T| -T {terminal} set terminal name
1156 |-d| -d {device} Amiga: open {device} to be used as a console
1157 |-u| -u {vimrc} read inits from {vimrc} instead of other inits
1158 |-U| -U {gvimrc} idem, for when starting the GUI
1159 |-i| -i {viminfo} read info from {viminfo} instead of other files
1160 |---| -- end of options, other arguments are file names
1161 |--help| --help show list of arguments and exit
1162 |--version| --version show version info and exit
1163 |--| - Read file from stdin.
1164 ------------------------------------------------------------------------------
1165 *X_ac* Automatic Commands
1167 |viminfo-file| Read registers, marks, history at startup, save when exiting.
1169 |:rviminfo| :rv[iminfo] [file] Read info from viminfo file [file]
1170 |:rviminfo| :rv[iminfo]! [file] idem, overwrite existing info
1171 |:wviminfo| :wv[iminfo] [file] Add info to viminfo file [file]
1172 |:wviminfo| :wv[iminfo]! [file] Write info to viminfo file [file]
1174 |modeline| Automatic option setting when editing a file
1176 |modeline| vim:{set-arg}: .. In the first and last lines of the
1177 file (see 'ml' option), {set-arg} is
1178 given as an argument to ":set"
1180 |autocommand| Automatic execution of commands on certain events.
1182 |:autocmd| :au List all autocommands
1183 |:autocmd| :au {event} List all autocommands for {event}
1184 |:autocmd| :au {event} {pat} List all autocommands for {event} with
1186 |:autocmd| :au {event} {pat} {cmd} Enter new autocommands for {event}
1188 |:autocmd| :au! Remove all autocommands
1189 |:autocmd| :au! {event} Remove all autocommands for {event}
1190 |:autocmd| :au! * {pat} Remove all autocommands for {pat}
1191 |:autocmd| :au! {event} {pat} Remove all autocommands for {event}
1193 |:autocmd| :au! {event} {pat} {cmd} Remove all autocommands for {event}
1194 with {pat} and enter new one
1195 ------------------------------------------------------------------------------
1196 *X_wi* Multi-window functions
1198 |CTRL-W_s| CTRL-W s or :split Split window into two parts
1199 |:split_f| :split {file} Split window and edit {file} in one of
1201 |:sfind| :sf[ind] {file} Split window, find {file} in 'path'
1203 |CTRL-W_]| CTRL-W ] Split window and jump to tag under
1205 |CTRL-W_f| CTRL-W f Split window and edit file name under
1207 |CTRL-W_CTRL-^| CTRL-W CTRL-^ Split window and edit alternate file
1208 |CTRL-W_n| CTRL-W n or :new Create new empty window
1209 |CTRL-W_q| CTRL-W q or :q[uit] Quit editing and close window
1210 |CTRL-W_c| CTRL-W c or :cl[ose] Make buffer hidden and close window
1211 |CTRL-W_o| CTRL-W o or :on[ly] Make current window only one on the
1214 |CTRL-W_j| CTRL-W j Move cursor to window below
1215 |CTRL-W_k| CTRL-W k Move cursor to window above
1216 |CTRL-W_CTRL-W| CTRL-W CTRL-W Move cursor to window below (wrap)
1217 |CTRL-W_W| CTRL-W W Move cursor to window above (wrap)
1218 |CTRL-W_t| CTRL-W t Move cursor to top window
1219 |CTRL-W_b| CTRL-W b Move cursor to bottom window
1220 |CTRL-W_p| CTRL-W p Move cursor to previous active window
1222 |CTRL-W_r| CTRL-W r Rotate windows downwards
1223 |CTRL-W_R| CTRL-W R Rotate windows upwards
1224 |CTRL-W_x| CTRL-W x Exchange current window with next one
1226 |CTRL-W_=| CTRL-W = Make all windows equal height
1227 |CTRL-W_-| CTRL-W - Decrease current window height
1228 |CTRL-W_+| CTRL-W + Increase current window height
1229 |CTRL-W__| CTRL-W _ Set current window height (default:
1231 ------------------------------------------------------------------------------
1232 *X_bu* Buffer list functions
1234 |:buffers| :buffers or :files list all known buffer and file names
1236 |:ball| :ball or :sball edit all args/buffers
1237 |:unhide| :unhide or :sunhide edit all loaded buffers
1239 |:badd| :badd {fname} add file name {fname} to the list
1240 |:bunload| :bunload[!] [N] unload buffer [N] from memory
1241 |:bdelete| :bdelete[!] [N] unload buffer [N] and delete it from
1244 in current window in new window ~
1245 |:buffer| :[N]buffer [N] :[N]sbuffer [N] to arg/buf N
1246 |:bnext| :[N]bnext [N] :[N]sbnext [N] to Nth next arg/buf
1247 |:bNext| :[N]bNext [N] :[N]sbNext [N] to Nth previous arg/buf
1248 |:bprevious| :[N]bprevious [N] :[N]sbprevious [N] to Nth previous arg/buf
1249 |:brewind| :brewind :sbrewind to first arg/buf
1250 |:blast| :blast :sblast to last arg/buf
1251 |:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf
1252 ------------------------------------------------------------------------------
1253 *X_sy* Syntax Highlighting
1255 |:syn-on| :syntax on start using syntax highlighting
1256 |:syn-off| :syntax off stop using syntax highlighting
1258 |:syn-keyword| :syntax keyword {group-name} {keyword} ..
1259 add a syntax keyword item
1260 |:syn-match| :syntax match {group-name} {pattern} ...
1261 add syntax match item
1262 |:syn-region| :syntax region {group-name} {pattern} ...
1263 add syntax region item
1264 |:syn-sync| :syntax sync [ccomment | lines {N} | ...]
1265 tell syntax how to sync
1266 |:syntax| :syntax [list] list current syntax items
1267 |:syn-clear| :syntax clear clear all syntax info
1269 |:highlight| :highlight clear clear all highlight info
1270 |:highlight| :highlight {group-name} {key}={arg} ..
1271 set highlighting for {group-name}
1273 |:filetype| :filetype on switch on file type detection, without
1275 ------------------------------------------------------------------------------
1278 |:gui| :gui UNIX: start the GUI
1279 |:gui| :gui {fname} .. idem, and edit {fname} ..
1281 |:menu| :menu list all menus
1282 |:menu| :menu {mpath} list menus starting with {mpath}
1283 |:menu| :menu {mpath} {rhs} add menu {mpath}, giving {lhs}
1284 |:menu| :menu {pri} {mpath} {rhs}
1285 idem, with priorities {pri}
1286 |:menu| :menu ToolBar.{name} {rhs}
1287 add toolbar item, giving {lhs}
1288 |:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath}
1289 |:unmenu| :unmenu {mpath} remove menu {mpath}
1291 ------------------------------------------------------------------------------
1294 Now that you've jumped here with CTRL-] or a double mouse click, you can use
1295 CTRL-T, CTRL-O, g<RightMouse>, or <C-RightMouse> to go back to where you were.
1296 ------------------------------------------------------------------------------
1297 vim:ts=8:sw=8:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":