Like most people I use
less as my terminal pager. Occasionally I view files consisting of very long lines of plain or marked-up text. By default
less folds these lines at the terminal window edge. That is, words get broken at the last column, making the text difficult to read. Is there any way of getting
less to instead wrap the lines at word boundaries, the same way that
fmt or Emacs visual line mode does?
I am aware that I could simply pipe the input through
fmt before viewing it, though that requires me to know my terminal width in advance. I was hoping there was some way of getting
less to nicely wrap lines, and to automatically reformat them when the terminal window is resized.