Skip to content

Commit

Permalink
chore: remove difftastic and use nvim and diffc command instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Hofer committed Nov 12, 2024
1 parent 0b87d90 commit 8f44f8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
20 changes: 3 additions & 17 deletions hosts/shared/programs/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
rm -f ~/.gitconfig
'';

home.packages = with pkgs; [
difftastic
];

programs.git = {
enable = lib.mkDefault true;
lfs.enable = lib.mkDefault true;
Expand All @@ -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\"";
};
};

Expand Down
12 changes: 12 additions & 0 deletions hosts/shared/programs/shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down

0 comments on commit 8f44f8f

Please sign in to comment.