Skip to content

Commit 5cf50ae

Browse files
authored
avoid line wrapping in less
When line numbers are shown in less, the horizontal ruler would wrap around if line wrapping is turned on, there're 2 options: 1. turn off line wrapping in less, using `-S` 2. decrease horizontal_rule width, e.g.: `$width -= 8`, to accommodate line numbers up to 4 digits. I added `-S`, but It should be fine to use either here.
1 parent 57b85e3 commit 5cf50ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pro-tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can do also do a one-off or a specific `diff-so-fancy` alias:
77
git diff --color | diff-so-fancy
88

99
git config --global alias.dsf '!f() { [ -z "$GIT_PREFIX" ] || cd "$GIT_PREFIX" '\
10-
'&& git diff --color "$@" | diff-so-fancy | less --tabs=4 -RFX; }; f'
10+
'&& git diff --color "$@" | diff-so-fancy | less --tabs=4 -RFXS; }; f'
1111
```
1212

1313
#### Opting-out
@@ -34,7 +34,7 @@ You can pre-seed your `less` pager with a search pattern, so you can move
3434
between files with `n`/`N` keys:
3535
```ini
3636
[pager]
37-
diff = diff-so-fancy | less --tabs=4 -RFX --pattern '^(Date|added|deleted|modified): '
37+
diff = diff-so-fancy | less --tabs=4 -RFXS --pattern '^(Date|added|deleted|modified): '
3838
```
3939

4040
#### Zsh plugin providing diff-so-fancy

0 commit comments

Comments
 (0)