Home Download Buy Blog Forum Support

How can I get my .scss files to open with the SCSS syntax?

How can I get my .scss files to open with the SCSS syntax?

Postby jannisg on Tue Sep 04, 2012 3:10 am

Hi folks,

I've been battling with this for a little while but it just got to the point now where my annoyance of it is driving me to seek help from you fine people.

Essentially, I use SCSS for most of my CSS authoring, I rarely ever use the older/original SASS syntax itself, so I want to be able to quick find (CMD+T) my application.css.scss file and have it open with the SCSS syntax.

The problem with this is that:

When SASS bundle is installed, the file will open with SASS syntax instead of SCSS.
I've tried the View > Syntax > Open all with current extension as… > SCSS option however after restarting Sublime the settings are reverted and SASS is the default again.

This has prompted me to just uninstall/remove the SASS bundle (via Package Control) all-together however this leads to another issue…
When the SASS bundle is uninstalled, I get an error while using quick find and I come across the scss file.
Error loading syntax file "Packages/SASS/Syntaxes/SASS.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/SASS/Syntaxes/SASS.tmLanguage"


The only way to remove this error seems to be installing the SASS bundle again but then I'm back to it being the default syntax… vicious circle.

Any ideas would be much appreciated.

Thanks for reading,
J.

PS: Here is a screenshot of the error message:
Image
jannisg
 
Posts: 2
Joined: Tue Sep 04, 2012 2:57 am

Re: How can I get my .scss files to open with the SCSS syntax?

Postby ptrdvds on Tue Nov 06, 2012 4:09 pm

I have the same issue and am wondering if someone has a fix for this.
After the .scss file is loaded selecting SCSS highlights as normal.

Please help
ptrdvds
 
Posts: 1
Joined: Tue Nov 06, 2012 4:06 pm

Re: How can I get my .scss files to open with the SCSS syntax?

Postby phillip.koebbe on Tue Nov 06, 2012 6:04 pm

I have the SCSS package [1] installed (through Package Control) and don't have any problems with .scss files. If that doesn't work for you, you can give DetectSyntax [2] a shot (but you really shouldn't need to resort to that).


[1] https://github.com/kuroir/SCSS.tmbundle ... blimeText2
[2] https://github.com/phillipkoebbe/DetectSyntax
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: How can I get my .scss files to open with the SCSS syntax?

Postby brokenthorn on Wed Nov 28, 2012 1:33 am

It's a bug. The Package Manager installs the Sass/SCSS stuff in wrong-case folder names and seems like ST is hard-coded or something as in what folder to look in...

I had to rename my Scss folder to SCSS and restart ST2.
That's it.

Should look like this:
Code: Select all
~/.config/sublime-text-2/Packages$ ls S
Sass/        Scala/       SCSS/        ShellScript/ SQL/

Oh and there's also this file "Packages/SASS/Syntaxes/SASS.tmLanguage" that you might need to rename from Sass.tmLanguage to SASS.tmLanguage. I had.
brokenthorn
 
Posts: 1
Joined: Wed Nov 28, 2012 1:26 am

Re: How can I get my .scss files to open with the SCSS syntax?

Postby perseo on Sun Dec 16, 2012 5:06 am

Hi jannisg, I hope not too late, if so will then as antecedent.

First of all, I had the same problem once uninstall the SASS and subsequently to install the SCSS package. I could solve it in the following way:

Inside the folder /home/user/.config/sublime-text-2/Packages/User (I use Linux, so I do not know the folder's name on MacOS), we must edit 2 files:

Note: Be sure to close all windows of ST2 before proceeding.

1.- Package Control.sublime-settings

You must delete the line: SASS, and save it.

2.- syntax_highlighting.py

You must edit the next line to: elif name[-5:] == ".scss":, thus leaving: set_syntax(view, "SCSS", "SCSS") and save it.

Now we go up one level in the directory tree (/home/user/.config/sublime-text-2) and inside the Settings folder, we must edit the file:

3.- Session.sublime_session

Note: I had to edit that file from the command line because with other text editors could not do it (I use nano). I do not know the reason for this.

And we replace all lines containing the string: "...SASS.tmLanguage" by "Packages/SCSS/SCSS.tmLanguage" and save it.

That would be all :D.

Hope I have helped in solving the problem ;)
perseo
 
Posts: 2
Joined: Thu Oct 18, 2012 8:11 pm

Re: How can I get my .scss files to open with the SCSS syntax?

Postby jannisg on Mon Apr 01, 2013 10:36 pm

Thanks perseo!

That did the trick, no more errors and proper highlighting on the .scss files, thank you.
jannisg
 
Posts: 2
Joined: Tue Sep 04, 2012 2:57 am

Re: How can I get my .scss files to open with the SCSS syntax?

Postby andrewmartin on Fri Apr 26, 2013 3:52 am

You may have gotten this set up already, but I was having this issue with SASS. I think an easier way is:

When you have a SASS/SCSS file open, go to View --> Syntax --> Open all with current extension as... and select SASS.
andrewmartin
 
Posts: 3
Joined: Fri Apr 26, 2013 3:51 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 19 guests