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

Idea: variable to disable registration of plugin #442

Closed
6 of 11 tasks
mikew opened this issue Mar 8, 2016 · 5 comments
Closed
6 of 11 tasks

Idea: variable to disable registration of plugin #442

mikew opened this issue Mar 8, 2016 · 5 comments
Labels

Comments

@mikew
Copy link

mikew commented Mar 8, 2016

It would be cool if vim-plug checked the name against a list of "disabled" plugins, and if the name is included, simply do nothing in s:Plug().

The idea being if people use vim-plug in their distributions (janus, spf-13, dotvim, etc), they wouldn't all need to write their own disabling logic.

Basically:

" This would be in the users' vimrc
let g:plugs_disabled = ['nerdtree']

" This would be somewhere in the distribution, not controlled by the user
Plug 'scrooloose/nerdtree'
Plug 'mileszs/ack.vim'

" NERDTree won't be installed or loaded

  • Type:
    • Bug
    • Enhancement
    • Feature Request
    • Question
  • OS:
    • All/Other
    • Linux
    • OS X
    • Windows
  • Vim:
    • Terminal Vim
    • GVim
    • Neovim
@vheon
Copy link
Contributor

vheon commented Mar 8, 2016

Personally I don't see the use case 😕

@mikew
Copy link
Author

mikew commented Mar 8, 2016

It's more for users and maintainers of vim distributions.

Hypothetical use case: I use $VimDistrib, which includes neocomplete, vim-rails and vim-vroom. I will never use these, but $VimDistrib has no way of disabling them aside from editing files (that will be overridden next time updated).

Now $VimDistrib could write a disable_plugin(...) function, but then $OtherDistrib would have to write one as well, and so on and so on.

@vheon
Copy link
Contributor

vheon commented Mar 8, 2016

With vim-plug configurability has always been "external" so you would do the logic around vim-plug's primitives (like Plug). What you're asking is similar to #137.

@mikew
Copy link
Author

mikew commented Mar 8, 2016

Similar, yeah. But that issue is for when you control the vimrc, and mine is for when you don't. Also, this solution would allow that reporter to use a single list of plugins and manipulate g:plugs_disabled based on his environment.

Anyways, this is what I've come up with, but it relies on g:plugs and g:plugs_order being global, which could change in the future.

@junegunn
Copy link
Owner

junegunn commented Mar 9, 2016

Thanks for the suggestion, but however, to me it clealy looks like a responsibility of each distribution. As you might have noticed while coming up with your own solution, implementing the blacklist is easy and requires just a few lines of Vimscript, so I wouldn't worry too much about the duplicate effort. g:plugs is not going away, but it can be done in different ways without having to rely on the variable. e.g. defining a command that conditionally executes Plug command; MyPlug 'foo/bar', {'baz': 1}

And to be honest, I believe "Vim distribution" is a bad practice and I wouldn't add a feature that I don't need just for the ease of development of those distributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants