Skip to content

Instantly share code, notes, and snippets.

@vol4ok
Created August 22, 2011 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vol4ok/1161902 to your computer and use it in GitHub Desktop.
Save vol4ok/1161902 to your computer and use it in GitHub Desktop.
CoffeeBeans tag syntax highlight for textmate
{ scopeName = 'text.html.ruby';
fileTypes = ( 'rhtml', 'erb', 'html.erb' );
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|<!--(?!.*-->)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
)';
foldingStopMarker = '(?x)
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|^\s*-->
|(^|\s)\}
)';
patterns = (
{ begin = '<%[=-]?\s*(coffee_script_tag)\s*(do)\s*%>';
end = '<%\s*(end)\s*-?%>';
beginCaptures = {
1 = { name = 'entity.name.tag.coffee'; };
2 = { name = 'keyword.control.start-block.ruby'; };
};
endCaptures = { 1 = { name = 'keyword.control.start-block.ruby'; }; };
patterns = ( { include = 'source.coffee'; } );
},
{ name = 'comment.block.erb';
begin = '<%+#';
end = '%>';
captures = { 0 = { name = 'punctuation.definition.comment.erb'; }; };
},
{ name = 'source.ruby.rails.embedded.html';
begin = '<%+(?!>)[-=]?';
end = '-?%>';
captures = { 0 = { name = 'punctuation.section.embedded.ruby'; }; };
patterns = (
{ name = 'comment.line.number-sign.ruby';
match = '(#).*?(?=-?%>)';
captures = { 1 = { name = 'punctuation.definition.comment.ruby'; }; };
},
{ include = 'source.ruby.rails'; },
);
},
{ include = 'text.html.basic'; },
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment