From 8f44f8fc01680266808be5df2590ef97b52ca8d8 Mon Sep 17 00:00:00 2001 From: Josef Hofer Date: Tue, 12 Nov 2024 12:25:07 +0100 Subject: [PATCH] chore: remove difftastic and use nvim and diffc command instead --- hosts/shared/programs/git/default.nix | 20 +++----------------- hosts/shared/programs/shell/default.nix | 12 ++++++++++++ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/hosts/shared/programs/git/default.nix b/hosts/shared/programs/git/default.nix index 69a514fd..0d671183 100644 --- a/hosts/shared/programs/git/default.nix +++ b/hosts/shared/programs/git/default.nix @@ -3,10 +3,6 @@ rm -f ~/.gitconfig ''; - home.packages = with pkgs; [ - difftastic - ]; - programs.git = { enable = lib.mkDefault true; lfs.enable = lib.mkDefault true; @@ -19,25 +15,15 @@ push.autoSetupRemote = lib.mkDefault true; pull.rebase = lib.mkDefault true; - # Difftastic configuration diff = { - tool = "kitty"; - guitool = "kittygui"; - external = "difft"; # Add difftastic as external diff tool - }; - - pager = { - difftool = "less -RFX"; # Configure pager for difftastic + tool = "nvimdiff"; }; difftool = { prompt = false; trustExitCode = true; - kitty = { - cmd = "kitten diff --to $LOCAL --from $REMOTE"; - }; - kittygui = { - cmd = "kitten diff --to $LOCAL --from $REMOTE"; + nvimdiff = { + cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""; }; }; diff --git a/hosts/shared/programs/shell/default.nix b/hosts/shared/programs/shell/default.nix index 268c3f2e..3fee639e 100644 --- a/hosts/shared/programs/shell/default.nix +++ b/hosts/shared/programs/shell/default.nix @@ -90,6 +90,18 @@ fi } + # diff function with default flags + diffc() { + diff -u -a "$@" + } + compdef _diff diffc + + # diff function using nvim + diffn() { + nvim -d "$@" + } + compdef _diff diffnV + check_repos() { find . -type d -name ".git" | while read gitdir; do repo_dir="$(dirname "$gitdir")"