Mercurial > vim
comparison runtime/doc/map.txt @ 42:c75153d791d0
updated for version 7.0026
author | vimboss |
---|---|
date | Wed, 29 Dec 2004 20:58:21 +0000 |
parents | 125e80798a85 |
children | 54f0f39bdf01 |
comparison
equal
deleted
inserted
replaced
41:f529edb9bab3 | 42:c75153d791d0 |
---|---|
1 *map.txt* For Vim version 7.0aa. Last change: 2004 Dec 09 | 1 *map.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
611 > | 611 > |
612 :ab #i #include | 612 :ab #i #include |
613 < "#i{CURSOR}" is expanded to "#include" | 613 < "#i{CURSOR}" is expanded to "#include" |
614 ">#i{CURSOR}" is not expanded | 614 ">#i{CURSOR}" is not expanded |
615 > | 615 > |
616 :ab ;; <endofline>" | 616 :ab ;; <endofline> |
617 < "test;;" is not expanded | 617 < "test;;" is not expanded |
618 "test ;;" is expanded to "test <endofline>" | 618 "test ;;" is expanded to "test <endofline>" |
619 | 619 |
620 To avoid the abbreviation in insert mode: Type part of the abbreviation, exit | 620 To avoid the abbreviation in insert mode: Type part of the abbreviation, exit |
621 insert mode with <Esc>, re-enter insert mode with "a" and type the rest. Or | 621 insert mode with <Esc>, re-enter insert mode with "a" and type the rest. Or |
733 | 733 |
734 The command-line contains two actual ^Vs before the ^[. This is | 734 The command-line contains two actual ^Vs before the ^[. This is |
735 how it should appear in your .exrc file, if you choose to go that | 735 how it should appear in your .exrc file, if you choose to go that |
736 route. The first ^V is there to quote the second ^V; the :ab | 736 route. The first ^V is there to quote the second ^V; the :ab |
737 command uses ^V as its own quote character, so you can include quoted | 737 command uses ^V as its own quote character, so you can include quoted |
738 whitespace or the | character in the abbreviation. The :ab command | 738 whitespace or the | character in the abbreviation. The :ab command |
739 doesn't do anything special with the ^[ character, so it doesn't need | 739 doesn't do anything special with the ^[ character, so it doesn't need |
740 to be quoted. (Although quoting isn't harmful; that's why typing 7 | 740 to be quoted. (Although quoting isn't harmful; that's why typing 7 |
741 [but not 8!] ^Vs works.) | 741 [but not 8!] ^Vs works.) |
742 | 742 |
743 Stored as: esc ^V^[ | 743 Stored as: esc ^V^[ |
748 abbreviation will be displayed. | 748 abbreviation will be displayed. |
749 | 749 |
750 Later, when the abbreviation is expanded because the user typed in | 750 Later, when the abbreviation is expanded because the user typed in |
751 the word "esc", the long form is subjected to the same type of | 751 the word "esc", the long form is subjected to the same type of |
752 ^V interpretation as keyboard input. So the ^V protects the ^[ | 752 ^V interpretation as keyboard input. So the ^V protects the ^[ |
753 character from being interpreted as the "exit input-mode" character. | 753 character from being interpreted as the "exit Insert mode" character. |
754 Instead, the ^[ is inserted into the text. | 754 Instead, the ^[ is inserted into the text. |
755 | 755 |
756 Expands to: ^[ | 756 Expands to: ^[ |
757 | 757 |
758 [example given by Steve Kirkendall] | 758 [example given by Steve Kirkendall] |
776 When defining a function in a script, "s:" can be prepended to the name to | 776 When defining a function in a script, "s:" can be prepended to the name to |
777 make it local to the script. But when a mapping is executed from outside of | 777 make it local to the script. But when a mapping is executed from outside of |
778 the script, it doesn't know in which script the function was defined. To | 778 the script, it doesn't know in which script the function was defined. To |
779 avoid this problem, use "<SID>" instead of "s:". The same translation is done | 779 avoid this problem, use "<SID>" instead of "s:". The same translation is done |
780 as for mappings. This makes it possible to define a call to the function in | 780 as for mappings. This makes it possible to define a call to the function in |
781 mapping. | 781 a mapping. |
782 | 782 |
783 When a local function is executed, it runs in the context of the script it was | 783 When a local function is executed, it runs in the context of the script it was |
784 defined in. This means that new functions and mappings it defines can also | 784 defined in. This means that new functions and mappings it defines can also |
785 use "s:" or "<SID>" and it will use the same unique number as when the | 785 use "s:" or "<SID>" and it will use the same unique number as when the |
786 function itself was defined. Also, the "s:var" local script variables can be | 786 function itself was defined. Also, the "s:var" local script variables can be |
1052 " (Enter this all as one line) | 1052 " (Enter this all as one line) |
1053 :com -range -nargs=1 -complete=file | 1053 :com -range -nargs=1 -complete=file |
1054 Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d | 1054 Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d |
1055 | 1055 |
1056 " Count the number of lines in the range | 1056 " Count the number of lines in the range |
1057 :com! -range -nargs=0 Lines :echo <line2> - <line1> + 1 "lines" | 1057 :com! -range -nargs=0 Lines echo <line2> - <line1> + 1 "lines" |
1058 | 1058 |
1059 " Call a user function (example of <f-args>) | 1059 " Call a user function (example of <f-args>) |
1060 :com -nargs=* Mycmd call Myfunc(<f-args>) | 1060 :com -nargs=* Mycmd call Myfunc(<f-args>) |
1061 | 1061 |
1062 When executed as: > | 1062 When executed as: > |