Search code examples
csssublimetext3csscomb

How to use CSScomb.sublime-settings in Sublime


I'm using the third Sublime version and I want to use this CSS comb: https://github.com/vitaligo/CSScomb.sublime-settings/blob/master/CSScomb.sublime-settings

The problem is I don't really know how to make it work - should I download this code and past in somewhere in Sublime or somehow connect it via Packages...could you please help me?

Sorry if this question sounds dumb, never done it before.

Thanks for your help!


Solution

  • The file that your question is referencing is just the settings file for the CSSComb package itself that a user has shared/is storing on GitHub. In order to use that, you need to also install the package in question as well.

    It's not clear from your question how much of this you might have already done, so I'll list the step by step here and you can pick things up at any point along the way.

    1. You need to/should install PackageControl. You can install packages manually, but if you're at all unsure about that, PC is the way to go. The easiest way to install it is to use the Tools > Install Package Control command from the menu, which will do it for you.

      NOTE: This menu item hides itself when Package Control is already installed, so if you don't see it, you have probably already done this step. In that case proceed to step 2, but if you don't see the command it talks about, there are manual instructions as well. This is usually only the case when you're using a really old version of Sublime, though.

    2. Open the command palette (Tools > Command Palette) and use the text pkginst to find and select the command PackageControl: Install Package.

    3. When the package list pops up, enter csscomb to find the package and select the entry to install it.

    4. This particular package relies on external programs to work (in this case, NodeJS). The package installer only installs the package, so you need to also take care of installing the appropriate external tools as well. The README on the Package Page tells you what you need to ensure is set up and how.

    5. At this point the package is installed and ready to go, but you need to configure it. The items under Preferences > Packages > CSSComb are used for this. In particular, Settings - Default will show you what the default settings look like (which is also generally an example of options you can use) and Settings - User is your own user specific settings.

    The way settings work in Sublime, the defaults are applied and then your settings are applied "on top". So your settings only need to include anything that you want to change the default for.

    The file you linked above that user's version of the user settings file. So if you like, you can use the Settings - User command mentioned above to open your user settings and then replace the contents with that file. Note that you may need to change things (like the node_path) as needed. It's also worth noting that some of the configuration options are configuring the external tool that powers the package, so being familiar with that tool or looking up help for it may also be needed.

    The rest of the user guide for the package is available in the README linked above. The above mentioned location in the preferences menu also contains a README entry that will open the file directly within Sublime.