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

Vundle should be more automatable #325

Open
sargon2 opened this issue Aug 23, 2013 · 5 comments
Open

Vundle should be more automatable #325

sargon2 opened this issue Aug 23, 2013 · 5 comments
Labels

Comments

@sargon2
Copy link

sargon2 commented Aug 23, 2013

BundleClean, BundleInstall, etc are great for running plugin management operations manually. But what if you want to automate them?

For example, I would like to automatically run BundleClean each time I start vim, in case my .vimrc has been modified on another computer. BundleInstall may be good to run as well, if it's fast enough. BundleUpdate is probably too slow to run each time, but I could script running it once a month, or something along those lines.

But I can't just add :BundleClean to my .vimrc, since it opens a buffer. I tried scripting closing the buffer immediately after it opens, but the screen still flashes annoyingly, and it still shows the buffer in the console after I quit vim.

I would love to see some kind of quiet-bundle-clean, quite-bundle-install, quiet-bundle-update, etc functions, that perform their operations without any user interaction (and raise any errors that occur in a visible way).

@lucc
Copy link
Contributor

lucc commented Aug 25, 2013

you can just write a executable vim script and execute that every day or week or whenever you want:

#!/usr/bin/env vim -e -s -u ~/.vimrc -S
BundleUpdate
qa

See :h -s-ex for more info.

@sargon2
Copy link
Author

sargon2 commented Aug 25, 2013

Sure, that's an OK workaround for update. It's not ideal since it would hide any error output. In addition, I also want to automatically run BundleClean and BundleInstall on vim startup.

@MarcWeber
Copy link

Think about why you want to run BundleClean automatically? Disk is cheap today. Also see #367 - eventually rm -fr everything and checking out everything from scratch is better for the reason given there. It looks like you're an advanced vim user - thus looking at bundles code should allow you to duplicate those viml lines you need (get list of plugins, use glob to find out about install, diff, then run rm -fr or so). I also suggest learning about "lazy loading" #364 which will change your view on this topic eventually.

@sargon2
Copy link
Author

sargon2 commented Feb 12, 2014

For #364, it's better to install all bundles at once, and then configure actually loading each plugin based on file type.

For #367 BundleClean should delete the old repo, and BundleUpdate should check out the new one. In my automated startup I would run clean before update.

For the viml lines -- I can look at that, but wouldn't it be better to avoid duplicating those lines between vundle and my .vimrc? I'd much rather have a callable function. It makes for more seamless package management.

This is not a high priority enhancement, but in the long term, it would make Vundle better.

@MarcWeber
Copy link

In VAM it would be
let list =
exec "VAMUninstallNotLoadedPlugins '.join(' ', filter(vam#install#KnownAddons(''), '!has_key(s:c.activated_plugins, v:val) && isdirectory(vam#PluginDirFromName(v:val))'))

but that would slow, (and still incomplete). The best option would be to glob the install directory and compare with directory names returned by vam#PluginDirFromName (tlib implements list diffing or such) - or use filter and index() or such - then pass to rm -fr.

In VAM its complicated because names can be translated to directory names. The solution mentioned last would work in for default setups pretty well.

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