Where do I save pathogen.vim so that the plugin installs - vim

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.

Related

How to install twig.vim in the .vimrc file for Vim 8.1

I'm trying to get this installed in my vim for ubuntu:
https://github.com/nelsyeung/twig.vim
I downloaded the files to ~/.vim folder, but there are no instructions on what I need to put into the .vimrc file to get it activated. What steps am I missing?
I downloaded the files to ~/.vim folder,
No. If you want to use Vim new integrated plugins management, first create the pack directory with a dedicated subdirectory of your choice (let's call it git-plugins but it's really own to you and depend how you want to have things organised)
mkdir -p ~/.vim/pack/git-plugins
In that location, create one of these directories:
start for plugins you always want available when you launch Vim
opt for plugins you want to activate and deactivate manually
Last, there will be a directory for the plugin itself. So, here, you have to download the files into let's say ~/.vim/pack/git-plugins/start/twig/
instructions on what I need […] to get it activated.
Now, launch vim and type the following command:
:packloadall
Check the included manual with
:h packl
This plugin has no doc to integrate into that system. But for general cases, put the following in your ~/.vimrc, after all internal setting and before plugins dedicated settings.
packloadall
silent! helptags ALL

vim - should i place all .vim files when enabling a plugin in vimfiles or vim74 folder?

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

Plugins in gVim not working

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.

using .vim plugins with pathogen

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

What is the difference between vim72 and vimfiles folder?

I am learning VIM. The VIM folder in the windows has two subdirectories VIM72 and VIMFILE. What is the difference between them? Where should I install my plugins?
Usually VIM72 (depends on the vim version) is the 'runtime' directory, I believe this is where vim is searching for all the stuff that it needs during 'runtime'. You would install your custom stuff, e.g. plugins, in your '$HOME/.vim' directory on linux (plugins in $HOME/.vim/plugin).
On windows it seems to be the vimfiles directory (you asked about VIMFILE on my windows system and vim71 it is vimfiles).
So I would try to store plugin in vimfiles\plugin directory on your system.
The difference would be that in VIM72 you would have all the runtime stuff that comes prepackaged with vim including binaries. You can install your own stuff in your vimfiles directory which will be usually searched first for stuff like syntax highlight, color schemes, plugins, documentation and so on.
You can find out the location of your vim72 directory, the location for your custom stuff like vim72/plugins, vim72/colors for colorshemes and so on, from vim do:
:echo $VIMRUNTIME
And finally, vim72 is used by vim 7.2 so when the version changes it will use different directory like vim73 and so on.
Expanding very slightly on stefan's answer:
Like he says, ~/.vim for linux-related systems, and usually vimfiles for gvim on Windows - this is your home vim directory.
You should put all of your own plugins into vimfiles to make sure that when you upgrade your vim installation you don't lose any of the custom plugins or modifications.
For example
There is a syntax file called cpp.vim in vim72/syntax.
If you now want to change a few things in this syntax file (say to add an extra keyword) you could have a copy of this syntax file in vimfiles/syntax with the additional keyword syntax rules.
Now when you upgrade vim to 7.3, you still have all of your custom plugins and settings.
If you were to instead change vim72/syntax/cpp.vim, when you next upgraded vim these files would be overwritten by the new versions and any changes that you made would be lost.
Plus, since vim72/syntax/ contains all of the original syntax files, it would be more difficult to tell which of these you had customised.
That 'vimfiles' directory is where you can install things system-wide without touching Vim's installation directory ('vim72'). The directory 'vim72' is subject to change when upgrading and a new major or minor version will use a different directory (e.g. Vim 7.1 used 'vim71' and Vim 8.0 will use 'vim80').

Resources