Skip to content

Instantly share code, notes, and snippets.

@jaygooby
Forked from hmcfletch/gist:1018085
Created October 7, 2012 07:20
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 jaygooby/3847401 to your computer and use it in GitHub Desktop.
Save jaygooby/3847401 to your computer and use it in GitHub Desktop.
TextMate javascript syntax highlighting for content_for :javascript_includes and :jquery_ready
// To edit:
// Bundles -> Bundle Editor -> Edit Languages
// Open Ruby on Rails
// Edit HTML (Rails)
// add to the patterns
// Works for <% content_for :jquery_ready do -%>
// <% content_for :javascript_includes do -%>
// and <% javascript_tag do -%>
//
// but not that I'm writing any inline js, honest guv
patterns = (
{ name = 'inline_js.rails.embedded.html';
begin = '<%\s+((content_for)\s+(:jquery_ready|javascript_includes)|javascript_tag)\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'; }; };
patterns = ( { include = 'source.js'; } );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment