summaryrefslogtreecommitdiffstats
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 90ebe06ebc..85155b439d 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 7.0aa. Last change: 2005 Dec 17
+*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -946,11 +946,10 @@ local function or uses a local mapping.
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 trick: >
- :map <SID>xx <SID>xx
- :let s:sid = maparg("<SID>xx")
- :unmap <SID>xx
-And remove the trailing "xx".
+use this function: >
+ function s:SID()
+ return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
+ endfun
The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to.