I use VIM for code development and lot of things. I see that there are lot of scripts, configurations shared at vim.org/scripts, also some at github. Time to time I would like to check which one of the scripts used by me were improved. This would need either manual checking of the scripts, but I am too lazy to do that. Writing some code to do the checking and upgrading is also an option, but I am not sure whether there is any agreement what all script contributors always follow. I would like to have a upgrader for these scripts. Is there any solution, or any practice for maintaining the VIM scripts?
I use pathogen.vim to make updating scripts stored on github trivial. Put pathogen.vim in .vim/autoload and add call pathogen#runtime_append_all_bundles() into your .vimrc file to set up pathogen. Then in .vim/bundle, I git clone [vim plugin], and updating is as simple as a git pull in the appropriate directories.
What about :h GetLatestVimScripts?
If you are using Ubuntu Linux, you can install the vim addon manager:
sudo apt-get install vim-addon-manager
You can use vim-addon-manager (not that one that can be found in debian/ubuntu repositories). It puts plugins each into its own directory like it will be done with pathogen and also supports installation of plugins with one command. It is able to use mainstream git/mercurial/subversion/bazaar repository (if it is known by one of its authors) and install plugins from vim.org.
Related
When I follow github instructions for vim-misc and vim-sessions, after unzipping to /Users/<me>/.vim/misc and /Users/<me>/.vim/vim-session-master, and then restarting macvim, I get
:helptags ~/.vim/doc
E150: Not a directory: ~/.vim/doc
Also tried putting the two folders in /Users/<me>/ (where my .vimrc is) and in the two locations pointer by $VIM and $VIMRUNTIME from within macvim (/Applications/MacVim.app/Contents/Resources/vim) all to no avail.
I guess I really don't understand how running the :helptags <whatever> starts up/completes installation of these plug-ins anyway?
Before using using a plugin managers, plugins used to go directly into ~/.vim, not into ~/.vim/pluginname. That's when we ran :helptags ~/.vim/doc.
Then we had plugin manager, each with different specific way of doing things. Some even take care of registering the documentation of the plugins installed.
IMO, you'd better find a plugin manager suited to your need and use it. I remember a Q/A on vi.SE, you could start by reading it.
If you prefer to install plugins manually instead of using one of plugin managers like vim-plug or others then you should add plugin directory to your runtimepath. Place this line to your .vimrc set runtimepath+=/path/to/plugin. I would not recommend to place plugins directly to ~/.vim directory, use sub-folder instead (e.g. /Users/<you>/.vim/plugins).
I use vim and try the 'Vundle'. It helps to install plugins like in Ruby on Rails:
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
... I write in my _vimrc file
But when I do saw, it installs the last version of this plugins from github. But I want to install one of the previous version. Who knows how to do what I want?
I don't think Vundle allows you to specify a repo ref. I think you can work around this though. Vundle assumes you want the master's head, so create your own fork to get control of the version.
In other words, fork the plugin repo, reset the master branch to the version you want, and use your fork in the .vimrc
Bundle '<your username>/nerdcommenter'
You can install a specific version through vundle. Somehow.
First install your bundle as normal.
Then, go to the bundle directory (e.g. cd ~/.ssh/bundle/nerdtree) and checkout the version you need: git checkout <thecommithash-or-release>.
Tada!
You can never ever update through vundle tho :)
There's also a forgotten pull request to allow installing specific plugin versions: https://github.com/VundleVim/Vundle.vim/pull/681 with syntax:
Plugin 'kien/ctrlp.vim', {'version': '1.79'}
which confirms it is not possible nicely from inside Vimscript. Shame, that feature is a must have...
This is also mentioned on the current README in the TODO list:
allow specifying revision/version?
After installing many plugins in my ~/.vim folder, I feel I no more understand the contents of that folder and I don't feel enough confidence about deleting the plugin from ~/.vim/plugin to uninstall a plugin. What if there are related files in other directories? What if the documentation was already registered (:helptags), yet the plugin will be removed? Is there any procedure to uninstall vim-plugins? I don't really want my Vim to end up being as messy as my Windows.
If you want to uninstall a plugin which was installed into ~/.vim manually, you should redownload its archive, list its content and manually remove everything, then run :helptags again (this will remove missing tags). If plugin was installed from a vimball, see documentation for :RmVimball. Vimball archives normally have .vba or .vba.gz extensions. In case you don't remember vimball file name, it is contained into ~/.vim/.VimballRecord file.
In order to avoid this problem in the future, try vim-addon-manager plugin. Like pathogen, it puts each plugin into separate directory, but is also capable of downloading, installing and updating them.
To manage easily plugins in vim use pathogen
and this awesome article --> come home to vim
If you install vim plugin via Vundle, it's easy to uninstall plugin, comment out the plugin in .vimrc, example:
"Bundle 'tmhedberg/SimpylFold'
then
:BundleClean
common commands of Vundle:
:BundleList -List all plugins
:BundleInstall -Install all plugins
:BundleInstall! -Update all plugins
:BundleSearch foo -Find foo plugin
:BundleSearch! foo -refresh buffer for foo plugin
:BundleClean -clean all plugins if the plugin not defined in .vimrc
You can simply run:
vim +PlugClean
OR open vim and run :PlugClean.
On running this command, it will ask you to remove the plugin directories. answer with y and it will clean the plugs.
Interestingly, even the much downloaded Pathogen.vim documentation boldly suggests (their emphasis, not mine):
For new users, I recommend using Vim's built-in package management instead. :help packages
Ok, I can take a hint, that pathogen is not for most of us new users.
So then looking into native vim packages, and what it has to offer...
The skinny from :help packages seems to be this:
... A package can be downloaded as an archive and unpacked in its own directory.
Thus the files are not mixed with files of other plugins.
That makes it easy to update and remove.
Can someone give me a detailed instalation procedure for gVim Portable and important C++ and python development plugins ... like OmniCppComplete, NERDTree, supertab etc ...
or better yet, a prebuilt version
thx
Using plugins on portable vim will require slightly different steps than the regular install. From the configuration page, your .vim file should probably be in Data/settings/.vim instead of ~/.vim
Follow the plugin install instructions and substitute ~/.vim with ((where you put PortableGvim))/Data/settings/.vim
If a plugin does an automatic install, then you may need to move files from ~/.vim
You may find it easier to grab someone else's vimfiles. Mine are on github.
As for the plugins themselves, I got started with this post. See also this SO question.
For what it's worth, if you can live with there being possible issues if you use a computer with vim installed and vimfiles present in the $HOME directory, you can simply take your vim72 directory, your vimfiles directory and your _vimrc (and _gvimrc if you have one) and put them in e:\vim (assuming E: is where the USB stick is mounted). You can then just run e:\vim\vim72\gvim.exe and it will load the configuration from e:\vim\_vimrc and e:\vim\vimfiles. If you plug it into a computer that mounts it as F:, then just run f:\vim\vim72\gvim.exe obviously.
Importantly, this does not require messing about with PortableGvim (which I've never really seen the point of since gvim is essentially portable anyway if you ignore the possible $HOME issues) and allows you to easily synchronise all of your settings between your desktop vim installation and your portable one.
On top of this, I also put vimrc in c:\vim\vimfiles and have _vimrc in c:\vim with the following contents:
runtime vimrc
and then put the whole of c:\vim\vimfiles under version control. This makes it very easy to keep the copy on the USB stick and the copy on the Windows PC (and the copy on my home Linux PC and... and...) synchronised.
Is it possible to update vim plugins automatically?
To provide an up to date answer to this old question, Vundle
works really great. It simulates the ruby bundle gem, you simply configure your Bundles in .vimrc and then run :BundleInstall! inside vim.
This vim plugin seems to do what you are after, though it hasn't been updated in a while. Never used it, but the author has written a "few" vim plugins in the past.
vim-addon-manager has the function :UpdateAddons [{name} ...] which when called with no arguments updates all installed addons.
My operating systems (Archlinux) has a bunch of packages containing vim plugins. Look into you OS for similar packages.
If the plugin versioned in git, for example, you can pathogen and put the plugin in another dir. Then to update is only a command.
I prefer a bash script. Then you can have it set as a cronjob, and you don't depend on other scripts supporting the ability to update.