From 523998dbbacee4f56136c1ea0ed19d56aea9ae12 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 19 Nov 2024 20:24:41 +0800 Subject: [PATCH] users/foo-dogsquared/programs/vs-code: integrate as Git merge and diff tool --- .../foo-dogsquared/modules/programs/vs-code.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix b/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix index 90bb458a..f81b8c4d 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/vs-code.nix @@ -33,5 +33,16 @@ in "extensions.ignoreRecommendations" = true; }; }; + + # We're using Visual Studio Code as a git difftool and mergetool which is + # surprisingly good compared to the competition (which is not much). + programs.git.extraConfig = { + diff.tool = lib.mkDefault "vscode"; + difftool.vscode.cmd = "code --wait --diff $LOCAL $REMOTE"; + + # It has a three-way merge. + merge.tool = lib.mkDefault "vscode"; + mergetool.vscode.cmd = "code --wait --merge $REMOTE $LOCAL $BASE $MERGED"; + }; }; }