headwind icon indicating copy to clipboard operation
headwind copied to clipboard

Change default keyboard shortcut

Open curtisblackwell opened this issue 5 years ago • 8 comments

In apps with tabs, Command + Shift + T is usually the shortcut to re-open the most-recently-closed tab. This is also the case in VS Code (at least with the Atom keymap enabled).

A different default keyboard shortcut would be great. I'm aware I can change it, but it's still frustrating, especially for those of use who work on multiple computers. I've changed mine to Control + Option + Command + T for now.

curtisblackwell avatar Nov 21 '19 16:11 curtisblackwell

Any ideas as to what shortcut would be better?

heybourn avatar Nov 21 '19 21:11 heybourn

I don't mind Control + Option + Command + T. Could also use a chord. Shift + Command + K chord Shift + Command + T.

Might be good to do a poll or something.

I imagine once fix on save is possible, I'll disable it altogether as I'll rarely need it. Only if I have an unsaved file I'm mucking around with, in which case I'd just use the command palette.

curtisblackwell avatar Nov 21 '19 21:11 curtisblackwell

Run on save is now possible, however I will look into adding a config option to change the default shortcut today.

heybourn avatar Dec 01 '19 23:12 heybourn

Have you considered registering as a formatter instead of a command? https://code.visualstudio.com/blogs/2016/11/15/formatters-best-practices

Then you would just be able to use the default formatter shortcut of Shift+Option+F

adriaanzon avatar Dec 09 '19 13:12 adriaanzon

Have you considered registering as a formatter instead of a command? https://code.visualstudio.com/blogs/2016/11/15/formatters-best-practices

Then you would just be able to use the default formatter shortcut of Shift+Option+F

I have, however this caused some issues last time I tried. I'm open to it (so long as it won't break anything).

heybourn avatar Dec 12 '19 12:12 heybourn

Thinking about it again, I actually like being able to run the sort operation separate from formatting the whole document (especially when working with Vue files which can also include JavaScript).

ctrl+shift+h might be a good default shortcut, it's what the IDEA port uses.

adriaanzon avatar Mar 05 '20 14:03 adriaanzon

As a temporary fix, add this to your keybindings.json (cmd + shift + p > keyboard shortcuts). The keybinding will override the one from the plugin. ~~You can probably add another keybinding for Headwind here, but I have it done automatically on save.~~ Added it below to bind to ctrl+shift+h.

[
  {
    "key": "shift+cmd+t",
    "command": "workbench.action.reopenClosedEditor",
  },
  {
    "key": "ctrl+shift+h",
    "command": "headwind.sortTailwindClasses",
    "when": "editorTextFocus"
  }
]

TimonVS avatar Oct 21 '20 14:10 TimonVS

+1 This was a pretty surprising keyboard rebinding. At least for me, CMD + SHIFT + T is a frequently used binding in both browsers and editors.

Christopher-Hayes avatar Apr 05 '22 20:04 Christopher-Hayes