Is there an existing package for editing Sass in Sublime Text 2?
This seems to be popular: https://github.com/n00ge/sublime-text-haml-sass
However, after installation, it appears that it only provides syntax highlighting for scss
files.
Ideally, I'd like syntax highlighting, indentation and completions for the sass
syntax.
Compiling Sass into CSS in Sublime Text is possible with a plugin called SassBuilder, which you can install through Package Control (see screenshot).
Steps to install: CTRL + SHIFT + P (Mac: COMMAND + SHIFT + P ) Type ' Package Control: Install package ' and press Enter . Wait several seconds.
INSTALLING WITH SUBLIME PACKAGE CONTROL When the list of available packages appears, type SASS into the input box to narrow the selection and then select SASS – SASS Support for TextMate & Sublime Text (2 & 3). The package will now install automatically.
I'd recommend you go with this one: https://github.com/nathos/sass-textmate-bundle, if only for the amazing code completion - compatible with SASS/SCSS.
Whenever in doubt about packages, and assuming you use the amazing Sublime Package Control, just use the packages list, type something (the result will be sorted by the number of installs), and usually the most popular one is the best one.
The reason it is only working for your scss files is because the Ruby HAML highlighting settings overrides your sass highlighting.
Goto Preferences
> Browse Packages...
Find and open Ruby Haml.tmLanguage
inside the Rails
folder
change the fileTypes from:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>fileTypes</key> <array> <string>haml</string> <string>sass</string> <!-- This line is causing the problem --> </array> <key>foldingStartMarker</key> <string>^\s*([-%#\:\.\w\=].*)\s$</string> <key>foldingStopMarker</key> <string>^\s*$</string> ...
to:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>fileTypes</key> <array> <string>haml</string> </array> <key>foldingStartMarker</key> <string>^\s*([-%#\:\.\w\=].*)\s$</string> <key>foldingStopMarker</key> <string>^\s*$</string> ...
Now the SASS highlighting package you installed should be working properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With