Home > vim > A Brief Note On Pathogen For Vim

A Brief Note On Pathogen For Vim

October 12th, 2010 Leave a comment Go to comments

I spent a while tracking down a vim issue this evening. For plugin-management purposes, I’ve recently switched to the excellent Pathogen plugin. Right at the top of that page it says:

Add this to your vimrc:

     call pathogen#runtime_append_all_bundles()

That seems easy enough, and everything worked great on Windows. Moving over to Linux, things weren’t going as well. Whenever I opened a Clojure file, its filetype wasn’t detected. I had to manually execute “set filetype=clojure” to get syntax highlighting and even then, indenting was weird.

So, I debugged. One great thing I learned along the way is how to enable vim’s logging for debugging purposes. Just do something like this:

   $ gvim -V9log.txt ...

that will log everything vim does to log.txt in the current directory. I was able to compare my Windows log to the on Linux and see that when it searched for ftdetect plugin directories, it wasn’t including any of the plugins managed by Pathogen. hmmm… I googled it for myself and was led back to … that’s right, the same Pathogen page, down toward the bottom where it says:

Note that you need to invoke the pathogen functions before invoking “filetype plugin indent on” if you want it to load ftdetect files. On Debian (and probably other distros), the system vimrc does this early on, so you actually need to “filetype off” before “filetype plugin indent on” to force reloading.

My evening would have been funner if the top of the page just said this in the first place:

Add this to your vimrc:

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

Yes, I should have read all the instructions. Everything’s up on github for the curious.

Categories: vim Tags:
  1. April 13th, 2011 at 21:10 | #1

    Thanks, this solved my problem!

    I was led here by this StackOverflow question, but only after some sweating and cursing, so thanks a lot!


  2. October 7th, 2011 at 21:13 | #2

    Thanks for pointing this out! It also works for Vundle. :-)

  3. mememe
    October 13th, 2011 at 19:16 | #3

    Thanks for this, this exact issue has been driving me nuts. Aargh, I wish I’d come across your webpage 3 hours earlier!

  4. Evgeny BAchinin
    February 10th, 2014 at 00:45 | #4

    Now (from pathogen ver.2.1) “call pathogen#runtime_append_all_bundles()” is deprecated. So use:
    call pathogen#incubate()

  1. No trackbacks yet.