Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Highlight SASS comments a little better #41

wants to merge 1 commit into from

3 participants


I like to put comments on the end of lines of SASS. // like this

But vim-haml doesn't highlight them.

I took a crack at fixing it. I don't know Vim syntax rules very well, but I think I nailed it.



Looks like you accidentally removed the 's' from 'scssComment'

That was deliberate.

This file imports css.vim and uses its definitions, but it doesn't import scss.vim. I figured the references to scss in this file were mistakes. Changing this to cssComment caused /* */ style comments on the ends of lines to work.

I could be mistaken about css.vim and scss.vim though, as my understanding of how these files work is not complete.


The original was correct. The SCSS highlighting wraps the Sass highlighting and depends on this. (This is exactly backwards, but I implemented Sass highlighting first and haven't had a chance to invert the dependency.)

Since I've waited to the last minute to merge this, I've gone ahead and squashed in a fix.

@tpope tpope closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 3, 2012
  1. @puyo
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 syntax/sass.vim
4 syntax/sass.vim
@@ -13,7 +13,7 @@ runtime! syntax/css.vim
syn case ignore
syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
-syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+syn cluster sassCssAttributes contains=css.*Attr,sassEndOfLineComment,cssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
@@ -66,7 +66,9 @@ syn keyword sassFor from to through in contained
syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained
syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+syn match sassEndOfLineComment "//.*" contains=sassComment,sassTodo,@Spell
+hi def link sassEndOfLineComment sassComment
hi def link sassCssComment sassComment
hi def link sassComment Comment
hi def link sassDefault cssImportant
Something went wrong with that request. Please try again.