comparison runtime/doc/change.txt @ 16553:0e473e9e70c2 v8.1.1280

patch 8.1.1280: remarks about functionality not in Vi clutters the help commit https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 5 18:13:34 2019 +0200 patch 8.1.1280: remarks about functionality not in Vi clutters the help Problem: Remarks about functionality not in Vi clutters the help. Solution: Move all info about what is new in Vim or already existed in Vi to vi_diff.txt. Remove {not in Vi} remarks. (closes #4268) Add "noet" to the help files modeline. Also include many other help file improvements.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 May 2019 18:15:06 +0200
parents 314694a2e74a
children 1eaf34420bb3
comparison
equal deleted inserted replaced
16552:deb3d4f5be8b 16553:0e473e9e70c2
1 *change.txt* For Vim version 8.1. Last change: 2019 Feb 05 1 *change.txt* For Vim version 8.1. Last change: 2019 May 05
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
32 "dl". 32 "dl".
33 The <Del> key does not take a [count]. Instead, it 33 The <Del> key does not take a [count]. Instead, it
34 deletes the last character of the count. 34 deletes the last character of the count.
35 See |:fixdel| if the <Del> key does not do what you 35 See |:fixdel| if the <Del> key does not do what you
36 want. See |'whichwrap'| for deleting a line break 36 want. See |'whichwrap'| for deleting a line break
37 (join lines). {Vi does not support <Del>} 37 (join lines).
38 38
39 *X* *dh* 39 *X* *dh*
40 ["x]X Delete [count] characters before the cursor [into 40 ["x]X Delete [count] characters before the cursor [into
41 register x] (not |linewise|). Does the same as "dh". 41 register x] (not |linewise|). Does the same as "dh".
42 Also see |'whichwrap'|. 42 Also see |'whichwrap'|.
57 ignored. 57 ignored.
58 58
59 {Visual}["x]x or *v_x* *v_d* *v_<Del>* 59 {Visual}["x]x or *v_x* *v_d* *v_<Del>*
60 {Visual}["x]d or 60 {Visual}["x]d or
61 {Visual}["x]<Del> Delete the highlighted text [into register x] (for 61 {Visual}["x]<Del> Delete the highlighted text [into register x] (for
62 {Visual} see |Visual-mode|). {not in Vi} 62 {Visual} see |Visual-mode|).
63 63
64 {Visual}["x]CTRL-H or *v_CTRL-H* *v_<BS>* 64 {Visual}["x]CTRL-H or *v_CTRL-H* *v_<BS>*
65 {Visual}["x]<BS> When in Select mode: Delete the highlighted text [into 65 {Visual}["x]<BS> When in Select mode: Delete the highlighted text [into
66 register x]. 66 register x].
67 67
68 {Visual}["x]X or *v_X* *v_D* *v_b_D* 68 {Visual}["x]X or *v_X* *v_D* *v_b_D*
69 {Visual}["x]D Delete the highlighted lines [into register x] (for 69 {Visual}["x]D Delete the highlighted lines [into register x] (for
70 {Visual} see |Visual-mode|). In Visual block mode, 70 {Visual} see |Visual-mode|). In Visual block mode,
71 "D" deletes the highlighted text plus all text until 71 "D" deletes the highlighted text plus all text until
72 the end of the line. {not in Vi} 72 the end of the line.
73 73
74 *:d* *:de* *:del* *:delete* *:dl* *:dp* 74 *:d* *:de* *:del* *:delete* *:dl* *:dp*
75 :[range]d[elete] [x] Delete [range] lines (default: current line) [into 75 :[range]d[elete] [x] Delete [range] lines (default: current line) [into
76 register x]. 76 register x].
77 Note these weird abbreviations: 77 Note these weird abbreviations:
114 lines available. 114 lines available.
115 115
116 *v_J* 116 *v_J*
117 {Visual}J Join the highlighted lines, with a minimum of two 117 {Visual}J Join the highlighted lines, with a minimum of two
118 lines. Remove the indent and insert up to two spaces 118 lines. Remove the indent and insert up to two spaces
119 (see below). {not in Vi} 119 (see below).
120 120
121 *gJ* 121 *gJ*
122 gJ Join [count] lines, with a minimum of two lines. 122 gJ Join [count] lines, with a minimum of two lines.
123 Don't insert or remove any spaces. {not in Vi} 123 Don't insert or remove any spaces.
124 124
125 *v_gJ* 125 *v_gJ*
126 {Visual}gJ Join the highlighted lines, with a minimum of two 126 {Visual}gJ Join the highlighted lines, with a minimum of two
127 lines. Don't insert or remove any spaces. {not in 127 lines. Don't insert or remove any spaces.
128 Vi}
129 128
130 *:j* *:join* 129 *:j* *:join*
131 :[range]j[oin][!] [flags] 130 :[range]j[oin][!] [flags]
132 Join [range] lines. Same as "J", except with [!] 131 Join [range] lines. Same as "J", except with [!]
133 the join does not insert or delete any spaces. 132 the join does not insert or delete any spaces.
134 If a [range] has equal start and end values, this 133 If a [range] has equal start and end values, this
135 command does nothing. The default behavior is to 134 command does nothing. The default behavior is to
136 join the current line with the line below it. 135 join the current line with the line below it.
137 {not in Vi: !}
138 See |ex-flags| for [flags]. 136 See |ex-flags| for [flags].
139 137
140 :[range]j[oin][!] {count} [flags] 138 :[range]j[oin][!] {count} [flags]
141 Join {count} lines, starting with [range] (default: 139 Join {count} lines, starting with [range] (default:
142 current line |cmdline-ranges|). Same as "J", except 140 current line |cmdline-ranges|). Same as "J", except
143 with [!] the join does not insert or delete any 141 with [!] the join does not insert or delete any
144 spaces. 142 spaces.
145 {not in Vi: !}
146 See |ex-flags| for [flags]. 143 See |ex-flags| for [flags].
147 144
148 These commands delete the <EOL> between lines. This has the effect of joining 145 These commands delete the <EOL> between lines. This has the effect of joining
149 multiple lines into one line. You can repeat these commands (except `:j`) and 146 multiple lines into one line. You can repeat these commands (except `:j`) and
150 undo them. 147 undo them.
207 ["x]S Delete [count] lines [into register x] and start 204 ["x]S Delete [count] lines [into register x] and start
208 insert. Synonym for "cc" |linewise|. 205 insert. Synonym for "cc" |linewise|.
209 206
210 {Visual}["x]c or *v_c* *v_s* 207 {Visual}["x]c or *v_c* *v_s*
211 {Visual}["x]s Delete the highlighted text [into register x] and 208 {Visual}["x]s Delete the highlighted text [into register x] and
212 start insert (for {Visual} see |Visual-mode|). {not 209 start insert (for {Visual} see |Visual-mode|).
213 in Vi}
214 210
215 *v_r* 211 *v_r*
216 {Visual}["x]r{char} Replace all selected characters by {char}. 212 {Visual}["x]r{char} Replace all selected characters by {char}.
217 213
218 *v_C* 214 *v_C*
219 {Visual}["x]C Delete the highlighted lines [into register x] and 215 {Visual}["x]C Delete the highlighted lines [into register x] and
220 start insert. In Visual block mode it works 216 start insert. In Visual block mode it works
221 differently |v_b_C|. {not in Vi} 217 differently |v_b_C|.
222 *v_S* 218 *v_S*
223 {Visual}["x]S Delete the highlighted lines [into register x] and 219 {Visual}["x]S Delete the highlighted lines [into register x] and
224 start insert (for {Visual} see |Visual-mode|). {not 220 start insert (for {Visual} see |Visual-mode|).
225 in Vi}
226 *v_R* 221 *v_R*
227 {Visual}["x]R Currently just like {Visual}["x]S. In a next version 222 {Visual}["x]R Currently just like {Visual}["x]S. In a next version
228 it might work differently. {not in Vi} 223 it might work differently.
229 224
230 Notes: 225 Notes:
231 - You can end Insert and Replace mode with <Esc>. 226 - You can end Insert and Replace mode with <Esc>.
232 - See the section "Insert and Replace mode" |mode-ins-repl| for the other 227 - See the section "Insert and Replace mode" |mode-ins-repl| for the other
233 special characters in these modes. 228 special characters in these modes.
320 315
321 ~{motion} 'tildeop' option: switch case of {motion} text. {Vi: 316 ~{motion} 'tildeop' option: switch case of {motion} text. {Vi:
322 tilde cannot be used as an operator} 317 tilde cannot be used as an operator}
323 318
324 *g~* 319 *g~*
325 g~{motion} Switch case of {motion} text. {not in Vi} 320 g~{motion} Switch case of {motion} text.
326 321
327 g~g~ *g~g~* *g~~* 322 g~g~ *g~g~* *g~~*
328 g~~ Switch case of current line. {not in Vi}. 323 g~~ Switch case of current line.
329 324
330 *v_~* 325 *v_~*
331 {Visual}~ Switch case of highlighted text (for {Visual} see 326 {Visual}~ Switch case of highlighted text (for {Visual} see
332 |Visual-mode|). {not in Vi} 327 |Visual-mode|).
333 328
334 *v_U* 329 *v_U*
335 {Visual}U Make highlighted text uppercase (for {Visual} see 330 {Visual}U Make highlighted text uppercase (for {Visual} see
336 |Visual-mode|). {not in Vi} 331 |Visual-mode|).
337 332
338 *gU* *uppercase* 333 *gU* *uppercase*
339 gU{motion} Make {motion} text uppercase. {not in Vi} 334 gU{motion} Make {motion} text uppercase.
340 Example: > 335 Example: >
341 :map! <C-F> <Esc>gUiw`]a 336 :map! <C-F> <Esc>gUiw`]a
342 < This works in Insert mode: press CTRL-F to make the 337 < This works in Insert mode: press CTRL-F to make the
343 word before the cursor uppercase. Handy to type 338 word before the cursor uppercase. Handy to type
344 words in lowercase and then make them uppercase. 339 words in lowercase and then make them uppercase.
345 340
346 341
347 gUgU *gUgU* *gUU* 342 gUgU *gUgU* *gUU*
348 gUU Make current line uppercase. {not in Vi}. 343 gUU Make current line uppercase.
349 344
350 *v_u* 345 *v_u*
351 {Visual}u Make highlighted text lowercase (for {Visual} see 346 {Visual}u Make highlighted text lowercase (for {Visual} see
352 |Visual-mode|). {not in Vi} 347 |Visual-mode|).
353 348
354 *gu* *lowercase* 349 *gu* *lowercase*
355 gu{motion} Make {motion} text lowercase. {not in Vi} 350 gu{motion} Make {motion} text lowercase.
356 351
357 gugu *gugu* *guu* 352 gugu *gugu* *guu*
358 guu Make current line lowercase. {not in Vi}. 353 guu Make current line lowercase.
359 354
360 *g?* *rot13* 355 *g?* *rot13*
361 g?{motion} Rot13 encode {motion} text. {not in Vi} 356 g?{motion} Rot13 encode {motion} text.
362 357
363 *v_g?* 358 *v_g?*
364 {Visual}g? Rot13 encode the highlighted text (for {Visual} see 359 {Visual}g? Rot13 encode the highlighted text (for {Visual} see
365 |Visual-mode|). {not in Vi} 360 |Visual-mode|).
366 361
367 g?g? *g?g?* *g??* 362 g?g? *g?g?* *g??*
368 g?? Rot13 encode current line. {not in Vi}. 363 g?? Rot13 encode current line.
369 364
370 To turn one line into title caps, make every first letter of a word 365 To turn one line into title caps, make every first letter of a word
371 uppercase: > 366 uppercase: >
372 :s/\v<(.)(\w*)/\u\1\L\2/g 367 :s/\v<(.)(\w*)/\u\1\L\2/g
373 368
374 369
375 Adding and subtracting ~ 370 Adding and subtracting ~
376 *CTRL-A* 371 *CTRL-A*
377 CTRL-A Add [count] to the number or alphabetic character at 372 CTRL-A Add [count] to the number or alphabetic character at
378 or after the cursor. {not in Vi} 373 or after the cursor.
379 374
380 *v_CTRL-A* 375 *v_CTRL-A*
381 {Visual}CTRL-A Add [count] to the number or alphabetic character in 376 {Visual}CTRL-A Add [count] to the number or alphabetic character in
382 the highlighted text. {not in Vi} 377 the highlighted text.
383 378
384 *v_g_CTRL-A* 379 *v_g_CTRL-A*
385 {Visual}g CTRL-A Add [count] to the number or alphabetic character in 380 {Visual}g CTRL-A Add [count] to the number or alphabetic character in
386 the highlighted text. If several lines are 381 the highlighted text. If several lines are
387 highlighted, each one will be incremented by an 382 highlighted, each one will be incremented by an
388 additional [count] (so effectively creating a 383 additional [count] (so effectively creating a
389 [count] incrementing sequence). {not in Vi} 384 [count] incrementing sequence).
390 For Example, if you have this list of numbers: 385 For Example, if you have this list of numbers:
391 1. ~ 386 1. ~
392 1. ~ 387 1. ~
393 1. ~ 388 1. ~
394 1. ~ 389 1. ~
399 3. ~ 394 3. ~
400 4. ~ 395 4. ~
401 396
402 *CTRL-X* 397 *CTRL-X*
403 CTRL-X Subtract [count] from the number or alphabetic 398 CTRL-X Subtract [count] from the number or alphabetic
404 character at or after the cursor. {not in Vi} 399 character at or after the cursor.
405 400
406 *v_CTRL-X* 401 *v_CTRL-X*
407 {Visual}CTRL-X Subtract [count] from the number or alphabetic 402 {Visual}CTRL-X Subtract [count] from the number or alphabetic
408 character in the highlighted text. {not in Vi} 403 character in the highlighted text.
409 404
410 On MS-Windows, this is mapped to cut Visual text 405 On MS-Windows, this is mapped to cut Visual text
411 |dos-standard-mappings|. If you want to disable the 406 |dos-standard-mappings|. If you want to disable the
412 mapping, use this: > 407 mapping, use this: >
413 silent! vunmap <C-X> 408 silent! vunmap <C-X>
415 *v_g_CTRL-X* 410 *v_g_CTRL-X*
416 {Visual}g CTRL-X Subtract [count] from the number or alphabetic 411 {Visual}g CTRL-X Subtract [count] from the number or alphabetic
417 character in the highlighted text. If several lines 412 character in the highlighted text. If several lines
418 are highlighted, each value will be decremented by an 413 are highlighted, each value will be decremented by an
419 additional [count] (so effectively creating a [count] 414 additional [count] (so effectively creating a [count]
420 decrementing sequence). {not in Vi} 415 decrementing sequence).
421 416
422 The CTRL-A and CTRL-X commands can work for: 417 The CTRL-A and CTRL-X commands can work for:
423 - signed and unsigned decimal numbers 418 - signed and unsigned decimal numbers
424 - unsigned binary, octal and hexadecimal numbers 419 - unsigned binary, octal and hexadecimal numbers
425 - alphabetic characters 420 - alphabetic characters
483 *<<* 478 *<<*
484 << Shift [count] lines one 'shiftwidth' leftwards. 479 << Shift [count] lines one 'shiftwidth' leftwards.
485 480
486 *v_<* 481 *v_<*
487 {Visual}[count]< Shift the highlighted lines [count] 'shiftwidth' 482 {Visual}[count]< Shift the highlighted lines [count] 'shiftwidth'
488 leftwards (for {Visual} see |Visual-mode|). {not in 483 leftwards (for {Visual} see |Visual-mode|).
489 Vi}
490 484
491 *>* 485 *>*
492 >{motion} Shift {motion} lines one 'shiftwidth' rightwards. 486 >{motion} Shift {motion} lines one 'shiftwidth' rightwards.
493 487
494 If the 'vartabstop' feature is enabled, and the 488 If the 'vartabstop' feature is enabled, and the
498 *>>* 492 *>>*
499 >> Shift [count] lines one 'shiftwidth' rightwards. 493 >> Shift [count] lines one 'shiftwidth' rightwards.
500 494
501 *v_>* 495 *v_>*
502 {Visual}[count]> Shift the highlighted lines [count] 'shiftwidth' 496 {Visual}[count]> Shift the highlighted lines [count] 'shiftwidth'
503 rightwards (for {Visual} see |Visual-mode|). {not in 497 rightwards (for {Visual} see |Visual-mode|).
504 Vi}
505 498
506 *:<* 499 *:<*
507 :[range]< Shift [range] lines one 'shiftwidth' left. Repeat '<' 500 :[range]< Shift [range] lines one 'shiftwidth' left. Repeat '<'
508 for shifting multiple 'shiftwidth's. 501 for shifting multiple 'shiftwidth's.
509 502
510 :[range]< {count} Shift {count} lines one 'shiftwidth' left, starting 503 :[range]< {count} Shift {count} lines one 'shiftwidth' left, starting
511 with [range] (default current line |cmdline-ranges|). 504 with [range] (default current line |cmdline-ranges|).
512 Repeat '<' for shifting multiple 'shiftwidth's. 505 Repeat '<' for shifting multiple 'shiftwidth's.
513 506
514 :[range]le[ft] [indent] left align lines in [range]. Sets the indent in the 507 :[range]le[ft] [indent] left align lines in [range]. Sets the indent in the
515 lines to [indent] (default 0). {not in Vi} 508 lines to [indent] (default 0).
516 509
517 *:>* 510 *:>*
518 :[range]> [flags] Shift {count} [range] lines one 'shiftwidth' right. 511 :[range]> [flags] Shift {count} [range] lines one 'shiftwidth' right.
519 Repeat '>' for shifting multiple 'shiftwidth's. 512 Repeat '>' for shifting multiple 'shiftwidth's.
520 See |ex-flags| for [flags]. 513 See |ex-flags| for [flags].
577 {filter}. 570 {filter}.
578 571
579 *v_!* 572 *v_!*
580 {Visual}!{filter} Filter the highlighted lines through the external 573 {Visual}!{filter} Filter the highlighted lines through the external
581 program {filter} (for {Visual} see |Visual-mode|). 574 program {filter} (for {Visual} see |Visual-mode|).
582 {not in Vi}
583 575
584 :{range}![!]{filter} [!][arg] *:range!* 576 :{range}![!]{filter} [!][arg] *:range!*
585 Filter {range} lines through the external program 577 Filter {range} lines through the external program
586 {filter}. Vim replaces the optional bangs with the 578 {filter}. Vim replaces the optional bangs with the
587 latest given command and appends the optional [arg]. 579 latest given command and appends the optional [arg].
611 *==* 603 *==*
612 == Filter [count] lines like with ={motion}. 604 == Filter [count] lines like with ={motion}.
613 605
614 *v_=* 606 *v_=*
615 {Visual}= Filter the highlighted lines like with ={motion}. 607 {Visual}= Filter the highlighted lines like with ={motion}.
616 {not in Vi}
617 608
618 609
619 *tempfile* *setuid* 610 *tempfile* *setuid*
620 Vim uses temporary files for filtering, generating diffs and also for 611 Vim uses temporary files for filtering, generating diffs and also for
621 tempname(). For Unix, the file will be in a private directory (only 612 tempname(). For Unix, the file will be in a private directory (only
676 g& Synonym for `:%s//~/&` (repeat last substitute with 667 g& Synonym for `:%s//~/&` (repeat last substitute with
677 last search pattern on all lines with the same flags). 668 last search pattern on all lines with the same flags).
678 For example, when you first do a substitution with 669 For example, when you first do a substitution with
679 `:s/pattern/repl/flags` and then `/search` for 670 `:s/pattern/repl/flags` and then `/search` for
680 something else, `g&` will do `:%s/search/repl/flags`. 671 something else, `g&` will do `:%s/search/repl/flags`.
681 Mnemonic: global substitute. {not in Vi} 672 Mnemonic: global substitute.
682 673
683 *:snomagic* *:sno* 674 *:snomagic* *:sno*
684 :[range]sno[magic] ... Same as `:substitute`, but always use 'nomagic'. 675 :[range]sno[magic] ... Same as `:substitute`, but always use 'nomagic'.
685 {not in Vi}
686 676
687 *:smagic* *:sm* 677 *:smagic* *:sm*
688 :[range]sm[agic] ... Same as `:substitute`, but always use 'magic'. 678 :[range]sm[agic] ... Same as `:substitute`, but always use 'magic'.
689 {not in Vi}
690 679
691 *:s_flags* 680 *:s_flags*
692 The flags that you can use for the substitute commands: 681 The flags that you can use for the substitute commands:
693 682
694 *:&&* 683 *:&&*
695 [&] Must be the first one: Keep the flags from the previous substitute 684 [&] Must be the first one: Keep the flags from the previous substitute
696 command. Examples: > 685 command. Examples: >
697 :&& 686 :&&
698 :s/this/that/& 687 :s/this/that/&
699 < Note that `:s` and `:&` don't keep the flags. 688 < Note that `:s` and `:&` don't keep the flags.
700 {not in Vi}
701 689
702 [c] Confirm each substitution. Vim highlights the matching string (with 690 [c] Confirm each substitution. Vim highlights the matching string (with
703 |hl-IncSearch|). You can type: *:s_c* 691 |hl-IncSearch|). You can type: *:s_c*
704 'y' to substitute this match 692 'y' to substitute this match
705 'l' to substitute this match and then quit ("last") 693 'l' to substitute this match and then quit ("last")
706 'n' to skip this match 694 'n' to skip this match
707 <Esc> to quit substituting 695 <Esc> to quit substituting
708 'a' to substitute this and all remaining matches {not in Vi} 696 'a' to substitute this and all remaining matches
709 'q' to quit substituting {not in Vi} 697 'q' to quit substituting
710 CTRL-E to scroll the screen up {not in Vi, not available when 698 CTRL-E to scroll the screen up {not available when compiled
711 compiled without the |+insert_expand| feature} 699 without the |+insert_expand| feature}
712 CTRL-Y to scroll the screen down {not in Vi, not available when 700 CTRL-Y to scroll the screen down {not available when compiled
713 compiled without the |+insert_expand| feature} 701 without the |+insert_expand| feature}
714 If the 'edcompatible' option is on, Vim remembers the [c] flag and 702 If the 'edcompatible' option is on, Vim remembers the [c] flag and
715 toggles it each time you use it, but resets it when you give a new 703 toggles it each time you use it, but resets it when you give a new
716 search pattern. 704 search pattern.
717 {not in Vi: highlighting of the match, other responses than 'y' or 'n'}
718 705
719 *:s_e* 706 *:s_e*
720 [e] When the search pattern fails, do not issue an error message and, in 707 [e] When the search pattern fails, do not issue an error message and, in
721 particular, continue in maps as if no error occurred. This is most 708 particular, continue in maps as if no error occurred. This is most
722 useful to prevent the "No match" error from breaking a mapping. Vim 709 useful to prevent the "No match" error from breaking a mapping. Vim
724 Regular expressions can't be delimited by letters 711 Regular expressions can't be delimited by letters
725 \ should be followed by /, ? or & 712 \ should be followed by /, ? or &
726 No previous substitute regular expression 713 No previous substitute regular expression
727 Trailing characters 714 Trailing characters
728 Interrupted 715 Interrupted
729 {not in Vi}
730 716
731 *:s_g* 717 *:s_g*
732 [g] Replace all occurrences in the line. Without this argument, 718 [g] Replace all occurrences in the line. Without this argument,
733 replacement occurs only for the first occurrence in each line. If 719 replacement occurs only for the first occurrence in each line. If
734 the 'edcompatible' option is on, Vim remembers this flag and toggles 720 the 'edcompatible' option is on, Vim remembers this flag and toggles
737 and the [g] argument switches it off. 723 and the [g] argument switches it off.
738 724
739 *:s_i* 725 *:s_i*
740 [i] Ignore case for the pattern. The 'ignorecase' and 'smartcase' options 726 [i] Ignore case for the pattern. The 'ignorecase' and 'smartcase' options
741 are not used. 727 are not used.
742 {not in Vi}
743 728
744 *:s_I* 729 *:s_I*
745 [I] Don't ignore case for the pattern. The 'ignorecase' and 'smartcase' 730 [I] Don't ignore case for the pattern. The 'ignorecase' and 'smartcase'
746 options are not used. 731 options are not used.
747 {not in Vi}
748 732
749 *:s_n* 733 *:s_n*
750 [n] Report the number of matches, do not actually substitute. The [c] 734 [n] Report the number of matches, do not actually substitute. The [c]
751 flag is ignored. The matches are reported as if 'report' is zero. 735 flag is ignored. The matches are reported as if 'report' is zero.
752 Useful to |count-items|. 736 Useful to |count-items|.
774 < The last commands will replace "green" with "red". > 758 < The last commands will replace "green" with "red". >
775 :s/blue/red/ 759 :s/blue/red/
776 /green 760 /green
777 :& 761 :&
778 < The last command will replace "blue" with "red". 762 < The last command will replace "blue" with "red".
779 {not in Vi}
780 763
781 Note that there is no flag to change the "magicness" of the pattern. A 764 Note that there is no flag to change the "magicness" of the pattern. A
782 different command is used instead, or you can use |/\v| and friends. The 765 different command is used instead, or you can use |/\v| and friends. The
783 reason is that the flags can only be found by skipping the pattern, and in 766 reason is that the flags can only be found by skipping the pattern, and in
784 order to skip the pattern the "magicness" must be known. Catch 22! 767 order to skip the pattern the "magicness" must be known. Catch 22!
1000 If the |+vartabs| feature is enabled then a list of 983 If the |+vartabs| feature is enabled then a list of
1001 tab widths separated by commas may be used in place of 984 tab widths separated by commas may be used in place of
1002 a single tabstop. Each value in the list represents 985 a single tabstop. Each value in the list represents
1003 the width of one tabstop, except the final value which 986 the width of one tabstop, except the final value which
1004 applies to all following tabstops. 987 applies to all following tabstops.
1005 {not in Vi}
1006 988
1007 *retab-example* 989 *retab-example*
1008 Example for using autocommands and ":retab" to edit a file which is stored 990 Example for using autocommands and ":retab" to edit a file which is stored
1009 with tabstops at 8 but edited with tabstops set at 4. Warning: white space 991 with tabstops at 8 but edited with tabstops set at 4. Warning: white space
1010 inside of strings can change! Also see 'softtabstop' option. > 992 inside of strings can change! Also see 'softtabstop' option. >
1024 1006
1025 *:reg* *:registers* 1007 *:reg* *:registers*
1026 :reg[isters] Display the contents of all numbered and named 1008 :reg[isters] Display the contents of all numbered and named
1027 registers. If a register is written to for |:redir| 1009 registers. If a register is written to for |:redir|
1028 it will not be listed. 1010 it will not be listed.
1029 {not in Vi}
1030 1011
1031 1012
1032 :reg[isters] {arg} Display the contents of the numbered and named 1013 :reg[isters] {arg} Display the contents of the numbered and named
1033 registers that are mentioned in {arg}. For example: > 1014 registers that are mentioned in {arg}. For example: >
1034 :reg 1a 1015 :reg 1a
1035 < to display registers '1' and 'a'. Spaces are allowed 1016 < to display registers '1' and 'a'. Spaces are allowed
1036 in {arg}. {not in Vi} 1017 in {arg}.
1037 1018
1038 *:di* *:display* 1019 *:di* *:display*
1039 :di[splay] [arg] Same as :registers. {not in Vi} 1020 :di[splay] [arg] Same as :registers.
1040 1021
1041 *y* *yank* 1022 *y* *yank*
1042 ["x]y{motion} Yank {motion} text [into register x]. When no 1023 ["x]y{motion} Yank {motion} text [into register x]. When no
1043 characters are to be yanked (e.g., "y0" in column 1), 1024 characters are to be yanked (e.g., "y0" in column 1),
1044 this is an error when 'cpoptions' includes the 'E' 1025 this is an error when 'cpoptions' includes the 'E'
1053 cursor to the end of line (which is more logical, 1034 cursor to the end of line (which is more logical,
1054 but not Vi-compatible) use ":map Y y$". 1035 but not Vi-compatible) use ":map Y y$".
1055 1036
1056 *v_y* 1037 *v_y*
1057 {Visual}["x]y Yank the highlighted text [into register x] (for 1038 {Visual}["x]y Yank the highlighted text [into register x] (for
1058 {Visual} see |Visual-mode|). {not in Vi} 1039 {Visual} see |Visual-mode|).
1059 1040
1060 *v_Y* 1041 *v_Y*
1061 {Visual}["x]Y Yank the highlighted lines [into register x] (for 1042 {Visual}["x]Y Yank the highlighted lines [into register x] (for
1062 {Visual} see |Visual-mode|). {not in Vi} 1043 {Visual} see |Visual-mode|).
1063 1044
1064 *:y* *:yank* *E850* 1045 *:y* *:yank* *E850*
1065 :[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the 1046 :[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
1066 "* or "+ registers is possible only when the 1047 "* or "+ registers is possible only when the
1067 |+clipboard| feature is included. 1048 |+clipboard| feature is included.
1084 times. Uses the "* register, unless another is 1065 times. Uses the "* register, unless another is
1085 specified. 1066 specified.
1086 Leaves the cursor at the end of the new text. 1067 Leaves the cursor at the end of the new text.
1087 Using the mouse only works when 'mouse' contains 'n' 1068 Using the mouse only works when 'mouse' contains 'n'
1088 or 'a'. 1069 or 'a'.
1089 {not in Vi}
1090 If you have a scrollwheel and often accidentally paste 1070 If you have a scrollwheel and often accidentally paste
1091 text, you can use these mappings to disable the 1071 text, you can use these mappings to disable the
1092 pasting with the middle mouse button: > 1072 pasting with the middle mouse button: >
1093 :map <MiddleMouse> <Nop> 1073 :map <MiddleMouse> <Nop>
1094 :imap <MiddleMouse> <Nop> 1074 :imap <MiddleMouse> <Nop>
1095 < You might want to disable the multi-click versions 1075 < You might want to disable the multi-click versions
1096 too, see |double-click|. 1076 too, see |double-click|.
1097 1077
1098 *gp* 1078 *gp*
1099 ["x]gp Just like "p", but leave the cursor just after the new 1079 ["x]gp Just like "p", but leave the cursor just after the new
1100 text. {not in Vi} 1080 text.
1101 1081
1102 *gP* 1082 *gP*
1103 ["x]gP Just like "P", but leave the cursor just after the new 1083 ["x]gP Just like "P", but leave the cursor just after the new
1104 text. {not in Vi} 1084 text.
1105 1085
1106 *:pu* *:put* 1086 *:pu* *:put*
1107 :[line]pu[t] [x] Put the text [from register x] after [line] (default 1087 :[line]pu[t] [x] Put the text [from register x] after [line] (default
1108 current line). This always works |linewise|, thus 1088 current line). This always works |linewise|, thus
1109 this command can be used to put a yanked block as new 1089 this command can be used to put a yanked block as new
1127 current line). 1107 current line).
1128 1108
1129 ["x]]p or *]p* *]<MiddleMouse>* 1109 ["x]]p or *]p* *]<MiddleMouse>*
1130 ["x]]<MiddleMouse> Like "p", but adjust the indent to the current line. 1110 ["x]]<MiddleMouse> Like "p", but adjust the indent to the current line.
1131 Using the mouse only works when 'mouse' contains 'n' 1111 Using the mouse only works when 'mouse' contains 'n'
1132 or 'a'. {not in Vi} 1112 or 'a'.
1133 1113
1134 ["x][P or *[P* 1114 ["x][P or *[P*
1135 ["x]]P or *]P* 1115 ["x]]P or *]P*
1136 ["x][p or *[p* *[<MiddleMouse>* 1116 ["x][p or *[p* *[<MiddleMouse>*
1137 ["x][<MiddleMouse> Like "P", but adjust the indent to the current line. 1117 ["x][<MiddleMouse> Like "P", but adjust the indent to the current line.
1138 Using the mouse only works when 'mouse' contains 'n' 1118 Using the mouse only works when 'mouse' contains 'n'
1139 or 'a'. {not in Vi} 1119 or 'a'.
1140 1120
1141 You can use these commands to copy text from one place to another. Do this 1121 You can use these commands to copy text from one place to another. Do this
1142 by first getting the text into a register with a yank, delete or change 1122 by first getting the text into a register with a yank, delete or change
1143 command, then inserting the register contents with a put command. You can 1123 command, then inserting the register contents with a put command. You can
1144 also use these commands to move text from one file to another, because Vim 1124 also use these commands to move text from one file to another, because Vim
1244 not exist} 1224 not exist}
1245 1225
1246 3. Small delete register "- *quote_-* *quote-* 1226 3. Small delete register "- *quote_-* *quote-*
1247 This register contains text from commands that delete less than one line, 1227 This register contains text from commands that delete less than one line,
1248 except when the command specifies a register with ["x]. 1228 except when the command specifies a register with ["x].
1249 {not in Vi}
1250 1229
1251 4. Named registers "a to "z or "A to "Z *quote_alpha* *quotea* 1230 4. Named registers "a to "z or "A to "Z *quote_alpha* *quotea*
1252 Vim fills these registers only when you say so. Specify them as lowercase 1231 Vim fills these registers only when you say so. Specify them as lowercase
1253 letters to replace their previous contents or as uppercase letters to append 1232 letters to replace their previous contents or as uppercase letters to append
1254 to their previous contents. When the '>' flag is present in 'cpoptions' then 1233 to their previous contents. When the '>' flag is present in 'cpoptions' then
1255 a line break is inserted before the appended text. 1234 a line break is inserted before the appended text.
1256 1235
1257 5. Read-only registers ":, ". and "% 1236 5. Read-only registers ":, ". and "%
1258 These are '%', '#', ':' and '.'. You can use them only with the "p", "P", 1237 These are '%', '#', ':' and '.'. You can use them only with the "p", "P",
1259 and ":put" commands and with CTRL-R. {not in Vi} 1238 and ":put" commands and with CTRL-R.
1260 *quote_.* *quote.* *E29* 1239 *quote_.* *quote.* *E29*
1261 ". Contains the last inserted text (the same as what is inserted 1240 ". Contains the last inserted text (the same as what is inserted
1262 with the insert mode commands CTRL-A and CTRL-@). Note: this 1241 with the insert mode commands CTRL-A and CTRL-@). Note: this
1263 doesn't work with CTRL-R on the command-line. It works a bit 1242 doesn't work with CTRL-R on the command-line. It works a bit
1264 differently, like inserting the text instead of putting it 1243 differently, like inserting the text instead of putting it
1308 turned into a String and used as a line. A Dictionary or FuncRef results in 1287 turned into a String and used as a line. A Dictionary or FuncRef results in
1309 an error message (use string() to convert). 1288 an error message (use string() to convert).
1310 1289
1311 If the "= register is used for the "p" command, the String is split up at <NL> 1290 If the "= register is used for the "p" command, the String is split up at <NL>
1312 characters. If the String ends in a <NL>, it is regarded as a linewise 1291 characters. If the String ends in a <NL>, it is regarded as a linewise
1313 register. {not in Vi} 1292 register.
1314 1293
1315 8. Selection and drop registers "*, "+ and "~ 1294 8. Selection and drop registers "*, "+ and "~
1316 Use these registers for storing and retrieving the selected text for the GUI. 1295 Use these registers for storing and retrieving the selected text for the GUI.
1317 See |quotestar| and |quoteplus|. When the clipboard is not available or not 1296 See |quotestar| and |quoteplus|. When the clipboard is not available or not
1318 working, the unnamed register is used instead. For Unix systems the clipboard 1297 working, the unnamed register is used instead. For Unix systems the clipboard
1319 is only available when the |+xterm_clipboard| feature is present. {not in Vi} 1298 is only available when the |+xterm_clipboard| feature is present.
1320 1299
1321 Note that there is only a distinction between "* and "+ for X11 systems. For 1300 Note that there is only a distinction between "* and "+ for X11 systems. For
1322 an explanation of the difference, see |x11-selection|. Under MS-Windows, use 1301 an explanation of the difference, see |x11-selection|. Under MS-Windows, use
1323 of "* and "+ is actually synonymous and refers to the |gui-clipboard|. 1302 of "* and "+ is actually synonymous and refers to the |gui-clipboard|.
1324 1303
1325 *quote_~* *quote~* *<Drop>* 1304 *quote_~* *quote~* *<Drop>*
1326 The read-only "~ register stores the dropped text from the last drag'n'drop 1305 The read-only "~ register stores the dropped text from the last drag'n'drop
1327 operation. When something has been dropped onto Vim, the "~ register is 1306 operation. When something has been dropped onto Vim, the "~ register is
1328 filled in and the <Drop> pseudo key is sent for notification. You can remap 1307 filled in and the <Drop> pseudo key is sent for notification. You can remap
1329 this key if you want; the default action (for all modes) is to insert the 1308 this key if you want; the default action (for all modes) is to insert the
1330 contents of the "~ register at the cursor position. {not in Vi} 1309 contents of the "~ register at the cursor position.
1331 {only available when compiled with the |+dnd| feature, currently only with the 1310 {only available when compiled with the |+dnd| feature, currently only with the
1332 GTK GUI} 1311 GTK GUI}
1333 1312
1334 Note: The "~ register is only used when dropping plain text onto Vim. 1313 Note: The "~ register is only used when dropping plain text onto Vim.
1335 Drag'n'drop of URI lists is handled internally. 1314 Drag'n'drop of URI lists is handled internally.
1336 1315
1337 9. Black hole register "_ *quote_* 1316 9. Black hole register "_ *quote_*
1338 When writing to this register, nothing happens. This can be used to delete 1317 When writing to this register, nothing happens. This can be used to delete
1339 text without affecting the normal registers. When reading from this register, 1318 text without affecting the normal registers. When reading from this register,
1340 nothing is returned. {not in Vi} 1319 nothing is returned.
1341 1320
1342 10. Last search pattern register "/ *quote_/* *quote/* 1321 10. Last search pattern register "/ *quote_/* *quote/*
1343 Contains the most recent search-pattern. This is used for "n" and 'hlsearch'. 1322 Contains the most recent search-pattern. This is used for "n" and 'hlsearch'.
1344 It is writable with `:let`, you can change it to have 'hlsearch' highlight 1323 It is writable with `:let`, you can change it to have 'hlsearch' highlight
1345 other matches without actually searching. You can't yank or delete into this 1324 other matches without actually searching. You can't yank or delete into this
1346 register. The search direction is available in |v:searchforward|. 1325 register. The search direction is available in |v:searchforward|.
1347 Note that the value is restored when returning from a function 1326 Note that the value is restored when returning from a function
1348 |function-search-undo|. 1327 |function-search-undo|.
1349 {not in Vi}
1350 1328
1351 *@/* 1329 *@/*
1352 You can write to a register with a `:let` command |:let-@|. Example: > 1330 You can write to a register with a `:let` command |:let-@|. Example: >
1353 :let @/ = "the" 1331 :let @/ = "the"
1354 1332
1375 6. Formatting text *formatting* 1353 6. Formatting text *formatting*
1376 1354
1377 :[range]ce[nter] [width] *:ce* *:center* 1355 :[range]ce[nter] [width] *:ce* *:center*
1378 Center lines in [range] between [width] columns 1356 Center lines in [range] between [width] columns
1379 (default 'textwidth' or 80 when 'textwidth' is 0). 1357 (default 'textwidth' or 80 when 'textwidth' is 0).
1380 {not in Vi}
1381 1358
1382 :[range]ri[ght] [width] *:ri* *:right* 1359 :[range]ri[ght] [width] *:ri* *:right*
1383 Right-align lines in [range] at [width] columns 1360 Right-align lines in [range] at [width] columns
1384 (default 'textwidth' or 80 when 'textwidth' is 0). 1361 (default 'textwidth' or 80 when 'textwidth' is 0).
1385 {not in Vi}
1386 1362
1387 *:le* *:left* 1363 *:le* *:left*
1388 :[range]le[ft] [indent] 1364 :[range]le[ft] [indent]
1389 Left-align lines in [range]. Sets the indent in the 1365 Left-align lines in [range]. Sets the indent in the
1390 lines to [indent] (default 0). {not in Vi} 1366 lines to [indent] (default 0).
1391 1367
1392 *gq* 1368 *gq*
1393 gq{motion} Format the lines that {motion} moves over. 1369 gq{motion} Format the lines that {motion} moves over.
1394 Formatting is done with one of three methods: 1370 Formatting is done with one of three methods:
1395 1. If 'formatexpr' is not empty the expression is 1371 1. If 'formatexpr' is not empty the expression is
1412 formatting, use this mapping: > 1388 formatting, use this mapping: >
1413 :nnoremap Q gq 1389 :nnoremap Q gq
1414 1390
1415 gqgq *gqgq* *gqq* 1391 gqgq *gqgq* *gqq*
1416 gqq Format the current line. With a count format that 1392 gqq Format the current line. With a count format that
1417 many lines. {not in Vi} 1393 many lines.
1418 1394
1419 *v_gq* 1395 *v_gq*
1420 {Visual}gq Format the highlighted text. (for {Visual} see 1396 {Visual}gq Format the highlighted text. (for {Visual} see
1421 |Visual-mode|). {not in Vi} 1397 |Visual-mode|).
1422 1398
1423 *gw* 1399 *gw*
1424 gw{motion} Format the lines that {motion} moves over. Similar to 1400 gw{motion} Format the lines that {motion} moves over. Similar to
1425 |gq| but puts the cursor back at the same position in 1401 |gq| but puts the cursor back at the same position in
1426 the text. However, 'formatprg' and 'formatexpr' are 1402 the text. However, 'formatprg' and 'formatexpr' are
1427 not used. {not in Vi} 1403 not used.
1428 1404
1429 gwgw *gwgw* *gww* 1405 gwgw *gwgw* *gww*
1430 gww Format the current line as with "gw". {not in Vi} 1406 gww Format the current line as with "gw".
1431 1407
1432 *v_gw* 1408 *v_gw*
1433 {Visual}gw Format the highlighted text as with "gw". (for 1409 {Visual}gw Format the highlighted text as with "gw". (for
1434 {Visual} see |Visual-mode|). {not in Vi} 1410 {Visual} see |Visual-mode|).
1435 1411
1436 Example: To format the current paragraph use: *gqap* > 1412 Example: To format the current paragraph use: *gqap* >
1437 gqap 1413 gqap
1438 1414
1439 The "gq" command leaves the cursor in the line where the motion command takes 1415 The "gq" command leaves the cursor in the line where the motion command takes