title: VIM: How to pass arguments to functions from user commands?
body: <p>I am trying to create a user-defined command in VIM that takes one argument and calls a function with the user supplied argument. Seems simple but I am unable to get it to work.  Here is the code from my foo.vim plugin:</p>
  
  <pre><code>function! s:MyFunc(myParam)
      do something
  endfunction
  
  command! -nargs=1 MyCommand call s:MyFunc(myParam)
  </code></pre>
  
  <p>When I try this out in a VIM buffer like this:</p>
  
  <pre><code>:MyCommand exampleParam
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>E121: Undefined variable: myParam 
  E116: Invalid arguments for function &lt;SNR&gt;7_MyFunc
  </code></pre>
  
  <p>What's wrong here? How do I fix this? Any help is greatly appreciated.</p>