Not possible to map multiple keybinds to the same command in Hyper
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.7k
- Forks
- 3.6k
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
- I am on the latest Hyper.app version
- I have searched the issues of this repo and believe that this is not a duplicate
- OS version and name: macOS Sierra 10.12.6
- Hyper.app version: Hyper 1.4.6 (stable)
- Link of a Gist with the contents of your .hyper.js: https://gist.github.com/lewisl9029/44f4f3c23bb310fb0035f013f7156fb2
- Relevant information from devtools (CMD+ALT+I on Mac OS, CTRL+SHIFT+I elsewhere): N/A
- The issue is reproducible in vanilla Hyper.app:
Is Vanilla
Issue
I was trying to remap both ctrl+e and cmd+e to pane splitting to allow my config to be sync'ed as-is between my Windows and Mac environments, but found out this wasn't possible in Hyper because the Hyper keymap format maps from commands to keybinds as opposed to from keybinds to commands, like in editors like Atom or VSCode:
Hyper:
// Only `cmd+e` here takes effect because a JS Object can't have duplicate keys.
'pane:splitHorizontal': 'ctrl+e',
'pane:splitHorizontal': 'cmd+e',
Atom:
// Both `cmd-e` and `ctrl-e` will be mapped to the same command.
'cmd-e': 'pane:split-right-and-copy-active-item'
'ctrl-e': 'pane:split-right-and-copy-active-item'
The Atom keymap structure seems to make much more sense to me, because mapping multiple keybinds to the same command seems like a much more useful and common use case than mapping multiple commands to the same key (in fact, I would go as far as to consider the fact that we're able to do this in Hyper to be a bug, because of all the confusing behavior this could lead to).
Any particular reason why we're mapping commands to keybinds instead of the other way around in Hyper? If not, would you consider accepting a PR to invert this mapping? I'd totally understand if you'd rather hold off on changing the keymap structure since it'll break people's configs. If anyone has any ideas on how to implement this change in a backwards compatible way, I'd love to hear them. Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the .hyper.js keymap configuration described in the issue and review the 11-comment discussion for compatibility concerns. Determine how multiple bindings could be accepted for one command while preserving existing configurations; done means both ctrl+e and cmd+e trigger pane splitting without breaking current keymaps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100