src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

cli search: config option to use a different git-diff tool

Open mikelnrd opened this issue 4 years ago • 1 comments

Hi. Loving using src from the cli so far. One small improvement I'd love to see...

Is it possible for you to provide a way to customise which git diff syntax highlighter the src cli uses? Perhaps via a config setting? (Not sure if this is possible... I guess it depends how much the code depends on colordiff specifics)

I set up the cli and have colordiff working correctly. However I'd love to have src use delta for git diff highlighting.

I tried piping the output of src search ... type:diff to delta but that doesn't work of course as the format is a mix of git-diff and highlighted search results.

mikelnrd avatar Feb 16 '20 08:02 mikelnrd

Hey @mikelnrd! Thanks for opening the issue (and pointing me to delta). There are currently no settings to switch from colordiff to another diff tool, no.

I tried swiching colordiff in the code to delta, just to see whether it would work or not. Now, it doesn't crash and it does show the diffs, but you tell me whether that looks fine to you:

The upper terminal shows the output of src search ... type:diff with delta hacked in. The lower terminal shows git show <commit> using delta as the pager.

Screen Shot 2020-02-19 at 13 15 44

If that looks fine as is, I don't think it's a lot of work to add support for DIFFER=delta src search ... type:diff or something like that

mrnugget avatar Feb 19 '20 12:02 mrnugget