Packer.nvim: Consider moving to/adding rtp-based plugin management

Created on 16 Oct 2020  路  7Comments  路  Source: wbthomason/packer.nvim

From conversations with @bfredl, @clason, and others, it may be worth investigating using "traditional" rtp-based plugin management instead of native packages (mostly to get around the annoying sourcing order problem).

This would entail:

  • Change the install root to not be on packpath
  • Generate a file with the correct rtp value, to be sourced in init

    • This entails figuring out the correct rtp value based on the set of plugins to be loaded eagerly

  • Write code to emulate packadd for lazy-loading
  • Figure out how to make short rtps, potentially by merging plugin directories like dein?
enhancement refactor

Most helpful comment

This could be done by changing the internal _representation_ of &rtp from a ridicously long string option, to an _array of strings_, which can be manipulated/inspected/debugged directly from lua code. We can even make it callback-driven (to lazy load things "smartly"), given Sufficiently Smart caching logic (which is how I do lua callbacks for :highlight definitions already).

All 7 comments

馃 I thought native package is the best way to go with regards to performance. I will look more into rtp.

Thanks for the update

@tami5: That had been my thinking too, but the others raised some valid points that this may not be the case (or may be easily fixed if it is the case) in discussion on Gitter.

Figure out how to make short rtps, potentially by merging plugin directories like dein?

If it helps, we will make neovim core handle long rtp:s better :]

This could be done by changing the internal _representation_ of &rtp from a ridicously long string option, to an _array of strings_, which can be manipulated/inspected/debugged directly from lua code. We can even make it callback-driven (to lazy load things "smartly"), given Sufficiently Smart caching logic (which is how I do lua callbacks for :highlight definitions already).

@bfredl: Am I correct in believing that https://github.com/neovim/neovim/pull/13119 only affects Lua start plugins, not Vimscript plugins? Meaning that changing to rtp-based management is now less important, but not completely irrelevant?

@wbthomason my _intention_ was to also support vimscript plugins but it looks to be a bit messy to do it "perfectly". At very least we will support autoload/ calls during init.vim for vimscript plugins that use autoload for config (but don't need all messy details of runtime during init). It could make sense to wait a few days as people try it out (and I fix remaining bugs :)

Sounds good, thank you for the patches! I'm happy about anything that gets me speed while saving me from having to do crazy cleverness with the rtp. :grinning:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nanotee picture nanotee  路  7Comments

jzelinskie picture jzelinskie  路  6Comments

GustavoPrietoP picture GustavoPrietoP  路  7Comments

ianzhuo picture ianzhuo  路  4Comments

clason picture clason  路  5Comments