How to get code folding in Sass files for BBEdit 10
I’m looking at a few IDE’s at the moment for an upcoming MacUser feature, one of which was BBEdit 10. One thing that was irking me was support for Sass files.
I’d found a Sass Language Module on Github that was supposed to provide folding and syntax highlighting but couldn’t get it working. Turns out it was written for BBEdit 9. Thankfully, one user (rayhatfield) had amended the plist file so it works with BBEdit 10. So, go get the file here: http://rocketsheep.com/tempp/SASS.plist and save it into ~/Library/Application Support/BBEdit/Language Modules (if that doesn’t work, you can go the riskier option of saving it in BBEdit.app (you’ll need to show package contents) > Contents > Language Modules) and then in BBedit, go to the preferences panel and go to the languages section. Then add a ‘Custom Extensions Mapping’ (enter ‘scss’as the suffix and use the selector on the right to choose ‘SASS’) and restart BBEdit 10.
Job done – you should now have code folding and syntax highlighting in BBEdit 10. Big thanks to Matt Martini (the original Language Module author) and Ray Hatfield for their efforts.
Thanks for the tip on SCSS files in BBedit 10. One issue that I found with Ray’s plist was that it didn’t offer block comment code coloring. After pouring through the BBedit manual and trip to StackOverflow (for the regex) I came up with this and it works for me.
Comment Pattern
(?:(?>[^*]+)|\*(?!/))*)\*/) (?# Block comment)
)]]>
Just replace the Comment Pattern key in your file, save and restart BBedit and you have code colored block comments.