These are my configuration files for git, lazygit, delta, and bat. All tools use the Tokyo Night color theme.
config/.config/lazygit/— the lazygit configurationconfig/.config/delta/— the delta color themeconfig/.config/bat/— the bat themes and syntax filesgit/.gitconfig— the global git configuration
| Tool | Function |
|---|---|
| git | version control |
| lazygit | terminal UI for git |
| delta | diff pager for git and lazygit |
| bat | supplies the syntax theme to delta |
| neovim | editor that lazygit opens |
Note: On Debian and Ubuntu, the bat package installs the command as batcat. Use batcat in the commands below.
On macOS:
brew install lazygit git-delta bat neovimOn Arch Linux:
sudo pacman -S lazygit git-delta bat neovimOn Debian and Ubuntu:
sudo apt install git-delta bat neovimIf your distribution does not include the lazygit package, download lazygit from the releases page.
git clone git@github.com:fastereder/dotfiles.git ~/Developer/dotfilesIf ~/.config/bat or ~/.config/delta already exists as a directory, remove it first. Otherwise ln -s places the symlink inside that directory instead of creating it, and the configuration is never read:
rm -rf ~/.config/bat ~/.config/delta
ln -s ~/Developer/dotfiles/config/.config/bat ~/.config/bat
ln -s ~/Developer/dotfiles/config/.config/delta ~/.config/deltaCheck the result with ls -la ~/.config | grep -E 'bat|delta'. Both entries must be symlinks that point into this repository.
If you have a ~/.gitconfig file, move it to ~/.gitconfig.local:
mv ~/.gitconfig ~/.gitconfig.localThen create the symlink:
ln -s ~/Developer/dotfiles/git/.gitconfig ~/.gitconfigThe git configuration includes ~/.gitconfig.local. Put your personal settings (name, email) in this file.
Notes:
- The git configuration replaces HTTPS push URLs for github.com with SSH URLs.
- It sets delta as the pager for
git diffandgit show, and as the filter forgit add -p. - To verify, run
git config --get core.pager. It must printdelta. Do not usegit config --global --get: git ignoresinclude.*directives when you limit the lookup to a single file, so that form reports nothing for any included setting.
On macOS, lazygit reads its configuration from ~/Library/Application Support/lazygit/config.yml. Create this symlink:
ln -s ~/Developer/dotfiles/config/.config/lazygit/config.yml ~/Library/Application\ Support/lazygit/config.ymlOn Linux, lazygit reads its configuration from ~/.config/lazygit/config.yml. Remove any existing directory first, for the same reason as in step 3:
rm -rf ~/.config/lazygit
ln -s ~/Developer/dotfiles/config/.config/lazygit ~/.config/lazygitCheck the result with ls -la ~/.config/lazygit. It must be a symlink into this repository, not a directory. If it is a directory that contains a lazygit symlink, the link was created one level too deep and lazygit is reading an empty config.yml.
Notes:
- The configuration hooks up delta through the
git.diffRendererskey. Older lazygit versions called this keygit.paging, thengit.pagers. On a version that predates the current name, lazygit ignores the entry and shows raw git diffs. Upgrade lazygit rather than renaming the key back. - lazygit migrates renamed configuration keys on startup and writes the result back to
config.yml. Because that file is a symlink into this repository, an upgrade can leave uncommitted changes here. Rungit -C ~/Developer/dotfiles statusafter a lazygit upgrade and commit the migration.
This step is required, not optional. It registers the Tokyo Night theme for bat and delta:
bat cache --buildTo make sure that the theme is available, run bat --list-themes. The list must contain tokyonight_night.
Without this step, delta cannot resolve the syntax-theme = tokyonight_night setting. It prints [bat warning]: Unknown theme 'tokyonight_night', using default. and falls back to its default syntax colors. The diff background colors still look correct, so the failure is easy to miss.
Rerun bat cache --build after every bat upgrade, since the cache is tied to the bat version.
ls -la ~/.config | grep -E 'bat|delta|lazygit' # three symlinks into this repository
bat --list-themes | grep tokyonight_night # theme is registered
git config --get core.pager # delta
git diff # a Tokyo Night diff, rendered by delta