jesseduffield / jesseduffield/lazygit

multiple preset values for configs & hooks, via custom commands

Open
#4,744 4 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### reference issues

example issues which this feature can solve completely or majorly:
- https://github.com/jesseduffield/lazygit/issues/4737#issuecomment-3070047065
- https://github.com/jesseduffield/lazygit/issues/4740#issuecomment-3070038413
- https://github.com/jesseduffield/lazygit/issues/4743#issuecomment-3074573403
- https://github.com/jesseduffield/lazygit/discussions/4076#discussioncomment-11372665 (ad-hoc add verbose flag to "open commit in editor")

### Is your feature request related to a problem? Please describe.

it's not possible to:
* set multiple presets to a config value, and
* switch programatically between them on-the-fly when using lazygit

this becomes useful when:
* the main value of config suffices for most cases, but
* other value is indispensible in temporary use-cases

the only current way seems to be to:
* save multiple values in commented out form in the `~/.config/lazygit/config.yml` file, and
* manually juggle between them

### Describe the solution you'd like

[custom command]: https://github.com/jesseduffield/lazygit/wiki/Custom-Commands-Compendium "Custom Commands Compendium · jesseduffield/lazygit Wiki"

* allow setting value for a config option via method similar to the awesome [custom command] mechanism in lazygit
* currently it runs a `command`, and streams the result to `output`.

.
* this could further be oxtended to "hooks", not just "configs"
* the [example](https://github.com/jesseduffield/lazygit/issues/4743#issuecomment-3074573403) being:
modify the command used to refresh info in files-tab (i.e. git shatus ...) for ad-hoc filtering
* things like this are obviously not exposed as a config, and that is good thing. but these can be exposed as hooks to be modified at runtime with this mechanism

implementation specific detail of this given in this first comment below:
\- .

### Describe alternatives you've considered

.

### Additional context

* closes https://github.com/jesseduffield/lazygit/issues/4737

*
```console
$ lazygit --version | cut --fields=3-7 --delimiter=',' --output-delimiter=$'\n' | column --table --separator '='
build source nix
version 0.52.0
os linux
arch amd64
git version 2.49.0

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.