Skip to content

Instantly share code, notes, and snippets.

@kaneshin
Created October 1, 2011 16:57
Show Gist options
  • Save kaneshin/1256323 to your computer and use it in GitHub Desktop.
Save kaneshin/1256323 to your computer and use it in GitHub Desktop.
How to use s: or <SID>
" How to use 's:' or '<SID>'
"--------------------
" s:
" :autocmd, :command, :function/:endfunction
command! -nargs=1 Foo :call s:foo(<f-args>)
function! s:foo(bar)
let l:baz = 0
" ...
return s:foo(l:baz)
endfunction
"--------------------
" <SID>
" :map, :menu
cnoremap foo call <SID>foo("qux")<CR>
"--------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment