Search code examples
vimpathogenftplugin

Pathogen ignoring ftplugin scripts


I'm trying to use Pathogen to manage Vim plugins. I had a couple of scripts I made in .vim/ftplugins.

I installed Pathogen but now none of the scripts in ftplugins runs.

I tried adding a directory inside .vim/bundle with the scripts but it didn't work (it was .vim/bundle/local/ftplugin/python.vim)

Any idea how can I make Pathogen load the scripts in ftplugin directory?

First lines of my .vimrc:

set nocompatible
syntax on
filetype plugin indent on
"execute pathogen#infect()

Only works with that line commented out.

I am running gvim from a Bash prompt with the filename as first parameter like this:

$ gvim some/path/somefile.py

I expect to see the file with my predefined colorscheme for Python files defined in ~/.vim/ftplugin/python.vim and all the other settings defined in that script.

The ~/.vim/bundle directory is empty.

Pathogen is in ~/.vim/autoload and there is nothing more there.

$ ls ~/.vim/ftplugin/
css.vim  html.vim  javascript.vim  python_pep8.vim  python_pyflakes.vim  python.vim  rst.vim  xml.vim

$ ls ~/.vim
autoload  bundle  colors  doc  ftdetect  ftplugin  plugins  ScrollColor.vim  spell  syntax

Solution

  • It was a problem with filetype detection, this is the Pathogen issue.

    The work around in my case was simple, use this to enable Pathogen:

    set nocompatible
    "execute pathogen#infect()    " breaks filetype detection
    call pathogen#runtime_append_all_bundles()
    
    filetype plugin indent on
    syntax on
    

    What I did to find out was to remove my ~/.vim directory and start with a clean one. Adding things one by one and checking the results. I realized it was not detecting the correct filetype (when I opened an empty file detection was ok, but it was not when opening an existing file).