1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-01 13:51:06 +03:00

Replace paging config with an array of pagers

This commit is contained in:
Stefan Haller
2025-10-08 16:22:17 +02:00
parent 765c9eb85c
commit e44d6ec330
9 changed files with 191 additions and 78 deletions

View File

@@ -233,8 +233,30 @@ type SpinnerConfig struct {
}
type GitConfig struct {
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md
Paging PagingConfig `yaml:"paging"`
// Array of pagers. Each entry has the following format:
// [dev] The following documentation is duplicated from the PagingConfig struct below.
//
// # Value of the --color arg in the git diff command. Some pagers want
// # this to be set to 'always' and some want it set to 'never'
// colorArg: "always"
//
// # e.g.
// # diff-so-fancy
// # delta --dark --paging=never
// # ydiff -p cat -s --wrap --width={{columnWidth}}
// pager: ""
//
// # e.g. 'difft --color=always'
// externalDiffCommand: ""
//
// # If true, Lazygit will use git's `diff.external` config for paging.
// # The advantage over `externalDiffCommand` is that this can be
// # configured per file type in .gitattributes; see
// # https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver.
// useExternalDiffGitConfig: false
//
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md for more information.
Pagers []PagingConfig `yaml:"pagers"`
// Config relating to committing
Commit CommitConfig `yaml:"commit"`
// Config relating to merging
@@ -301,6 +323,7 @@ func (PagerType) JSONSchemaExtend(schema *jsonschema.Schema) {
}
}
// [dev] This documentation is duplicated in the GitConfig struct. If you make changes here, make them there too.
type PagingConfig struct {
// Value of the --color arg in the git diff command. Some pagers want this to be set to 'always' and some want it set to 'never'
ColorArg string `yaml:"colorArg" jsonschema:"enum=always,enum=never"`
@@ -441,6 +464,7 @@ type KeybindingUniversalConfig struct {
PrevTab string `yaml:"prevTab"`
NextScreenMode string `yaml:"nextScreenMode"`
PrevScreenMode string `yaml:"prevScreenMode"`
CyclePagers string `yaml:"cyclePagers"`
Undo string `yaml:"undo"`
Redo string `yaml:"redo"`
FilteringMenu string `yaml:"filteringMenu"`
@@ -784,11 +808,6 @@ func GetDefaultConfig() *UserConfig {
SwitchTabsWithPanelJumpKeys: false,
},
Git: GitConfig{
Paging: PagingConfig{
ColorArg: "always",
Pager: "",
ExternalDiffCommand: "",
},
Commit: CommitConfig{
SignOff: false,
AutoWrapCommitMessage: true,
@@ -904,6 +923,7 @@ func GetDefaultConfig() *UserConfig {
PrevTab: "[",
NextScreenMode: "+",
PrevScreenMode: "_",
CyclePagers: "|",
Undo: "z",
Redo: "Z",
FilteringMenu: "<c-s>",