Reputation: 42483
In VIM script, i want to check if VIM was started with command-line arguments or wthout. For this, i want to check a result of :args command that prints arguments. But how to put a result of :args inside an if() or a variable. Following wll not work:
let s:MyArgs = execute( "args" )
Upvotes: 2
Views: 481
Reputation: 32946
You need to play with :redir
. I have encapsulated this operation in a function there.
BTW, argc() should also answer your original need in a simpler way. (:h argc())
Upvotes: 5