-3

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\

whytheq
  • 34,466
  • 65
  • 172
  • 267
  • Just follow the instructions: "Install in ~/.vim/autoload (~\vimfiles\autoload on Windows)". – glts May 12 '13 at 12:50
  • @glts (I'm really new to this sort of software) is "Install in ~/.vim/autoload (~\vimfiles\autoload on Windows)" the same as "Save in ~/.vim/autoload (~\vimfiles\autoload on Windows)"? – whytheq May 12 '13 at 13:26
  • Yes, just drop the file `pathogen.vim` in the `~/.vim/autoload` directory (create it if it doesn't already exist). – glts May 12 '13 at 13:39
  • @glts cheers - I've got an `autoload` directory here: `M:\vimfiles\autoload` ...this is part of my rtp so vim seems to have found it now. I've added the code that Calvin suggested to `_vimrc`. On startup of gvim everything loads ok - but if I open gvim as administrator then I now get the error: `E117: Unknown function: pathogen#infect`. Is there an easy way to check that in normal non-admin gvim that the function is being used? – whytheq May 12 '13 at 14:12
  • who marked me down and why? - please reveal yourself!! – whytheq May 12 '13 at 19:54

2 Answers2

4
  1. You don't need pathogen to install plugins.

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

  3. 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\
    
  4. 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.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • referring to your number 1. ... if this is the case then what is the point of `pathogen`? I downloaded it and moved it to my autoload file - in the meantime I plugged in dbext and got it working without using my bundle directory. So now I'm wondering what the point of pathogen is?! – whytheq May 12 '13 at 19:55
  • When installed manually, plugins often put files in many directories. It's widely considered messy and pathogen is *one* solution to that issue: it allows you to keep your plugins well organized. – romainl May 12 '13 at 20:29
  • +1 thanks for this info romainl (out of interest - did you down-vote my question?). My vim is installed in `C:\Program files\` ....I didn't change the default when installing - do you think I should uninstall and re-install it outside `Program Files` ? – whytheq May 12 '13 at 20:53
  • No, I didn't downvote your question and no, leave Vim where it is as it does't matter in the slightest bit. Just do your configuration in `C:\Users\username\` and forget all about Vim's location or the content of the default runtime. – romainl May 12 '13 at 21:04
  • (if you agree that the downvote is out-of-line could you cancel it out orfr me?) I already have the files in here: `M:\vimfiles\` ...seems like vim picks them up fine. The version of `_vimrc` that I have edited is in `Program Files` and i have to open vim as administrator to edit it. – whytheq May 12 '13 at 21:09
  • is `C:\Users\username` part of vim's runtimepath? – whytheq May 12 '13 at 21:16
  • `C:\Users\username` is likely to be what Vim calls `$HOME`. As such it is not part of the rtp but `C:\Users\username\vimruntime` is part of the rtp. – romainl May 12 '13 at 21:19
  • why doesn't `:Set $HOME?` tell me what it is? – whytheq May 12 '13 at 21:24
2

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.

Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
  • +1 thanks for the help - I definitely would have benefited by installing away from "C/Program Files" as I need to go in as administrator a lot of the time to make changes; although not such a big deal – whytheq May 12 '13 at 13:29
  • apologies Calvin I never accept straight away but accept the most useful answer after a couple of days – whytheq May 12 '13 at 13:33
  • what can Pathogen be used for? - it helps with installing plugins? – whytheq May 12 '13 at 13:34
  • There are two such plugin management tool for vim. `vundle` and `pathogen`. They act like "package managers" so when you download a new vim plugin, you do not have to manually move individual files into specific subdirectories that the plugin requires you to. `pathogen`'s approach is to solve this by allowing you to throw the entire plugin into the `bundles` directory. – Calvin Cheng May 12 '13 at 13:35
  • @whytheq There is [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) that does install the plugins and is currently the only one handling dependencies without requiring plugin author to specify them (as we maintain a database with dependencies) and has hooks (which can e.g. compile Command-T libraries after installation). Vundle AFAIK can install from github. [We keep a comparison with related projects.](http://vimpluginloader.sourceforge.net/doc/vim-addon-manager-additional-documentation.txt.html#VAM-comparison) This may be interesting, but may be a bit outdated. – ZyX May 12 '13 at 15:04
  • @CalvinCheng why is my question getting down-voted? (please can you upvote it if you think it is reasonable). Also - if I follow your answer and then open gVim as administrator then I get an error message saying the function `call pathogen#infect()` is not recognised – whytheq May 13 '13 at 06:57
  • @CalvinCheng 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\." isn't the best advice ...the default installation for me was `C:\Program Files` which is the bext place for it. – whytheq May 14 '13 at 11:53