vim-jetpack
vim-jetpack copied to clipboard
Request: expose `s:declared_packages` for removing plugins
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
- add jetpack#unadd to remove from
s:declared_packages
- change to something like
g:declared_packages
- 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