Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with sourcing plugins #118

Closed
wants to merge 1 commit into from
Closed

Conversation

sheerun
Copy link

@sheerun sheerun commented Sep 30, 2020

I'm author of vim-polyglot plugin which as very specific requirements when it comes about source files of plugins. Specifically it is required that its filetype script is loaded before vim's filetype script. Also the order of loading packages is important, vim-polyglot should defined first in ~/.vimrc, and should also be loaded first, before any other plugins. Consider ~/.vimrc that defines 2 plugins to load. Every other package manager sources files in this order:

  1. ftdetect dirs of plugins
  2. ftdetect dir of vim runtime
  3. plugin dirs of vim plugins
  4. plugin dir of vim runtime

You can see it in action for vim-plug (vundle, pathogen, dein.vim work the same). The same story is even with vim8 packages when using start plugins + packload (here plugin load order depends on names of plugins), and also vim8 opt packages + packadd command (though here filetype.vim is loaded in reversed order...).

Here finally we can compare with what minpac does. First of all load order is different on vim and nvim, and it is wrong in both cases.

Vim load order:

  1. ftdetect files of plugins (in reverse alphabetical order, instead of order of definition)
  2. plugin dir of vim runtime
  3. filetype.vim dir of vim runtime
  4. plugin dirs of vim plugins, in reverse order

Nvim load order (even worse):

  1. filetype.vim of vim runtime
  2. plugin dir of vim runtime
  3. ftdetect files of plugins (but this time in alphabetical order, instead of order of definition)
  4. runtime ftdetect files again
    5 plugin dir of vim plugins

As you can see nothing is consistent and this PR changes it by loading plugins in correct order, on all platforms, in correct time, as other plugin managers do, and exactly the same on vim and nvim. I'm doing to by installing all packages as opt, and manually adding them to runtimepath, instead of either calling packadd, packadd!, packload, all of which have weird behaviors.

@k-takata
Copy link
Owner

Handling 'runtimepath' is not a task of minpac (except for supporting neovim's :UpdateRemotePlugins command). It's a task of Vim's packages feature.
It seems that the original issue in sheerun/vim-polyglot#571 has been solved. So, closing.

@k-takata k-takata closed this Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants