Lines Matching refs:map
1 *map.txt* For Vim version 8.2. Last change: 2021 Nov 15
13 1.1 MAP COMMANDS |:map-commands|
14 1.2 Special arguments |:map-arguments|
15 1.3 Mapping and modes |:map-modes|
16 1.4 Listing mappings |map-listing|
17 1.5 Mapping special keys |:map-special-keys|
18 1.6 Special characters |:map-special-chars|
19 1.7 What keys to map |map-which-keys|
20 1.8 Examples |map-examples|
21 1.9 Using mappings |map-typing|
22 1.10 Mapping alt-keys |:map-alt-keys|
24 1.12 Mapping an operator |:map-operator|
35 :map <F2> a<C-R>=strftime("%c")<CR><Esc>
40 1.1 MAP COMMANDS *:map-commands*
43 See |map-overview| for the various forms of "map" and their relationships with
49 :map {lhs} {rhs} |mapmode-nvo| *:map*
55 :map! {lhs} {rhs} |mapmode-ic| *:map!*
61 where the map command applies. The result, including
80 where the map command applies. Disallow mapping of
86 :nun[map] {lhs} |mapmode-n| *:nun* *:nunmap*
97 map command applies. The mapping may remain defined
101 :map @@ foo
115 Remove ALL mappings for the modes where the map
118 mappings |:map-<buffer>|
121 :map |mapmode-nvo|
127 :map! |mapmode-ic|
132 List all key mappings for the modes where the map
133 command applies. Note that ":map" and ":map!" are
136 :map {lhs} |mapmode-nvo| *:map_l*
142 :map! {lhs} |mapmode-ic| *:map_l!*
148 with {lhs} in the modes where the map command applies.
150 These commands are used to map a key or key sequence to a string of
155 *map-ambiguous*
167 1.2 SPECIAL ARGUMENTS *:map-arguments*
173 *:map-local* *:map-<buffer>* *E224* *E225*
176 :map <buffer> ,w /[.,;]<CR>
177 Then you can map ",w" to something else in another buffer: >
178 :map <buffer> ,w /[#&!]<CR>
187 Also see |map-precedence|.
189 *:map-<nowait>* *:map-nowait*
203 *:map-<silent>* *:map-silent*
206 :map <silent> ,h /Header<CR>
210 :map <silent> ,h :exe ":silent normal /Header\r"<CR>
215 *:map-<special>* *:map-special*
219 :map <special> <F12> /Header<CR>
221 *:map-<script>* *:map-script*
228 Note: ":map <script>" and ":noremap <script>" do the same thing. The
232 *:map-<unique>* *E226* *E227*
236 :map <unique> ,w /[#&!]<CR>
237 When defining a local mapping, there will also be a check if a global map
240 :map ,w /[#&!]<CR>
241 :map <buffer> <unique> ,w /[.,;]<CR>
242 If you want to map a key and then have it do what it was originally mapped to,
245 *:map-<expr>* *:map-expression*
325 *<Cmd>* *:map-cmd*
351 - In Select mode, |:map| and |:vmap| command mappings are executed in
363 1.3 MAPPING AND MODES *:map-modes*
376 is disabled. This makes it possible to map zero without making it impossible
379 *map-overview* *map-modes*
380 Overview of which map command works in which mode. More details below.
382 :map :noremap :unmap Normal, Visual, Select, Operator-pending
388 :map! :noremap! :unmap! Insert and Command-line
395 *map-table*
398 [nore]map | yes | - | - | yes | yes | yes | - | - |
399 n[nore]map | yes | - | - | - | - | - | - | - |
400 [nore]map! | - | yes | yes | - | - | - | - | - |
401 i[nore]map | - | yes | - | - | - | - | - | - |
402 c[nore]map | - | - | yes | - | - | - | - | - |
403 v[nore]map | - | - | - | yes | yes | - | - | - |
404 x[nore]map | - | - | - | yes | - | - | - | - |
405 s[nore]map | - | - | - | - | yes | - | - | - |
406 o[nore]map | - | - | - | - | - | yes | - | - |
407 t[nore]map | - | - | - | - | - | - | yes | - |
408 l[nore]map | - | yes | yes | - | - | - | - | yes |
413 :map :noremap :unmap :mapclear yes yes yes
438 :map! :noremap! :unmap! :mapclear! yes yes -
447 Therefore the ":map" and ":map!" commands enter and display mappings for
472 :map xx something-difficult
503 1.4 LISTING MAPPINGS *map-listing*
535 *:map-verbose*
536 When 'verbose' is non-zero, listing a key map will also display where it was
539 :verbose map <C-W>*
546 1.5 MAPPING SPECIAL KEYS *:map-special-keys*
548 There are three ways to map a special key:
550 starts with <Esc>. To enter a mapping like this you type ":map " and then
566 :map <t_F3> G
579 for a mapping is done again (so you can map an internal code to something
586 1.6 SPECIAL CHARACTERS *:map-special-chars*
587 *map_backslash* *map-backslash*
594 To map a backslash, or use a backslash literally in the {rhs}, the special
598 *map_CTRL-C* *map-CTRL-C*
605 *map_space_in_lhs* *map-space_in_lhs*
608 *map_space_in_rhs* *map-space_in_rhs*
612 *map_empty_rhs* *map-empty-rhs*
620 :map <F8> <Nop>
621 :map! <F8> <Nop>
623 *map-multibyte*
624 It is possible to map multibyte characters, but only the whole character. You
625 cannot map the first byte only. This was done to prevent problems in this
639 :map <Leader>A oanother line<Esc>
641 :map \A oanother line<Esc>
645 :map ,A oanother line<Esc>
655 :map <buffer> <LocalLeader>A oanother line<Esc>
664 *map-<SID>*
674 To map a character by its decimal, octal or hexadecimal number the <Char>
683 *map-comments*
688 *map_bar* *map-bar*
689 Since the '|' character is used to separate a map command from the next
693 <Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M
694 \| 'b' is not in 'cpoptions' :map _l :!ls \| more^M
695 ^V| always, in Vim and Vi :map _l :!ls ^V| more^M
706 *map_return* *map-return*
710 :map _ls :!ls -l %:S<CR>:echo "the end"<CR>
715 *map-error*
725 1.7 WHAT KEYS TO MAP *map-which-keys*
727 If you are going to map something, you will need to choose which key(s) to use
734 characters may be used as well. |:map-alt-keys|
748 1.8 EXAMPLES *map-examples*
753 :map <F3> o#include
754 :map <M-g> /foo<CR>cwbar<Esc>
755 :map _x d/END/e<CR>
756 :map! qq quadrillion questions
763 :map <F4> 3w
766 :map <F4> @='3w'<CR>
770 1.9 USING MAPPINGS *map-typing*
774 complete match or until there is no match at all. Example: If you map! "qq",
783 *map-precedence*
784 Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
789 :map <buffer> <nowait> \a :echo "Local \a"<CR>
790 :map \abc :echo "Global \abc"<CR>
794 *map-keys-fails*
815 :map <F1><Esc>OP :echo "yes"<CR>
820 prepends ESC instead of setting the 8th bit. See |:map-alt-keys|.
832 :map ab abcd
842 With the normal :map command, when the 'remap' option is on, mapping takes
845 :map x y
846 :map y x
851 *:map-undo*
859 1.10 MAPPING ALT-KEYS *:map-alt-keys*
923 When modifyOtherKeys is enabled you can map <C-[> and <C-S-{>: >
930 mapping, see |map-bar|.
932 WARNING: if you map <C-[> you may very well break any key codes that start
944 1.12 MAPPING AN OPERATOR *:map-operator*
1137 mappings, see |map-listing|.
1158 See |:map-<expr>| for the optional <expr> argument.
1159 See |:map-<buffer>| for the optional <buffer> argument.
1262 When executing the map command, Vim will replace "<SID>" with the special
1265 :map <SID>Add