comparison 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
comparison
equal deleted inserted replaced
624:91e7d4a7b3b0 625:81fe2ccc1207
1 *map.txt* For Vim version 7.0aa. Last change: 2005 Dec 17 1 *map.txt* For Vim version 7.0aa. Last change: 2006 Jan 09
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
944 local function or uses a local mapping. 944 local function or uses a local mapping.
945 945
946 Otherwise, using "<SID>" outside of a script context is an error. 946 Otherwise, using "<SID>" outside of a script context is an error.
947 947
948 If you need to get the script number to use in a complicated script, you can 948 If you need to get the script number to use in a complicated script, you can
949 use this trick: > 949 use this function: >
950 :map <SID>xx <SID>xx 950 function s:SID()
951 :let s:sid = maparg("<SID>xx") 951 return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
952 :unmap <SID>xx 952 endfun
953 And remove the trailing "xx".
954 953
955 The "<SNR>" will be shown when listing functions and mappings. This is useful 954 The "<SNR>" will be shown when listing functions and mappings. This is useful
956 to find out what they are defined to. 955 to find out what they are defined to.
957 956
958 The |:scriptnames| command can be used to see which scripts have been sourced 957 The |:scriptnames| command can be used to see which scripts have been sourced