-
-
Notifications
You must be signed in to change notification settings - Fork 10
Lazygit ‐ Delta ‐ Bat ‐ Auto Style
How to enable lazygit
with bluloco theme including delta
and bat
for the best visual experience.
I am using this setup as my preferred way to handle all things git.
delta
is showing a nice diffview which is superior to the default git diff.
Not only is the diff nice, but it also can highlight the syntax itself in the diff via bat
.
Auto light and dark mode detection is displayed in this example. Please change the commented sections if you prefer to use a single style only.
Make sure to install lazygit
, delta
and bat
command line tools.
Merge lazygit
and bat
config from this repositories extra
folder with your existing config at ~/.config/
.
The config files should be at these locations after merging:
.config/
bat/
themes/
bluloco-dark/
bluloco-dark.tmTheme
bluloco-light/
bluloco-light.tmTheme
config-dark.conf
config-light.conf
lazygit/
config.yml
config-dark.yml
config-light.yml
Add to your .gitconfig
[core]
editor = nvim
pager = delta --features "$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode)"
; pager = delta --features dark-mode
; pager = delta --features light-mode
; delta
[interactive]
diffFilter = delta --color-only
[add.interactive]
useBuiltin = false # required for git 2.37.0
[delta "dark-mode"]
navigate = true # use n and N to move between diff sections
dark = true
syntax-theme = bluloco-dark
plus-style = syntax "#2B5A3F"
plus-emph-style = syntax "#2D6363"
minus-style = syntax "#4D3034"
minus-emph-style = syntax "#6A3234"
hunk-header-style = omit
file-style = normal
file-decoration-style = blue ul ol
file-modified-label = [M]
file-added-label = [A]
file-removed-label = [D]
file-renamed-label = [R]
file-copied-label = [C]
inline-hint = yellow
map-styles = \
bold purple => syntax "#2B5A3F", \
bold cyan => syntax "#4D3034", \
bold blue => syntax "#2B5A3F", \
bold yellow => syntax "#4D3034",
[delta "light-mode"]
navigate = true # use n and N to move between diff sections
light = true
syntax-theme = bluloco-light
plus-style = syntax "#B5F6C6"
plus-emph-style = syntax "#A8F0C8"
minus-style = syntax "#F8DDE0"
minus-emph-style = syntax "#F7BEC5"
hunk-header-style = omit
file-style = normal
file-decoration-style = blue ul ol
file-modified-label = [M]
file-added-label = [A]
file-removed-label = [D]
file-renamed-label = [R]
file-copied-label = [C]
inline-hint = yellow
map-styles = \
bold purple => syntax "#B5F6C6", \
bold cyan => syntax "#F8DDE0", \
bold blue => syntax "#B5F6C6", \
bold yellow => syntax "#F8DDE0",
[delta "interactive"]
keep-plus-minus-markers = false
local lazygit = Terminal:new({
-- hidden terms need high ids otherwise clash with count toggle
id = 100,
cmd = [[
THEME=$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark || echo light)
# THEME=dark
# THEME=light
XDG_CONFIG_DIR=${HOME}/.config
CONFIG_BASE=${XDG_CONFIG_DIR}/lazygit/config.yml
CONFIG_THEME=${XDG_CONFIG_DIR}/lazygit/config-${THEME}.yml
lazygit --use-config-file=${CONFIG_BASE},${CONFIG_THEME}
]],
hidden = true,
direction = 'float',
})
local cmd = vim.api.nvim_create_user_command
cmd("LazygitOpen", function() lazygit:open() end, {})
cmd("LazygitToggle", function() lazygit:toggle() end, {})
cmd("LazygitClose", function() lazygit:close() end, {})
Here is my lazygit config with opening files via nvr
(neovim-remote
). Make sure to install neovim-remote
, if you want to use it (recommended!)
If you don't want to use the nvr stuff, omit the os
property.
os:
edit: "nvr -cc 'LazygitClose' --remote-silent {{filename}}"
editAtLine: "nvr -cc 'LazygitClose' +{{line}} --remote-silent {{filename}}"
editAtLineAndWait: "nvr -cc 'LazygitClose' +{{line}} --remote-wait-silent {{filename}}"
editInTerminal: true
gui:
showFileTree: false
scrollHeight: 20
showIcons: true
branchColors:
'main': 'blue'
'master': 'blue'
'dev': 'green'
'develop': 'green'
'release': 'yellow'
'hotfix': 'red'
nerdFontsVersion: "3"
promptToReturnFromSubprocess: false
git:
overrideGpg: true
Enjoy!