3

My current Vim setup includes the ack.vim plugin. Now, I'd like to use the Vim setup I have on other systems, but some of those systems don't have ack installed. Is there a way for me to detect the presence or absence of ack in the .vimrc and turn the plugin on/off accordingly?

(Edit: fixed a typo.)

abeger
  • 6,766
  • 7
  • 41
  • 58

1 Answers1

1

There's probably a better way but this works:

call system('which ack')
if !v:shell_error
  " turn your plugin on
endif
allan
  • 1,269
  • 9
  • 7