From 9c0baa8deb0f3af8579de7063bb40d6a839d0bc2 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Thu, 10 Nov 2022 00:34:47 -0500 Subject: [PATCH] git: switch to delta --- fish/config.fish | 7 +--- fish/functions/diff.fish | 8 +--- git/config | 70 +++++++++++++++++++------------- install/install-brew-packages.sh | 1 - nix/packages.nix | 1 - 5 files changed, 43 insertions(+), 44 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index 2d8eb48..ff3dc3b 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -10,13 +10,8 @@ if status --is-interactive # Disable the abbreviated directory format set fish_prompt_pwd_dir_length 0 - # If installed, setup git tools - command -q diff-so-fancy; and set -gx GIT_PAGER "diff-so-fancy | $PAGER" - command -q delta; and set -gx GIT_PAGER 'delta --diff-so-fancy' - command -q interactive-rebase-tool; and set -gx GIT_SEQUENCE_EDITOR interactive-rebase-tool - # If installed, setup z function - command -q zoxide; and zoxide init fish | source + command -q zoxide; and zoxide init fish | source # Git prompt set -g __fish_git_prompt_showdirtystate 1 diff --git a/fish/functions/diff.fish b/fish/functions/diff.fish index c527f73..707d858 100644 --- a/fish/functions/diff.fish +++ b/fish/functions/diff.fish @@ -1,9 +1,3 @@ function diff - if command -q delta - command diff -u $argv[1] $argv[2] | delta --diff-so-fancy - else if command -q diff-so-fancy - command diff -u $argv[1] $argv[2] | diff-so-fancy - else - command diff -u $argv[1] $argv[2] - end + command diff -u $argv[1] $argv[2] | delta end diff --git a/git/config b/git/config index 06b30b7..66e4381 100644 --- a/git/config +++ b/git/config @@ -1,42 +1,54 @@ -[user] - name = Charles Gould - useConfigOnly = true -[core] - autocrlf = input [alias] - aliases = config --get-regexp alias + aliases = config --get-regexp alias branchsort = branch --sort='-committerdate' --format='%(HEAD) %(color:blue)%(committerdate:short)%(color:reset) %(if)%(worktreepath)%(then)%(color:reverse yellow)%(refname:short)%(color:reset)%(else)%(color:yellow)%(refname:short)%(color:reset)%(end) %(color:green)%(upstream:short)%(color:reset)' - can = commit --amend --no-edit - cand = commit --amend --no-edit --date=now - logsearch = log --color=always --format=tformat:'%C(blue)%cs%C(reset) %C(yellow)%h%C(reset) %C(normal)%s%C(reset)' - rbi = rebase --interactive - wipe = restore --staged --worktree -[color "branch"] - current = yellow reverse - local = yellow - remote = green -[color "diff"] - meta = yellow - frag = magenta bold - commit = yellow bold - old = red bold - new = green bold - whitespace = red reverse -[color "diff-highlight"] - oldNormal = red bold - oldHighlight = red bold 52 - newNormal = green bold - newHighlight = green bold 22 + can = commit --amend --no-edit + cand = commit --amend --no-edit --date=now + logsearch = log --color=always --format=tformat:'%C(blue)%cs%C(reset) %C(yellow)%h%C(reset) %C(normal)%s%C(reset)' + rbi = rebase --interactive + wipe = restore --staged --worktree [color "status"] added = yellow changed = green untracked = cyan +[core] + autocrlf = input + pager = delta +[delta] + features = blame-style diff-style +[delta "blame-style"] + blame-code-style = syntax + blame-format = " {commit:<8} {author:^18} {timestamp:>10} " + blame-palette = "#2E3440" "#3B4252" "#434C5E" "#4C566A" + blame-separator-style = blue + blame-timestamp-output-format = "%v" +[delta "diff-style"] + file-decoration-style = blue box + file-style = blue + hunk-header-decoration-style = none + hunk-header-line-number-style = blue + line-numbers = false + minus-style = bold red + minus-emph-style = bold red 52 + plus-style = bold green + plus-emph-style = bold green 22 + zero-style = dim syntax +[diff] + colorMoved = default +[interactive] + diffFilter = delta --color-only +[log] + date = human +[merge] + conflictStyle = zdiff3 [pull] rebase = true [push] default = current -[log] - date = human +[sequence] + editor = interactive-rebase-tool [stash] showPatch = true showStat = true +[user] + name = Charles Gould + useConfigOnly = true diff --git a/install/install-brew-packages.sh b/install/install-brew-packages.sh index 722d7df..5f9007b 100755 --- a/install/install-brew-packages.sh +++ b/install/install-brew-packages.sh @@ -7,7 +7,6 @@ ROOTDIR=$(cd "$(dirname "$0")/.." && pwd) # Install required tools brew install \ bat \ - diff-so-fancy \ fd \ fish \ fzf \ diff --git a/nix/packages.nix b/nix/packages.nix index 2ccb34f..4640ae9 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -4,7 +4,6 @@ with import {}; [ bat - diff-so-fancy delta fd fish