summaryrefslogtreecommitdiffstats
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-10-20 22:22:38 +0200
committerBram Moolenaar <Bram@vim.org>2011-10-20 22:22:38 +0200
commit1514667a24c00c247d8527e9a2e12dba97ca9d85 (patch)
treeb5f8c262ed1763dd64224736e374ec90de5df4d9 /runtime/doc/map.txt
parente3cc6d422367e5d7a0a15c69480313644caefd01 (diff)
Updated runtime files.
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 92e21668f0..759c90c528 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 7.3. Last change: 2011 Aug 19
+*map.txt* For Vim version 7.3. Last change: 2011 Oct 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -237,11 +237,18 @@ For this reason the following is blocked:
- Editing another buffer.
- The |:normal| command.
- Moving the cursor is allowed, but it is restored afterwards.
-- You can use getchar(), but the existing typeahead isn't seen and new
- typeahead is discarded.
If you want the mapping to do any of these let the returned characters do
that.
+You can use getchar(), it consumes typeahead if there is any. E.g., if you
+have these mappings: >
+ inoremap <expr> <C-L> nr2char(getchar())
+ inoremap <expr> <C-L>x "foo"
+If you now type CTRL-L nothing happens yet, Vim needs the next character to
+decide what mapping to use. If you type 'x' the second mapping is used and
+"foo" is inserted. If you type 'a' the first mapping is used, getchar() gets
+the 'a' and returns it.
+
Here is an example that inserts a list number that increases: >
let counter = 0
inoremap <expr> <C-L> ListItem()