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

Formatter also works in non css, sass, etc files #3

Open
zaneshaw opened this issue May 23, 2022 · 1 comment
Open

Formatter also works in non css, sass, etc files #3

zaneshaw opened this issue May 23, 2022 · 1 comment

Comments

@zaneshaw
Copy link

zaneshaw commented May 23, 2022

I bound the 'alphabetize' keybind to the same as my auto formatter so it runs when ever I want to format my file. Problem is, when I run it in a js file for example, it messes up my indents and curly bracket order. I think it would be better if the 'alphabetize' command only ran in appropriate file types or language ids.

@smoochy
Copy link

smoochy commented Jan 4, 2024

A little bit late to the party, but as I just started using Alphabetize and want to format on save, I made the following for keybindings.json:

[
  {
    "command": "runCommands",
    "key": "ctrl+s", // You can choose a different keybinding if desired
    "args": {
      "commands": ["css-alphabetize.alphabetize", "workbench.action.files.save"]
    },
    "when": "(editorTextFocus && editorLangId == css)"
  }
]

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

No branches or pull requests

2 participants