tags:

views:

66

answers:

1

Hello.

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" )
+3  A: 

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())

Luc Hermitte