On 2011-06-20 08:33 +0200, Torquil Macdonald Sørensen wrote:
> Man pages are displayed using 'less' in my terminal. However, I recently added
>
> LESS="-N"
>
> to my .bashrc because I decided I always want line numbering. However, now the
> line breaking for man pages is not correct. The lines are too wide for my
> terminal,
> so they are wrapped near the end. Therefore I now have almost an entire blink
> line
> between each line of text in the man pages.
>
> Shouldn't 'less' report a somewhat smaller line width to the man page
> generator,
> since the first few character positions are now taken up by the line numbering
> digits?
That does not seem to be possible because man calls less, not the other
way around. However, you could achieve this by setting MANWIDTH to a
lower value than $COLUMNS. Something like this (tested with bash and
zsh):
alias man='eval "MANWIDTH=\$(( \$COLUMNS - 8 ))" command man'
You have to use eval to force recomputation of $MANWIDTH in case the
terminal gets resized, and "command man" prevents recursive evaluation
of the alias.
Cheers,
Sven
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]