scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

Integrate diff-so-fancy #207

Closed rebolyte closed 7 years ago

rebolyte commented 7 years ago

Is there a way to integrate diff-so-fancy with scm_breeze's numbered shortcuts? I was able to add an alias that diff'd the whole repo, but I couldn't get numbered shortcuts to work.

ghthor commented 7 years ago

From my initial inspection, diff-so-fancy is only used as a pipe target for output from a diffing tool. If this is incorrect, can you give me an example of how you'd use it with numbered shortcuts?

I was able to use g diff --color 1 | diff-so-fancy and it worked as expected. It'd be nice to use gd 1 | diff-so-fancy or integrate diff-so-fancy into the gd alias to enable gd 1 to output through diff-so-fancy. This should of course be configurable, maybe as an option, git_diff_post_processing_tool or something of that nature. I'm looking into how this option could be added.

ghthor commented 7 years ago

I was able to make diff-so-fancy the default output of gd 1 by setting it as the pager in my global gitconfig[1] file.

git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

I propose that this is the best way to enable DSF and nothing should be changed/added to scm_breeze.

[1] https://github.com/so-fancy/diff-so-fancy#usage

rebolyte commented 7 years ago

Great, thank you! I wasn't thinking it would be integrated into scm_breeze, so this is just what I was looking for.