diff runtime/doc/map.txt @ 5035:1cf89d38aa76 v7.3.1261

updated for version 7.3.1261 Problem: A buffer-local language mapping from a keymap stops a global insert mode mapping from working. (Ron Aaron) Solution: Do not wait for more characters to be typed only when the mapping was defined with <nowait>.
author Bram Moolenaar <bram@vim.org>
date Sat, 29 Jun 2013 13:58:31 +0200
parents a5352e73dc00
children c458ff35497e
line wrap: on
line diff
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -159,9 +159,9 @@ type "a", then "bar" will get inserted.
 
 1.2 SPECIAL ARGUMENTS					*:map-arguments*
 
-"<buffer>", "<silent>", "<special>", "<script>", "<expr>" and "<unique>" can
-be used in any order.  They must appear right after the command, before any
-other arguments.
+"<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and
+"<unique>" can be used in any order.  They must appear right after the
+command, before any other arguments.
 
 				*:map-local* *:map-<buffer>* *E224* *E225*
 If the first argument to one of these commands is "<buffer>" the mapping will
@@ -169,7 +169,9 @@ be effective in the current buffer only.
 	:map <buffer>  ,w  /[.,;]<CR>
 Then you can map ",w" to something else in another buffer: >
 	:map <buffer>  ,w  /[#&!]<CR>
-The local buffer mappings are used before the global ones.
+The local buffer mappings are used before the global ones.  See <nowait> below
+to make a short local mapping not taking effect when a longer global one
+exists.
 The "<buffer>" argument can also be used to clear mappings: >
 	:unmap <buffer> ,w
 	:mapclear <buffer>
@@ -177,6 +179,14 @@ Local mappings are also cleared when a b
 unloaded.  Just like local option values.
 Also see |map-precedence|.
 
+						*:map-<nowait>* *:map-nowait*
+When defining a buffer-local mapping for "," there may be a global mapping
+that starts with ",".  Then you need to type another character for Vim to know
+whether to use the "," mapping or the longer one.  To avoid this add the
+<nowait> argument.  Then the mapping will be used when it matches, Vim does
+not wait for more characters to be typed.  However, if the characters were
+already type they are used.
+
 						*:map-<silent>* *:map-silent*
 To define a mapping which will not be echoed on the command line, add
 "<silent>" as the first argument.  Example: >