Using less +-S
does not work (although it does ask Chop long lines (press RETURN)
), and entering -S
once inside less
also does not work. Is there a solution?
I am usig OS X Mavericks (10.9.3).
less 418 (default) or less 458 (via MacPorts)
Using less +-S
does not work (although it does ask Chop long lines (press RETURN)
), and entering -S
once inside less
also does not work. Is there a solution?
I am usig OS X Mavericks (10.9.3).
less 418 (default) or less 458 (via MacPorts)
You can use fold
to first wrap the text, then pipe to less
:
fold -w 78 | less
Of course, -w
sets the number of characters. By default it's 80. fold
is POSIX and bundled with OS X.
Apparently, using less -r
as the default Git pager will also achieve folding of long lines.
Otherwise, while the diff is being displayed, you can type -S
, then Enter to toggle chopping/folding long lines.
git
) diff
command --- so I don't think this will work
Commented
Jul 6, 2014 at 16:08
less -r
as Git pager work in that case?
less -r
did something completely different. Any idea why this works in git, but not terminal?
Commented
Jul 6, 2014 at 16:13
less -+S
doesn't work in your case. In fact, in my setup (also under OS X), the diff shown in less
is automatically line-wrapped, but I haven't set anything explicitly to enable it.
less
version number as output byless --version
. OS X still ships version 418 in Yosemite, by the way, and I see the same buggy behavior withless -S
on Yosemite, so this question is not dead, even if it is "answered". I've seen this behavior for years and years on multiple OSes, though so my belief is thatless -S
is just plain buggy.icdiff
: github.com/jeffkaufman/icdiff