Clark J. Wang wrote:
> Some built-in vim functions support optional arguments.
> For example, we can write winnr() as well as winnr('$').
> Can I define my own functions with optional arguments?

Yes. When desperate, try something like this to search Help:

  :helpgrep \coptional.*arg

That does a case-insensitive (\c) search for all lines
containing "optional" followed by "arg". There are a lot of hits
you don't want, but then you find:

  :help function-argument

There are a few details about getting it working, and I have
seen different approaches. There are couple of techniques which
work well in the scripts in these tips:

http://vim.wikia.com/wiki/CSV
http://vim.wikia.com/wiki/Highlight_multiple_words

See '...' in the first tip, and s:Highlight(args) in the second.

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to