A Brief Note On Pathogen For Vim
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.