Skip to content

Instantly share code, notes, and snippets.

@uhlenbrock
Created March 13, 2014 17:27
Show Gist options
  • Save uhlenbrock/9532942 to your computer and use it in GitHub Desktop.
Save uhlenbrock/9532942 to your computer and use it in GitHub Desktop.
Force Atom to load rails grammar over ruby grammar
path = require 'path'
atom.workspaceView.eachEditorView (editorView) ->
editor = editorView.getEditor()
grammar = switch path.extname(editor.getPath())
when '.rb' then atom.syntax.grammarsByScopeName['source.ruby.rails']
when '.erb' then atom.syntax.grammarsByScopeName['text.html.ruby']
editor.setGrammar(grammar) if grammar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment