Plugins in gVim not working

12,932

Solution 1

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.

Solution 2

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.

Share:
12,932
Panoy
Author by

Panoy

Passionate individual and aspiring software developer.

Updated on July 06, 2022

Comments

  • Panoy
    Panoy 3 months

    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!

  • Jason Down
    Jason Down over 10 years
    This is my preferred way as well. +1
  • Panoy
    Panoy over 10 years
    Thanks! I created a "vimfiles" folder in my HOMEPATH (documents and settings\username) and extracted the contents of the NERDTree plugin and it did work. I was able to use NERDTree but still can't use the EasyMotion plugin. I typed the "/w" character and there's no highlighted letter that appears, it makes me think that EasyMotion is not working.
  • Benoit
    Benoit over 10 years
    The latest Easymotion (github/lokaltog) uses a double leader as prefix for its commands, and the leader is not slash but backslash. Try \\w.
  • Panoy
    Panoy over 10 years
    I suggest the users capable of closing this post to now closed it. ;D
  • Benoit
    Benoit over 10 years
    @Panoy: posts are closed when they do not meet the guidelines, not when they are resolved.
  • Panoy
    Panoy over 10 years
    I see. Thanks for the clarification!
  • Admin
    Admin over 8 years
    In windows you may need to create vimfiles/colors and put the downloaded colorscheme in that folder before doing :color desert256.vim