1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-30 09:16:47 +02:00
lazygit/docs/Custom_Pagers.md
2021-04-06 19:34:32 +10:00

1.6 KiB

Custom Pagers

Lazygit supports custom pagers, configured in the config.yml file (which can be opened by pressing o in the Status panel).

Support does not extend to Windows users, because we're making use of a package which doesn't have Windows support.

Default:

git:
  paging:
    colorArg: always
    useConfig: false

the colorArg key is for whether you want the --color=always arg in your git diff command. Some pagers want it set to always, others want it set to never.

Delta:

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never

Diff-so-fancy

git:
  paging:
    colorArg: always
    pager: diff-so-fancy

ydiff

gui:
  sidePanelWidth: 0.2 # gives you more space to show things side-by-side
git:
  paging:
    colorArg: never
    pager: ydiff -p cat -s --wrap --width={{columnWidth}}

Be careful with this one, I think the homebrew and pip versions are behind master. I needed to directly download the ydiff script to get the no-pager functionality working.

Using git config

git:
  paging:
    colorArg: always
    useConfig: true

If you set useConfig: true, lazygit will use whatever pager is specified in $GIT_PAGER, $PAGER, or your git config. If the pager ends with something like | less we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the --paging=never flag for the delta pager).