Skip to content

Commit ce5a8b6

Browse files
authored
Update docs and schema for release (#5761)
2 parents 26dd82d + 440f357 commit ce5a8b6

12 files changed

Lines changed: 332 additions & 195 deletions

docs/Config.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,26 @@ gui:
110110
# is true.
111111
expandedSidePanelWeight: 2
112112

113+
# If true, don't give a side panel more height than it needs to show its
114+
# content; when all panels fit, the leftover height is shared among them so that
115+
# they still fill the screen.
116+
shrinkSidePanelsToContent: false
117+
118+
# The side panels, in the order they appear from top to bottom.
119+
# Each entry is a list of one or more names that share a single panel as tabs
120+
# (cycle through them with the next-tab/previous-tab keys).
121+
# Omit a name to hide it; give a name its own one-element list to promote a tab
122+
# to a top-level panel.
123+
# Valid names are: 'status', 'files', 'worktrees', 'submodules', 'branches',
124+
# 'remotes', 'tags', 'commits', 'reflog', 'stash'. 'files', 'branches', and
125+
# 'commits' must always be included; they can't be hidden.
126+
sidePanels:
127+
- [status]
128+
- [files, worktrees, submodules]
129+
- [branches, remotes, tags]
130+
- [commits, reflog]
131+
- [stash]
132+
113133
# Sometimes the main window is split in two (e.g. when the selected file has
114134
# both staged and unstaged changes). This setting controls how the two sections
115135
# are split.
@@ -342,6 +362,11 @@ gui:
342362
git:
343363
# Array of pagers. Each entry has the following format:
344364
#
365+
# # A name for the pager, shown in the notification when cycling pagers.
366+
# # If not set, the name is derived from the first word of the pager
367+
# # command (or of the external diff command).
368+
# name: ""
369+
#
345370
# # Value of the --color arg in the git diff command. Some pagers want
346371
# # this to be set to 'always' and some want it set to 'never'
347372
# colorArg: "always"
@@ -361,6 +386,9 @@ git:
361386
# # https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver.
362387
# useExternalDiffGitConfig: false
363388
#
389+
# 'pager', 'externalDiffCommand', and 'useExternalDiffGitConfig' are mutually
390+
# exclusive; set at most one per entry.
391+
#
364392
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md
365393
# for more information.
366394
pagers: []
@@ -406,6 +434,11 @@ git:
406434
# If true, periodically refresh files and submodules
407435
autoRefresh: true
408436

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+
409442
# If not "none", lazygit will automatically fast-forward local branches to match
410443
# their upstream after fetching. Applies to branches that are not the currently
411444
# checked out branch, and only to those that are strictly behind their upstream
@@ -499,6 +532,15 @@ git:
499532
# to 40 to disable truncation.
500533
truncateCopiedCommitHashesTo: 12
501534

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+
502544
# Periodic update checks
503545
update:
504546
# One of: 'prompt' (default) | 'background' | 'never'
@@ -517,6 +559,11 @@ refresher:
517559
# Auto-fetch can be disabled via option 'git.autoFetch'.
518560
fetchInterval: 60
519561

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+
520567
# If true, show a confirmation popup before quitting Lazygit
521568
confirmOnQuit: false
522569

@@ -648,6 +695,7 @@ keybinding:
648695
confirmInEditor: [<ctrl+enter>, <ctrl+s>]
649696
remove: d
650697
new: "n"
698+
newWorktree: w
651699
edit: e
652700
openFile: o
653701
scrollUpMain: [<pgup>, K, <ctrl+u>]
@@ -667,6 +715,7 @@ keybinding:
667715
nextScreenMode: +
668716
prevScreenMode: _
669717
cyclePagers: '|'
718+
cyclePagersReverse: \
670719
undo: z
671720
redo: Z
672721
filteringMenu: <ctrl+s>
@@ -681,6 +730,7 @@ keybinding:
681730
increaseRenameSimilarityThreshold: )
682731
decreaseRenameSimilarityThreshold: (
683732
openDiffTool: <ctrl+t>
733+
editConfig: <alt+shift+c>
684734
status:
685735
checkForUpdate: u
686736
recentRepos: <enter>
@@ -726,8 +776,6 @@ keybinding:
726776
fetchRemote: f
727777
addForkRemote: F
728778
sortOrder: s
729-
worktrees:
730-
viewWorktreeOptions: w
731779
commits:
732780
squashDown: s
733781
renameCommit: r
@@ -1059,6 +1107,12 @@ keybinding:
10591107
edit: <disabled> # disable 'edit file'
10601108
```
10611109

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.
1115+
10621116
### Example Keybindings For Colemak Users
10631117

10641118
```yaml

docs/Custom_Pagers.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
Lazygit supports custom pagers, [configured](/docs/Config.md) in the config.yml file (which can be opened by pressing `e` in the Status panel).
44

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-
75
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.
86

97
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:
7169
- externalDiffCommand: difft --color=always
7270
```
7371

74-
The `colorArg` and `pager` options are not used in this case.
72+
The `colorArg` option is not used in this case.
7573

7674
You can add whatever extra arguments you prefer for your difftool; for instance
7775

@@ -91,29 +89,4 @@ git:
9189

9290
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.
9391

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:
97-
98-
```pwsh
99-
#!/usr/bin/env pwsh
100-
101-
$old = $args[1].Replace('\', '/')
102-
$new = $args[4].Replace('\', '/')
103-
$path = $args[0]
104-
git diff --no-index --no-ext-diff $old $new
105-
| %{ $_.Replace($old, $path).Replace($new, $path) }
106-
| delta --width=$env:LAZYGIT_COLUMNS
107-
```
108-
109-
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).
110-
111-
In your lazygit config, use
112-
113-
```yml
114-
git:
115-
pagers:
116-
- externalDiffCommand: "C:/wherever/lazygit-pager.ps1"
117-
```
118-
119-
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.

docs/keybindings/Keybindings_en.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
2222
| `` 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`. |
2323
| `` + `` | Next screen mode (normal/half/fullscreen) | |
2424
| `` _ `` | 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. |
2627
| `` <esc> `` | Cancel | |
2728
| `` ? `` | Open keybindings menu | |
2829
| `` <ctrl+s> `` | View filter options | View options for filtering the commit log, so that only commits matching the filter are shown. |
2930
| `` 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. |
3031
| `` q, <ctrl+c> `` | Quit | |
3132
| `` <ctrl+z> `` | Suspend the application | |
3233
| `` <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. |
3335
| `` 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. |
3436
| `` 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. |
3537

@@ -110,13 +112,13 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
110112
| `` o `` | Open commit in browser | |
111113
| `` n `` | Create new branch off of commit | |
112114
| `` 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 | |
113116
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
114117
| `` 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. |
115118
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
116119
| `` * `` | Select commits of current branch | |
117120
| `` 0 `` | Focus main view | |
118121
| `` <enter> `` | View files | |
119-
| `` w `` | View worktree options | |
120122
| `` / `` | Search the current view by text | |
121123

122124
## Confirmation panel
@@ -176,6 +178,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
176178
| `` <space> `` | Checkout | Checkout selected item. |
177179
| `` n `` | New branch | |
178180
| `` 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 | |
179182
| `` o `` | Create pull request | |
180183
| `` O `` | View create pull request options | |
181184
| `` 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
195198
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
196199
| `` 0 `` | Focus main view | |
197200
| `` <enter> `` | View commits | |
198-
| `` w `` | View worktree options | |
199201
| `` / `` | Filter the current view by text | |
200202

201203
## Main panel (merging)
202204

203205
| Key | Action | Info |
204206
|-----|--------|-------------|
205207
| `` <space> `` | Pick hunk | |
206-
| `` b `` | Pick all hunks | |
208+
| `` b `` | Pick both hunks | |
207209
| `` <up>, k `` | Previous hunk | |
208210
| `` <down>, j `` | Next hunk | |
209211
| `` <left>, h `` | Previous conflict | |
@@ -280,14 +282,14 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
280282
| `` o `` | Open commit in browser | |
281283
| `` n `` | Create new branch off of commit | |
282284
| `` 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 | |
283286
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
284287
| `` 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. |
285288
| `` <ctrl+r> `` | Reset copied (cherry-picked) commits selection | |
286289
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
287290
| `` * `` | Select commits of current branch | |
288291
| `` 0 `` | Focus main view | |
289292
| `` <enter> `` | View commits | |
290-
| `` w `` | View worktree options | |
291293
| `` / `` | Filter the current view by text | |
292294

293295
## Remote branches
@@ -297,6 +299,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
297299
| `` <ctrl+o> `` | Copy branch name to clipboard | |
298300
| `` <space> `` | Checkout | Checkout a new local branch based on the selected remote branch, or the remote branch as a detached head. |
299301
| `` n `` | New branch | |
302+
| `` w `` | New worktree | |
300303
| `` M `` | Merge | View options for merging the selected item into the current branch (regular merge, squash merge) |
301304
| `` r `` | Rebase | Rebase the checked-out branch onto the selected branch. |
302305
| `` 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
306309
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
307310
| `` 0 `` | Focus main view | |
308311
| `` <enter> `` | View commits | |
309-
| `` w `` | View worktree options | |
310312
| `` / `` | Filter the current view by text | |
311313

312314
## Remotes
@@ -337,17 +339,16 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
337339
| `` g `` | Pop | Apply the stash entry to your working directory and remove the stash entry. |
338340
| `` d `` | Drop | Remove the stash entry from the stash list. |
339341
| `` 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 | |
340343
| `` r `` | Rename stash | |
341344
| `` 0 `` | Focus main view | |
342345
| `` <enter> `` | View files | |
343-
| `` w `` | View worktree options | |
344346
| `` / `` | Filter the current view by text | |
345347

346348
## Status
347349

348350
| Key | Action | Info |
349351
|-----|--------|-------------|
350-
| `` o `` | Open config file | Open file in default application. |
351352
| `` e `` | Edit config file | Open file in external editor. |
352353
| `` u `` | Check for update | |
353354
| `` <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
365366
| `` o `` | Open commit in browser | |
366367
| `` n `` | Create new branch off of commit | |
367368
| `` 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 | |
368370
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
369371
| `` 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. |
370372
| `` <ctrl+r> `` | Reset copied (cherry-picked) commits selection | |
371373
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
372374
| `` * `` | Select commits of current branch | |
373375
| `` 0 `` | Focus main view | |
374376
| `` <enter> `` | View files | |
375-
| `` w `` | View worktree options | |
376377
| `` / `` | Search the current view by text | |
377378

378379
## Submodules
@@ -396,13 +397,13 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
396397
| `` <ctrl+o> `` | Copy tag to clipboard | |
397398
| `` <space> `` | Checkout | Checkout the selected tag as a detached HEAD. |
398399
| `` n `` | New tag | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
400+
| `` w `` | New worktree | |
399401
| `` d `` | Delete | View delete options for local/remote tag. |
400402
| `` P `` | Push tag | Push the selected tag to a remote. You'll be prompted to select a remote. |
401403
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
402404
| `` <ctrl+t> `` | Open external diff tool (git difftool) | |
403405
| `` 0 `` | Focus main view | |
404406
| `` <enter> `` | View commits | |
405-
| `` w `` | View worktree options | |
406407
| `` / `` | Filter the current view by text | |
407408

408409
## Worktrees

0 commit comments

Comments
 (0)