Mercurial > vim
comparison runtime/doc/map.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 | 47d6e874955c |
children | d23afa4d8b63 |
comparison
equal
deleted
inserted
replaced
16552:deb3d4f5be8b | 16553:0e473e9e70c2 |
---|---|
1 *map.txt* For Vim version 8.1. Last change: 2019 Apr 25 | 1 *map.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 |
74 :cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap* | 74 :cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap* |
75 :tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap* | 75 :tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap* |
76 Map the key sequence {lhs} to {rhs} for the modes | 76 Map the key sequence {lhs} to {rhs} for the modes |
77 where the map command applies. Disallow mapping of | 77 where the map command applies. Disallow mapping of |
78 {rhs}, to avoid nested and recursive mappings. Often | 78 {rhs}, to avoid nested and recursive mappings. Often |
79 used to redefine a command. {not in Vi} | 79 used to redefine a command. |
80 | 80 |
81 | 81 |
82 :unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap* | 82 :unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap* |
83 :nun[map] {lhs} |mapmode-n| *:nun* *:nunmap* | 83 :nun[map] {lhs} |mapmode-n| *:nun* *:nunmap* |
84 :vu[nmap] {lhs} |mapmode-v| *:vu* *:vunmap* | 84 :vu[nmap] {lhs} |mapmode-v| *:vu* *:vunmap* |
108 :imapc[lear] |mapmode-i| *:imapc* *:imapclear* | 108 :imapc[lear] |mapmode-i| *:imapc* *:imapclear* |
109 :lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear* | 109 :lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear* |
110 :cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear* | 110 :cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear* |
111 :tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear* | 111 :tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear* |
112 Remove ALL mappings for the modes where the map | 112 Remove ALL mappings for the modes where the map |
113 command applies. {not in Vi} | 113 command applies. |
114 Use the <buffer> argument to remove buffer-local | 114 Use the <buffer> argument to remove buffer-local |
115 mappings |:map-<buffer>| | 115 mappings |:map-<buffer>| |
116 Warning: This also removes the default mappings. | 116 Warning: This also removes the default mappings. |
117 | 117 |
118 :map |mapmode-nvo| | 118 :map |mapmode-nvo| |
141 :lm[ap] {lhs} |mapmode-l| *:lmap_l* | 141 :lm[ap] {lhs} |mapmode-l| *:lmap_l* |
142 :cm[ap] {lhs} |mapmode-c| *:cmap_l* | 142 :cm[ap] {lhs} |mapmode-c| *:cmap_l* |
143 :tma[p] {lhs} |mapmode-t| *:tmap_l* | 143 :tma[p] {lhs} |mapmode-t| *:tmap_l* |
144 List the key mappings for the key sequences starting | 144 List the key mappings for the key sequences starting |
145 with {lhs} in the modes where the map command applies. | 145 with {lhs} in the modes where the map command applies. |
146 {not in Vi} | |
147 | 146 |
148 These commands are used to map a key or key sequence to a string of | 147 These commands are used to map a key or key sequence to a string of |
149 characters. You can use this to put command sequences under function keys, | 148 characters. You can use this to put command sequences under function keys, |
150 translate one key into another, etc. See |:mkexrc| for how to save and | 149 translate one key into another, etc. See |:mkexrc| for how to save and |
151 restore the current mappings. | 150 restore the current mappings. |
158 When Vim has read "aa", it will need to get another character to be able to | 157 When Vim has read "aa", it will need to get another character to be able to |
159 decide if "aa" or "aaa" should be mapped. This means that after typing "aa" | 158 decide if "aa" or "aaa" should be mapped. This means that after typing "aa" |
160 that mapping won't get expanded yet, Vim is waiting for another character. | 159 that mapping won't get expanded yet, Vim is waiting for another character. |
161 If you type a space, then "foo" will get inserted, plus the space. If you | 160 If you type a space, then "foo" will get inserted, plus the space. If you |
162 type "a", then "bar" will get inserted. | 161 type "a", then "bar" will get inserted. |
163 {Vi does not allow ambiguous mappings} | |
164 | 162 |
165 | 163 |
166 1.2 SPECIAL ARGUMENTS *:map-arguments* | 164 1.2 SPECIAL ARGUMENTS *:map-arguments* |
167 | 165 |
168 "<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and | 166 "<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and |
1014 remove abbreviations after expansion. To avoid | 1012 remove abbreviations after expansion. To avoid |
1015 expansion insert a CTRL-V (type it twice). | 1013 expansion insert a CTRL-V (type it twice). |
1016 | 1014 |
1017 *:norea* *:noreabbrev* | 1015 *:norea* *:noreabbrev* |
1018 :norea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] | 1016 :norea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] |
1019 same as ":ab", but no remapping for this {rhs} {not | 1017 Same as ":ab", but no remapping for this {rhs}. |
1020 in Vi} | |
1021 | 1018 |
1022 *:ca* *:cabbrev* | 1019 *:ca* *:cabbrev* |
1023 :ca[bbrev] [<expr>] [<buffer>] [lhs] [rhs] | 1020 :ca[bbrev] [<expr>] [<buffer>] [lhs] [rhs] |
1024 same as ":ab", but for Command-line mode only. {not | 1021 Same as ":ab", but for Command-line mode only. |
1025 in Vi} | |
1026 | 1022 |
1027 *:cuna* *:cunabbrev* | 1023 *:cuna* *:cunabbrev* |
1028 :cuna[bbrev] {lhs} same as ":una", but for Command-line mode only. {not | 1024 :cuna[bbrev] {lhs} Same as ":una", but for Command-line mode only. |
1029 in Vi} | |
1030 | 1025 |
1031 *:cnorea* *:cnoreabbrev* | 1026 *:cnorea* *:cnoreabbrev* |
1032 :cnorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] | 1027 :cnorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] |
1033 same as ":ab", but for Command-line mode only and no | 1028 same as ":ab", but for Command-line mode only and no |
1034 remapping for this {rhs} {not in Vi} | 1029 remapping for this {rhs} |
1035 | 1030 |
1036 *:ia* *:iabbrev* | 1031 *:ia* *:iabbrev* |
1037 :ia[bbrev] [<expr>] [<buffer>] [lhs] [rhs] | 1032 :ia[bbrev] [<expr>] [<buffer>] [lhs] [rhs] |
1038 same as ":ab", but for Insert mode only. {not in Vi} | 1033 Same as ":ab", but for Insert mode only. |
1039 | 1034 |
1040 *:iuna* *:iunabbrev* | 1035 *:iuna* *:iunabbrev* |
1041 :iuna[bbrev] {lhs} same as ":una", but for insert mode only. {not in | 1036 :iuna[bbrev] {lhs} Same as ":una", but for insert mode only. |
1042 Vi} | |
1043 | 1037 |
1044 *:inorea* *:inoreabbrev* | 1038 *:inorea* *:inoreabbrev* |
1045 :inorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] | 1039 :inorea[bbrev] [<expr>] [<buffer>] [lhs] [rhs] |
1046 same as ":ab", but for Insert mode only and no | 1040 Same as ":ab", but for Insert mode only and no |
1047 remapping for this {rhs} {not in Vi} | 1041 remapping for this {rhs}. |
1048 | 1042 |
1049 *:abc* *:abclear* | 1043 *:abc* *:abclear* |
1050 :abc[lear] [<buffer>] Remove all abbreviations. {not in Vi} | 1044 :abc[lear] [<buffer>] Remove all abbreviations. |
1051 | 1045 |
1052 *:iabc* *:iabclear* | 1046 *:iabc* *:iabclear* |
1053 :iabc[lear] [<buffer>] Remove all abbreviations for Insert mode. {not in Vi} | 1047 :iabc[lear] [<buffer>] Remove all abbreviations for Insert mode. |
1054 | 1048 |
1055 *:cabc* *:cabclear* | 1049 *:cabc* *:cabclear* |
1056 :cabc[lear] [<buffer>] Remove all abbreviations for Command-line mode. {not | 1050 :cabc[lear] [<buffer>] Remove all abbreviations for Command-line mode. |
1057 in Vi} | |
1058 | 1051 |
1059 *using_CTRL-V* | 1052 *using_CTRL-V* |
1060 It is possible to use special characters in the rhs of an abbreviation. | 1053 It is possible to use special characters in the rhs of an abbreviation. |
1061 CTRL-V has to be used to avoid the special meaning of most non printable | 1054 CTRL-V has to be used to avoid the special meaning of most non printable |
1062 characters. How many CTRL-Vs need to be typed depends on how you enter the | 1055 characters. How many CTRL-Vs need to be typed depends on how you enter the |
1145 to find out what they are defined to. | 1138 to find out what they are defined to. |
1146 | 1139 |
1147 The |:scriptnames| command can be used to see which scripts have been sourced | 1140 The |:scriptnames| command can be used to see which scripts have been sourced |
1148 and what their <SNR> number is. | 1141 and what their <SNR> number is. |
1149 | 1142 |
1150 This is all {not in Vi} and {not available when compiled without the |+eval| | 1143 This is all {not available when compiled without the |+eval| feature}. |
1151 feature}. | |
1152 | 1144 |
1153 ============================================================================== | 1145 ============================================================================== |
1154 4. User-defined commands *user-commands* | 1146 4. User-defined commands *user-commands* |
1155 | 1147 |
1156 It is possible to define your own Ex commands. A user-defined command can act | 1148 It is possible to define your own Ex commands. A user-defined command can act |
1389 -range=N A count (default N) which is specified in the line | 1381 -range=N A count (default N) which is specified in the line |
1390 number position (like |:split|); allows for zero line | 1382 number position (like |:split|); allows for zero line |
1391 number. | 1383 number. |
1392 -count=N A count (default N) which is specified either in the line | 1384 -count=N A count (default N) which is specified either in the line |
1393 number position, or as an initial argument (like |:Next|). | 1385 number position, or as an initial argument (like |:Next|). |
1394 Specifying -count (without a default) acts like -count=0 | 1386 -count acts like -count=0 |
1395 | 1387 |
1396 Note that -range=N and -count=N are mutually exclusive - only one should be | 1388 Note that -range=N and -count=N are mutually exclusive - only one should be |
1397 specified. | 1389 specified. |
1398 | 1390 |
1399 *:command-addr* | 1391 *:command-addr* |
1400 It is possible that the special characters in the range like ., $ or % which | 1392 It is possible that the special characters in the range like ., $ or % which |
1401 by default correspond to the current line, last line and the whole buffer, | 1393 by default correspond to the current line, last line and the whole buffer, |
1402 relate to arguments, (loaded) buffers, windows or tab pages. | 1394 relate to arguments, (loaded) buffers, windows or tab pages. |
1403 | 1395 |
1404 Possible values are (second column is the short name used in listing): | 1396 Possible values are (second column is the short name used in listing): |
1405 -addr=lines Range of lines (this is the default) | 1397 -addr=lines Range of lines (this is the default for -range) |
1406 -addr=arguments arg Range for arguments | 1398 -addr=arguments arg Range for arguments |
1407 -addr=buffers buf Range for buffers (also not loaded buffers) | 1399 -addr=buffers buf Range for buffers (also not loaded buffers) |
1408 -addr=loaded_buffers load Range for loaded buffers | 1400 -addr=loaded_buffers load Range for loaded buffers |
1409 -addr=windows win Range for windows | 1401 -addr=windows win Range for windows |
1410 -addr=tabs tab Range for tab pages | 1402 -addr=tabs tab Range for tab pages |
1411 -addr=quickfix qf Range for quickfix entries | 1403 -addr=quickfix qf Range for quickfix entries |
1412 -addr=other ? other kind of range | 1404 -addr=other ? other kind of range; can use ".", "$" and "%" |
1405 as with "lines" (this is the default for | |
1406 -count) | |
1413 | 1407 |
1414 | 1408 |
1415 Special cases ~ | 1409 Special cases ~ |
1416 *:command-bang* *:command-bar* | 1410 *:command-bang* *:command-bar* |
1417 *:command-register* *:command-buffer* | 1411 *:command-register* *:command-buffer* |