Note: For the key binding, see the second part.
In less
, it's called line folding rather than line wrapping.
To set it not to fold, use the -S
option:
-S, --chop-long-lines
Causes lines longer than the screen width to be chopped rather than folded. That is, the portion of a long line that does not fit in the screen width is not shown. The default is to fold long lines; that is, display the remainder on the next line.
— less(1)
Alternatively, as mentioned in the below comment, if you already opened the file, you can toggle the mode by typing -S
(and then Enter for some implementations).
After disabling line folding, you can scroll sideways with the arrow keys.
1Now that I disabled "line chopping", how do I scroll horizontally? – becko – 2017-09-17T17:08:54.057
3@becko use the right and left arrow keys. – xxpor – 2018-06-22T04:11:21.417
210... and toggle inside
less
with the same keys (-
, thenShift-S
). – peth – 2011-04-19T16:27:49.420