1

I have these 3 lines in my .vimrc.

" keeping pathogen only for its 'syntax on' bug workaround
Bundle "tpope/vim-pathogen"
execute pathogen#infect()

I must have removed and re-added these 3 lines about a dozen of times now. I'm on latest version of Vim, and yet, for some reasons, some syntax highlighting isn't working correctly.

On MacOS, Go syntax highlighting isn't working, while on Arch Linux is. But on Arch, coffeescript isn't highlighted. For some reason, executing pathogen#infect() solves all problems on both platforms.

Its kind of like black magic to me, so I'm wondering why is that. Is there any better way to fix this problem?

Answer: I have looked into my vimrc, and found the error. I had this line

filetype plugin indent on

before the Bundle's, where it should have been after the Bundles.

if __name__ is None
  • 11,083
  • 17
  • 55
  • 71

1 Answers1

3

By default, Vim does not look in .vim/bundle directories when starting. So it means that your "ftdetect" won't be loaded.

Pathogen looks into every bundle directory and load them.

If you want to see for yourself, start Vim twice, once with and once without pathogen:infect(), and type :scriptnames after boot. You'll see the list of loaded scripts.

You can even do a :redir to write the output into a file before invoking :scriptnames to get the exact diff of loaded scripts.

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
  • If he is using Vundle and it doesn't support ftdetect then he must either find another plugin manager or submit an issue to its author. – romainl Oct 11 '13 at 09:14