vim-jetpack icon indicating copy to clipboard operation
vim-jetpack copied to clipboard

Request: expose `s:declared_packages` for removing plugins

Open BlueDrink9 opened this issue 1 year ago • 0 comments

Hello. I am migrating from vim-plug. In vim-plug, I could undo a Plug command by removing the plugin from g:plugs. This lets me replace plugins with better versions if dependencies allow. For example, treesitter can replace plugins like context and argumentative, but I only want to do that if I have successfully set up treesitter. So I can have context in my config as normal, but on machines with a c compiler, it seamlessly replaces it with treesitter.

Would you consider either

  1. add jetpack#unadd to remove from s:declared_packages
  2. change to something like g:declared_packages
  3. expose plugin SID so users can hack this on at their own risk

I understand you might not want to officially support un-adding plugins before jetpack#end, so 1. might be bad. 3 would be safe, just add:

function! jetpack#getSID()
    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfunction

BlueDrink9 avatar Aug 03 '23 02:08 BlueDrink9