how to use delta as pager/diff tool? #202
Replies: 3 comments 4 replies
-
Fyi for anyone else stumbling upon this and wondering why it isn’t working for them; I’ve set delta as my pager in gitconfig, and something like Anyway, setting this environment variable (in the fish shell) works for me: |
Beta Was this translation helpful? Give feedback.
-
The solution proposed by @notDavid works for git log, but it doesn't work for git status. function fzf_preview_changed_file_using_delta
set -l path (string split ' ' $argv)[-1]
if string match -r '^\?\?' $argv --quiet
echo -e (set_color --underline)=== Untracked ===\n
_fzf_preview_file $path
else
if string match -r '\S\s\S' $argv --quiet
echo -e (set_color --underline red)=== Unstaged ===\n
git diff --color=always -- $path | delta
end
if string match -r '^\S' $argv --quiet
echo -e (set_color --underline green)=== Staged ===\n
git diff --color=always --staged -- $path | delta
end
end
end That function is copied and adapted from That solution is not ideal though because I will now miss updates to |
Beta Was this translation helpful? Give feedback.
-
I'm currently looking into making this a feature out of the box based on ideas from dandavison/delta#840. Stay tuned! And check out that discussion for ideas for yourself in the meantime. |
Beta Was this translation helpful? Give feedback.
-
Hi, 👋
I've recently used dandavison/delta/ to get better diffs.
I was wondering if there's a way to use it in the git log preview? ctrl+alt+L
I see that in fzf.vim it uses delta if it detects it's installed.
Beta Was this translation helpful? Give feedback.
All reactions