Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show custom keybindings in the help menu #545

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joelazar
Copy link

@joelazar joelazar commented Mar 5, 2025

This adds the feature of showing the custom keybindings in the help menu. When the custom keybinding is extended with a name key, it will render that, otherwise it will use the command itself.

Example:

    - key: g
      command: >
        cd {{.RepoPath}} && lazygit
      name: lazygit

CleanShot 2025-03-05 at 17 54 54@2x

@dlvhdr
Copy link
Owner

dlvhdr commented Mar 7, 2025

Thank you! I've always wanted this :)

From some quick testing I see a few issues:

  • Keys in the universal section don't show up - this is an existing missing feature, but would be great to add that together with this PR
  • For some reason, in the C key case below, I'm not seeing the name in the help menu

So I would check against this config:

keybindings:
  universal:
    - key: g
      name: lazygit
      command: >
        cd {{.RepoPath}} && lazygit
  prs:
    - key: O
      builtin: checkout
    - key: C
      name: review in octo
      command: >
        tmux new-window -c {{.RepoPath}} '
        nvim -c ":silent Octo pr edit {{.PrNumber}}"
        '

@joelazar
Copy link
Author

Thank you! I've always wanted this :)

From some quick testing I see a few issues:

* Keys in the `universal` section don't show up - this is an existing missing feature, but would be great to add that together with this PR

* For some reason, in the C key case below, I'm not seeing the `name` in the help menu

So I would check against this config:

keybindings:
  universal:
    - key: g
      name: lazygit
      command: >
        cd {{.RepoPath}} && lazygit
  prs:
    - key: O
      builtin: checkout
    - key: C
      name: review in octo
      command: >
        tmux new-window -c {{.RepoPath}} '
        nvim -c ":silent Octo pr edit {{.PrNumber}}"
        '

Perfect, thanks for the feedback. I'll look into them and sort them out in the next 1–2 days 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants