I really like the character-level highlighting of diff-so-fancy.
How can I use it to compare files without using git?
I really like the character-level highlighting of diff-so-fancy.
How can I use it to compare files without using git?
If what you want is to compare files that are not under git, you can simply use git diff --color file1 file2 | diff-so-fancy.
If both files are in the same git repository, you'll need to use git diff --no-index --color file1 file2 | diff-so-fancy.
From this issue it seems diff-so-fancy currently requires git-formatted input to achieve correctly coloured output.
As a work-around:
dsf() { git diff --no-index --color "$@" | diff-so-fancy }
Thanks to this answer for pointing me in the right direction.