In Vim, is it possible to conditionally disable a plugin based on environment?

My current Vim setup includes the ack.vim plugin . Now I would like to use the Vim setup on my other systems, but some of those systems are not installed. Is there a way to detect the presence or absence of ack in the .vimrc and enable / disable the plugin accordingly?

(Edit: typo corrected.)


source to share

1 answer

Probably the best way, but this works:

call system('which ack')
if !v:shell_error
  " turn your plugin on




All Articles