Sublime Text plugin for CSSfmt
Install CSSfmt
with Package Control and restart Sublime.
You need to have Node.js installed.
Make sure it's in your $PATH by running node -v
in your command-line.
Note: On OS X it's expected that Node resides in the /usr/local/bin/ folder, which it does when installed with the default installer. If this is not the case, symlink your Node binary to this location:
ln -s /full/path/to/your/node /usr/local/bin/node
-
Open the Command Palette (Windows and Linux: ctrl+shift+p, OSX: cmd+shift+p)
-
Select Package Control > Add Repository
Use the Command Pallete (Windows and Linux: ctrl+shift+p, OSX: cmd+shift+p) and run:
Run CSSfmt
(Preferences > Package Settings > CSSfmt > Settings - User)
{
"formatOnSave": true
}
You can override the default and user settings for individual projects. Just add an "CSSfmt"
object to the "settings"
object in the project's .sublime-project
file containing your project specific settings.
Example:
{
"settings": {
"CSSfmt": {
"formatOnSave": false
}
}
}
You can also set up a keyboard shortcut to run the command by opening up Preferences > Key Bindings - User and adding your shortcut with the cssfmt
command.
Example:
[
{ "keys": ["alt+super+f"], "command": "cssfmt" }
]
Based on FixMyJS plugin by Addy Osmani.
ISC © Damien Seguin