From 7eb4952e3e33830273af0549a16994e00591e39a Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 15 Dec 2022 16:07:23 -0500 Subject: [PATCH] meta: Add elementary kitty diff support Having image diffs in the terminal is very cool, however I ultimately decided against using kitty's diff feature due to using the existing colors of the shell being non-trivial. --- fish/.config/fish/config.fish | 2 ++ git/.gitconfig | 14 ++++++++++++++ kitty/.config/kitty/diff.conf | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 kitty/.config/kitty/diff.conf diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index c1eea53..c7ffb5f 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -80,7 +80,9 @@ if not set -q set_abbr abbr gcl "git clone" abbr gco "git checkout" abbr gd "git diff" # Show all file changes not staged yet + abbr gdi "git difftool --no-symlinks --dir-diff" abbr gds "git diff --staged" # Show changes staged but not committed + abbr gdsi "git difftool --no-symlinks --dir-diff --staged" abbr gi "git init" abbr gl "git log --oneline --decorate --all --graph -n 10" abbr gm "git merge" diff --git a/git/.gitconfig b/git/.gitconfig index 82570f1..73e0a4c 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -12,6 +12,20 @@ excludesfile = ~/.gitignore quotePath = false +[diff] + tool = kitty + guitool = kitty.gui + +[difftool] + prompt = false + trustExitCode = true + +[difftool "kitty"] + cmd = kitty +kitten diff $LOCAL $REMOTE + +[difftool "kitty.gui"] + cmd = kitty kitty +kitten diff $LOCAL $REMOTE + [web] browser = qutebrowser diff --git a/kitty/.config/kitty/diff.conf b/kitty/.config/kitty/diff.conf new file mode 100644 index 0000000..5af6f03 --- /dev/null +++ b/kitty/.config/kitty/diff.conf @@ -0,0 +1,4 @@ +map d scroll_to next-page +map u scroll_to prev-page +map g scroll_to start +map G scroll_to end