summary refs log tree commit diff stats
path: root/user/settings
diff options
context:
space:
mode:
authorAlan Pearce2025-03-04 10:50:28 +0100
committerAlan Pearce2025-03-04 10:50:28 +0100
commit5fe0269a2d12e6e36cc379224fc6f4a49596612a (patch)
tree51f3fcf42e0e5691e29b9abbc5ec585eb8119fad /user/settings
parentb3373e1c82b5fd0b19452709646306705a018598 (diff)
downloadnixfiles-5fe0269a2d12e6e36cc379224fc6f4a49596612a.tar.lz
nixfiles-5fe0269a2d12e6e36cc379224fc6f4a49596612a.tar.zst
nixfiles-5fe0269a2d12e6e36cc379224fc6f4a49596612a.zip
git: use difftastic (semantic diffs) in place of delta
Diffstat (limited to 'user/settings')
-rw-r--r--user/settings/git.nix15
-rw-r--r--user/settings/shell.nix4
2 files changed, 17 insertions, 2 deletions
diff --git a/user/settings/git.nix b/user/settings/git.nix
index 54efe25f..feb6a3fb 100644
--- a/user/settings/git.nix
+++ b/user/settings/git.nix
@@ -12,12 +12,15 @@ in
     userName = name;
     userEmail = email;
     delta = {
-      enable = true;
+      enable = false;
       options = {
         navigate = true;
         light = true;
       };
     };
+    difftastic = {
+      enable = true;
+    };
     extraConfig = {
       init = {
         defaultBranch = "main";
@@ -123,6 +126,12 @@ in
       ignored = "ls-files --others -i --exclude-standard";
       clear = "clear-soft";
       clear-hard = "!git-clear-hard";
+      dlog = "-c diff.external=difft log --ext-diff";
+      dshow = "-c diff.external=difft show --ext-diff";
+      ddiff = "-c diff.external=difft diff";
+      dl = "dlog";
+      ds = "dshow";
+      dt = "ddiff";
     };
     ignores = [
       ".DS_Store"
@@ -148,6 +157,9 @@ in
       user = {
         inherit name email;
       };
+      ui = {
+        "diff.tool" = [ "${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right" ];
+      };
     };
   };
   home.packages = with pkgs; [
@@ -155,7 +167,6 @@ in
     git-worktree-switcher
     ghq
     # reduce these on server
-    delta
     gitui
     gitstatus
     hut # sourcehut tools
diff --git a/user/settings/shell.nix b/user/settings/shell.nix
index e35564ef..72fcde3c 100644
--- a/user/settings/shell.nix
+++ b/user/settings/shell.nix
@@ -77,8 +77,12 @@ in
 
       ga = "git add";
       gs = "git st";
+      gds = "git dshow";
+      gsl = "git dshow";
       gd = "git diff";
       gdc = "git diff --cached";
+      gdd = "git ddiff";
+      gddc = "git ddiff --cached";
       gf = "git fetch";
       gk = "git push";
       gkf = "git push --force-with-lease";