50

Pathogen does not work for me. I am following Adam Lowe's hints posted here (and few more) without any success...

My vimrc:

filetype off
call pathogen#runtime_append_all_bundles()

filetype plugin indent on
set nocompatible
syntax on
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set number
colorscheme darkblue

Contents of .vim - ls .vim/*:

.vim/autoload:
pathogen.vim

.vim/bundle:
nerdcommenter/  vim-haml/   vim-surround/
vim-endwise/    vim-rails/  vim-vividchalk/

All plugins in bundle were installed by cloning them from GitHub into bundle directory.

I have tried with pathogen 1.1 and 1.2 and even the latest from GitHub without any result. Vividchalk, Vim-rails and nerdcommenter are not working. I have very little experience with other plugs so I am not sure about them, but I suppose they are not working too.

I am using ArchLinux, vim 7.2.385-1 (not the latest because the latest requires me to install ruby1.9, but it is still 7.2). It has been installed via pacman - ArchLinux package manager. No vim plugins were installed the other way than using pathogen (I have even reinstalled vim package with cleaning /usr/share/vim).

What am I doing wrong?

EDIT:

Community
  • 1
  • 1
skalee
  • 12,331
  • 6
  • 55
  • 57
  • You aren't using vim-sessions by chance, are you? I'm using sessions and pathogen didn't seem to work unless I created a new vim and didn't load a session but created a new one. – jpfuentes2 Sep 24 '10 at 16:03
  • Just Vividchalk, Vim-rails and nerdcommenter aren't working? Do the others work? – Somebody still uses you MS-DOS Sep 29 '10 at 21:26
  • I'm having this same issue. A lot of plugins are working, though nerdcommenter does not... I wonder if NERD_commenter is being loaded when filetype is off and that's ruining things? – agscala Nov 10 '10 at 16:04
  • I have just moved from ArchLinux to Mac OS X. Most plugins started to work, NERD_commenter still does not. I think the problem with NERD_commenter is different from problem I had on Arch - not having plugins loaded at all. The fact I changed OS also means that I will have no possibility to check your hints. Thanks for help. – skalee Nov 11 '10 at 20:52
  • I don't know if this will help anyone else, but I had misplaced my `.vimrc` file under `~/.vim/.vimrc` instead of `~/.vimrc`. I spent way too long debugging that. – jocull Aug 20 '16 at 20:43

19 Answers19

31

This seems to be common problem caused by the "system" vimrc in some distributions setting filetype on before you set up pathogen. So turning it off and back on again forces plugins to load correctly:

 call pathogen#runtime_append_all_bundles()
 filetype off
 syntax on
 filetype plugin indent on

More info here.

Dave Ray
  • 39,616
  • 7
  • 83
  • 82
  • 14
    `call pathogen#infect()` which can be used in the latest version of pathogen now deals with this `filetype` problem (and is much easier to remember and type than `runtime_append_all_bundles`). – Araxia Aug 02 '11 at 23:53
  • 1
    I suspect the `runtime_append_all_bundle` no longer exists in pathogen. You should change it to `incubate`. Or use `infect` as suggested by @Araxia . – Dilawar Jul 01 '13 at 08:27
24

I was having a similar problem. Pathogen was loading some of my plugins while not all of them. After some fiddling and wondering I discovered (I don't know if it's mentioned in the documentation) that in each bundle/'plugin_name' folder, there should be another folder called plugin that contains the *.vim file.

Then, when vim starts will look, not in bundle, but in those folders within bundle that contain a folder called plugin... and will create other folders (in each plugin folder).

So, if the plugin is just a .vim file make a folder for it...

instead of:

~/.vim/bundle/vimexplorer/vimExplorer.vim

you need:

~/.vim/bundle/vimexplorer/plugin/vimExplorer.vim

And everything works like a charm.

fioghual
  • 509
  • 3
  • 11
  • This was exactly my problem: The plugin source tree contained a directory called 'ftplugin'. I just created a symlink to it called 'plugin' and now everything works as expected. – BlueBomber Jul 19 '13 at 15:43
  • same with other kinds of plugins like colorschemes. They require a `colors` folder, mirroring the `$VIM/vimfiles` directory. Pathogen works by adding each plugin root folder to Vim's runtimepath setting, which Vim then traverses looking for layouts that it expects in '$VIM/vimfiles' – xdhmoore Mar 15 '16 at 15:33
14

I've had problems loading particular plugins: specifically, plugins with a plugin subdirectory. For example, on a fresh MacVim install, a plugin in ~/.vim/bundle/surround/plugin/surround.vim wasn't being loaded, even though ~/.vim/bundle/surround appeared in the output of :scriptnames.

The problem was that I was loading Pathogen in .gvimrc, not .vimrc. For whatever reason, stuff in .vim/bundle/*/plugin subdirectories won't load if you do that, so do it in .vimrc!

I've opened an issue on github—I don't know if it can be made to work even if it loads from .gvimrc, but there should at least be some sort of warning in the documentation for idiots like me.

aanand
  • 141
  • 1
  • 2
  • Changing from _gvimrc to .vimrc fixed mine problem! Thank you! – Alfa07 Mar 06 '12 at 20:46
  • 3
    Moving these lines from `.gvimrc` to `.vimrc` got it working for me. `call pathogen#infect()` `filetype plugin indent on` – Mike Mar 16 '12 at 15:12
11

If your .vim is based on a git repo and submodules, DO REMEMBER to run git submodule init and git submodule update after cloning the repo. i.e.

git submodule init
git submodule update

I had the same error and tried all of the above, but it didn't work. Until I initialized and updated the git submodules.

Hope this helps for anyone who has a similar error.

jhtong
  • 1,529
  • 4
  • 23
  • 34
  • As un-related as this looks to vim, if you used git to add the vim plugins as submodules, a clean init and update is the only way to proceed. Even if you already have a copy of the directories in place from a previous installation. – Shawn Jun 25 '18 at 22:41
6

Maybe Arch's default vimrc (possibly /etc/vim/vimrc) doesn't play well with Pathogen. Try starting Vim without loading config files:

vim -u NONE

and then load your vimrc from within vim:

:so ~/.vimrc

Do the plugins work then?

Roberto Bonvallet
  • 31,943
  • 5
  • 40
  • 57
  • 1
    I am getting error E117 that `pathogen#runtime_append_all_bundles` and `pathogen#helptags` are unknown functions. Loading pathogen with `:so .vim/autoload/pathogen.vim` before loading `.vimrc` does not help. Commenting everything in `/etc/vimrc` does not help. Substituting `/etc/vimrc` with standard example vimrc does not help. Thanks for your effords. – skalee Sep 02 '10 at 19:35
  • 4
    Did you ever figure out how to fix it? I have the same problem now using Ubuntu. – Conceited Code Oct 10 '10 at 21:08
  • 1
    Yeah I have the same problem too. Installed http://github.com/akitaonrails/vimfiles. On Ubuntu 10.10. gVim 7.2.330 – Ramon Tayag Oct 30 '10 at 02:58
  • I'm having the same problem under Ubuntu 10.10. Anyone get it working? – Christian Joudrey Feb 25 '11 at 00:25
  • 5
    This solved my problem: http://blog.darevay.com/2010/10/a-brief-note-on-pathogen-for-vim/ – Christian Joudrey Feb 25 '11 at 00:30
  • 2
    @Christian Joudrey, the link you gave is dead. – Harshiv Sep 28 '17 at 06:23
6

Fixed by (mattn & tpope) after raising issue via github

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

see https://github.com/tpope/vim-pathogen/issues/50#issuecomment-3137909

FigmentEngine
  • 511
  • 3
  • 8
3

My environment is Vim 7.3.35 and Ubuntu 11.04.

I spent some time trying to resolve it. I clone the project https://github.com:r00k/dotfiles and follow the instructions to install.

When started vi a got the so commented

E117: Unknown function: pathogen#runtime_append_all_bundles

and the solution:

filetype off

call pathogen#runtime_append_all_bundles()

filetype on

did not work.

I found the .vim symlink in my home directory where no properly set. The install script made a .vim DIRECTORY with a symlink vim inside of it pointing to my .dotfiles/vim. The solution was to delete the .vim directory and make a symlink .vim pointing .dotfiles/vim.

A kept the filetype off/on in my .vimrc also.

Community
  • 1
  • 1
2
filetype off                                                                
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
gregf
  • 1,091
  • 1
  • 11
  • 20
2

Try to check your runtime path using command: :set runtimepath? First entry should be something like ~/.vim.

My problem with not loading plugins/pathogen was that i placed my vim environment in ~/.dotfiles/vim where my vimrc and rest of the stuff (plugins etc.) lives. After creating symlink to ~/.dotfiles/vim/vimrc in ~/.vimrc i forgot to make second symlink ~/.vim -> ~/.dotfiles/vim/ which caused vim to be confused cause he was looking for stuff in ~/.vim (default). After i made proper symlink everything poped in right place.

I hope it will help someone who forgot about second symlink like I did ;-)

Sabr
  • 21
  • 1
  • Had the same problem in Git for Windows after switching from Git Bash. Git Bash had the files in `~/vimfiles`. Changed the name to `~/.vim`, and it works. – Joseph K. Strauss Jul 21 '15 at 18:21
2

Instead of call pathogen#runtime_append_all_bundles(), I used call pathogen#infect('~/.vim/bundle') and it worked for me.

Christian Specht
  • 35,843
  • 15
  • 128
  • 182
Prateek
  • 21
  • 1
1

I was having the same problem with Ubuntu. The log was:

linha 4: executando "/usr/share/vim/vim73/ftoff.vim"
Erro detectado ao processar /usr/share/vim/vim73/ftoff.vim:
linha   11:
E216: Grupo ou evento inexistente: filetypedetect *
fim da execução de /usr/share/vim/vim73/ftoff.vim

The solution was to add "\n"s at the end from file /usr/share/vim/vim73/ftoff.vim to execute it properly.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
adelarsq
  • 3,718
  • 4
  • 37
  • 47
1
set nocp
call pathogen#infect()
syntax on
filetype plugin indent on
call pathogen#infect()

The above helped me fix the issue, can't leave a comment on other peoples however thank you for posting the code above.

0

For the sake of completion I'll add my solution for this problem.

I just renamed my ~/.gvimrc file to ~/.vimrc, and all my problems were solved. I literally copied my .vim and my .gvimrc from linux and did this change and everything works as expected.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Guillermo Siliceo Trueba
  • 4,251
  • 5
  • 34
  • 47
0

I had the same problem. I tried every possible combination.

Finally I found that if I use mksession to save my Vim workspace and have it load on Vim startup, it made pathogen not load new plugins I put into the bundle folder.

After installing a new plugin I now always delete my session file and start Vim fresh and every plugin loads fine.

filetype off
set nocompatible
set laststatus=2
execute pathogen#infect()
syntax on
filetype plugin indent on
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
hugo24
  • 1,089
  • 13
  • 21
0

In my case I cloned to a folder ~/dotfiles but vun looks for a folder ~/.vim, as a result he carried no plugins or color schemes to solve the problem I did this:

ln -s ~/.dotfiles ~/.vim
SergioAraujo
  • 11,069
  • 3
  • 50
  • 40
0

i had the same problem , solved by copying this file into ~/.vim/autoload: https://github.com/sontek/dotfiles/blob/master/_vim/autoload/pathogen.vim

Omid Yaghoubi
  • 169
  • 1
  • 9
0

I was facing the same issue, finally after lot of google and tweaking the vimrc file, found the solution. Hope the following code snippet would resolve the issue.

set nocp source /home/ameet/.vim/autoload/pathogen.vim "location of my pathogen.vim call pathogen#infect() call pathogen#helptags()

Ameet
  • 37
  • 9
0

I have it in mine as:

silent! call pathogen#runtime_append_all_bundles()

Abizern
  • 146,289
  • 39
  • 203
  • 257
0

After spending waaaay too long trying to solve this problem with nerd-commenter/pathogen, I broke down and just used Debian's OS provided nerd-commenter plugin:

vim-addons install nerd-commenter

If you're on Debian and need to get back to work, try it out. You probably need "vim-addon-manager" and "vim-scripts" packages installed from apt if you don't have it already.

Andrew Wagner
  • 22,677
  • 21
  • 86
  • 100