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

Keybindings for Custom Command's Prompt menus #3626

Open
rtalexk opened this issue Jun 1, 2024 · 0 comments
Open

Keybindings for Custom Command's Prompt menus #3626

rtalexk opened this issue Jun 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rtalexk
Copy link

rtalexk commented Jun 1, 2024

I'm creating a custom command with a menu prompt, similar to the "Reset to [commit hash]" menu.

image

Mine looks like this:

image
Configuration

In summary, what this does is allowing me to edit a file by reusing an existing $EDITOR instance in a Tmux window. Or, I can also choose to edit the file in the current window, or in a new $EDITOR instance (that's handled by the lazygit_edit_cmd script).

customCommands:
  - name: "edit"
    context: "files"
    key: "e"
    prompts:
      - type: "menu"
        title: "Editor instance"
        key: "WinChoise"
        options:
          - value: "reuse"
            description: "Search for a Window with an EDITOR instance"
            key: "r" # <-- This is what I want
          - value: "current"
            description: "Edit the file in the current window"
            key: "c" # <-- This is what I want
          - value: "new"
            description: "Edit the file in a new window"
            key: "n" # <-- This is what I want
    command: "lazygit_edit_cmd -w {{.Form.WinChoise}} {{.SelectedFile.Name}}"
    subprocess: true

Describe the solution you'd like
What I would like to have is mapping some keybinding to options in the prompt menu, just as in the Reset menu with m for Mixed, s for Soft and h for Hard reset.

Right now I mostly use the "Reuse" option (that's why it is the first one), and that's my workaround, but it would be cool if that's something that can be configured.

I read the Custom Commands docs and I didn't see any way to set bindings, if I missed that part please let me know.

@rtalexk rtalexk added the enhancement New feature or request label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant