dotfiles/git/gitconfig
Benedikt Heine 881d4a0340 nvim: set EDITOR variable only if installed
Since git core.editor was set in the initial commit, I suspect I wasn't
aware of $EDITOR in the environment. So it's safe to delete
git/gitconfig's core.editor and take it from $EDITOR by default, which
actually checks if nvim is installed.

for git's diff.tool and merge.tool, I don't see a possibility to have a
conditional switch and fallback to vim. I don't expect to work on
another workstation without neovim.
2026-01-27 00:18:58 +01:00

102 lines
2.4 KiB
Text

[color]
diff = auto
status = auto
branch = auto
ui = true
[user]
name = Felix Buehler
email = account@buehler.rocks
[merge]
defaultToUpstream = true
tool = nvim -d
conflictstyle = zdiff3
[core]
eol = native
pager = delta || (diff-so-fancy | less --tabs=4 -RFX)
quotepath = false
commitGraph = true
[interactive]
diffFilter = delta --color-only
[alias]
committree = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
ct = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
d = difftool
git = !exec git
s = status
unstage = reset HEAD --
c = commit
cam = commit --amend
cp = cherry-pick
r = rebase
ri = rebase --interactive
rc = rebase --continue
ra = rebase --abort
[rerere]
enabled = true
autoupdate = true
[branch]
autoSetupMerge = always
# Fetch also the merge requests data for common remotes
# GitHub uses "pull/*", GitLab uses "merge-requests/*"
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
[remote "upstream"]
fetch = +refs/pull/*/head:refs/remotes/upstream/pull/*
fetch = +refs/merge-requests/*/head:refs/remotes/upstream/merge-requests/*
[diff]
tool = nvim -d
colorMoved = default
algorithm = histogram
mnemonicPrefix = true
renames = true
[difftool]
prompt = false
[color.blame]
repeatedLines = yellow
[blame]
coloring = repeatedLines
[color "diff-highlight"]
oldNormal = red
oldHighlight = red bold 52
newNormal = green
newHighlight = green bold 22
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[rebase]
autosquash = true
[color "diff"]
meta = yellow bold
commit = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[gc]
writeCommitGraph = true
[delta]
line-numbers = true
navigate = true
light = false
[pull]
ff = only
rebase = true
[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
pushInsteadOf = https://gitlab.com/
[url "ssh://git@bitbucket.org/"]
pushInsteadOf = https://bitbucket.org/
[push]
autoSetupRemote = true
default = simple
followTags = true
[tag]
sort = version:refname
[fetch]
prune = true
pruneTags = true
[help]
autocorrect = prompt