From 3729e67247bf24247f9565bcc0740c49138f871e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Thu, 17 Aug 2023 23:44:27 +0200 Subject: [PATCH] Git: add few bits to improve mergetool and diff --- .gitconfig | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitconfig b/.gitconfig index ee0161b..68601d8 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,10 +21,17 @@ smtpserver = smtp.gmail.com smtpuser = robert.r.kmiec@gmail.com smtpserverport = 587 -[diff] - tool = vimdiff [merge] - tool = vimdiff + conflictstyle = diff3 + tool = nfugitive +[mergetool "nfugitive"] + cmd = nvim -c "Gvdiffsplit!" "$MERGED" +[diff] + tool = nvimdiff +[difftool "nvimdiff"] + cmd = nvim -d "$LOCAL" "$REMOTE" +[diff "markdown"] + xfuncname = "^#+.*$" [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f @@ -33,13 +40,13 @@ [alias] cm = commit co = checkout - br = branch + br = branch -vva st = status d = diff dc = diff --cached short = rev-parse --short --verify HEAD update = !git stash && git pull --rebase && git stash pop && git submodule update --init --recursive - diff-image = "!f() { cd -- \"${GIT_PREFIX:-.}\"; GIT_DIFF_IMAGE_ENABLED=1 git diff \"$@\"; }; f" + diff-image = "!f() { cd -- \"${GIT_PREFIX:-.}\"; GIT_DIFF_IMAGE_ENABLED=1 git diff \"$@\"; }; f" [interactive] diffFilter = delta --color-only [delta] @@ -58,6 +65,8 @@ cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' [init] defaultBranch = master -[diff "image"] - command = /home/kmcr/tools/git-diff-image/git_diff_image - textconv = imgcat +#[diff "image"] +# command = /home/kmcr/tools/git-diff-image/git_diff_image +# textconv = imgcat +[advice] + detachedHead = false