1*quickref.txt* For Vim version 7.0aa. Last change: 2004 Jul 02 2 3 4 VIM REFERENCE MANUAL by Bram Moolenaar 5 6 Quick reference guide 7 8 *quickref* *Contents* 9 tag subject tag subject ~ 10|Q_ct| list of help files |Q_re| Repeating commands 11|Q_lr| motion: Left-right |Q_km| Key mapping 12|Q_ud| motion: Up-down |Q_ab| Abbreviations 13|Q_tm| motion: Text object |Q_op| Options 14|Q_pa| motion: Pattern searches |Q_ur| Undo/Redo commands 15|Q_ma| motion: Marks |Q_et| External commands 16|Q_vm| motion: Various |Q_qf| Quickfix commands 17|Q_ta| motion: Using tags |Q_vc| Various commands 18|Q_sc| Scrolling |Q_ce| Ex: Command-line editing 19|Q_in| insert: Inserting text |Q_ra| Ex: Ranges 20|Q_ai| insert: Keys |Q_ex| Ex: Special characters 21|Q_ss| insert: Special keys |Q_ed| Editing a file 22|Q_di| insert: Digraphs |Q_fl| Using the argument list 23|Q_si| insert: Special inserts |Q_wq| Writing and quitting 24|Q_de| change: Deleting text |Q_st| Starting VIM 25|Q_cm| change: Copying and moving |Q_ac| Automatic commands 26|Q_ch| change: Changing text |Q_wi| Multi-window commands 27|Q_co| change: Complex |Q_bu| Buffer list commands 28|Q_vi| Visual mode |Q_sy| Syntax highlighting 29|Q_to| Text objects |Q_gu| GUI commands 30 |Q_fo| Folding 31 32------------------------------------------------------------------------------ 33N is used to indicate an optional count that can be given before the command. 34------------------------------------------------------------------------------ 35*Q_lr* Left-right motions 36 37|h| N h left (also: CTRL-H, <BS>, or <Left> key) 38|l| N l right (also: <Space> or <Right> key) 39|0| 0 to first character in the line (also: <Home> key) 40|^| ^ to first non-blank character in the line 41|$| N $ to the last character in the line (N-1 lines lower) 42 (also: <End> key) 43|g0| N g0 to first character in screen line (differs from "0" 44 when lines wrap) 45|g^| N g^ to first non-blank character in screen line (differs 46 from "^" when lines wrap) 47|g$| N g$ to last character in screen line (differs from "$" 48 when lines wrap) 49|gm| N gm to middle of the screen line 50|bar| N | to column N (default: 1) 51|f| N f{char} to the Nth occurrence of {char} to the right 52|F| N F{char} to the Nth occurrence of {char} to the left 53|t| N t{char} till before the Nth occurrence of {char} to the right 54|T| N T{char} till before the Nth occurrence of {char} to the left 55|;| N ; repeat the last "f", "F", "t", or "T" N times 56|,| N , repeat the last "f", "F", "t", or "T" N times in 57 opposite direction 58------------------------------------------------------------------------------ 59*Q_ud* Up-down motions 60 61|k| N k up N lines (also: CTRL-P and <Up>) 62|j| N j down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>) 63|-| N - up N lines, on the first non-blank character 64|+| N + down N lines, on the first non-blank character (also: 65 CTRL-M and <CR>) 66|_| N _ down N-1 lines, on the first non-blank character 67|G| N G goto line N (default: last line), on the first 68 non-blank character 69|gg| N gg goto line N (default: first line), on the first 70 non-blank character 71|N%| N % goto line N percentage down in the file. N must be 72 given, otherwise it is the |%| command. 73|gk| N gk up N screen lines (differs from "k" when line wraps) 74|gj| N gj down N screen lines (differs from "j" when line wraps) 75------------------------------------------------------------------------------ 76*Q_tm* Text object motions 77 78|w| N w N words forward 79|W| N W N blank-separated |WORD|s forward 80|e| N e forward to the end of the Nth word 81|E| N E forward to the end of the Nth blank-separated |WORD| 82|b| N b N words backward 83|B| N B N blank-separated |WORD|s backward 84|ge| N ge backward to the end of the Nth word 85|gE| N gE backward to the end of the Nth blank-separated |WORD| 86 87|)| N ) N sentences forward 88|(| N ( N sentences backward 89|}| N } N paragraphs forward 90|{| N { N paragraphs backward 91|]]| N ]] N sections forward, at start of section 92|[[| N [[ N sections backward, at start of section 93|][| N ][ N sections forward, at end of section 94|[]| N [] N sections backward, at end of section 95|[(| N [( N times back to unclosed '(' 96|[{| N [{ N times back to unclosed '{' 97|[m| N [m N times back to start of method (for Java) 98|[M| N [M N times back to end of method (for Java) 99|])| N ]) N times forward to unclosed ')' 100|]}| N ]} N times forward to unclosed '}' 101|]m| N ]m N times forward to start of method (for Java) 102|]M| N ]M N times forward to end of method (for Java) 103|[#| N [# N times back to unclosed "#if" or "#else" 104|]#| N ]# N times forward to unclosed "#else" or "#endif" 105|[star| N [* N times back to start of comment "/*" 106|]star| N ]* N times forward to end of comment "*/" 107------------------------------------------------------------------------------ 108*Q_pa* Pattern searches 109 110|/| N /{pattern}[/[offset]]<CR> 111 search forward for the Nth occurrence of {pattern} 112|?| N ?{pattern}[?[offset]]<CR> 113 search backward for the Nth occurrence of {pattern} 114|/<CR>| N /<CR> repeat last search, in the forward direction 115|?<CR>| N ?<CR> repeat last search, in the backward direction 116|n| N n repeat last search 117|N| N N repeat last search, in opposite direction 118|star| N * search forward for the identifier under the cursor 119|#| N # search backward for the identifier under the cursor 120|gstar| N g* like "*", but also find partial matches 121|g#| N g# like "#", but also find partial matches 122|gd| gd goto local declaration of identifier under the cursor 123|gD| gD goto global declaration of identifier under the cursor 124 125|pattern| Special characters in search patterns 126 127 meaning magic nomagic ~ 128 matches any single character . \. 129 matches start of line ^ ^ 130 matches <EOL> $ $ 131 matches start of word \< \< 132 matches end of word \> \> 133 matches a single char from the range [a-z] \[a-z] 134 matches a single char not in the range [^a-z] \[^a-z] 135 matches an identifier char \i \i 136 idem but excluding digits \I \I 137 matches a keyword character \k \k 138 idem but excluding digits \K \K 139 matches a file name character \f \f 140 idem but excluding digits \F \F 141 matches a printable character \p \p 142 idem but excluding digits \P \P 143 matches a white space character \s \s 144 matches a non-white space character \S \S 145 146 matches <Esc> \e \e 147 matches <Tab> \t \t 148 matches <CR> \r \r 149 matches <BS> \b \b 150 151 matches 0 or more of the preceding atom * \* 152 matches 1 or more of the preceding atom \+ \+ 153 matches 0 or 1 of the preceding atom \= \= 154 matches 2 to 5 of the preceding atom \{2,5} \{2,5} 155 separates two alternatives \| \| 156 group a pattern into an atom \(\) \(\) 157 158|search-offset| Offsets allowed after search command 159 160 [num] [num] lines downwards, in column 1 161 +[num] [num] lines downwards, in column 1 162 -[num] [num] lines upwards, in column 1 163 e[+num] [num] characters to the right of the end of the match 164 e[-num] [num] characters to the left of the end of the match 165 s[+num] [num] characters to the right of the start of the match 166 s[-num] [num] characters to the left of the start of the match 167 b[+num] [num] identical to s[+num] above (mnemonic: begin) 168 b[-num] [num] identical to s[-num] above (mnemonic: begin) 169 ;{search-command} execute {search-command} next 170------------------------------------------------------------------------------ 171*Q_ma* Marks and motions 172 173|m| m{a-zA-Z} mark current position with mark {a-zA-Z} 174|`a| `{a-z} go to mark {a-z} within current file 175|`A| `{A-Z} go to mark {A-Z} in any file 176|`0| `{0-9} go to the position where Vim was previously exited 177|``| `` go to the position before the last jump 178|`quote| `" go to the position when last editing this file 179|`[| `[ go to the start of the previously operated or put text 180|`]| `] go to the end of the previously operated or put text 181|`<| `< go to the start of the (previous) Visual area 182|`>| `> go to the end of the (previous) Visual area 183|`.| `. go to the position of the last change in this file 184|'| '{a-zA-Z0-9[]'"<>.} 185 same as `, but on the first non-blank in the line 186|:marks| :marks print the active marks 187|CTRL-O| N CTRL-O go to Nth older position in jump list 188|CTRL-I| N CTRL-I go to Nth newer position in jump list 189|:ju| :ju[mps] print the jump list 190------------------------------------------------------------------------------ 191*Q_vm* Various motions 192 193|%| % find the next brace, bracket, comment, or "#if"/ 194 "#else"/"#endif" in this line and go to its match 195|H| N H go to the Nth line in the window, on the first 196 non-blank 197|M| M go to the middle line in the window, on the first 198 non-blank 199|L| N L go to the Nth line from the bottom, on the first 200 non-blank 201 202|go| N go go to Nth byte in the buffer 203|:go| :[range]go[to] [off] go to [off] byte in the buffer 204------------------------------------------------------------------------------ 205*Q_ta* Using tags 206 207|:ta| :ta[g][!] {tag} Jump to tag {tag} 208|:ta| :[count]ta[g][!] Jump to [count]'th newer tag in tag list 209|CTRL-]| CTRL-] Jump to the tag under cursor, unless changes 210 have been made 211|:ts| :ts[elect][!] [tag] List matching tags and select one to jump to 212|:tjump| :tj[ump][!] [tag] Jump to tag [tag] or select from list when 213 there are multiple matches 214 215|:tags| :tags Print tag list 216|CTRL-T| N CTRL-T Jump back from Nth older tag in tag list 217|:po| :[count]po[p][!] Jump back from [count]'th older tag in tag list 218|:tnext| :[count]tn[ext][!] Jump to [count]'th next matching tag 219|:tp| :[count]tp[revious][!] Jump to [count]'th previous matching tag 220|:tr| :[count]tr[ewind][!] Jump to [count]'th matching tag 221|:tl| :tl[ast][!] Jump to last matching tag 222 223|:ptag| :pt[ag] {tag} open a preview window to show tag {tag} 224|CTRL-W_}| CTRL-W } like CTRL-] but show tag in preview window 225|:pts| :pts[elect] like ":tselect" but show tag in preview window 226|:ptjump| :ptj[ump] like ":tjump" but show tag in preview window 227|:pclose| :pc[lose] close tag preview window 228|CTRL-W_z| CTRL-W z close tag preview window 229------------------------------------------------------------------------------ 230*Q_sc* Scrolling 231 232|CTRL-E| N CTRL-E window N lines downwards (default: 1) 233|CTRL-D| N CTRL-D window N lines Downwards (default: 1/2 window) 234|CTRL-F| N CTRL-F window N pages Forwards (downwards) 235|CTRL-Y| N CTRL-Y window N lines upwards (default: 1) 236|CTRL-U| N CTRL-U window N lines Upwards (default: 1/2 window) 237|CTRL-B| N CTRL-B window N pages Backwards (upwards) 238|z<CR>| z<CR> or zt redraw, current line at top of window 239|z.| z. or zz redraw, current line at center of window 240|z-| z- or zb redraw, current line at bottom of window 241 242These only work when 'wrap' is off: 243|zh| N zh scroll screen N characters to the right 244|zl| N zl scroll screen N characters to the left 245|zH| N zH scroll screen half a screenwidth to the right 246|zL| N zL scroll screen half a screenwidth to the left 247------------------------------------------------------------------------------ 248*Q_in* Inserting text 249 250|a| N a append text after the cursor (N times) 251|A| N A append text at the end of the line (N times) 252|i| N i insert text before the cursor (N times) (also: <Insert>) 253|I| N I insert text before the first non-blank in the line (N times) 254|gI| N gI insert text in column 1 (N times) 255|o| N o open a new line below the current line, append text (N times) 256|O| N O open a new line above the current line, append text (N times) 257|:startinsert| :star[tinsert][!] start Insert mode, append when [!] used 258 259in Visual block mode: 260|v_b_I| I insert the same text in front of all the selected lines 261|v_b_A| A append the same text after all the selected lines 262------------------------------------------------------------------------------ 263*Q_ai* Insert mode keys 264 265|insert-index| alphabetical index of Insert mode commands 266 267leaving Insert mode: 268|i_<Esc>| <Esc> end Insert mode, back to Normal mode 269|i_CTRL-C| CTRL-C like <Esc>, but do not use an abbreviation 270|i_CTRL-O| CTRL-O {command} execute {command} and return to Insert mode 271 272moving around: 273|i_<Up>| cursor keys move cursor left/right/up/down 274|i_<S-Left>| shift-left/right one word left/right 275|i_<S-Up>| shift-up/down one screenful backward/forward 276|i_<End>| <End> cursor after last character in the line 277|i_<Home>| <Home> cursor to first character in the line 278------------------------------------------------------------------------------ 279*Q_ss* Special keys in Insert mode 280 281|i_CTRL-V| CTRL-V {char}.. insert character literally, or enter decimal 282 byte value 283|i_<NL>| <NL> or <CR> or CTRL-M or CTRL-J 284 begin new line 285|i_CTRL-E| CTRL-E insert the character from below the cursor 286|i_CTRL-Y| CTRL-Y insert the character from above the cursor 287 288|i_CTRL-A| CTRL-A insert previously inserted text 289|i_CTRL-@| CTRL-@ insert previously inserted text and stop 290 Insert mode 291|i_CTRL-R| CTRL-R {0-9a-z%#:.-="} insert the contents of a register 292 293|i_CTRL-N| CTRL-N insert next match of identifier before the 294 cursor 295|i_CTRL-P| CTRL-P insert previous match of identifier before 296 the cursor 297|i_CTRL-X| CTRL-X ... complete the word before the cursor in 298 various ways 299 300|i_<BS>| <BS> or CTRL-H delete the character before the cursor 301|i_<Del>| <Del> delete the character under the cursor 302|i_CTRL-W| CTRL-W delete word before the cursor 303|i_CTRL-U| CTRL-U delete all entered characters in the current 304 line 305|i_CTRL-T| CTRL-T insert one shiftwidth of indent in front of 306 the current line 307|i_CTRL-D| CTRL-D delete one shiftwidth of indent in front of 308 the current line 309|i_0_CTRL-D| 0 CTRL-D delete all indent in the current line 310|i_^_CTRL-D| ^ CTRL-D delete all indent in the current line, 311 restore indent in next line 312------------------------------------------------------------------------------ 313*Q_di* Digraphs 314 315|:dig| :dig[raphs] show current list of digraphs 316|:dig| :dig[raphs] {char1}{char2} {number} ... 317 add digraph(s) to the list 318 319In Insert or Command-line mode: 320|i_CTRL-K| CTRL-K {char1} {char2} 321 enter digraph 322|i_digraph| {char1} <BS> {char2} 323 enter digraph if 'digraph' option set 324------------------------------------------------------------------------------ 325*Q_si* Special inserts 326 327|:r| :r [file] insert the contents of [file] below the cursor 328|:r!| :r! {command} insert the standard output of {command} below the 329 cursor 330------------------------------------------------------------------------------ 331*Q_de* Deleting text 332 333|x| N x delete N characters under and after the cursor 334|<Del>| N <Del> delete N characters under and after the cursor 335|X| N X delete N characters before the cursor 336|d| N d{motion} delete the text that is moved over with {motion} 337|v_d| {visual}d delete the highlighted text 338|dd| N dd delete N lines 339|D| N D delete to the end of the line (and N-1 more lines) 340|J| N J join N-1 lines (delete <EOL>s) 341|v_J| {visual}J join the highlighted lines 342|gJ| N gJ like "J", but without inserting spaces 343|v_gJ| {visual}gJ like "{visual}J", but without inserting spaces 344|:d| :[range]d [x] delete [range] lines [into register x] 345------------------------------------------------------------------------------ 346*Q_cm* Copying and moving text 347 348|quote| "{char} use register {char} for the next delete, yank, or put 349|:reg| :reg show the contents of all registers 350|:reg| :reg {arg} show the contents of registers mentioned in {arg} 351|y| N y{motion} yank the text moved over with {motion} into a register 352|v_y| {visual}y yank the highlighted text into a register 353|yy| N yy yank N lines into a register 354|Y| N Y yank N lines into a register 355|p| N p put a register after the cursor position (N times) 356|P| N P put a register before the cursor position (N times) 357|]p| N ]p like p, but adjust indent to current line 358|[p| N [p like P, but adjust indent to current line 359|gp| N gp like p, but leave cursor after the new text 360|gP| N gP like P, but leave cursor after the new text 361------------------------------------------------------------------------------ 362*Q_ch* Changing text 363 364|r| N r{char} replace N characters with {char} 365|gr| N gr{char} replace N characters without affecting layout 366|R| N R enter Replace mode (repeat the entered text N times) 367|gR| N gR enter virtual Replace mode: Like Replace mode but 368 without affecting layout 369|v_b_r| {visual}r{char} 370 in Visual block mode: Replace each char of the 371 selected text with {char} 372 373 (change = delete text and enter Insert mode) 374|c| N c{motion} change the text that is moved over with {motion} 375|v_c| {visual}c change the highlighted text 376|cc| N cc change N lines 377|S| N S change N lines 378|C| N C change to the end of the line (and N-1 more lines) 379|s| N s change N characters 380|v_b_c| {visual}c in Visual block mode: Change each of the selected 381 lines with the entered text 382|v_b_C| {visual}C in Visual block mode: Change each of the selected 383 lines until end-of-line with the entered text 384 385|~| N ~ switch case for N characters and advance cursor 386|v_~| {visual}~ switch case for highlighted text 387|v_u| {visual}u make highlighted text lowercase 388|v_U| {visual}U make highlighted text uppercase 389|g~| g~{motion} switch case for the text that is moved over with 390 {motion} 391|gu| gu{motion} make the text that is moved over with {motion} 392 lowercase 393|gU| gU{motion} make the text that is moved over with {motion} 394 uppercase 395|v_g?| {visual}g? perform rot13 encoding on highlighted text 396|g?| g?{motion} perform rot13 encoding on the text that is moved over 397 with {motion} 398 399|CTRL-A| N CTRL-A add N to the number at or after the cursor 400|CTRL-X| N CTRL-X subtract N from the number at or after the cursor 401 402|<| N <{motion} move the lines that are moved over with {motion} one 403 shiftwidth left 404|<<| N << move N lines one shiftwidth left 405|>| N >{motion} move the lines that are moved over with {motion} one 406 shiftwidth right 407|>>| N >> move N lines one shiftwidth right 408|gq| N gq{motion} format the lines that are moved over with {motion} to 409 'textwidth' length 410|:ce| :[range]ce[nter] [width] 411 center the lines in [range] 412|:le| :[range]le[ft] [indent] 413 left-align the lines in [range] (with [indent]) 414|:ri| :[range]ri[ght] [width] 415 right-align the lines in [range] 416------------------------------------------------------------------------------ 417*Q_co* Complex changes 418 419|!| N !{motion}{command}<CR> 420 filter the lines that are moved over through {command} 421|!!| N !!{command}<CR> 422 filter N lines through {command} 423|v_!| {visual}!{command}<CR> 424 filter the highlighted lines through {command} 425|:range!| :[range]! {command}<CR> 426 filter [range] lines through {command} 427|=| N ={motion} 428 filter the lines that are moved over through 'equalprg' 429|==| N == filter N lines through 'equalprg' 430|v_=| {visual}= 431 filter the highlighted lines through 'equalprg' 432|:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c] 433 substitute {pattern} by {string} in [range] lines; 434 with [g], replace all occurrences of {pattern}; 435 with [c], confirm each replacement 436|:s| :[range]s[ubstitute] [g][c] 437 repeat previous ":s" with new range and options 438|&| & Repeat previous ":s" on current line without options 439|:ret| :[range]ret[ab][!] [tabstop] 440 set 'tabstop' to new value and adjust white space 441 accordingly 442------------------------------------------------------------------------------ 443*Q_vi* Visual mode 444 445|visual-index| list of Visual mode commands. 446 447|v| v start highlighting characters } move cursor and use 448|V| V start highlighting linewise } operator to affect 449|CTRL-V| CTRL-V start highlighting blockwise } highlighted text 450|v_o| o exchange cursor position with start of highlighting 451|gv| gv start highlighting on previous visual area 452|v_v| v highlight characters or stop highlighting 453|v_V| V highlight linewise or stop highlighting 454|v_CTRL-V| CTRL-V highlight blockwise or stop highlighting 455------------------------------------------------------------------------------ 456*Q_to* Text objects (only in Visual mode or after an operator) 457 458|v_aw| N aw Select "a word" 459|v_iw| N iw Select "inner word" 460|v_aW| N aW Select "a |WORD|" 461|v_iW| N iW Select "inner |WORD|" 462|v_as| N as Select "a sentence" 463|v_is| N is Select "inner sentence" 464|v_ap| N ap Select "a paragraph" 465|v_ip| N ip Select "inner paragraph" 466|v_ab| N ab Select "a block" (from "[(" to "])") 467|v_ib| N ib Select "inner block" (from "[(" to "])") 468|v_aB| N aB Select "a Block" (from "[{" to "]}") 469|v_iB| N iB Select "inner Block" (from "[{" to "]}") 470------------------------------------------------------------------------------ 471*Q_re* Repeating commands 472 473|.| N . repeat last change (with count replaced with N) 474|q| q{a-z} record typed characters into register {a-z} 475|q| q{A-Z} record typed characters, appended to register {a-z} 476|q| q stop recording 477|@| N @{a-z} execute the contents of register {a-z} (N times) 478|@@| N @@ repeat previous @{a-z} (N times) 479|:@| :@{a-z} execute the contents of register {a-z} as an Ex 480 command 481|:@@| :@@ repeat previous :@{a-z} 482|:g| :[range]g[lobal]/{pattern}/[cmd] 483 Execute Ex command [cmd] (default: ":p") on the lines 484 within [range] where {pattern} matches. 485|:g| :[range]g[lobal]!/{pattern}/[cmd] 486 Execute Ex command [cmd] (default: ":p") on the lines 487 within [range] where {pattern} does NOT match. 488|:so| :so[urce] {file} 489 Read Ex commands from {file}. 490|:so| :so[urce]! {file} 491 Read Vim commands from {file}. 492|:sl| :sl[eep] [sec] 493 don't do anything for [sec] seconds 494|gs| N gs Goto Sleep for N seconds 495------------------------------------------------------------------------------ 496*Q_km* Key mapping 497 498|:map| :ma[p] {lhs} {rhs} Map {lhs} to {rhs} in Normal and Visual 499 mode. 500|:map!| :ma[p]! {lhs} {rhs} Map {lhs} to {rhs} in Insert and Command-line 501 mode. 502|:noremap| :no[remap][!] {lhs} {rhs} 503 Same as ":map", no remapping for this {rhs} 504|:unmap| :unm[ap] {lhs} Remove the mapping of {lhs} for Normal and 505 Visual mode. 506|:unmap!| :unm[ap]! {lhs} Remove the mapping of {lhs} for Insert and 507 Command-line mode. 508|:map_l| :ma[p] [lhs] List mappings (starting with [lhs]) for 509 Normal and Visual mode. 510|:map_l!| :ma[p]! [lhs] List mappings (starting with [lhs]) for 511 Insert and Command-line mode. 512|:cmap| :cmap/:cunmap/:cnoremap 513 like ":map!"/":unmap!"/":noremap!" but for 514 Command-line mode only 515|:imap| :imap/:iunmap/:inoremap 516 like ":map!"/":unmap!"/":noremap!" but for 517 Insert mode only 518|:nmap| :nmap/:nunmap/:nnoremap 519 like ":map"/":unmap"/":noremap" but for 520 Normal mode only 521|:vmap| :vmap/:vunmap/:vnoremap 522 like ":map"/":unmap"/":noremap" but for 523 Visual mode only 524|:omap| :omap/:ounmap/:onoremap 525 like ":map"/":unmap"/":noremap" but only for 526 when an operator is pending 527|:mapc| :mapc[lear] remove mappings for Normal and Visual mode 528|:mapc| :mapc[lear]! remove mappings for Insert and Cmdline mode 529|:imapc| :imapc[lear] remove mappings for Insert mode 530|:vmapc| :vmapc[lear] remove mappings for Visual mode 531|:omapc| :omapc[lear] remove mappings for Operator-pending mode 532|:nmapc| :nmapc[lear] remove mappings for Normal mode 533|:cmapc| :cmapc[lear] remove mappings for Cmdline mode 534|:mkexrc| :mk[exrc][!] [file] write current mappings, abbreviations, and 535 settings to [file] (default: ".exrc"; 536 use ! to overwrite) 537|:mkvimrc| :mkv[imrc][!] [file] 538 same as ":mkexrc", but with default ".vimrc" 539|:mksession| :mks[ession][!] [file] 540 like ":mkvimrc", but store current files, 541 windows, etc. too, to be able to continue 542 this session later. 543------------------------------------------------------------------------------ 544*Q_ab* Abbreviations 545 546|:abbreviate| :ab[breviate] {lhs} {rhs} add abbreviation for {lhs} to {rhs} 547|:abbreviate| :ab[breviate] {lhs} show abbr's that start with {lhs} 548|:abbreviate| :ab[breviate] show all abbreviations 549|:unabbreviate| :una[bbreviate] {lhs} remove abbreviation for {lhs} 550|:noreabbrev| :norea[bbrev] [lhs] [rhs] like ":ab", but don't remap [rhs] 551|:iabbrev| :iab/:iunab/:inoreab like ":ab", but only for Insert mode 552|:cabbrev| :cab/:cunab/:cnoreab like ":ab", but only for 553 Command-line mode 554|:abclear| :abc[lear] remove all abbreviations 555|:cabclear| :cabc[lear] remove all abbr's for Cmdline mode 556|:iabclear| :iabc[lear] remove all abbr's for Insert mode 557------------------------------------------------------------------------------ 558*Q_op* Options 559 560|:set| :se[t] Show all modified options. 561|:set| :se[t] all Show all non-termcap options. 562|:set| :se[t] termcap Show all termcap options. 563|:set| :se[t] {option} Set boolean option (switch it on), 564 show string or number option. 565|:set| :se[t] no{option} Reset boolean option (switch it off). 566|:set| :se[t] inv{option} invert boolean option. 567|:set| :se[t] {option}={value} Set string/number option to {value}. 568|:set| :se[t] {option}+={value} append {value} to string option, add 569 {value} to number option 570|:set| :se[t] {option}-={value} remove {value} to string option, 571 subtract {value} from number option 572|:set| :se[t] {option}? Show value of {option}. 573|:set| :se[t] {option}& Reset {option} to its default value. 574 575|:setlocal| :setl[ocal] like ":set" but set the local value 576 for options that have one 577|:setglobal| :setg[lobal] like ":set" but set the global value 578 of a local option 579 580|:fix| :fix[del] Set value of 't_kD' according to 581 value of 't_kb'. 582|:options| :opt[ions] Open a new window to view and set 583 options, grouped by functionality, 584 a one line explanation and links to 585 the help. 586 587Short explanation of each option: *option-list* 588|'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew) 589|'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode 590|'altkeymap'| |'akm'| for default second language (Farsi/Hebrew) 591|'ambiwidth'| |'ambw'| what to do with Unicode chars of ambiguous width 592|'antialias'| |'anti'| Mac OS X: use smooth, antialiased fonts 593|'autochdir'| |'acd'| change directory to the file in the current window 594|'arabic'| |'arab'| for Arabic as a default second language 595|'arabicshape'| |'arshape'| do shaping for Arabic characters 596|'autoindent'| |'ai'| take indent for new line from previous line 597|'autoread'| |'ar'| autom. read file when changed outside of Vim 598|'autowrite'| |'aw'| automatically write file if changed 599|'autowriteall'| |'awa'| as 'autowrite', but works with more commands 600|'background'| |'bg'| "dark" or "light", used for highlight colors 601|'backspace'| |'bs'| how backspace works at start of line 602|'backup'| |'bk'| keep backup file after overwriting a file 603|'backupcopy'| |'bkc'| make backup as a copy, don't rename the file 604|'backupdir'| |'bdir'| list of directories for the backup file 605|'backupext'| |'bex'| extension used for the backup file 606|'backupskip'| |'bsk'| no backup for files that match these patterns 607|'balloondelay'| |'bdlay'| delay in mS before a balloon may pop up 608|'ballooneval'| |'beval'| switch on balloon evaluation 609|'binary'| |'bin'| read/write/edit file in binary mode 610|'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters 611|'bomb'| prepend a Byte Order Mark to the file 612|'breakat'| |'brk'| characters that may cause a line break 613|'browsedir'| |'bsdir'| which directory to start browsing in 614|'bufhidden'| |'bh'| what to do when buffer is no longer in window 615|'buflisted'| |'bl'| whether the buffer shows up in the buffer list 616|'buftype'| |'bt'| special type of buffer 617|'casemap'| |'cmp'| specifies how case of letters is changed 618|'cdpath'| |'cd'| list of directories searched with ":cd" 619|'cedit'| key used to open the command-line window 620|'charconvert'| |'ccv'| expression for character encoding conversion 621|'cindent'| |'cin'| do C program indenting 622|'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set 623|'cinoptions'| |'cino'| how to do indenting when 'cindent' is set 624|'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent 625|'clipboard'| |'cb'| use the clipboard as the unnamed register 626|'cmdheight'| |'ch'| number of lines to use for the command-line 627|'cmdwinheight'| |'cwh'| height of the command-line window 628|'columns'| |'co'| number of columns in the display 629|'comments'| |'com'| patterns that can start a comment line 630|'commentstring'| |'cms'| template for comments; used for fold marker 631|'compatible'| |'cp'| behave Vi-compatible as much as possible 632|'complete'| |'cpt'| specify how Insert mode completion works 633|'completefunc'| |'cfu'| function to be used for Insert mode completion 634|'confirm'| |'cf'| ask what to do about unsaved/read-only files 635|'conskey'| |'consk'| get keys directly from console (MS-DOS only) 636|'copyindent'| |'ci'| make 'autoindent' use existing indent structure 637|'cpoptions'| |'cpo'| flags for Vi-compatible behavior 638|'cscopepathcomp'| |'cspc'| how many components of the path to show 639|'cscopeprg'| |'csprg'| command to execute cscope 640|'cscopequickfix'| |'csqf'| use quickfix window for cscope results 641|'cscopetag'| |'cst'| use cscope for tag commands 642|'cscopetagorder'| |'csto'| determines ":cstag" search order 643|'cscopeverbose'| |'csverb'| give messages when adding a cscope database 644|'debug'| set to "msg" to see all error messages 645|'define'| |'def'| pattern to be used to find a macro definition 646|'delcombine'| |'deco'| delete combining characters on their own 647|'dictionary'| |'dict'| list of file names used for keyword completion 648|'diff'| use diff mode for the current window 649|'diffexpr'| |'dex'| expression used to obtain a diff file 650|'diffopt'| |'dip'| options for using diff mode 651|'digraph'| |'dg'| enable the entering of digraphs in Insert mode 652|'directory'| |'dir'| list of directory names for the swap file 653|'display'| |'dy'| list of flags for how to display text 654|'eadirection'| |'ead'| in which direction 'equalalways' works 655|'edcompatible'| |'ed'| toggle flags of ":substitute" command 656|'encoding'| |'enc'| encoding used internally 657|'endofline'| |'eol'| write <EOL> for last line in file 658|'equalalways'| |'ea'| windows are automatically made the same size 659|'equalprg'| |'ep'| external program to use for "=" command 660|'errorbells'| |'eb'| ring the bell for error messages 661|'errorfile'| |'ef'| name of the errorfile for the QuickFix mode 662|'errorformat'| |'efm'| description of the lines in the error file 663|'esckeys'| |'ek'| recognize function keys in Insert mode 664|'eventignore'| |'ei'| autocommand events that are ignored 665|'expandtab'| |'et'| use spaces when <Tab> is inserted 666|'exrc'| |'ex'| read .vimrc and .exrc in the current directory 667|'fileencoding'| |'fenc'| file encoding for multi-byte text 668|'fileencodings'| |'fencs'| automatically detected character encodings 669|'fileformat'| |'ff'| file format used for file I/O 670|'fileformats'| |'ffs'| automatically detected values for 'fileformat' 671|'filetype'| |'ft'| type of file, used for autocommands 672|'fillchars'| |'fcs'| characters to use for displaying special items 673|'fkmap'| |'fk'| Farsi keyboard mapping 674|'foldclose'| |'fcl'| close a fold when the cursor leaves it 675|'foldcolumn'| |'fdc'| width of the column used to indicate folds 676|'foldenable'| |'fen'| set to display all folds open 677|'foldexpr'| |'fde'| expression used when 'foldmethod' is "expr" 678|'foldignore'| |'fdi'| ignore lines when 'foldmethod' is "indent" 679|'foldlevel'| |'fdl'| close folds with a level higher than this 680|'foldlevelstart'| |'fdls'| 'foldlevel' when starting to edit a file 681|'foldmarker'| |'fmr'| markers used when 'foldmethod' is "marker" 682|'foldmethod'| |'fdm'| folding type 683|'foldminlines'| |'fml'| minimum number of lines for a fold to be closed 684|'foldnestmax'| |'fdn'| maximum fold depth 685|'foldopen'| |'fdo'| for which commands a fold will be opened 686|'foldtext'| |'fdt'| expression used to display for a closed fold 687|'formatoptions'| |'fo'| how automatic formatting is to be done 688|'formatprg'| |'fp'| name of external program used with "gq" command 689|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on 690|'grepformat'| |'gfm'| format of 'grepprg' output 691|'grepprg'| |'gp'| program to use for ":grep" 692|'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking 693|'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used 694|'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used 695|'guifontwide'| |'gfw'| list of font names for double-wide characters 696|'guiheadroom'| |'ghr'| GUI: pixels room for window decorations 697|'guioptions'| |'go'| GUI: Which components and options are used 698|'guipty'| GUI: try to use a pseudo-tty for ":!" commands 699|'helpfile'| |'hf'| full path name of the main help file 700|'helpheight'| |'hh'| minimum height of a new help window 701|'helplang'| |'hlg'| preferred help languages 702|'hidden'| |'hid'| don't unload buffer when it is |abandon|ed 703|'highlight'| |'hl'| sets highlighting mode for various occasions 704|'hlsearch'| |'hls'| highlight matches with last search pattern 705|'history'| |'hi'| number of command-lines that are remembered 706|'hkmap'| |'hk'| Hebrew keyboard mapping 707|'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping 708|'icon'| let Vim set the text of the window icon 709|'iconstring'| string to use for the Vim icon text 710|'ignorecase'| |'ic'| ignore case in search patterns 711|'imactivatekey'| |'imak'| key that activates the X input method 712|'imcmdline'| |'imc'| use IM when starting to edit a command line 713|'imdisable'| |'imd'| do not use the IM in any mode 714|'iminsert'| |'imi'| use :lmap or IM in Insert mode 715|'imsearch'| |'ims'| use :lmap or IM when typing a search pattern 716|'include'| |'inc'| pattern to be used to find an include file 717|'includeexpr'| |'inex'| expression used to process an include line 718|'incsearch'| |'is'| highlight match while typing search pattern 719|'indentexpr'| |'inde'| expression used to obtain the indent of a line 720|'indentkeys'| |'indk'| keys that trigger indenting with 'indentexpr' 721|'infercase'| |'inf'| adjust case of match for keyword completion 722|'insertmode'| |'im'| start the edit of a file in Insert mode 723|'isfname'| |'isf'| characters included in file names and pathnames 724|'isident'| |'isi'| characters included in identifiers 725|'iskeyword'| |'isk'| characters included in keywords 726|'isprint'| |'isp'| printable characters 727|'joinspaces'| |'js'| two spaces after a period with a join command 728|'key'| encryption key 729|'keymap'| |'kmp'| name of a keyboard mapping 730|'keymodel'| |'km'| enable starting/stopping selection with keys 731|'keywordprg'| |'kp'| program to use for the "K" command 732|'langmap'| |'lmap'| alphabetic characters for other language mode 733|'langmenu'| |'lm'| language to be used for the menus 734|'laststatus'| |'ls'| tells when last window has status lines 735|'lazyredraw'| |'lz'| don't redraw while executing macros 736|'linebreak'| |'lbr'| wrap long lines at a blank 737|'lines'| number of lines in the display 738|'linespace'| |'lsp'| number of pixel lines to use between characters 739|'lisp'| automatic indenting for Lisp 740|'lispwords'| |'lw'| words that change how lisp indenting works 741|'list'| show <Tab> and <EOL> 742|'listchars'| |'lcs'| characters for displaying in list mode 743|'loadplugins'| |'lpl'| load plugin scripts when starting up 744|'magic'| changes special characters in search patterns 745|'makeef'| |'mef'| name of the errorfile for ":make" 746|'makeprg'| |'mp'| program to use for the ":make" command 747|'matchpairs'| |'mps'| pairs of characters that "%" can match 748|'matchtime'| |'mat'| tenths of a second to show matching paren 749|'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions 750|'maxmapdepth'| |'mmd'| maximum recursive depth for mapping 751|'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer 752|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers 753|'menuitems'| |'mis'| maximum number of items in a menu 754|'modeline'| |'ml'| recognize modelines at start or end of file 755|'modelines'| |'mls'| number of lines checked for modelines 756|'modifiable'| |'ma'| changes to the text are not possible 757|'modified'| |'mod'| buffer has been modified 758|'more'| pause listings when the whole screen is filled 759|'mouse'| enable the use of mouse clicks 760|'mousefocus'| |'mousef'| keyboard focus follows the mouse 761|'mousehide'| |'mh'| hide mouse pointer while typing 762|'mousemodel'| |'mousem'| changes meaning of mouse buttons 763|'mouseshape'| |'mouses'| shape of the mouse pointer in different modes 764|'mousetime'| |'mouset'| max time between mouse double-click 765|'nrformats'| |'nf'| number formats recognized for CTRL-A command 766|'number'| |'nu'| print the line number in front of each line 767|'osfiletype'| |'oft'| operating system-specific filetype information 768|'paragraphs'| |'para'| nroff macros that separate paragraphs 769|'paste'| allow pasting text 770|'pastetoggle'| |'pt'| key code that causes 'paste' to toggle 771|'patchexpr'| |'pex'| expression used to patch a file 772|'patchmode'| |'pm'| keep the oldest version of a file 773|'path'| |'pa'| list of directories searched with "gf" et.al. 774|'preserveindent'| |'pi'| preserve the indent structure when reindenting 775|'previewheight'| |'pvh'| height of the preview window 776|'previewwindow'| |'pvw'| identifies the preview window 777|'printdevice'| |'pdev'| name of the printer to be used for :hardcopy 778|'printencoding'| |'penc'| encoding to be used for printing 779|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy 780|'printfont'| |'pfn'| name of the font to be used for :hardcopy 781|'printheader'| |'pheader'| format of the header used for :hardcopy 782|'printoptions'| |'popt'| controls the format of :hardcopy output 783|'quoteescape'| |'qe'| escape characters used in a string 784|'readonly'| |'ro'| disallow writing the buffer 785|'remap'| allow mappings to work recursively 786|'report'| threshold for reporting nr. of lines changed 787|'restorescreen'| |'rs'| Win32: restore screen when exiting 788|'revins'| |'ri'| inserting characters will work backwards 789|'rightleft'| |'rl'| window is right-to-left oriented 790|'rightleftcmd'| |'rlc'| commands for which editing works right-to-left 791|'ruler'| |'ru'| show cursor line and column in the status line 792|'rulerformat'| |'ruf'| custom format for the ruler 793|'runtimepath'| |'rtp'| list of directories used for runtime files 794|'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D 795|'scrollbind'| |'scb'| scroll in window as other windows scroll 796|'scrolljump'| |'sj'| minimum number of lines to scroll 797|'scrolloff'| |'so'| minimum nr. of lines above and below cursor 798|'scrollopt'| |'sbo'| how 'scrollbind' should behave 799|'sections'| |'sect'| nroff macros that separate sections 800|'secure'| secure mode for reading .vimrc in current dir 801|'selection'| |'sel'| what type of selection to use 802|'selectmode'| |'slm'| when to use Select mode instead of Visual mode 803|'sessionoptions'| |'ssop'| options for |:mksession| 804|'shell'| |'sh'| name of shell to use for external commands 805|'shellcmdflag'| |'shcf'| flag to shell to execute one command 806|'shellpipe'| |'sp'| string to put output of ":make" in error file 807|'shellquote'| |'shq'| quote character(s) for around shell command 808|'shellredir'| |'srr'| string to put output of filter in a temp file 809|'shellslash'| |'ssl'| use forward slash for shell file names 810|'shelltype'| |'st'| Amiga: influences how to use a shell 811|'shellxquote'| |'sxq'| like 'shellquote', but include redirection 812|'shiftround'| |'sr'| round indent to multiple of shiftwidth 813|'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step 814|'shortmess'| |'shm'| list of flags, reduce length of messages 815|'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars 816|'showbreak'| |'sbr'| string to use at the start of wrapped lines 817|'showcmd'| |'sc'| show (partial) command in status line 818|'showfulltag'| |'sft'| show full tag pattern when completing tag 819|'showmatch'| |'sm'| briefly jump to matching bracket if insert one 820|'showmode'| |'smd'| message on status line to show current mode 821|'sidescroll'| |'ss'| minimum number of columns to scroll horizontal 822|'sidescrolloff'| |'siso'| min. nr. of columns to left and right of cursor 823|'smartcase'| |'scs'| no ignore case when pattern has uppercase 824|'smartindent'| |'si'| smart autoindenting for C programs 825|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab> 826|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing 827|'splitbelow'| |'sb'| new window from split is below the current one 828|'splitright'| |'spr'| new window is put right of the current one 829|'startofline'| |'sol'| commands move cursor to first blank in line 830|'statusline'| |'stl'| custom format for the status line 831|'suffixes'| |'su'| suffixes that are ignored with multiple match 832|'suffixesadd'| |'sua'| suffixes added when searching for a file 833|'swapfile'| |'swf'| whether to use a swapfile for a buffer 834|'swapsync'| |'sws'| how to sync the swap file 835|'switchbuf'| |'swb'| sets behavior when switching to another buffer 836|'syntax'| |'syn'| syntax to be loaded for current buffer 837|'tabstop'| |'ts'| number of spaces that <Tab> in file uses 838|'tagbsearch'| |'tbs'| use binary searching in tags files 839|'taglength'| |'tl'| number of significant characters for a tag 840|'tagrelative'| |'tr'| file names in tag file are relative 841|'tags'| |'tag'| list of file names used by the tag command 842|'tagstack'| |'tgst'| push tags onto the tag stack 843|'term'| name of the terminal 844|'termbidi'| |'tbidi'| terminal takes care of bi-directionality 845|'termencoding'| |'tenc'| character encoding used by the terminal 846|'terse'| shorten some messages 847|'textauto'| |'ta'| obsolete, use 'fileformats' 848|'textmode'| |'tx'| obsolete, use 'fileformat' 849|'textwidth'| |'tw'| maximum width of text that is being inserted 850|'thesaurus'| |'tsr'| list of thesaurus files for keyword completion 851|'tildeop'| |'top'| tilde command "~" behaves like an operator 852|'timeout'| |'to'| time out on mappings and key codes 853|'timeoutlen'| |'tm'| time out time in milliseconds 854|'title'| let Vim set the title of the window 855|'titlelen'| percentage of 'columns' used for window title 856|'titleold'| old title, restored when exiting 857|'titlestring'| string to use for the Vim window title 858|'toolbar'| |'tb'| GUI: which items to show in the toolbar 859|'toolbariconsize'| |'tbis'| size of the toolbar icons (for GTK 2 only) 860|'ttimeout'| time out on mappings 861|'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds 862|'ttybuiltin'| |'tbi'| use built-in termcap before external termcap 863|'ttyfast'| |'tf'| indicates a fast terminal connection 864|'ttymouse'| |'ttym'| type of mouse codes generated 865|'ttyscroll'| |'tsl'| maximum number of lines for a scroll 866|'ttytype'| |'tty'| alias for 'term' 867|'undolevels'| |'ul'| maximum number of changes that can be undone 868|'updatecount'| |'uc'| after this many characters flush swap file 869|'updatetime'| |'ut'| after this many milliseconds flush swap file 870|'verbose'| |'vbs'| give informative messages 871|'viewdir'| |'vdir'| directory where to store files with :mkview 872|'viewoptions'| |'vop'| specifies what to save for :mkview 873|'viminfo'| |'vi'| use .viminfo file upon startup and exiting 874|'virtualedit'| |'ve'| when to use virtual editing 875|'visualbell'| |'vb'| use visual bell instead of beeping 876|'warn'| warn for shell command when buffer was changed 877|'weirdinvert'| |'wi'| for terminals that have weird inversion method 878|'whichwrap'| |'ww'| allow specified keys to cross line boundaries 879|'wildchar'| |'wc'| command-line character for wildcard expansion 880|'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped 881|'wildignore'| |'wig'| files matching these patterns are not completed 882|'wildmenu'| |'wmnu'| use menu for command line completion 883|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion 884|'winaltkeys'| |'wak'| when the windows system handles ALT keys 885|'winheight'| |'wh'| minimum number of lines for the current window 886|'winfixheight'| |'wfh'| keep window height when opening/closing windows 887|'winminheight'| |'wmh'| minimum number of lines for any window 888|'winminwidth'| |'wmw'| minimal number of columns for any window 889|'winwidth'| |'wiw'| minimal number of columns for current window 890|'wrap'| long lines wrap and continue on the next line 891|'wrapmargin'| |'wm'| chars from the right where wrapping starts 892|'wrapscan'| |'ws'| searches wrap around the end of the file 893|'write'| writing to a file is allowed 894|'writeany'| |'wa'| write to file with no need for "!" override 895|'writebackup'| |'wb'| make a backup before overwriting a file 896|'writedelay'| |'wd'| delay this many msec for each char (for debug) 897------------------------------------------------------------------------------ 898*Q_ur* Undo/Redo commands 899 900|u| N u undo last N changes 901|CTRL-R| N CTRL-R redo last N undone changes 902|U| U restore last changed line 903------------------------------------------------------------------------------ 904*Q_et* External commands 905 906|:shell| :sh[ell] start a shell 907|:!| :!{command} execute {command} with a shell 908|K| K lookup keyword under the cursor with 909 'keywordprg' program (default: "man") 910------------------------------------------------------------------------------ 911*Q_qf* Quickfix commands 912 913|:cc| :cc [nr] display error [nr] (default is the same again) 914|:cnext| :cn display the next error 915|:cprevious| :cp display the previous error 916|:clist| :cl list all errors 917|:cfile| :cf read errors from the file 'errorfile' 918|:cquit| :cq quit without writing and return error code (to 919 the compiler) 920|:make| :make [args] start make, read errors, and jump to first 921 error 922|:grep| :gr[ep] [args] execute 'grepprg' to find matches and jump to 923 the first one. 924------------------------------------------------------------------------------ 925*Q_vc* Various commands 926 927|CTRL-L| CTRL-L Clear and redraw the screen. 928|CTRL-G| CTRL-G show current file name (with path) and cursor 929 position 930|ga| ga show ascii value of character under cursor in 931 decimal, hex, and octal 932|g_CTRL-G| g CTRL-G show cursor column, line, and character 933 position 934|CTRL-C| CTRL-C during searches: Interrupt the search 935|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search 936|<Del>| <Del> while entering a count: delete last character 937|:version| :ve[rsion] show version information 938|:mode| :mode N MS-DOS: set screen mode to N (number, C80, 939 C4350, etc.) 940|:normal| :norm[al][!] {commands} 941 Execute Normal mode commands. 942|Q| Q switch to "Ex" mode 943 944|:redir| :redir >{file} redirect messages to {file} 945|:silent| :silent[!] {command} execute {command} silently 946|:confirm| :confirm {command} quit, write, etc., asking about 947 unsaved changes or read-only files. 948|:browse| :browse {command} open/read/write file, using a 949 file selection dialog 950------------------------------------------------------------------------------ 951*Q_ce* Command-line editing 952 953|c_<Esc>| <Esc> abandon command-line (if 'wildchar' is 954 <Esc>, type it twice) 955 956|c_CTRL-V| CTRL-V {char} insert {char} literally 957|c_CTRL-V| CTRL-V {number} enter decimal value of character (up to 958 three digits) 959|c_CTRL-K| CTRL-K {char1} {char2} 960 enter digraph (See |Q_di|) 961|c_CTRL-R| CTRL-R {0-9a-z"%#:-=} 962 insert the contents of a register 963 964|c_<Left>| <Left>/<Right> cursor left/right 965|c_<S-Left>| <S-Left>/<S-Right> cursor one word left/right 966|c_CTRL-B| CTRL-B/CTRL-E cursor to beginning/end of command-line 967 968|c_<BS>| <BS> delete the character in front of the cursor 969|c_<Del>| <Del> delete the character under the cursor 970|c_CTRL-W| CTRL-W delete the word in front of the cursor 971|c_CTRL-U| CTRL-U remove all characters 972 973|c_<Up>| <Up>/<Down> recall older/newer command-line that starts 974 with current command 975|c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history 976|:history| :his[tory] show older command-lines 977 978Context-sensitive completion on the command-line: 979 980|c_wildchar| 'wildchar' (default: <Tab>) 981 do completion on the pattern in front of the 982 cursor. If there are multiple matches, 983 beep and show the first one; further 984 'wildchar' will show the next ones. 985|c_CTRL-D| CTRL-D list all names that match the pattern in 986 front of the cursor 987|c_CTRL-A| CTRL-A insert all names that match pattern in front 988 of cursor 989|c_CTRL-L| CTRL-L insert longest common part of names that 990 match pattern 991|c_CTRL-N| CTRL-N after 'wildchar' with multiple matches: go 992 to next match 993|c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go 994 to previous match 995------------------------------------------------------------------------------ 996*Q_ra* Ex ranges 997 998|:range| , separates two line numbers 999|:range| ; idem, set cursor to the first line number 1000 before interpreting the second one 1001 1002|:range| {number} an absolute line number 1003|:range| . the current line 1004|:range| $ the last line in the file 1005|:range| % equal to 1,$ (the entire file) 1006|:range| * equal to '<,'> (visual area) 1007|:range| 't position of mark t 1008|:range| /{pattern}[/] the next line where {pattern} matches 1009|:range| ?{pattern}[?] the previous line where {pattern} matches 1010 1011|:range| +[num] add [num] to the preceding line number 1012 (default: 1) 1013|:range| -[num] subtract [num] from the preceding line 1014 number (default: 1) 1015------------------------------------------------------------------------------ 1016*Q_ex* Special Ex characters 1017 1018|:bar| | separates two commands (not for ":global" and ":!") 1019|:quote| " begins comment 1020 1021|:_%| % current file name (only where a file name is expected) 1022|:_#| #[num] alternate file name [num] (only where a file name is 1023 expected) 1024 Note: The next four are typed literally; these are not special keys! 1025|:<cword>| <cword> word under the cursor (only where a file name is 1026 expected) 1027|:<cWORD>| <cWORD> WORD under the cursor (only where a file name is 1028 expected) (see |WORD|) 1029|:<cfile>| <cfile> file name under the cursor (only where a file name is 1030 expected) 1031|:<afile>| <afile> file name for autocommand (only where a file name is 1032 expected) 1033|:<sfile>| <sfile> file name of a ":source"d file, within that file (only 1034 where a file name is expected) 1035 1036 After "%", "#", "<cfile>", "<sfile>" or "<afile>" 1037 |::p| :p full path 1038 |::h| :h head (file name removed) 1039 |::t| :t tail (file name only) 1040 |::r| :r root (extension removed) 1041 |::e| :e extension 1042 |::s| :s/{pat}/{repl}/ substitute {pat} with {repl} 1043------------------------------------------------------------------------------ 1044*Q_ed* Editing a file 1045 1046 Without !: Fail if changes has been made to the current buffer. 1047 With !: Discard any changes to the current buffer. 1048|:edit_f| :e[dit][!] {file} Edit {file}. 1049|:edit| :e[dit][!] Reload the current file. 1050|:enew| :ene[w][!] Edit a new, unnamed buffer. 1051|:find| :fin[d][!] {file} Find {file} in 'path' and edit it. 1052 1053|CTRL-^| N CTRL-^ Edit alternate file N (equivalent to ":e #N"). 1054|gf| gf or ]f Edit the file whose name is under the cursor 1055|:pwd| :pwd Print the current directory name. 1056|:cd| :cd [path] Change the current directory to [path]. 1057|:cd-| :cd - Back to previous current directory. 1058|:file| :f[ile] Print the current file name and the cursor 1059 position. 1060|:file| :f[ile] {name} Set the current file name to {name}. 1061|:files| :files Show alternate file names. 1062------------------------------------------------------------------------------ 1063*Q_fl* Using the argument list |argument-list| 1064 1065|:args| :ar[gs] Print the argument list, with the current file 1066 in "[]". 1067|:all| :all or :sall Open a window for every file in the arg list. 1068|:wn| :wn[ext][!] Write file and edit next file. 1069|:wn| :wn[ext][!] {file} Write to {file} and edit next file, unless 1070 {file} exists. With !, overwrite existing 1071 file. 1072|:wN| :wN[ext][!] [file] Write file and edit previous file. 1073 1074 in current window in new window ~ 1075|:argument| :argu[ment] N :sar[gument] N Edit file N 1076|:next| :n[ext] :sn[ext] Edit next file 1077|:next_f| :n[ext] {arglist} :sn[ext] {arglist} define new arg list 1078 and edit first file 1079|:Next| :N[ext] :sN[ext] Edit previous file 1080|:first| :fir[st] :sfir[st] Edit first file 1081|:last| :la[st] :sla[st] Edit last file 1082------------------------------------------------------------------------------ 1083*Q_wq* Writing and quitting 1084 1085|:w| :[range]w[rite][!] Write to the current file. 1086|:w_f| :[range]w[rite] {file} Write to {file}, unless it already 1087 exists. 1088|:w_f| :[range]w[rite]! {file} Write to {file}. Overwrite an existing 1089 file. 1090|:w_a| :[range]w[rite][!] >> Append to the current file. 1091|:w_a| :[range]w[rite][!] >> {file} Append to {file}. 1092|:w_c| :[range]w[rite] !{cmd} Execute {cmd} with [range] lines as 1093 standard input. 1094|:up| :[range]up[date][!] write to current file if modified 1095|:wall| :wa[ll][!] write all changed buffers 1096 1097|:q| :q[uit] Quit current buffer, unless changes have been 1098 made. Exit Vim when there are no other 1099 non-help buffers 1100|:q| :q[uit]! Quit current buffer always, discard any 1101 changes. Exit Vim when there are no other 1102 non-help buffers 1103|:qa| :qa[ll] Exit Vim, unless changes have been made. 1104|:qa| :qa[ll]! Exit Vim always, discard any changes. 1105|:cq| :cq Quit without writing and return error code. 1106 1107|:wq| :wq[!] Write the current file and exit. 1108|:wq| :wq[!] {file} Write to {file} and exit. 1109|:xit| :x[it][!] [file] Like ":wq" but write only when changes have 1110 been made 1111|ZZ| ZZ Same as ":x". 1112|ZQ| ZQ Same as ":q!". 1113|:xall| :xa[ll][!] or :wqall[!] 1114 Write all changed buffers and exit 1115 1116|:stop| :st[op][!] Suspend VIM or start new shell. If 'aw' option 1117 is set and [!] not given write the buffer. 1118|CTRL-Z| CTRL-Z Same as ":stop" 1119------------------------------------------------------------------------------ 1120*Q_st* Starting VIM 1121 1122|-vim| vim [options] start editing with an empty buffer 1123|-file| vim [options] {file} .. start editing one or more files 1124|--| vim [options] - read file from stdin 1125|-tag| vim [options] -t {tag} edit the file associated with {tag} 1126|-qf| vim [options] -q [fname] start editing in QuickFix mode, 1127 display the first error 1128 1129 Vim arguments: 1130 1131|-gui| -g start GUI (also allows other options) 1132 1133|-+| +[num] put the cursor at line [num] (default: last line) 1134|-+c| +{command} execute {command} after loading the file 1135|-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat} 1136|-v| -v Vi mode, start ex in Normal mode 1137|-e| -e Ex mode, start vim in Ex mode 1138|-R| -R Read-only mode, implies -n 1139|-m| -m modifications not allowed (resets 'write' option) 1140|-b| -b binary mode 1141|-l| -l lisp mode 1142|-A| -A Arabic mode ('arabic' is set) 1143|-F| -F Farsi mode ('fkmap' and 'rightleft' are set) 1144|-H| -H Hebrew mode ('hkmap' and 'rightleft' are set) 1145|-V| -V Verbose, give informative messages 1146|-C| -C Compatible, set the 'compatible' option 1147|-N| -N Nocompatible, reset the 'compatible' option 1148|-r| -r give list of swap files 1149|-r| -r {file} .. recover aborted edit session 1150|-n| -n do not create a swap file 1151|-o| -o [num] open [num] windows (default: one for each file) 1152|-f| -f GUI: foreground process, don't fork 1153 Amiga: do not restart VIM to open a window (for 1154 e.g., mail) 1155|-s| -s {scriptin} first read commands from the file {scriptin} 1156|-w| -w {scriptout} write typed chars to file {scriptout} (append) 1157|-W| -W {scriptout} write typed chars to file {scriptout} (overwrite) 1158|-T| -T {terminal} set terminal name 1159|-d| -d {device} Amiga: open {device} to be used as a console 1160|-u| -u {vimrc} read inits from {vimrc} instead of other inits 1161|-U| -U {gvimrc} idem, for when starting the GUI 1162|-i| -i {viminfo} read info from {viminfo} instead of other files 1163|---| -- end of options, other arguments are file names 1164|--help| --help show list of arguments and exit 1165|--version| --version show version info and exit 1166|--| - Read file from stdin. 1167------------------------------------------------------------------------------ 1168*Q_ac* Automatic Commands 1169 1170|viminfo-file| Read registers, marks, history at startup, save when exiting. 1171 1172|:rviminfo| :rv[iminfo] [file] Read info from viminfo file [file] 1173|:rviminfo| :rv[iminfo]! [file] idem, overwrite existing info 1174|:wviminfo| :wv[iminfo] [file] Add info to viminfo file [file] 1175|:wviminfo| :wv[iminfo]! [file] Write info to viminfo file [file] 1176 1177|modeline| Automatic option setting when editing a file 1178 1179|modeline| vim:{set-arg}: .. In the first and last lines of the 1180 file (see 'ml' option), {set-arg} is 1181 given as an argument to ":set" 1182 1183|autocommand| Automatic execution of commands on certain events. 1184 1185|:autocmd| :au List all autocommands 1186|:autocmd| :au {event} List all autocommands for {event} 1187|:autocmd| :au {event} {pat} List all autocommands for {event} with 1188 {pat} 1189|:autocmd| :au {event} {pat} {cmd} Enter new autocommands for {event} 1190 with {pat} 1191|:autocmd| :au! Remove all autocommands 1192|:autocmd| :au! {event} Remove all autocommands for {event} 1193|:autocmd| :au! * {pat} Remove all autocommands for {pat} 1194|:autocmd| :au! {event} {pat} Remove all autocommands for {event} 1195 with {pat} 1196|:autocmd| :au! {event} {pat} {cmd} Remove all autocommands for {event} 1197 with {pat} and enter new one 1198------------------------------------------------------------------------------ 1199*Q_wi* Multi-window commands 1200 1201|CTRL-W_s| CTRL-W s or :split Split window into two parts 1202|:split_f| :split {file} Split window and edit {file} in one of 1203 them 1204|:vsplit| :vsplit {file} Same, but split vertically 1205|:vertical| :vertical {cmd} Make {cmd} split vertically 1206 1207|:sfind| :sf[ind] {file} Split window, find {file} in 'path' 1208 and edit it. 1209|CTRL-W_]| CTRL-W ] Split window and jump to tag under 1210 cursor 1211|CTRL-W_f| CTRL-W f Split window and edit file name under 1212 the cursor 1213|CTRL-W_^| CTRL-W ^ Split window and edit alternate file 1214|CTRL-W_n| CTRL-W n or :new Create new empty window 1215|CTRL-W_q| CTRL-W q or :q[uit] Quit editing and close window 1216|CTRL-W_c| CTRL-W c or :cl[ose] Make buffer hidden and close window 1217|CTRL-W_o| CTRL-W o or :on[ly] Make current window only one on the 1218 screen 1219 1220|CTRL-W_j| CTRL-W j Move cursor to window below 1221|CTRL-W_k| CTRL-W k Move cursor to window above 1222|CTRL-W_CTRL-W| CTRL-W CTRL-W Move cursor to window below (wrap) 1223|CTRL-W_W| CTRL-W W Move cursor to window above (wrap) 1224|CTRL-W_t| CTRL-W t Move cursor to top window 1225|CTRL-W_b| CTRL-W b Move cursor to bottom window 1226|CTRL-W_p| CTRL-W p Move cursor to previous active window 1227 1228|CTRL-W_r| CTRL-W r Rotate windows downwards 1229|CTRL-W_R| CTRL-W R Rotate windows upwards 1230|CTRL-W_x| CTRL-W x Exchange current window with next one 1231 1232|CTRL-W_=| CTRL-W = Make all windows equal height 1233|CTRL-W_-| CTRL-W - Decrease current window height 1234|CTRL-W_+| CTRL-W + Increase current window height 1235|CTRL-W__| CTRL-W _ Set current window height (default: 1236 very high) 1237------------------------------------------------------------------------------ 1238*Q_bu* Buffer list commands 1239 1240|:buffers| :buffers or :files list all known buffer and file names 1241 1242|:ball| :ball or :sball edit all args/buffers 1243|:unhide| :unhide or :sunhide edit all loaded buffers 1244 1245|:badd| :badd {fname} add file name {fname} to the list 1246|:bunload| :bunload[!] [N] unload buffer [N] from memory 1247|:bdelete| :bdelete[!] [N] unload buffer [N] and delete it from 1248 the buffer list 1249 1250 in current window in new window ~ 1251|:buffer| :[N]buffer [N] :[N]sbuffer [N] to arg/buf N 1252|:bnext| :[N]bnext [N] :[N]sbnext [N] to Nth next arg/buf 1253|:bNext| :[N]bNext [N] :[N]sbNext [N] to Nth previous arg/buf 1254|:bprevious| :[N]bprevious [N] :[N]sbprevious [N] to Nth previous arg/buf 1255|:bfirst| :bfirst :sbfirst to first arg/buf 1256|:blast| :blast :sblast to last arg/buf 1257|:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf 1258------------------------------------------------------------------------------ 1259*Q_sy* Syntax Highlighting 1260 1261|:syn-on| :syntax on start using syntax highlighting 1262|:syn-off| :syntax off stop using syntax highlighting 1263 1264|:syn-keyword| :syntax keyword {group-name} {keyword} .. 1265 add a syntax keyword item 1266|:syn-match| :syntax match {group-name} {pattern} ... 1267 add syntax match item 1268|:syn-region| :syntax region {group-name} {pattern} ... 1269 add syntax region item 1270|:syn-sync| :syntax sync [ccomment | lines {N} | ...] 1271 tell syntax how to sync 1272|:syntax| :syntax [list] list current syntax items 1273|:syn-clear| :syntax clear clear all syntax info 1274 1275|:highlight| :highlight clear clear all highlight info 1276|:highlight| :highlight {group-name} {key}={arg} .. 1277 set highlighting for {group-name} 1278 1279|:filetype| :filetype on switch on file type detection, without 1280 syntax highlighting 1281|:filetype| :filetype plugin indent on 1282 switch on file type detection, with 1283 automatic indenting and settings 1284------------------------------------------------------------------------------ 1285*Q_gu* GUI commands 1286 1287|:gui| :gui UNIX: start the GUI 1288|:gui| :gui {fname} .. idem, and edit {fname} .. 1289 1290|:menu| :menu list all menus 1291|:menu| :menu {mpath} list menus starting with {mpath} 1292|:menu| :menu {mpath} {rhs} add menu {mpath}, giving {lhs} 1293|:menu| :menu {pri} {mpath} {rhs} 1294 idem, with priorities {pri} 1295|:menu| :menu ToolBar.{name} {rhs} 1296 add toolbar item, giving {lhs} 1297|:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath} 1298|:unmenu| :unmenu {mpath} remove menu {mpath} 1299------------------------------------------------------------------------------ 1300*Q_fo* Folding 1301 1302|'foldmethod'| set foldmethod=manual manual folding 1303 set foldmethod=indent folding by indent 1304 set foldmethod=expr folding by 'foldexpr' 1305 set foldmethod=syntax folding by syntax regions 1306 set foldmethod=marker folding by 'foldmarkers' 1307 1308|zf| zf{motion} operator: Define a fold manually 1309|:fold| :{range}fold define a fold for {range} lines 1310|zd| zd delete one fold under the cursor 1311|zD| zD delete all folds under the cursor 1312 1313|zo| zo open one fold under the cursor 1314|zO| zO open all folds under the cursor 1315|zc| zc close one fold under the cursor 1316|zC| zC close all folds under the cursor 1317 1318|zm| zm fold more: decrease 'foldlevel' 1319|zM| zM close all folds: make 'foldlevel' zero 1320|zr| zr reduce folding: increase 'foldlevel' 1321|zR| zR open all folds: make 'foldlevel' max. 1322 1323|zn| zn fold none: reset 'foldenable' 1324|zN| zN fold normal set 'foldenable' 1325|zi| zi invert 'foldenable' 1326 1327 vim:tw=78:ts=8:ft=help:norl: 1328