fastest way to make vim use new plugin in ~/.vim/bundles - vim

I'm using pathogen with vim.
When I add a new plugin to the ~/.vim/bundle directory what's the fastest way to make my existing MacVim window start using it? Do I have to close it and open a new one or is there a quick command I can run?

You can use vim-addon-manager instead of pathogen. It uses bundle-like directory too, but when you call
ActivateAddons snipMate
if snipmate was not installed, VAM will install it and then source so that you don’t need to restart. You will have to add some call to vam#ActivateAddons() with 'snipMate' in arguments to the vimrc though.

If you don't mind trying an alternative to Pathogen, check out Unbundle which lets you call :Unbundle manually to "rescan" your ~/.vim/bundle directory without closing Vim. It also supports filetype specific bundles, which can be manually rescanned in a similar fashion.

Related

problems installing vim-misc and vim-session plugins on mac / macvim

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).

Can't install vim plugins with pathogen

I am connecting to my university's computers. I am trying to customize vim. They put their vim configuration files in the protected /usr/share folder where I have no permissions.
I copied the .vimrc file to my home directory and started changing. This seemed to work :-)
Step 2,
I installed pathogen as instructed here:
http://mirnazim.org/writings/vim-plugins-i-use/
I added the following lines to .vimrc
execute pathogen#infect('~/.vim/bundle/{}')
call pathogen#helptags()
Unfortunately vim doesn't recognize my plugins (for example TagBar). I tried to play with the argument in infect, change execute to call, and etc.
Nothing helped.
Interestingly enough when I do :scriptnames I see that ~/.vim/autoload/pathogen.vim shows. Files in bundle directory don't show though :-(.
Ideas?
I know it is kind of obvious, but your plugins folders actually have files inside?
Some people already missed it: Vim: Pathogen not loading
how can i make my plugin work? maybe without pathogen?
some people like it, other not, but I'd advice you to use Vundle instead of pathogen. Here's a nice post about why, but honestly the main reason is that it's just stupid simple to manage plugins using it.
The installation process is very easy:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
and edit .vimrc :
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" … new bundles here
filetype plugin indent on
And for each new plugin I want to install, I do add the following to my .vim rc, where the comment is:
Bundle "user/plugin"
and then you execute :BundleInstall on a new instance.
Elegant and simple, what else do you want?

Installing fuzzyfinder vim plugin

I unziped the vim-fuzzyfinder and vim-l9 packages in my ~/.vimrc directory
[shetye#dev03 ~/.vim/vim-fuzzyfinder]$ls
autoload doc plugin
[shetye#dev03 ~/.vim]$cd vim-l9/
[shetye#dev03 ~/.vim/vim-l9]$ls
autoload doc plugin
Also i tried copying the same in my home directory. vim however does not detect this plugin.
:fuf-usage
E492: Not an editor command fuf-usage
:FufBuffer
E492: Not an editor command FufBuffer
I tried adding the directory ~/.vim/vim-fuzzyfinder, ~/.vim/vim-l9 to the $PATH env variable. That did not help either.
Any ideas on how to get fuzzyfinder going ?
You should install it correctly to make it work. This is the file structure you should have:
~/
+-.vim/
+-autoload/
+-doc/
+-plugin/
Once you get to that point, you are supposed to type this command in Vim:
:helptags ~/.vim/doc
The .vim directory structure that you have created is a mix between traditional Vim (where all plugins are mixed together into single .vim/autoload/, .vim/plugin/, etc. directories) and the separation (into .vim/bundle/<pluginname>/autoload/) created by package managers like Pathogen or Vundle.
Either stick to the original layout (even though there are many proponents for the new package structure, the old one works just fine; it's just not as easy to uninstall a plugin), or install one of the mentioned package managers and adhere to their prescribed layout.

Uninstalling Plugin in Vim

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.

Autoupdate VIM Plugins?

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.

Resources