tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
19.84k stars 1.01k forks source link

What git command, if any, does inline diff call? #2249

Closed hahuang65 closed 8 months ago

hahuang65 commented 8 months ago

I'm trying to integrate https://dandavison.github.io/delta/ into git, such that fugitive uses it everywhere that it can.

However, I don't think that inline diffs is using it (pressing = on a file in the :Git status window.)

What command do the inline diff keys use to bring up the diff?

tpope commented 8 months ago

They use git diff --no-color, because the color is provided by Vim's syntax highlighting. delta uses ANSI escape sequences to provide highlighting, which Vim does not support, except in terminal buffers. So the closest you can get to delta support in Vim is to use a command that runs in a terminal. Here's one:

:Git -c pager.diff=delta diff
hahuang65 commented 8 months ago

Got it, thank you, that makes sense.