Closed mathomp4 closed 12 months ago
if executable('code-minimap') Plug 'wfxr/minimap.vim' endif
I think the solution is already elegant and expressive. vim-plug tries to avoid reinventing the wheel, i.e. if you can do something natively without an option, we probably shouldn't provide the option.
You might want to check out: https://github.com/junegunn/vim-plug/wiki/tips#conditional-activation
This is just a question as I'm trying to be an elegant/better user of vim-plug rather than just hacking my way along. To wit, I recently learned about
minimap.vim
which requirescode-minimap
to be installed. Now, the author says you can do:but, well, I don't want to do any
cargo install
on some of the systems I run on. But, you can just installcode-minimap
, put it in the path, and all is well.So, what I'd like to do is only use the plug if the executable is installed. I'm currently doing this by:
which seems to work just fine. But I wondered "Is there a more elegant way of doing this?" vim-plug has all those cool
Plug options
that I'd like to learn. I tried reading the FAQ and wiki but I couldn't see anything, so apologies if this is a FAQ.