Assuming that the plugin is using the standard scheme for filetype specific configuration...
Probably the simplest way to override is by creating a file in
$MYVIMDIR/after/ftplugin with filename that matches the
ft) setting when such a file is loaded. The plugin likely has a file of the same name and it will either be in directory
ftplugin within its own installation directory or in the shared location for such files,
As an example, filetype specific settings for Java source files would be in a file named
java.vim so to override you'd do:
(Assuming *nix style home directory.) Inside that file you'd then assign appropriate values to whatever settings you want to override.
In your specific case where you have a custom
'makeprg' value you'll want to do:
(If you just wanted to reset to the default value you could do
You can find some additional details in the "DISABLING" section under
Update: So the above is a valid solution but requires taking action any time a new plugin that overrides
makeprg comes along. OP wondered if there's a way to take care of current and future plugins in one fell swoop. This'll do the trick...
In your Vim "home directory" (e.g.
~/.vim) create a file in
after/ftdetect. Name doesn't matter. I chose
makecheck.vim. Then add the following line to it:
au BufRead,BufNewFile * if &makeprg !=# 'XXX' | set makeprg=XXX | endif
XXX should be replaced with whatever global
makeprg value you're using.
As the name suggests, files in the
after sub-tree get processed after other Vim files. This ensures the settings within aren't overwritten (by a plugin, for instance). It should be pretty self-explanatory how it works from there.