Created
March 13, 2014 17:27
-
-
Save uhlenbrock/9532942 to your computer and use it in GitHub Desktop.
Force Atom to load rails grammar over ruby grammar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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