I know that you can refer to script-local functions using
<SID> but what about script-local variables? I tried the following, and hitting
let s:testVar = "foo" function! s:GetTestVar() return s:testVar endfunction nnoremap <space> :echo <SID>GetTestVar()<cr> nnoremap <c-space> :echo <SID>testVar<cr>
You can get around this by writing accessor functions (as above) but sometimes it would be nice to be able to refer directly.