1

How to reference a script-local dictionary in a Vim mapping?

view story
linux-howto

http://unix.stackexchange.com – Somehow I'm not able to execute the following mapping: function! s:MySurroundingFunctionIWantToKeep() let s:Foobar={'foo': 'bar'} map \42 :echo <sid>Foobar.foo<cr> endfunction call s:MySurroundingFunctionIWantToKeep() I thought it works the same way as it does with a script-local function: function! s:MySurroundingFunctionIWantToKeep() function! s:Foobar() echo 'bar' endfunction map \42 :call <sid>Foobar()<cr> endfunction call s:MySurroundingFunctionIWantToKeep() Also freeing s:Foobar from s:MySurroundingFunctionIWantToKeep() doesn't help, like: let (HowTos)