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
Use vim-plug over vundle #345
Use vim-plug over vundle #345
Conversation
👍 I was just thinking about this today. I'm also interested in the on-demand loading of plugins that Plug can do, but I see you didn't add any of those yet. |
@tsigo, I'm excited about this feature, but I don't think many of the plugins included in vim-rails was my top candidate, but it turns out to have a fairly short load time, and has so many relevant commands that I think some would fall through in an attempt to defined the ones that result in pre-loading. I also haven't tested whether vim-rails' awareness of whether you are in a Rails app or not would be affected by being loaded lazily. Since this commit could potentially disrupt users' plugin use (one time) with the required renaming of plugin declarations, I'd like to keep the changes as compact as possible, and we can start investigating which plugins work well in lazy loading in a later PR. |
Vundle has two plugin options.
This function and custom command should allow users to continue with their existing UPDATE: edited this shim in the commit, it's not quite correct. function! PluginToPlug(arg, options)
let vundle_options = a:options
let vim_plug_options = {}
if len(vundle_options) > 0
if has_key(vundle_options, 'name')
let vim_plug_options.dir = "~/.vim/bundle/".vundle_options.name
endif
if has_key(vundle_options, 'rtp')
vim_plug_options.rtp = vundle_options.rtp
endif
endif
Plug a:arg, vim_plug_options
endfunction
com! -nargs=+ -bar Plugin call PluginToPlug(<args>) |
I installed vim-easy-align today and noticed that the README recommended vim-plug. Seems like it's gaining some community momentum? https://github.com/croaky/dotfiles/commit/1efd070ef59d3e8a33e2a6bad223bd0b766dcb43 |
Well, in that case it's because it's from the same author. I've seen it used/recommended in a few other places though. |
After using this for a couple weeks (during which I've been swapping some experimental plugins in and out), I have had a very nice experience using vim-plug. I think some other folks should also give it a try. @gylaz, should I commit the above-pasted shim-function so that folks don't have to edit their own |
What's the impact to existing users of this switch? Do they need to do anything? |
37e8016
to
3fc376c
Compare
(note: just fixed the shim after doing a little more testing) I squashed the shim in on the reasoning that it's better to have the easiest migration path possible. With my Given that this will cause a lot of error messages on vim start if there's a problem, I'd appreciate it if a few folks could test locally on their machines. The best way to test the migration path would be:
Unless/until Vundle changes their API, we can leave the shim in place. If at some future point Vundle changes their API, I think it would be best to remove the shim after users had gotten time to migrate their |
3fc376c
to
e0086bd
Compare
The lock and rollback certainly seem interesting enough to consider this. The rest of the stuff... meh. As for the shim, I think it'd be useful if it outputted a deprecation notice when it was used. Is that possible? We don't want to maintain this shim forever. Still not certain its the way to go. Why cant these things be added to vundle? |
@derekprior, gmarik wrote last year that he's no longer going to contribute to Vundle. Since April, development has more or less stopped despite lots of open issues and pull requests. The git tag/branch functionality is on Vundle's wishlist, but there are as yet no plans to do lock/rollback. I'm happy to add a deprecation notice, I think that's the most practical way to get users to update their |
a1a0c27
to
d55447e
Compare
If Vundle is basically defunct, I think it makes sense for us to switch to something which is actively developed. |
|
||
com! -nargs=+ -bar Plugin call PluginToPlug(<args>) | ||
|
||
filetype off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I just stumbled upon this :) filetype off
here and filetype on
below are not required as they are already handled by plug#begin()
and plug#end()
.
Removing these on @junegunn's recommendation: thoughtbot#345 (comment)
I just migrated from vundle to vim-plug and it was pretty seamless. I didn't even have to remove my previous |
1964c02
to
60e21f4
Compare
I just squashed my commits and rebased against master since there have been some changes there since this PR got started. |
60e21f4
to
70b3367
Compare
[vim-plug](https://github.com/junegunn/vim-plug) has a number of advantages over Vundle: * Installs and updates plugins very quickly in parallel * Can lock plugins at versions/tags * Can rollbacks updates (useful if a plugin breaks) and take/reload snapshots of current state * Optionally lazily-load plugins when their relevant command is invoked * Execute post-update hooks for plugins with compiled extensions, etc. vim-plug uses a DSL very close to Vundle (simplest form is `Plug` vs. `Plugin`), and here it is set to continue to use the same plugin location that Vundle was using before. After updating, users will need to 1. Rename `Plugin` lines in `.vimrc.bundles.local` to use `Plug` 2. Run `:PlugInstall` (the post-up hook does this)
70b3367
to
4893a9a
Compare
I accidentally deleted the branch on Github, which screwed up this PR. Reopened as #368. |
Close |
vim-plug has a number of advantages over Vundle:
vim-plug uses a DSL very close to Vundle's (simplest form is
Plug
vs.Plugin
), and here it is set to continue to use the same plugin location that Vundle was using before.After updating, users will need to
Plugin
lines in.vimrc.bundles.local
to usePlug
:PlugInstall
(the post-up hook does this automatically)I am unsure of whether automating renaming in
.vimrc.bundles.local
in a one-time post-up hook (executing it if vim-plug isn't installed at the same time as installing vim-plug) is a good thing to do. For now I've left it out, but if that's needed for widespread support, that would be straightforward to add.