I need help in installing some of the popular plugins in Vim. I just started learning this editor and is very excited to use the popular plugins. I'm using gVim in Windows XP and have extracted the .vim files and copied them to the Program Files folder of Vim.
Inside my "F:\Program Files\Vim" folder, there are exactly two folders the "vim73" and the "vimfiles" folder. I put the .vim files (EasyMotion.vim) into the "plugin" folder inside the "vimfiles" folder.
When I run gVim, the plugins doesn't work, and in my case, the EasyMotion plugin is not working. I typed the "/w" to make the EasyMotion plugin work (as stated on its usage on its github account) and nothing seems to work.
Am I missing out something here? Are there extra commands to put in the vimrc file to recognize those plugins?
Cheers!
Never touch Program Files. There is a vim setting called 'runtimepath' (see the :help 'rtp') that says where Vim is going to locate the plugins. For each directory in the runtimepath, Vim will source every .vim file found in the plugin subfolder, and lookup for functions containing # in their names in the .vim files of the autoload folder. It will also lookup filetype plugins in the ftplugin folder when 'ft' is set.
Normally you should have %HOMEPATH%\Vim\vimfiles in your runtimepath (:echo &rtp to know). Unzip Easymotion there, NOT in Program Files.
Due to that structure, vim plugins mix up in the same 2-3 folders. However it is possible to install every plugin in its own subfolder if you play with runtimepath. The pathogen plugin is dedicated to that. It makes it possible to have every plugin in its own subfolder, and adds every plugin root folder to the runtimepath. The Readme is self-explanatory.
As #benoit said, you should never in general put files into your vim73 folder
(notable exceptions exist, but you'll know when you encounter them).
On windows, Vim searches for configuration files (those include _vimrc and your
plugins) in several directories, in a certain order. First it will look in
$HOME ... which is your c:\documents and settings\username\ folder
$VIM ... which is the folder where you installed or extracted Vim
$VIMRUNTIME ... which is your \vim73 folder ...
and so on ...
What this means? It means it will first look in $HOME before looking in let's
say, your Vim install folder. So it is a nice way of separating plugins which
you just want to test out before being sure you're gonna be keeping them.
For example, you could organize your Vim related files in this manner:
- install vim to c:\vim or c:\program files\vim\
(vim's program files will go in \...\vim\vim73\)
- put your _vimrc in \vim\
- put your vimfiles in \vim\vimfiles\
- and put your temporary vimfiles in c:\documents and settings\username\vimfiles\
That way when you're done with them, you can just delete that last
\username\vimfiles\ folder.
Related
Do all .vim files go into vimfiles or vim 74 folders when installing a plugin? on windows 7 and is this the standard for all vim plugins?
Thanks
If you have a single name.vim file, that usually goes into %HOMEDRIVE%\%HOMEPATH%\vimfiles\plugin\ on Windows. If this doesn't exist yet, create it. You can check the actual locations from within Vim via
:echo &runtimepath
Directories under C:\Program Files\vim\vim74 are reserved for the scripts that come with Vim. You must not put any files there; that'll just cause problems when upgrading!
On Windows, third party plugins and colorschemes are supposed to go in this directory:
%userprofile%\vimfiles\
including your vimrc if you only use Vim 7.4:
%userprofile%\vimfiles\vimrc
I've just downloaded the file pathogen.vim from vim.org
Where do I save this file so that it becomes part of gVim? In one of the runtimepath locations?
Does this .vim need to go in either of these locations?:
- C:\Program Files (x86)\Vim73\
- C:\Program Files (x86)\Vim\vimfiles\
You don't need pathogen to install plugins.
For the nth time this week, put your plugins into the C:\Users\username\vimfiles directory and your settings into the C:\Users\username\_vimrc file. You must create those directories/files yourself.
What you should have:
C:\Users\username\_vimrc
C:\Users\username\vimfiles\
C:\Users\username\vimfiles\autoload\
C:\Users\username\vimfiles\autoload\pathogen.vim
C:\Users\username\vimfiles\bundle\
Many Vim plugins have UNIX-oriented instructions and Vim itself is mostly UNIX-oriented so you'd better learn a thing or two about the UNIX command line.
If you are using windows, I recommend that you install your gVim into a custom directory instead of under Program Files or Program Files (x86) directories.
This makes things a lot easier going forward.
For instance, in a location like this:-
Install gvim in your user's home directory (e.g. C:\Users\whytheq\) (where whytheq is your user name) so it becomes C:\Users\whytheq\Vim73\.
Then, create a _vimrc file (with no file extension) there as well with the following contents:
set nocp
call pathogen#infect()
syntax on
filetype plugin indent on
Next, create a folder under C:\Users\whytheq\Vim73 called vimfiles with two subfolders beneath that, autoload and bundle.
Then, download the pathogen.vim file and moved it into the autoload folder.
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.
I want to use lustyjuggler and lustyExplorer. They are vim plugins but I want to us pathogen to manage them. Normally I unzip vim plugins and the whole folder structure goes into ~/.vim/bundle/. But with lustyJuggler and lustyExplorer they come as .vim files. How do I get these to work with pathogen?
Create the folders ~/.vim/bundle/lustyJuggler/plugin and ~/.vim/bundle/lustyExplorer/plugin and place the .vim files in there
You can use the vim-scripts mirrors:
https://github.com/vim-scripts/LustyJuggler
https://github.com/vim-scripts/LustyExplorer
Or you can create your own filestructure, just make the plugin folder manually, i.e.
~/.vim/bundle/lustyX/plugin/whatever.vim
I'm working on moving my whole vim config to my Dropbox folder in order share it between machines more effectively. To do this, I've changed my .vimrc to the following:
set runtimepath+=$HOME/My\ Documents/Dropbox/vim
source $HOME\My Documents\Dropbox\vim\vimrc.vim
vimrc.vim looks like this:
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax enable
The problem is then that snipMate.vim no longer works. I know that there aren't any plugins interfering with it, as I've done a fresh install of vim and removed all the other plugins. It worked perfectly before I moved the plugins to the dropbox folder. I think it may have something to do with the fact that the after directory in vimfiles doesn't seem to be getting read once I move the plugin folder to the dropbox (i.e. after/snipmate.vim only shows up in :scriptnames when I have vimfiles as the plugin folder). I've tried explicitly sourcing the script in the after directory by adding the following to my .vimrc:
source $HOME\My Documents\Dropbox\vim\after\plugin\snipMate.vim
but snipmate still doesn't work.
Any ideas on fixing this?
You have to add the after directory to 'runtimepath' if you want Vim to look for it.
set runtimepath^=$HOME/My\ Documents/Dropbox/vim
set runtimepath+=$HOME/My\ Documents/Dropbox/vim/after
This follows the normal behavior of having your personal vim directory sourced first, then the system-wide stuff, and finally your personal after directory.