You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Custom_Pagers.md
+24-21Lines changed: 24 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,27 @@ Lazygit supports custom pagers, [configured](/docs/Config.md) in the config.yml
4
4
5
5
Support does not extend to Windows users, because we're making use of a package which doesn't have Windows support. However, see [below](#emulating-custom-pagers-on-windows) for a workaround.
6
6
7
-
## Default:
7
+
Multiple pagers are supported; you can cycle through them with the `|` key. This can be useful if you usually prefer a particular pager, but want to use a different one for certain kinds of diffs.
8
+
9
+
Pagers are configured with the `pagers` array in the git section; here's an example for a multi-pager setup:
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`.
20
+
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`. The default is `always`, since that's what most pagers need.
16
21
17
22
## Delta:
18
23
19
24
```yaml
20
25
git:
21
-
paging:
22
-
colorArg: always
23
-
pager: delta --dark --paging=never
26
+
pagers:
27
+
- pager: delta --dark --paging=never
24
28
```
25
29
26
30

@@ -31,9 +35,8 @@ A cool feature of delta is --hyperlinks, which renders clickable links for the l
31
35
32
36
```yaml
33
37
git:
34
-
paging:
35
-
colorArg: always
36
-
pager: diff-so-fancy
38
+
pagers:
39
+
- pager: diff-so-fancy
37
40
```
38
41
39
42

@@ -44,9 +47,9 @@ git:
44
47
gui:
45
48
sidePanelWidth: 0.2 # gives you more space to show things side-by-side
Instead of setting this command in lazygit's `externalDiffCommand` config, you can also tell lazygit to use the external diff command that is configured in git itself (`diff.external`), by using
79
82
80
83
```yaml
81
84
git:
82
-
paging:
83
-
useExternalDiffGitConfig: true
85
+
pagers:
86
+
- useExternalDiffGitConfig: true
84
87
```
85
88
86
89
This can be useful if you also want to use it for diffs on the command line, and it also has the advantage that you can configure it per file type in `.gitattributes`; see https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver.
The main limitation of this approach compared to a "real" pager is that renames are not displayed correctly; they are shown as if they were modifications of the old file. (This affects only the hunk headers; the diff itself is always correct.)
0 commit comments