Skip to content

Reusing Settings

DASH supports defining global settings that will always be applied, and lets you override them with a per-repo or one-time basis.

This lets you set your theme, keybindings and any other setting by defining them once.

The global config is usually under $HOME/.config/gh-dash/config.yml - but that follows the XDG spec. See How to Configure for more details.

The global config is loaded first, with the option to override anything it defines. Here you’d usually want to define stuff like your theme, keybindings etc.

DASH supports passing ad-hoc or per-repo config files by:

  • Creating a .gh-dash.yml file in a git repo’s root directory.
  • Passing a path to a .yml file you supplied with the --config flag or the GH_DASH_CONFIG environment variable.

Any settings defined here will override your global config settings.

Your global config under ~/.config/gh-dash/config.yml could look like this:

pager:
diff: diffnav
theme:
colors:
text:
primary: "#E2E1ED"
secondary: "#666CA6"
inverted: "#242347"
# ...
keybindings:
universal:
- key: g
name: lazygit
command: cd {{.RepoPath}} && lazygit

Then in a git repo you could create a .gh-dash.yml file defining just the sections:

prSections:
- title: Bugs
filters: is:open author:@me [BUG]
- title: Our Packages
filters: is:open review-requested:@me repo:work-org/our-pkg

Starting DASH from the git repo, the final config used will have the pager, theme and keybindings from your global config and the prSections from your repo’s config.

Any config file can pull in other config files with the include directive, which takes a list of paths to other config files:

include:
- /var/lib/gh-dash/system-shared.yml
- ~/.config/gh-dash/themes/tokyonight.yml
- ./shared-keybindings.yml
prSections:
- title: Bugs
filters: is:open author:@me [BUG]

Included files are merged in using the same rules as the global/override merge: the file doing the including takes precedence over the files it includes, and included files are merged in the order they’re listed (later ones overriding earlier ones). keybindings are unioned across all files, and sections are taken from the file that defines them.

Paths are resolved relative to the file declaring the include, and a leading ~ is expanded to your home directory. Included files may declare their own include directives, which are resolved recursively.