Mercurial > vim
diff runtime/doc/map.txt @ 625:81fe2ccc1207 v7.0179
updated for version 7.0179
author | vimboss |
---|---|
date | Thu, 12 Jan 2006 23:22:24 +0000 |
parents | cf83dc83b1ab |
children | 732c7ae5743e |
line wrap: on
line diff
--- 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.