brackets-emmet icon indicating copy to clipboard operation
brackets-emmet copied to clipboard

Shortcuts being taken by Brackets core

Open njx opened this issue 10 years ago • 5 comments

Hi,

As part of our work to implement multiple selection functionality in Brackets, we need to add a few keyboard shortcuts for new commands. Unfortunately, a number of these shortcuts conflict with Emmet shortcuts.

If it's possible to change any of these shortcuts that are important for your users, that would be great. Otherwise, you can unregister the default Brackets shortcuts using KeyBindingManager.removeBinding() before registering your own, but that means users wouldn't be able to access the Brackets functionality that uses these shortcuts.

Eventually we'll have configurable shortcuts so this won't be as much of an issue, but we just wanted to give you a heads-up. The new shortcuts will likely be added in Release 38, which should come out in a month or so.

The specific shortcuts that will conflict with existing Emmet shortcuts are:

  • Shift-Alt-Up (Add Previous Line to Selection)
  • Shift-Alt-Down (Add Next Line to Selection)
  • Ctrl-Alt-L (Split into Lines)
  • Ctrl-B (Add Next Match to Selection)
  • Ctrl-Shift-B (Skip and Add Next Match)

Of these, I'd say Ctrl-Alt-L is probably the least important to worry about. Ctrl-B/Ctrl-Shift-B are probably the most useful, followed by Shift-Alt-Up/Down.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3981897-shortcuts-being-taken-by-brackets-core?utm_campaign=plugin&utm_content=tracker%2F311111&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F311111&utm_medium=issues&utm_source=github).

njx avatar Mar 11 '14 02:03 njx

Can you provide a Pull Request with shortcuts that will not be taken by Brackets?

sergeche avatar Mar 11 '14 07:03 sergeche

Sure, I can look into it, though I might not get to it for another couple of weeks (busy this week and out of town the next). I will definitely try to get to it before we release 38. Feel free to ping me if you don't hear from me in a couple weeks.

njx avatar Mar 12 '14 00:03 njx

OK, I've put up https://github.com/emmetio/brackets-emmet/pull/38. It looks like I was originally mistaken about Ctrl-Alt-L - it doesn't look like you're actually using that shortcut.

njx avatar Mar 28 '14 23:03 njx

There is also a conflict with increment_number_by_1 and decrement_number_by_1. They are used by edit.lineUp and edit.LineDown.

I would prefere the following configuration:

"increment_number_by_1": "Ctrl-Shift-+",
"decrement_number_by_1": "Ctrl-Shift--",
"increment_number_by_01": "Ctrl-Shift-Alt-+",
"decrement_number_by_01": "Ctrl-Shift-Alt--",
"increment_number_by_10": "Ctrl-Alt-+",
"decrement_number_by_10": "Ctrl-Alt--",

Lichtjaeger avatar Jan 15 '16 10:01 Lichtjaeger

In case someone needs to implement a quick solution:

  1. In Brackets, go to Help -> Open extensions folder.
  2. Once opened, open user folder and find brackets-emmet folder.
  3. Open keymap.json file and change the key combinations (starting around line 19).
  4. Save and close the file.
  5. Restart or Reload brackets.

Hope it helps somebody :)

davoscript avatar Mar 01 '16 19:03 davoscript