1

How can I use diff-so-fancy in magit rather than magit-delta?

I'd like to refine diff buffer in Emacs with magit. I found diff-so-fancy and prefer it to delta for several reasons.

I installed diff-so-fancy but magit didn't show diff formatted by diff-so-fancy but Terminal does by git diff.

3
  • I agree with @phils that is unlikely that magit could support it directly. What is it exactly that you are wanting it to use? The colors? (can certainly be fixed) The file headers? (could probably be fixed as well with some hacking). Feb 10 at 1:19
  • Like this image, I mainly want to emphasize word level difference. diff-so-fancy image I just found magit-diff-refine-hunk satisfies my needs but it seems buggy like this image.
    – Rami
    Feb 10 at 8:17
  • I had turned on magit-diff-refine-hunk so long ago I forgot it wasn't the default. :) Feb 11 at 5:23

2 Answers 2

0

I can't imagine that being an option -- how could Magit understand the output of some arbitrary visualiser? It needs standard diffs to work with (whereas in your terminal you're getting read-only content, so it doesn't matter).

4
  • n.b. I don't know for certain, though; I'm sure someone will correct me if there's support for this.
    – phils
    Feb 7 at 21:53
  • Thanks for commenting. magit-delta does that. And I just found magit-diff-refine-hunk basically satisfies my needs.
    – Rami
    Feb 10 at 8:20
  • I didn't realize magit-delta was a package. Perhaps you can just change magit-delta-delta-executable and magit-delta-delta-args. If they both use ANSI escape sequence (which I assume they must), then perhaps magit-delta will do the rest. You might also have to add advice to magit-delta--make-delta-args to prevent it from adding --theme. Feb 11 at 5:23
  • Thanks for your suggestion. That made me clear how to custom magit-delta code!
    – Rami
    Feb 11 at 12:23
0

delta has a diff-so-fancy emulation mode via --diff-so-fancy or the delta.diff-so-fancy git config option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.