1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-13 00:07:59 +02:00

prettify config.md

This commit is contained in:
Jesse Duffield 2021-04-11 21:42:41 +10:00
parent 069c7c9d35
commit 764bd556f3

View File

@ -2,190 +2,190 @@
Default path for the config file: Default path for the config file:
* Linux: `~/.config/lazygit/config.yml` - Linux: `~/.config/lazygit/config.yml`
* MacOS: `~/Library/Application Support/lazygit/config.yml` - MacOS: `~/Library/Application Support/lazygit/config.yml`
* Windows: `%APPDATA%\lazygit\config.yml` - Windows: `%APPDATA%\lazygit\config.yml`
For old installations (slightly embarrassing: I didn't realise at the time that you didn't need to supply a vendor name to the path so I just used my name): For old installations (slightly embarrassing: I didn't realise at the time that you didn't need to supply a vendor name to the path so I just used my name):
* Linux: `~/.config/jesseduffield/lazygit/config.yml` - Linux: `~/.config/jesseduffield/lazygit/config.yml`
* MacOS: `~/Library/Application Support/jesseduffield/lazygit/config.yml` - MacOS: `~/Library/Application Support/jesseduffield/lazygit/config.yml`
* Windows: `%APPDATA%\jesseduffield\lazygit\config.yml` - Windows: `%APPDATA%\jesseduffield\lazygit\config.yml`
## Default ## Default
```yaml ```yaml
gui: gui:
# stuff relating to the UI # stuff relating to the UI
scrollHeight: 2 # how many lines you scroll by scrollHeight: 2 # how many lines you scroll by
scrollPastBottom: true # enable scrolling past the bottom scrollPastBottom: true # enable scrolling past the bottom
sidePanelWidth: 0.3333 # number from 0 to 1 sidePanelWidth: 0.3333 # number from 0 to 1
expandFocusedSidePanel: false expandFocusedSidePanel: false
mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical' mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical'
theme: theme:
lightTheme: false # For terminals with a light background lightTheme: false # For terminals with a light background
activeBorderColor: activeBorderColor:
- white - white
- bold - bold
inactiveBorderColor: inactiveBorderColor:
- green - green
optionsTextColor: optionsTextColor:
- blue - blue
selectedLineBgColor: selectedLineBgColor:
- default - default
selectedRangeBgColor: selectedRangeBgColor:
- blue - blue
commitLength: commitLength:
show: true show: true
mouseEvents: true mouseEvents: true
skipUnstageLineWarning: false skipUnstageLineWarning: false
skipStashWarning: true skipStashWarning: true
showFileTree: false # for rendering changes files in a tree format showFileTree: false # for rendering changes files in a tree format
showCommandLog: false showCommandLog:
git: git:
paging: paging:
colorArg: always colorArg: always
useConfig: false useConfig: false
merging: merging:
# only applicable to unix users # only applicable to unix users
manualCommit: false manualCommit: false
# extra args passed to `git merge`, e.g. --no-ff # extra args passed to `git merge`, e.g. --no-ff
args: "" args: ''
pull: pull:
mode: 'merge' # one of 'merge' | 'rebase' | 'ff-only' mode: 'merge' # one of 'merge' | 'rebase' | 'ff-only'
skipHookPrefix: WIP skipHookPrefix: WIP
autoFetch: true autoFetch: true
branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --" branchLogCmd: 'git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --'
allBranchesLogCmd: "git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium" allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium'
overrideGpg: false # prevents lazygit from spawning a separate process when using GPG overrideGpg: false # prevents lazygit from spawning a separate process when using GPG
disableForcePushing: false disableForcePushing: false
refresher: refresher:
refreshInterval: 10 # file/submodule refresh interval in seconds refreshInterval: 10 # file/submodule refresh interval in seconds
fetchInterval: 60 # re-fetch interval in seconds fetchInterval: 60 # re-fetch interval in seconds
update: update:
method: prompt # can be: prompt | background | never method: prompt # can be: prompt | background | never
days: 14 # how often an update is checked for days: 14 # how often an update is checked for
reporting: 'undetermined' # one of: 'on' | 'off' | 'undetermined' reporting: 'undetermined' # one of: 'on' | 'off' | 'undetermined'
confirmOnQuit: false confirmOnQuit: false
# determines whether hitting 'esc' will quit the application when there is nothing to cancel/close # determines whether hitting 'esc' will quit the application when there is nothing to cancel/close
quitOnTopLevelReturn: false quitOnTopLevelReturn: false
disableStartupPopups: false disableStartupPopups: false
notARepository: 'prompt' # one of: 'prompt' | 'create' | 'skip' notARepository: 'prompt' # one of: 'prompt' | 'create' | 'skip'
keybinding: keybinding:
universal: universal:
quit: 'q' quit: 'q'
quit-alt1: '<c-c>' # alternative/alias of quit quit-alt1: '<c-c>' # alternative/alias of quit
return: '<esc>' # return to previous menu, will quit if there's nowhere to return return: '<esc>' # return to previous menu, will quit if there's nowhere to return
quitWithoutChangingDirectory: 'Q' quitWithoutChangingDirectory: 'Q'
togglePanel: '<tab>' # goto the next panel togglePanel: '<tab>' # goto the next panel
prevItem: '<up>' # go one line up prevItem: '<up>' # go one line up
nextItem: '<down>' # go one line down nextItem: '<down>' # go one line down
prevItem-alt: 'k' # go one line up prevItem-alt: 'k' # go one line up
nextItem-alt: 'j' # go one line down nextItem-alt: 'j' # go one line down
prevPage: ',' # go to next page in list prevPage: ',' # go to next page in list
nextPage: '.' # go to previous page in list nextPage: '.' # go to previous page in list
gotoTop: '<' # go to top of list gotoTop: '<' # go to top of list
gotoBottom: '>' # go to bottom of list gotoBottom: '>' # go to bottom of list
prevBlock: '<left>' # goto the previous block / panel prevBlock: '<left>' # goto the previous block / panel
nextBlock: '<right>' # goto the next block / panel nextBlock: '<right>' # goto the next block / panel
prevBlock-alt: 'h' # goto the previous block / panel prevBlock-alt: 'h' # goto the previous block / panel
nextBlock-alt: 'l' # goto the next block / panel nextBlock-alt: 'l' # goto the next block / panel
nextMatch: 'n' nextMatch: 'n'
prevMatch: 'N' prevMatch: 'N'
optionMenu: 'x' # show help menu optionMenu: 'x' # show help menu
optionMenu-alt1: '?' # show help menu optionMenu-alt1: '?' # show help menu
select: '<space>' select: '<space>'
goInto: '<enter>' goInto: '<enter>'
confirm: '<enter>' confirm: '<enter>'
confirm-alt1: 'y' confirm-alt1: 'y'
remove: 'd' remove: 'd'
new: 'n' new: 'n'
edit: 'e' edit: 'e'
openFile: 'o' openFile: 'o'
scrollUpMain: '<pgup>' # main panel scrool up scrollUpMain: '<pgup>' # main panel scrool up
scrollDownMain: '<pgdown>' # main panel scrool down scrollDownMain: '<pgdown>' # main panel scrool down
scrollUpMain-alt1: 'K' # main panel scrool up scrollUpMain-alt1: 'K' # main panel scrool up
scrollDownMain-alt1: 'J' # main panel scrool down scrollDownMain-alt1: 'J' # main panel scrool down
scrollUpMain-alt2: '<c-u>' # main panel scrool up scrollUpMain-alt2: '<c-u>' # main panel scrool up
scrollDownMain-alt2: '<c-d>' # main panel scrool down scrollDownMain-alt2: '<c-d>' # main panel scrool down
executeCustomCommand: ':' executeCustomCommand: ':'
createRebaseOptionsMenu: 'm' createRebaseOptionsMenu: 'm'
pushFiles: 'P' pushFiles: 'P'
pullFiles: 'p' pullFiles: 'p'
refresh: 'R' refresh: 'R'
createPatchOptionsMenu: '<c-p>' createPatchOptionsMenu: '<c-p>'
nextTab: ']' nextTab: ']'
prevTab: '[' prevTab: '['
nextScreenMode: '+' nextScreenMode: '+'
prevScreenMode: '_' prevScreenMode: '_'
undo: 'z' undo: 'z'
redo: '<c-z>' redo: '<c-z>'
filteringMenu: '<c-s>' filteringMenu: '<c-s>'
diffingMenu: 'W' diffingMenu: 'W'
diffingMenu-alt: '<c-e>' # deprecated diffingMenu-alt: '<c-e>' # deprecated
copyToClipboard: '<c-o>' copyToClipboard: '<c-o>'
submitEditorText: '<enter>' submitEditorText: '<enter>'
appendNewline: '<tab>' appendNewline: '<tab>'
status: status:
checkForUpdate: 'u' checkForUpdate: 'u'
recentRepos: '<enter>' recentRepos: '<enter>'
files: files:
commitChanges: 'c' commitChanges: 'c'
commitChangesWithoutHook: 'w' # commit changes without pre-commit hook commitChangesWithoutHook: 'w' # commit changes without pre-commit hook
amendLastCommit: 'A' amendLastCommit: 'A'
commitChangesWithEditor: 'C' commitChangesWithEditor: 'C'
ignoreFile: 'i' ignoreFile: 'i'
refreshFiles: 'r' refreshFiles: 'r'
stashAllChanges: 's' stashAllChanges: 's'
viewStashOptions: 'S' viewStashOptions: 'S'
toggleStagedAll: 'a' # stage/unstage all toggleStagedAll: 'a' # stage/unstage all
viewResetOptions: 'D' viewResetOptions: 'D'
fetch: 'f' fetch: 'f'
toggleTreeView: '`' toggleTreeView: '`'
branches: branches:
createPullRequest: 'o' createPullRequest: 'o'
checkoutBranchByName: 'c' checkoutBranchByName: 'c'
forceCheckoutBranch: 'F' forceCheckoutBranch: 'F'
rebaseBranch: 'r' rebaseBranch: 'r'
mergeIntoCurrentBranch: 'M' mergeIntoCurrentBranch: 'M'
viewGitFlowOptions: 'i' viewGitFlowOptions: 'i'
fastForward: 'f' # fast-forward this branch from its upstream fastForward: 'f' # fast-forward this branch from its upstream
pushTag: 'P' pushTag: 'P'
setUpstream: 'u' # set as upstream of checked-out branch setUpstream: 'u' # set as upstream of checked-out branch
fetchRemote: 'f' fetchRemote: 'f'
commits: commits:
squashDown: 's' squashDown: 's'
renameCommit: 'r' renameCommit: 'r'
renameCommitWithEditor: 'R' renameCommitWithEditor: 'R'
viewResetOptions: 'g' viewResetOptions: 'g'
markCommitAsFixup: 'f' markCommitAsFixup: 'f'
createFixupCommit: 'F' # create fixup commit for this commit createFixupCommit: 'F' # create fixup commit for this commit
squashAboveCommits: 'S' squashAboveCommits: 'S'
moveDownCommit: '<c-j>' # move commit down one moveDownCommit: '<c-j>' # move commit down one
moveUpCommit: '<c-k>' # move commit up one moveUpCommit: '<c-k>' # move commit up one
amendToCommit: 'A' amendToCommit: 'A'
pickCommit: 'p' # pick commit (when mid-rebase) pickCommit: 'p' # pick commit (when mid-rebase)
revertCommit: 't' revertCommit: 't'
cherryPickCopy: 'c' cherryPickCopy: 'c'
cherryPickCopyRange: 'C' cherryPickCopyRange: 'C'
pasteCommits: 'v' pasteCommits: 'v'
tagCommit: 'T' tagCommit: 'T'
checkoutCommit: '<space>' checkoutCommit: '<space>'
resetCherryPick: '<c-R>' resetCherryPick: '<c-R>'
copyCommitMessageToClipboard: '<c-y>' copyCommitMessageToClipboard: '<c-y>'
stash: stash:
popStash: 'g' popStash: 'g'
commitFiles: commitFiles:
checkoutCommitFile: 'c' checkoutCommitFile: 'c'
main: main:
toggleDragSelect: 'v' toggleDragSelect: 'v'
toggleDragSelect-alt: 'V' toggleDragSelect-alt: 'V'
toggleSelectHunk: 'a' toggleSelectHunk: 'a'
pickBothHunks: 'b' pickBothHunks: 'b'
submodules: submodules:
init: 'i' init: 'i'
update: 'u' update: 'u'
bulkMenu: 'b' bulkMenu: 'b'
``` ```
## Platform Defaults ## Platform Defaults
@ -193,22 +193,22 @@ For old installations (slightly embarrassing: I didn't realise at the time that
### Windows ### Windows
```yaml ```yaml
os: os:
openCommand: 'cmd /c "start "" {{filename}}"' openCommand: 'cmd /c "start "" {{filename}}"'
``` ```
### Linux ### Linux
```yaml ```yaml
os: os:
openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"' openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"'
``` ```
### OSX ### OSX
```yaml ```yaml
os: os:
openCommand: 'open {{filename}}' openCommand: 'open {{filename}}'
``` ```
### Recommended Config Values ### Recommended Config Values
@ -216,8 +216,8 @@ For old installations (slightly embarrassing: I didn't realise at the time that
for users of VSCode for users of VSCode
```yaml ```yaml
os: os:
openCommand: 'code -rg {{filename}}' openCommand: 'code -rg {{filename}}'
``` ```
## Color Attributes ## Color Attributes
@ -243,16 +243,16 @@ The available attributes are:
If you have issues with a light terminal theme where you can't read / see the text add these settings If you have issues with a light terminal theme where you can't read / see the text add these settings
```yaml ```yaml
gui: gui:
theme: theme:
lightTheme: true lightTheme: true
activeBorderColor: activeBorderColor:
- black - black
- bold - bold
inactiveBorderColor: inactiveBorderColor:
- black - black
selectedLineBgColor: selectedLineBgColor:
- default - default
``` ```
## Struggling to see selected line ## Struggling to see selected line
@ -260,15 +260,16 @@ If you have issues with a light terminal theme where you can't read / see the te
If you struggle to see the selected line I recommend using the reverse attribute on selected lines like so: If you struggle to see the selected line I recommend using the reverse attribute on selected lines like so:
```yaml ```yaml
gui: gui:
theme: theme:
selectedLineBgColor: selectedLineBgColor:
- reverse - reverse
selectedRangeBgColor: selectedRangeBgColor:
- reverse - reverse
``` ```
The following has also worked for a couple of people: The following has also worked for a couple of people:
```yaml ```yaml
gui: gui:
theme: theme:
@ -297,33 +298,33 @@ For all possible keybinding options, check [Custom_Keybindings.md](https://githu
### Example Keybindings For Colemak Users ### Example Keybindings For Colemak Users
```yaml ```yaml
keybinding: keybinding:
universal: universal:
prevItem-alt: 'u' prevItem-alt: 'u'
nextItem-alt: 'e' nextItem-alt: 'e'
prevBlock-alt: 'n' prevBlock-alt: 'n'
nextBlock-alt: 'i' nextBlock-alt: 'i'
nextMatch: '=' nextMatch: '='
prevMatch: '-' prevMatch: '-'
new: 'k' new: 'k'
edit: 'o' edit: 'o'
openFile: 'O' openFile: 'O'
scrollUpMain-alt1: 'U' scrollUpMain-alt1: 'U'
scrollDownMain-alt1: 'E' scrollDownMain-alt1: 'E'
scrollUpMain-alt2: '<c-u>' scrollUpMain-alt2: '<c-u>'
scrollDownMain-alt2: '<c-e>' scrollDownMain-alt2: '<c-e>'
undo: 'l' undo: 'l'
redo: '<c-r>' redo: '<c-r>'
diffingMenu: 'M' diffingMenu: 'M'
filteringMenu: '<c-f>' filteringMenu: '<c-f>'
files: files:
ignoreFile: 'I' ignoreFile: 'I'
commits: commits:
moveDownCommit: '<c-e>' moveDownCommit: '<c-e>'
moveUpCommit: '<c-u>' moveUpCommit: '<c-u>'
branches: branches:
viewGitFlowOptions: 'I' viewGitFlowOptions: 'I'
setUpstream: 'U' setUpstream: 'U'
``` ```
## Custom pull request URLs ## Custom pull request URLs
@ -334,7 +335,7 @@ the pull request. You can do so on your `config.yml` file using the following sy
```yaml ```yaml
services: services:
"<gitDomain>": "<provider>:<webDomain>" '<gitDomain>': '<provider>:<webDomain>'
``` ```
Where: Where:
@ -344,19 +345,21 @@ Where:
- `webDomain` is the URL where your git service exposes a web interface and APIs, e.g. `gitservice.work.com` - `webDomain` is the URL where your git service exposes a web interface and APIs, e.g. `gitservice.work.com`
## Predefined commit message prefix ## Predefined commit message prefix
In situations where certain naming pattern is used for branches and commits, pattern can be used to populate In situations where certain naming pattern is used for branches and commits, pattern can be used to populate
commit message with prefix that is parsed from the branch name. commit message with prefix that is parsed from the branch name.
Example: Example:
* Branch name: feature/AB-123
* Commit message: [AB-123] Adding feature - Branch name: feature/AB-123
- Commit message: [AB-123] Adding feature
```yaml ```yaml
git: git:
commitPrefixes: commitPrefixes:
my_project: # This is repository folder name my_project: # This is repository folder name
pattern: "^\\w+\\/(\\w+-\\w+).*" pattern: "^\\w+\\/(\\w+-\\w+).*"
replace: "[$1] " replace: '[$1] '
``` ```
## Custom git log command ## Custom git log command