-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vim sets filetype to HTML (not Slim) when using 'doctype html' #38
Comments
Same here. |
👍 Yep… same thing here. |
Any idea why this happens or how to fix it? |
I thought Vim uses only the extension for resolving the type |
This is the change that broke it for me… 1e4e488#commitcomment-3871242 When I revert it, it works just fine. Good catch on the doctype thing though… now we just need to figure out why. |
This is the standard way to set the filetype, and allows syntax.vim to set the correct syntax highlighting automatically.
1e4e488 should be reverted. Vim's filetype.vim has an autocmd that tries to detect html files based on doctype and this is triggered before scripts in ftdetect/* are sourced. IMO that seems wrong, but what can you do I guess. Sorry for the hassle everyone. |
@jacknagel Has it really been reverted? I still see the code in master and am getting the issue in a fresh clone |
I don't think so. I don't have commit access to this repo, though. |
Very annoying indeed. Until fixed (although this repo seems quite dead...) I use in
|
@cram1010 Create a pull request?! |
yeah... it would be great if I had the time... Maybe did my comment sound like a criticism? No my intention, it was just an ascertainment. I understand it is difficult to find the time to maintain a project, like I find difficult to find the time to prepare the pull request... |
It was meant more like an encouragement 😄 |
great :) |
f8180ad which is merged in master fixes this issue for me. |
I updated the plugin and now it works for me, too. Thanks!! |
I was editing my Rails application layout file in Vim 7.3 with this vim-slim plugin installed and noticed that Vim was using a filetype of HTML instead of Slim for my application.html.slim file and not providing syntax highlighting.
My other views that followed the *.html.slim naming convention were correctly using the Slim filetype and syntax.
The culprit seemed to be the first line of the file, which was
doctype html
. I changed it to the equivalentdoctype 5
and now Vim correctly sets the filetype to Slim for this file.The text was updated successfully, but these errors were encountered: