From 58da740702fa5ca476945079adafe98d723bd4c2 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Thu, 11 Jul 2024 16:10:06 +0300 Subject: [PATCH] git-delta --- home/.gitconfig | 32 +++++++++++++++++++++++--------- macos/Brewfile | 1 + 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/home/.gitconfig b/home/.gitconfig index 8093aba..deb8317 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -1,6 +1,26 @@ # local user config, usernames, etc [include] path=~/.config/.gitconfig.local + +### git-delta +[core] + pager = delta +[interactive] + diffFilter = delta --color-only +[delta] + navigate = true # use n and N to move between diff sections + true-color = always + hyperlinks = true + hyperlinks-file-link-format = "vscode://file/{path}:{line}" + # side-by-side = true # alterantively use git -c delta.side-by-side=true diff +[delta "side-by-side"] + side-by-side = true +[merge] + conflictstyle = diff3 +[diff] + colorMoved = default +### end git-delta + [color] diff = auto status = auto @@ -8,24 +28,17 @@ interactive = auto ui = auto [help] - # Automatically correct and execute mistyped commands. - autocorrect = 1 + autocorrect = 1 # Automatically correct and execute mistyped commands. [branch] - # Show most recently changed branches first. - sort = -committerdate + sort = -committerdate # Show most recently changed branches first. [push] default = simple autoSetupRemote = true -[diff] - tool = default-difftool -[difftool "default-difftool"] - cmd = code --wait --diff $LOCAL $REMOTE [filter "media"] clean = git media clean %f smudge = git media smudge %f required = true [alias] - # Shorten some often used commands b = branch c = commit sw = switch @@ -45,6 +58,7 @@ squash = rebase --autostash -i megasquash = "!f() { git rebase --autostash -i `git merge-base --fork-point HEAD master`; }; f" unstage = restore --staged + # fzf commands cf="!checkout_fzf() { git branch | fzf-tmux -p -h 25% --header 'git checkout' | xargs git checkout; }; checkout_fzf" sf="!switch_fzf() { git branch | fzf-tmux -p -h 25% --header 'git switch' | xargs git switch; }; switch_fzf" diff --git a/macos/Brewfile b/macos/Brewfile index 4b7fdac..8f1b47b 100644 --- a/macos/Brewfile +++ b/macos/Brewfile @@ -11,6 +11,7 @@ brew 'findutils' brew 'fzf' brew 'gh' brew 'git' +brew 'git-delta' # https://github.com/dandavison/delta brew 'gnupg' brew 'htop' brew 'iperf3'