Sublime Text 3 - SASS (scss) autocomplete variables from other files

I have two files:

  • variables.scss:

    $ my_var: #fff;

  • module.scss:

    @import 'variables';

    .body {background: $ my_var;}

And Visual Studio gives me nice hints - when I type "$ my" in module.scss, I see all the variables from the imported files that match "$ my". Just. But Sublime Text 3 automatically fills only variables from the .scss module, and not from other imported files. I installed the whole Autocomplete package, it does not work ... Any ideas? This is an important feature for me ...

+5
source share
3 answers

A question was given here: Sass support for sublime text 3

From this link: You can install Emmet (formerly Zen Coding), it is an extremely powerful tool for creating css (and scss), for example:
I type bi and press tab , and it gives me: background-image: url(|); (using | your cursor).

If you're interested, check out this:

Now, how to make it work with scss:

Answer here

  • You need to install the sass-textmate-bundle package for scss and do what I wrote.
  • If you need sass, not scss, check this answer , especially the second answer from Alexander Ekdahl
+1
source

I had the same problem. Here is what posed the problem for me:

  • Have an active tab with a SASS file (SCSS), and then go to Preferences > Settings - More > Syntax Specific - User
  • Insert this "word_separators": "./\\()\"':,.;<> ~!@ #%^&*|+=[]{}`~?"
  • Save and make a profit.

Hope this helps. There is a github issue if you want more information.

0
source

I got this working using the AllAutocomplete plugin

The biggest drawback of using this plugin is that the file that it reads from the variables must be open. Unfortunately, I have not found a better way to achieve this.

Support for Sublime text 3?

This plugin did not work for me out of the box with ST3. I had to make a small modification to the user settings file to make it work.

 "word_separators": "./\\()\"':,.;<> ~!@ #%^&*|+=[]{}`~?", 

Adding this file to your custom settings file should do the trick. Here is the github issue it came from.

https://github.com/alienhard/SublimeAllAutocomplete/issues/18

0
source

All Articles