Syntax Highlighting for Sass in Sublime Text 2

Posted on

Here’s how to get your Sublime Text to highlight Sass (.scss) files correctly!

  1. First, you need to have the Package Manager installed in Sublime Text. If you already have Package Manager, skip to the next step.
    Copy the following command, and in Sublime Text go to View > Show Console. Paste the copied command into the console window at the bottom of Sublime and hit enter.

    import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
  2. Open up your Command Palette from the menu in Sublime (Tools > Command Palette). Type “Package Control Install” and hit enter to select this option.
  3. Now you’ll have to search for the package we want. Type “Sass” and choose the first option in the list of results & click or hit enter.
  4. With your .scss file open, choose from the Sublime Text menu “View > Syntax > Open all with current extension as > Sass.”

Yay, you’re done! You’ll get some nice neat syntax highlighting in all your Sass code from now on.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>