Skip to content

Instantly share code, notes, and snippets.

@7rulnik
Created June 18, 2015 22:12
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 7rulnik/a0d81d2bbd1a2d4d4335 to your computer and use it in GitHub Desktop.
Save 7rulnik/a0d81d2bbd1a2d4d4335 to your computer and use it in GitHub Desktop.
{extname} = require 'path'
fileTypes =
'.css' : 'source.css.scss'
atom.workspace.observeTextEditors (editor) ->
scopeName = fileTypes[extname editor.getPath()]
return unless scopeName?
g = atom.grammars.grammarForScopeName scopeName
return unless g?
editor.setGrammar g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment