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
# 'pager', 'externalDiffCommand', and 'useExternalDiffGitConfig' are mutually
390
+
# exclusive; set at most one per entry.
391
+
#
364
392
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md
365
393
# for more information.
366
394
pagers: []
@@ -406,6 +434,11 @@ git:
406
434
# If true, periodically refresh files and submodules
407
435
autoRefresh: true
408
436
437
+
# If true, poll the repo periodically for external ref changes (commits, branch
438
+
# updates, checkouts made outside lazygit) and refresh when one is detected.
439
+
# Independent of autoRefresh, which only governs the files panel.
440
+
autoDetectExternalChanges: true
441
+
409
442
# If not "none", lazygit will automatically fast-forward local branches to match
410
443
# their upstream after fetching. Applies to branches that are not the currently
411
444
# checked out branch, and only to those that are strictly behind their upstream
@@ -499,6 +532,15 @@ git:
499
532
# to 40 to disable truncation.
500
533
truncateCopiedCommitHashesTo: 12
501
534
535
+
# Config relating to git worktrees
536
+
worktree:
537
+
# Default parent directory for new worktrees. It is offered as a candidate
538
+
# location alongside the parent directories of any worktrees you already have.
539
+
# A relative path is resolved against the repository's root directory, so
540
+
# "../worktrees" sits beside the repo and ".worktrees" sits inside it.
541
+
# A leading "~" is expanded to your home directory, so "~/worktrees" works.
542
+
defaultPath: ""
543
+
502
544
# Periodic update checks
503
545
update:
504
546
# One of: 'prompt' (default) | 'background' | 'never'
@@ -517,6 +559,11 @@ refresher:
517
559
# Auto-fetch can be disabled via option 'git.autoFetch'.
518
560
fetchInterval: 60
519
561
562
+
# Interval in seconds at which lazygit polls for external ref changes (commits,
563
+
# branch updates, checkouts made outside lazygit).
564
+
# Detection can be disabled via option 'git.autoDetectExternalChanges'.
565
+
externalChangeCheckInterval: 2
566
+
520
567
# If true, show a confirmation popup before quitting Lazygit
521
568
confirmOnQuit: false
522
569
@@ -648,6 +695,7 @@ keybinding:
648
695
confirmInEditor: [<ctrl+enter>, <ctrl+s>]
649
696
remove: d
650
697
new: "n"
698
+
newWorktree: w
651
699
edit: e
652
700
openFile: o
653
701
scrollUpMain: [<pgup>, K, <ctrl+u>]
@@ -667,6 +715,7 @@ keybinding:
667
715
nextScreenMode: +
668
716
prevScreenMode: _
669
717
cyclePagers: '|'
718
+
cyclePagersReverse: \
670
719
undo: z
671
720
redo: Z
672
721
filteringMenu: <ctrl+s>
@@ -681,6 +730,7 @@ keybinding:
681
730
increaseRenameSimilarityThreshold: )
682
731
decreaseRenameSimilarityThreshold: (
683
732
openDiffTool: <ctrl+t>
733
+
editConfig: <alt+shift+c>
684
734
status:
685
735
checkForUpdate: u
686
736
recentRepos: <enter>
@@ -726,8 +776,6 @@ keybinding:
726
776
fetchRemote: f
727
777
addForkRemote: F
728
778
sortOrder: s
729
-
worktrees:
730
-
viewWorktreeOptions: w
731
779
commits:
732
780
squashDown: s
733
781
renameCommit: r
@@ -1059,6 +1107,12 @@ keybinding:
1059
1107
edit: <disabled> # disable 'edit file'
1060
1108
```
1061
1109
1110
+
### Overriding the platform for default keybindings
1111
+
1112
+
A few keybindings have different defaults on macOS than on Linux and Windows (e.g. word-wise cursor movement in text inputs uses `alt` on macOS but `ctrl` elsewhere). Lazygit picks these based on the OS it's running on, but you can override that with the `LAZYGIT_KEYBINDING_PLATFORM` environment variable. Set it to `darwin`, `linux`, or `windows`; any other value is ignored and the actual OS is used.
1113
+
1114
+
This is useful when running lazygit in a Linux container that you access over ssh from a Mac, where you'd rather use the macOS keybindings.
Copy file name to clipboardExpand all lines: docs/Custom_Pagers.md
+2-29Lines changed: 2 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
Lazygit supports custom pagers, [configured](/docs/Config.md) in the config.yml file (which can be opened by pressing `e` in the Status panel).
4
4
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
-
7
5
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
6
9
7
Pagers are configured with the `pagers` array in the git section; here's an example for a multi-pager setup (use an empty object `{}` for the default builtin diff display that doesn't use a pager):
@@ -71,7 +69,7 @@ git:
71
69
- externalDiffCommand: difft --color=always
72
70
```
73
71
74
-
The `colorArg` and `pager` options are not used in this case.
72
+
The `colorArg` option is not used in this case.
75
73
76
74
You can add whatever extra arguments you prefer for your difftool; for instance
77
75
@@ -91,29 +89,4 @@ git:
91
89
92
90
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.
93
91
94
-
## Emulating custom pagers on Windows
95
-
96
-
There is a trick to emulate custom pagers on Windows using a Powershell script configured as an external diff command. It's not perfect, but certainly better than nothing. To do this, save the following script as `lazygit-pager.ps1` at a convenient place on your disk:
Use the pager of your choice with the arguments you like in the last line of the script. Personally I wouldn't want to use lazygit anymore without delta's `--hyperlinks --hyperlinks-file-link-format="lazygit-edit://{path}:{line}"` args, see [above](#delta).
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.)
92
+
`pager`, `externalDiffCommand`, and `useExternalDiffGitConfig` are alternative ways of producing the diff, so a pager entry may use at most one of them.
Copy file name to clipboardExpand all lines: docs/keybindings/Keybindings_en.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,16 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
22
22
|`` R ``| Refresh | Refresh the git state (i.e. run `git status`, `git branch`, etc in background to update the contents of panels). This does not run `git fetch`. |
23
23
|`` + ``| Next screen mode (normal/half/fullscreen) ||
24
24
|`` _ ``| Prev screen mode ||
25
-
|`` \| ``| Cycle pagers | Choose the next pager in the list of configured pagers |
25
+
|`` \| ``| Cycle pagers | Choose the next pager in the list of configured pagers. |
26
+
|`` \ ``| Cycle pagers (reverse) | Choose the previous pager in the list of configured pagers. |
26
27
|`` <esc> ``| Cancel ||
27
28
|`` ? ``| Open keybindings menu ||
28
29
|`` <ctrl+s> ``| View filter options | View options for filtering the commit log, so that only commits matching the filter are shown. |
29
30
|`` W, <ctrl+e> ``| View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. |
30
31
|`` q, <ctrl+c> ``| Quit ||
31
32
|`` <ctrl+z> ``| Suspend the application ||
32
33
|`` <ctrl+w> ``| Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view.<br><br>The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. |
34
+
|`` <alt+shift+c> ``| Edit config file | Open file in external editor. |
33
35
|`` z ``| Undo | The reflog will be used to determine what git command to run to undo the last git command. This does not include changes to the working tree; only commits are taken into consideration. |
34
36
|`` Z ``| Redo | The reflog will be used to determine what git command to run to redo the last git command. This does not include changes to the working tree; only commits are taken into consideration. |
35
37
@@ -110,13 +112,13 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
110
112
|`` o ``| Open commit in browser ||
111
113
|`` n ``| Create new branch off of commit ||
112
114
|`` N ``| Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
115
+
|`` w ``| New worktree ||
113
116
|`` g ``| Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
114
117
|`` C ``| Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
115
118
|`` <ctrl+t> ``| Open external diff tool (git difftool) ||
116
119
|`` * ``| Select commits of current branch ||
117
120
|`` 0 ``| Focus main view ||
118
121
|`` <enter> ``| View files ||
119
-
|`` w ``| View worktree options ||
120
122
|`` / ``| Search the current view by text ||
121
123
122
124
## Confirmation panel
@@ -176,6 +178,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
|`` N ``| Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
181
+
|`` w ``| New worktree ||
179
182
|`` o ``| Create pull request ||
180
183
|`` O ``| View create pull request options ||
181
184
|`` G ``| Open pull request in browser ||
@@ -195,15 +198,14 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
195
198
|`` <ctrl+t> ``| Open external diff tool (git difftool) ||
196
199
|`` 0 ``| Focus main view ||
197
200
|`` <enter> ``| View commits ||
198
-
|`` w ``| View worktree options ||
199
201
|`` / ``| Filter the current view by text ||
200
202
201
203
## Main panel (merging)
202
204
203
205
| Key | Action | Info |
204
206
|-----|--------|-------------|
205
207
|`` <space> ``| Pick hunk ||
206
-
|`` b ``| Pick all hunks ||
208
+
|`` b ``| Pick both hunks ||
207
209
|`` <up>, k ``| Previous hunk ||
208
210
|`` <down>, j ``| Next hunk ||
209
211
|`` <left>, h ``| Previous conflict ||
@@ -280,14 +282,14 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
280
282
|`` o ``| Open commit in browser ||
281
283
|`` n ``| Create new branch off of commit ||
282
284
|`` N ``| Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
285
+
|`` w ``| New worktree ||
283
286
|`` g ``| Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
284
287
|`` C ``| Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
|`` <ctrl+t> ``| Open external diff tool (git difftool) ||
287
290
|`` * ``| Select commits of current branch ||
288
291
|`` 0 ``| Focus main view ||
289
292
|`` <enter> ``| View commits ||
290
-
|`` w ``| View worktree options ||
291
293
|`` / ``| Filter the current view by text ||
292
294
293
295
## Remote branches
@@ -297,6 +299,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
297
299
|`` <ctrl+o> ``| Copy branch name to clipboard ||
298
300
|`` <space> ``| Checkout | Checkout a new local branch based on the selected remote branch, or the remote branch as a detached head. |
299
301
|`` n ``| New branch ||
302
+
|`` w ``| New worktree ||
300
303
|`` M ``| Merge | View options for merging the selected item into the current branch (regular merge, squash merge) |
301
304
|`` r ``| Rebase | Rebase the checked-out branch onto the selected branch. |
302
305
|`` d ``| Delete | Delete the remote branch from the remote. |
@@ -306,7 +309,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
306
309
|`` <ctrl+t> ``| Open external diff tool (git difftool) ||
307
310
|`` 0 ``| Focus main view ||
308
311
|`` <enter> ``| View commits ||
309
-
|`` w ``| View worktree options ||
310
312
|`` / ``| Filter the current view by text ||
311
313
312
314
## Remotes
@@ -337,17 +339,16 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
337
339
|`` g ``| Pop | Apply the stash entry to your working directory and remove the stash entry. |
338
340
|`` d ``| Drop | Remove the stash entry from the stash list. |
339
341
|`` n ``| New branch | Create a new branch from the selected stash entry. This works by git checking out the commit that the stash entry was created from, creating a new branch from that commit, then applying the stash entry to the new branch as an additional commit. |
342
+
|`` w ``| New worktree ||
340
343
|`` r ``| Rename stash ||
341
344
|`` 0 ``| Focus main view ||
342
345
|`` <enter> ``| View files ||
343
-
|`` w ``| View worktree options ||
344
346
|`` / ``| Filter the current view by text ||
345
347
346
348
## Status
347
349
348
350
| Key | Action | Info |
349
351
|-----|--------|-------------|
350
-
|`` o ``| Open config file | Open file in default application. |
351
352
|`` e ``| Edit config file | Open file in external editor. |
352
353
|`` u ``| Check for update ||
353
354
|`` <enter> ``| Switch to a recent repo ||
@@ -365,14 +366,14 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
365
366
|`` o ``| Open commit in browser ||
366
367
|`` n ``| Create new branch off of commit ||
367
368
|`` N ``| Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
369
+
|`` w ``| New worktree ||
368
370
|`` g ``| Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
369
371
|`` C ``| Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
0 commit comments