Skip to content

Instantly share code, notes, and snippets.

@dmerejkowsky
Last active March 24, 2016 10:57
Show Gist options
  • Save dmerejkowsky/5cb58999d2bf2106a788 to your computer and use it in GitHub Desktop.
Save dmerejkowsky/5cb58999d2bf2106a788 to your computer and use it in GitHub Desktop.
" One argument:
function! Foo(foo)
" Do something with a:foo
endfunction
command! -nargs=1 -complete=file Foo :call Foo("<args>") " <- note the quotes
" Two arguments:
function! Foo2(foo, bar)
" Do something with a:foo and a:bar
endfunction
command! -nargs=* -complete=file Foo :call Foo(<f-args>)
" -> no quotes
" -> -nargs=2 does not work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment