Skip to content

Commit d2e5dbe

Browse files
committed
Add -FX flags to the pager so that less doesn't clear the screen for a short diff and doesn't wait for the user to press Q to return to the shell
-F makes less return immediately if the content fits on the screen. Without this you need to press Q to get back to your shell even if the diff was only a few lines long -X prevent less from clearing the screen at the beginning. Which is undesirable if the content fits on one screen and unnecessary if the content is longer than a screen. And the -R flag (not added by this PR) displays colors correctly instead of outputting as ASCII representation of the control chars
1 parent 455ea67 commit d2e5dbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ git diff --color | diff-so-fancy
2121

2222
**But**, you'll probably want to fancify all your diffs. Run this so `git diff` and `git show` will use it:
2323
```shell
24-
git config --global pager.diff "diff-so-fancy | less --tabs=1,5 -R"
25-
git config --global pager.show "diff-so-fancy | less --tabs=1,5 -R"
24+
git config --global pager.diff "diff-so-fancy | less --tabs=1,5 -RFX"
25+
git config --global pager.show "diff-so-fancy | less --tabs=1,5 -RFX"
2626
```
2727

2828
Or, create a git alias in your `~/.gitconfig` for shorthand fanciness:

0 commit comments

Comments
 (0)