summaryrefslogtreecommitdiffstats
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-21 13:16:30 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-21 13:16:30 +0100
commit4466ad6baa22485abb1147aca3340cced4778a66 (patch)
treeca11c0216ad16b5ce923f32bebaf116bc0ffc0e9 /runtime/doc/map.txt
parent2d718267f4b7dcd65261c9f2acd59a6f6bdc8641 (diff)
Update runtime files
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 83a5428ce6..5132507b0a 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 8.2. Last change: 2020 Nov 12
+*map.txt* For Vim version 8.2. Last change: 2020 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -319,13 +319,16 @@ Example of using <Cmd> halfway Insert mode: >
nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
-command: it is executed as if an (unrestricted) |autocmd| was invoked.
+command: it is executed as if an (unrestricted) |autocommand| was invoked.
Note:
- Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and
|CmdlineLeave| events, because no user interaction is expected.
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys.
+- The command is not echo'ed, no need for <silent>.
+- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
+ Visual area, the cursor is at the other end.
- In Select mode, |:map| and |:vmap| command mappings are executed in
Visual mode. Use |:smap| to handle Select mode differently.
@@ -1238,9 +1241,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can
use this function: >
- function s:SID()
- return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
- endfun
+ func s:ScriptNumber()
+ return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
+ endfunc
The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to.