In my .vimrc
I am trying to use ftplugin
and obviously use some commands relating to that under the assumption that it was loaded successfully. However, I have now encountered a few old machines that don't have the plugin installed. Can I somehow make loading of this plugin conditional and add filetype on
and similar directives into the same conditional block?
I have seen there are conditions for color schemes and the Vim version, but I haven't seen an example that would check for the plugin (or didn't recognize it).
NB: Be gentle, I am a VimScript beginner.
~/.vimrc
, so you won't be able to test for the effects of a plugin within your~/.vimrc
unless you test for the existence of the plugin file or defer the test until after plugins have been loaded with an autocommand such as VimEnter.