brackets-emmet
brackets-emmet copied to clipboard
Shortcuts being taken by Brackets core
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.
Can you provide a Pull Request with shortcuts that will not be taken by Brackets?
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.
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.
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--",
In case someone needs to implement a quick solution:
- In Brackets, go to Help -> Open extensions folder.
- Once opened, open user folder and find brackets-emmet folder.
- Open keymap.json file and change the key combinations (starting around line 19).
- Save and close the file.
- Restart or Reload brackets.
Hope it helps somebody :)