Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic CSSComb on save #53

Open
karlhorky opened this issue Feb 3, 2015 · 25 comments
Open

Automatic CSSComb on save #53

karlhorky opened this issue Feb 3, 2015 · 25 comments

Comments

@karlhorky
Copy link
Contributor

It would be useful to have an option to automate Run CSSComb on every save, rather than manually having to invoke the command.

@lrobeson
Copy link

+1

2 similar comments
@remillc
Copy link

remillc commented Feb 18, 2015

+1

@ghost
Copy link

ghost commented Mar 29, 2015

+1

@Gliptal
Copy link

Gliptal commented Apr 3, 2015

+1

2 similar comments
@pzi
Copy link

pzi commented Apr 7, 2015

+1

@williambout
Copy link

+1

@abacaj
Copy link

abacaj commented May 2, 2015

+++++++1

@chris-flanagan
Copy link

+1

5 similar comments
@jomarinb
Copy link

+1

@graylaurenm
Copy link

+1

@marcobiedermann
Copy link

+1

@lumatijev
Copy link

+1

@HarrisJT
Copy link

+1

@powelski
Copy link

+2

@powelski
Copy link

As a workaround, I installed Hooks package, then added this code to my CSS syntax-specific settings:

"on_pre_save_language": [
    {
        "command": "css_comb"
    }
]

Works like a charm!

@lrobeson
Copy link

Whoa, I didn't know about the Hooks package, thanks for sharing your workaround!

@powelski
Copy link

@lrobeson You're welcome!

@julianpinedayyz
Copy link

@powelski This just made my day dude! Awesomeness in 3 lines of code ;)

@karlhorky
Copy link
Contributor Author

I found another CSS code style formatter plugin that has autosave:
https://github.com/yisibl/sublime-perfectionist

@powelski
Copy link

powelski commented Sep 7, 2015

@karlhorky Too bad it doesn't sort properties. It just takes care of white characters.

@JackBracken
Copy link

Thanks for the link to the hooks package @powelski, made my day

@lspoor
Copy link

lspoor commented Apr 20, 2017

The problem with @powelski solution is css-comb now runs on any file type I save, is there a way to limit it to css/scss/sass files?

@lrobeson
Copy link

@lspoor If you open an .scss file (or whatever syntax you want) and go to "Preferences -> Settings - Syntax Specific" and add this, it will only affect scss or whichever syntax settings file you have open:

// These settings override both User and Default settings for the SCSS syntax { "on_pre_save_language": [ { "command": "css_comb" } ] }

@htmlpluscss
Copy link

[
     { "keys": ["ctrl+s"], "command": "css_comb" }
]

@powelski
Copy link

@htmlpluscss on_pre_save_language is better solution, because you keep your saving keyboard shortcut in one place, instead of repeating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests