vim does not approve of your compass spriting . 06/29/2013

Compass provides a really cool way to generate sprites from a directory full of images - This is pretty much all it takes:

@import "my-icons/*.png";
@include all-my-icons-sprites;

Unfortunately for Vim users, part of the first line is confused to be the beginning of a CSS comment :\

bad syntax

This obviously won't do. Lucky for us, editing the logic of Vim's syntax highlighting logic is pretty easy. Scriptease.vim provides some cool commands that help deal with runtime files. :Vedit is the one we need here.

:Vedit syntax/sass.vim

Search for this line:

syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType

Change it to this:

syn region sassInclude start="@import" end=";\|$" contains=cssURL,cssUnicodeEscape,cssMediaType

Basically the scssComment syntax match statement is the problem. Remove it and your SCSS files with Compass Spriting look like they should :D

good syntax

comments powered by Disqus