Skip to content

Custom Keybindings

dash allows you to override existing keybindings as well as add custom ones.

Every valid entry for the configuration options must have a key and command. When a user presses the key or key combination the dashboard shells out and executes the command.

To help you identify your custom commands, an additional name property can be supplied to describe it in the help menu.

There are 3 types of keybindings: universal, prs and issues.

Define keybindings that will work in any view.

For example:

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

Define any number of keybindings for the PRs view or override existing ones.

For example:

keybindings:
prs:
- key: O
builtin: checkout
- key: m
command: gh pr merge --admin --repo {{.RepoName}} {{.PrNumber}}
- key: g
name: lazygit add
command: >
cd {{.RepoPath}} && git add -A && lazygit
- key: v
name: approve
command: >
gh pr review --repo {{.RepoName}} --approve --body "$(gum input --prompt='Approval Comment: ')" {{.PrNumber}}

The available arguments are:

ArgumentDescription
RepoNameThe full name of the repo (e.g. dlvhdr/gh-dash)
RepoPathThe path to the Repo, using the config.yml repoPaths key to get the mapping
PrNumberThe PR number
HeadRefNameThe PR’s remote branch name

Define any number of keybindings for the issues view or override existing ones.

For example:

keybindings:
issues:
key: "P"
command: >
gh issue pin {{ .IssueNumber }} --repo {{ .RepoName }}

The available arguments are:

ArgumentDescription
RepoNameThe full name of the repo (e.g. dlvhdr/gh-dash)
RepoPathThe path to the Repo, using the config.yml repoPaths key to get the mapping
IssueNumberThe issue number