Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get Pathogen to work in Vim

I know there are multiple posts on this question but I have tried with no avail to get this simple part of Vim to work. I would like to get the pathogen plugin to work with Vim. As a few points, I am working on a Windows system. I have downloaded pathogen via github and have created the directories .vim and subdirectories autoload and bundle. My .vimrc is the default created with mkvimrc with:

call pathogen#infect()
syntax on
filetype plugin indent on

added to the bottom. Addressing other postings I have seen:

:set cp? = nocompatible

One area I am guessing is part of the issue is after I run :scriptnames I don't get the .vim directory. I only get the Vim\.vimrc and vim73 directories. How do I address this? I have been at this a long time and apologize if this is obvious to others here.

like image 432
Liam Avatar asked Dec 17 '12 21:12

Liam


2 Answers

On Windows the default location of the local user configuration is $HOME/vimfiles. If your files are in $HOME/.vim then you either need to move them to vimfiles or add .vim to your runtimepath in your .vimrc:

set runtimepath+=~/.vim

Also, if Pathogen is in a subdirectory of bundle you will need to run it explicitly from there, since by default Vim will only look in ~/.vim/. Put this in your .vimrc before the pathogen#infect call:

runtime bundle/pathogen/autoload/pathogen.vim
like image 143
Prince Goulash Avatar answered Sep 22 '22 13:09

Prince Goulash


The solution for me was re-downloading the pathogen.vim as it had somehow failed to download by failing to follow a redirect. The URL specified on tpope's github has the following step:

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

You will know the redirect failed to download as the contents of pathogen.vim will be a 302 redirect page. Just download from the URL contained in the redirect e.g:

wget -N -O ~/.vim/autoload/pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
like image 25
Jonathan Avatar answered Sep 21 '22 13:09

Jonathan