I have the same problem on Ubuntu. It's caused by system-level vim settings.
You can what system-level vim settings are applied with :scriptnames
. If you run redir @c | scriptnames | redir END | enew | put c
inside of vim, you'll get a buffer containing all scripts sourced by vim. If you ignore all of your files (:g/\~/d
), you can see all system-level scripts.
My problem was in the very first file: /usr/share/vim/vimrc
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
Because syntax on
appears before pathogen (my vim plugin manager) is setup, vim never looks in the bundle/vimclojure/ftdetect directory. I think vundle will have the same problem for you. (Try copying ftdetect/clojure.vim into ~/.vim/ftdetect/clojure.vim and see if you still have the problem.)
If you're having the same problem, you have three possible solutions:
- Comment out those lines and file a bug with whoever owns the offending file (Apple or MacVim). I'd guess that your files are in the MacVim bundle, since I don't remember MacVim doing system-level changes.
- Add
filetype off
before initializing vundle (you may need syntax off
too). Pathogen uses pathogen#infect() to do this, maybe vundle has something similar. (Corresponding pathogen bug and fix.) Make sure you turn them back on after! (Also, make sure your vundle setup comes before anything else in your vimrc related to filetype/plugin/syntax.)
- Make symlinks from ftdetect files for all bundles into ~/.vim/ftdetect (and have doubled autocmds if the bug is ever fixed).