How do I make conditional settings in vim based on whether some command is available in system path?

For example I would like to enable par paragraph formating when the par command is available

Something like this:

if syspathhas("par")
    set formatprg=par\ -w80
endif
link|improve this question

50% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Use the executable function, as

if executable("par")
    set formatprg=par\ -w80
endif
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.