|
1 |
| -*cmdline.txt* For Vim version 9.0. Last change: 2022 Sep 26 |
| 1 | +*cmdline.txt* For Vim version 9.0. Last change: 2023 May 20 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -517,16 +517,26 @@ example, to match only files that end in ".c": >
|
517 | 517 | :e *.c$
|
518 | 518 | This will not match a file ending in ".cpp". Without the "$" it does match.
|
519 | 519 |
|
520 |
| -The old value of an option can be obtained by hitting 'wildchar' just after |
521 |
| -the '='. For example, typing 'wildchar' after ":set dir=" will insert the |
522 |
| -current value of 'dir'. This overrules file name completion for the options |
523 |
| -that take a file name. |
524 |
| - |
525 | 520 | If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
|
526 | 521 | your .cshrc: >
|
527 | 522 | xmodmap -e "keysym Tab = Tab Find"
|
528 | 523 | And this in your .vimrc: >
|
529 | 524 | :cmap <Esc>[1~ <C-P>
|
| 525 | +< *complete-set-option* |
| 526 | +When setting an option using |:set=|, the old value of an option can be |
| 527 | +obtained by hitting 'wildchar' just after the '='. For example, typing |
| 528 | +'wildchar' after ":set dir=" will insert the current value of 'dir'. This |
| 529 | +overrules file name completion for the options that take a file name. |
| 530 | + |
| 531 | +When using |:set=|, |:set+=|, or |:set^=|, string options that have |
| 532 | +pre-defined names or syntax (e.g. 'diffopt', 'listchars') or are a list of |
| 533 | +single-character flags (e.g. 'shortmess') will also present a list of possible |
| 534 | +values for completion when using 'wildchar'. |
| 535 | + |
| 536 | +When using |:set-=|, comma-separated options like 'diffopt' or 'backupdir' |
| 537 | +will show each item separately. Flag list options like 'shortmess' will show |
| 538 | +both the entire old value and the individual flags. Otherwise completion will |
| 539 | +just fill in with the entire old value. |
530 | 540 |
|
531 | 541 | ==============================================================================
|
532 | 542 | 3. Ex command-lines *cmdline-lines*
|
@@ -617,6 +627,7 @@ followed by another Vim command:
|
617 | 627 | :read !
|
618 | 628 | :scscope
|
619 | 629 | :sign
|
| 630 | + :tabdo |
620 | 631 | :tcl
|
621 | 632 | :tcldo
|
622 | 633 | :tclfile
|
@@ -736,19 +747,59 @@ Line numbers may be specified with: *:range* *{address}*
|
736 | 747 | 'T position of mark T (uppercase); when the mark is in
|
737 | 748 | another file it cannot be used in a range
|
738 | 749 | /{pattern}[/] the next line where {pattern} matches *:/*
|
| 750 | + also see |:range-pattern| below |
739 | 751 | ?{pattern}[?] the previous line where {pattern} matches *:?*
|
| 752 | + also see |:range-pattern| below |
740 | 753 | \/ the next line where the previously used search
|
741 | 754 | pattern matches
|
742 | 755 | \? the previous line where the previously used search
|
743 | 756 | pattern matches
|
744 | 757 | \& the next line where the previously used substitute
|
745 | 758 | pattern matches
|
746 | 759 |
|
| 760 | + *:range-offset* |
747 | 761 | Each may be followed (several times) by '+' or '-' and an optional number.
|
748 | 762 | This number is added or subtracted from the preceding line number. If the
|
749 | 763 | number is omitted, 1 is used. If there is nothing before the '+' or '-' then
|
750 | 764 | the current line is used.
|
751 |
| - |
| 765 | + *:range-closed-fold* |
| 766 | +When a line number after the comma is in a closed fold it is adjusted to the |
| 767 | +last line of the fold, thus the whole fold is included. |
| 768 | + |
| 769 | +When a number is added this is done after the adjustment to the last line of |
| 770 | +the fold. This means these lines are additionally included in the range. For |
| 771 | +example: > |
| 772 | + :3,4+2print |
| 773 | +On this text: |
| 774 | + 1 one ~ |
| 775 | + 2 two ~ |
| 776 | + 3 three ~ |
| 777 | + 4 four FOLDED ~ |
| 778 | + 5 five FOLDED ~ |
| 779 | + 6 six ~ |
| 780 | + 7 seven ~ |
| 781 | + 8 eight ~ |
| 782 | +Where lines four and five are a closed fold, ends up printing lines 3 to 7. |
| 783 | +The 7 comes from the "4" in the range, which is adjusted to the end of the |
| 784 | +closed fold, which is 5, and then the offset 2 is added. |
| 785 | + |
| 786 | +An example for subtracting (which isn't very useful): > |
| 787 | + :2,4-1print |
| 788 | +On this text: |
| 789 | + 1 one ~ |
| 790 | + 2 two ~ |
| 791 | + 3 three FOLDED~ |
| 792 | + 4 four FOLDED ~ |
| 793 | + 5 five FOLDED ~ |
| 794 | + 6 six FOLDED ~ |
| 795 | + 7 seven ~ |
| 796 | + 8 eight ~ |
| 797 | +Where lines three to six are a closed fold, ends up printing lines 2 to 6. |
| 798 | +The 6 comes from the "4" in the range, which is adjusted to the end of the |
| 799 | +closed fold, which is 6, and then 1 is subtracted, then this is still in the |
| 800 | +closed fold and the last line of that fold is used, which is 6. |
| 801 | + |
| 802 | + *:range-pattern* |
752 | 803 | The "/" and "?" after {pattern} are required to separate the pattern from
|
753 | 804 | anything that follows.
|
754 | 805 |
|
@@ -804,7 +855,7 @@ always be swapped then.
|
804 | 855 |
|
805 | 856 | Count and Range *N:*
|
806 | 857 |
|
807 |
| -When giving a count before entering ":", this is translated into: |
| 858 | +When giving a count before entering ":", this is translated into: > |
808 | 859 | :.,.+(count - 1)
|
809 | 860 | In words: The "count" lines at and after the cursor. Example: To delete
|
810 | 861 | three lines: >
|
@@ -921,9 +972,10 @@ Note: these are typed literally, they are not special keys!
|
921 | 972 | write. *E495*
|
922 | 973 | *:<abuf>* *<abuf>*
|
923 | 974 | <abuf> When executing autocommands, is replaced with the currently
|
924 |
| - effective buffer number (for ":r file" and ":so file" it is |
925 |
| - the current buffer, the file being read/sourced is not in a |
926 |
| - buffer). *E496* |
| 975 | + effective buffer number. It is not set for all events, |
| 976 | + also see |bufnr()|. For ":r file" and ":so file" it is the |
| 977 | + current buffer, the file being read/sourced is not in a |
| 978 | + buffer. *E496* |
927 | 979 | *:<amatch>* *<amatch>*
|
928 | 980 | <amatch> When executing autocommands, is replaced with the match for
|
929 | 981 | which this autocommand was executed. *E497*
|
|
0 commit comments