Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Last active March 19, 2025 22:05
Show Gist options
  • Save palaniraja/4350f25e110edf1f557099c5a0ed2eea to your computer and use it in GitHub Desktop.
Save palaniraja/4350f25e110edf1f557099c5a0ed2eea to your computer and use it in GitHub Desktop.
lazygit config.yml - my lazygit conf ('~/Library/Application Support/lazygit/config.yml')
gui:
expandFocusedSidePanel: true
git:
paging:
# colorArg: always
# pager: diff-so-fancy
pager: delta --dark --paging=never -n --syntax-theme "everforest-friendly" #-s -n --syntax-theme "1337" --diff-so-fancy --diff-highlight
# externalDiffCommand: "difft --color=always --display=inline"
# useConfig: true
customCommands:
#Files panel
- key: <c-4> # delta full screen
command: "clear && git diff HEAD {{.SelectedFile.Name}} | delta -n --diff-so-fancy --tabs=4"
context: files
description: delta current file
subprocess: yes
- key: <c-5> # delta split fullscreen
command: "clear && git diff HEAD {{.SelectedFile.Name}} | delta -s --diff-so-fancy --tabs=4"
context: files
description: diff delta split current file
subprocess: yes
- key: <c-6> # difftastic full screen inline
command: clear && FT_DISPLAY=inline git ddiff HEAD {{.SelectedFile.Name}}
context: files
description: difft (alias) current file
subprocess: yes
# tig blame
- key: b
command: tig blame -- {{.SelectedFile.Name}}
context: files
description: blame file at tree
subprocess: yes
#Commits, subcommits, reflog panel
- key: '<c-4>' # delta full screen
context: 'commits,subCommits,reflogCommits'
command: "clear && git show -w {{.SelectedCommit.Sha}} | delta --diff-so-fancy -n --tabs=4"
subprocess: true
description: "Show selected commit"
stream: true
- key: '<c-5>' # delta split fullscreen
context: 'commits,subCommits,reflogCommits'
command: "clear && git show {{.SelectedCommit.Sha}} | delta -s --diff-so-fancy --tabs=4"
subprocess: true
description: "Show selected commit in delta split view"
stream: true
- key: '<c-6>' # difftastic full screen inline
context: 'commits,subCommits,reflogCommits'
command: "clear && FT_DISPLAY=inline git dshow {{.SelectedCommit.Sha}}"
subprocess: true
description: "Show selected commit in difftastic inline fullscreen "
stream: true
#stash panel
- key: '<c-4>' # delta full screen
context: 'stash'
# command: "clear && echo \"{{.SelectedStashEntry.Name}}\"" #git show -w -p stash@{ {{.SelectedStashEntry.Index}} } | delta --diff-so-fancy -n --tabs=4"
command: "clear && git show -w -p stash@{{\"{\"}}{{.SelectedStashEntry.Index}}{{\"}\"}} | delta --diff-so-fancy -n --tabs=4"
subprocess: true
description: "Show selected commit"
stream: true
- key: '<c-5>' # delta split fullscreen
context: 'stash'
command: "clear && git show -w -p stash@{{\"{\"}}{{.SelectedStashEntry.Index}}{{\"}\"}} | delta --diff-so-fancy -n -s --tabs=4"
subprocess: true
description: "Show selected commit in delta split view"
stream: true
- key: '<c-6>' # difftastic full screen inline
context: 'stash'
command: "clear && FT_DISPLAY=inline git dshow stash@{{\"{\"}}{{.SelectedStashEntry.Index}}{{\"}\"}}"
subprocess: true
description: "Show selected commit in difftastic inline fullscreen "
stream: true
# https://github.com/jesseduffield/lazygit/wiki/Custom-Commands-Compendium
- key : '<c-a>'
description: 'Search the whole history (From a ref and down) for an expression in a file'
command: "git checkout {{index .PromptResponses 3}}"
context: 'commits'
prompts:
- type: 'input'
title: 'Search word:'
- type: 'input'
title: 'File/Subtree:'
- type: 'input'
title: 'Ref:'
initialValue: "{{index .CheckedOutBranch.Name }}"
- type: 'menuFromCommand'
title: 'Commits:'
command: "git log --oneline {{index .PromptResponses 2}} -S'{{index .PromptResponses 0}}' --all -- {{index .PromptResponses 1}}"
filter: '(?P<commit_id>[0-9a-zA-Z]*) *(?P<commit_msg>.*)'
valueFormat: '{{ .commit_id }}'
labelFormat: '{{ .commit_id | green | bold }} - {{ .commit_msg | yellow }}'
- key: b
command: tig blame {{.SelectedSubCommit.Sha}} -- {{.SelectedCommitFile.Name}}
context: commitFiles
description: blame file at revision
subprocess: yes
- key: B
command: tig blame -- {{.SelectedCommitFile.Name}}
context: commitFiles
description: blame file at tree
subprocess: yes
- key: t
command: tig show {{.SelectedSubCommit.Sha}}
context: subCommits
description: tig commit (`t` again to browse files at revision)
subprocess: yes
- key: t
command: tig show {{.SelectedLocalBranch.Name}}
context: localBranches
description: tig branch (`t` again to browse files at revision)
subprocess: yes
- key: t
command: tig show {{.SelectedRemoteBranch.RemoteName}}/{{.SelectedRemoteBranch.Name}}
context: remoteBranches
description: tig branch (`t` again to browse files at revision)
subprocess: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment