Closed greg0ire closed 12 years ago
For your information, I've made a fork of mustache.vim specifically for Handlebars: https://github.com/nono/vim-handlebars
I just installed it via pathogen too and it works great... but I must type :setfiletype handlebars
... I guess something must be missing in my vim configuration, but what?
It does support .handlebars. Could you confirm this in ftdetect/mustache.vim
?
if has("autocmd")
au BufNewFile,BufRead *.mustache,*.handlebars,*.hbs set filetype=mustache
endif
If a .mustache works, then .handlebars should work as well.
The fact is, it doesn't work for .mustache either, the detected filetype is html... I was mislead because html gives some coloration, but after setting the filetype to mustache, it is far better. My vim configuration is available here if you want to take a look at it.
Hi greg, sorry for late reply.
Your configuration is right as I can see. It should detect *.mustache, *.handlebars, *.hbs
, as you can see in ftdetect/mustache.vim:
au BufNewFile,BufRead *.mustache,*.handlebars,*.hbs set filetype=mustache
Can you try a new file with *.hbs extension?
Hello juvenn, thanks for the reply, I tried with a hbs copy of the handlebars file, and I got the same problem. I posted my problem here and got a solution using a filetype.vim file... strange.
My use of pathogen was in cause. Sorry for the inconvenience. I posted the solution [here](http://unix.stackexchange.com/questions/21843/filetype-not-detected
That's great you've got it working, thanks :)
I installed your plugin via pathogen, and I can't have syntax highlighting in a .handlebars file unless I explicitely set the filetype (like this
:setfiletype mustache
). I saw a condition in the file :if has("autocmd")
, so I typed:autocmd
and saw it was installed, obviously, so the condition should pass.