Skip to content

Instantly share code, notes, and snippets.

@hmcfletch
Created June 10, 2011 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hmcfletch/1018085 to your computer and use it in GitHub Desktop.
Save hmcfletch/1018085 to your computer and use it in GitHub Desktop.
TextMate javascript syntax highlighting for content_for :inline_js
// To edit:
// Bundles -> Bundle Editor -> Edit Languages
// Open Ruby on Rails
// Edit HTML (Rails)
// add to the patterns
{
name = 'inline_js.rails.embedded.html';
begin = '<%\s+(content_for)\s+(:inline_js)\s+(do)\s+-?%>';
end = '<%\s+(end)\s+-?%>';
beginCaptures = {
1 = { name = 'support.function.viewhelpers.rails'; };
2 = { name = 'constant.other.symbol.double-quoted.ruby'; };
3 = { name = 'keyword.control.def.ruby'; };
};
endCaptures = { 1 = { name = 'keyword.control.def.ruby'; }; }; // make it blue
patterns = (
{ include = 'source.js'; }
);
}
@joshheartsy
Copy link

winning!

@hmcfletch
Copy link
Author

Need to figure out how to not have a hack for the beginCaptures... But this works for now.

@jaygooby
Copy link

jaygooby commented Oct 7, 2012

Great stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment