gh-dash icon indicating copy to clipboard operation
gh-dash copied to clipboard

Support multiple keys for bindings

Open gabriellanata opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. I would like to assign multiple keys to an action, but it is currently only possible to assign a single key. Any additional keybindings replace the previous one.

For example, i want both tab and right arrow to go to the next section. However, this doesnt work and only the second key will work:

keybindings:
  universal:
    - key: right
      builtin: nextSection
    - key: tab
      builtin: nextSection

Describe the solution you'd like I'd like support for multiple keys. The key binding descriptions already include multiple keys by showing them separated by "/". So i propose using the same syntax for adding multiple keys.

keybindings:
  universal:
    - key: right/tab
      builtin: nextSection

Describe alternatives you've considered Al alternative is to make the original snippet work and having multiple keys be defined separately. This is a perfectly fine alternative.

gabriellanata avatar Jan 10 '25 20:01 gabriellanata

Proposed solution is here: https://github.com/dlvhdr/gh-dash/pull/505

gabriellanata avatar Jan 10 '25 20:01 gabriellanata

In YAML lists should be represented like this:

keybindings:
   universal:
    - key: [right, tab]
      builtin: nextSection

And then when the YAML is parsed you need to process either the single value or list accordingly.

Omnikron13 avatar Jan 11 '25 14:01 Omnikron13

Thanks for the feedback, I updated the PR

gabriellanata avatar Jan 13 '25 08:01 gabriellanata