Friday, August 5, 2016

How does one load plugin-specific settings after a plugin with the new packages feature?

Previously, when I installed a plugin, I could set up mappings to that plugin's functionality by putting commands in ~/vimfiles/after/plugin/someplugin_maps.vim

Now with packages, this no longer works, because loading plugins is done as with ":runtime! plugin/**/*.vim" BEFORE loading packages.

This is somewhat counter-intuitive because the ~/vimfiles/after directory DOES come after the package plugin directories.

What's the best practice now? I tried using an after/plugin directory in a plugin folder within a package, but although the after directory gets added to the runtime path, stuff in the after/plugin directory won't get sourced.

I'm not fond of adding a VimEnter autocmd for this, since that prevents me from easily installing/uninstalling plugins by simply removing their directory (and maybe an "override" directory).

The best I can come up with is adding a new pluginname_overrides/plugin/pluginname_maps.vim in the same package as the plugin itself. Then by virtue of sort order it will always get sourced after the plugin itself.

Is there a better way?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment