Vital.Vim.Snoop provides a way to snoop script local functions.
vital.vim: https://github.com/vim-jp/vital.vim
NeoBundle 'vim-jp/vital.vim'
NeoBundle 'haya14busa/vital-snoop.vim'
Plugin 'vim-jp/vital.vim'
Plugin 'haya14busa/vital-snoop.vim'
Plug 'vim-jp/vital.vim'
Plug 'haya14busa/vital-snoop.vim'
2. Embed vital-snoop.vim into your plugin with :Vitalize (assume current directory is the root of your plugin repository).
See :Vitalize
for more information.
:Vitalize . --name={plugin_name} Vim.Snoop
:Vitalize .
let s:V = vital#of('vital')
let s:S = s:V.import('Vim.Snoop')
"" Get <SID> with relative path to &runtimepath
" e.g. starts with autoload/, plugin/, etc...
" (autoload/**/.vim, plugin/**/.vim)
:echo s:S.sid('autoload/Snoop/test/snoop_relative.vim')
" => <SID>
"" Get the dict which contains script local functions with absolute
" path
:let sf = s:S.sfuncs('~/.vim/bundle/vital-snoop.vim/test/files/snoop.vim')
:echo sf
" =>
" {
" 'double': function('<SNR>439_double'),
" '_power': function('<SNR>439__power')
" }
:echo sf.double(3) | " => 6
:echo sf._power(3) | " => 9
function! s:double(x) abort
return a:x * 2
endfunction
function! s:_power(x) abort
return a:x * a:x
endfunction
haya14busa (https://github.com/haya14busa)