Tony,

A.J.Mechelynck said on 12/04/2006 12:55 AM:
Guido Van Hoecke wrote:
The :Man command always outputs lines that do not fit within the current line length.

The Description section of the bash man page is rendered as follows in a 75x50 gnome terminal (using a narrow window to avoid the wrapping by email clients):

DESCRIPTION
       Bash  is  an  sh-compatible  command language interpreter
@that  exe
       cutes  commands read from the standard input or from a
@file.  Bash

This is gvim/vim 7 on Ubuntu 6.10 Edgy Eft 2.6.17-10-generic AMD64

The man.vim pluging picks up the width of the line from winwidth(0). I am afraid that this does not account for unavailable columns due to the scroll bar at the right side, the folding margin at the left side, the fact that I have the number option on, so some columns are used for the line number etc...

I copied the script into ~/.vim/ftplugin/ and changed line 144 into
 let $MANWIDTH = winwidth(0) - 10
This fixes my problem, but it is definitely not the proper way to do this.

Guido.


Man expects to page its output through less or similar (via some formatting filter such as -IIRC- groff). This usually means 80 "usable" columns per line. You might want to set your 'columns' in the vimrc in such way that 80 columns are available for man pages (possibly with ":setlocal nonumber" for manpages) while restricting the line length for mail messages to avoid wrapping when quoted on arrival (e.g., by using ":setlocal wrapmargin=5" for mail).

The "typical" way of doing that would be in the vimrc, plus user-filetype-plugins in an |after-directory| such as (on Unix) ~/.vim/after/ftplugin/

Thanks for the advice. I'v since added following line to my .vimrc
(triggered by Bram's suggestion)
        autocmd FileType man setlocal nonumber foldcolumn=0
and that gets rid of my so-called problem.
Thanx to help out, once more!
Guido.

Best regards,
Tony.



--
http://vanhoecke.org ... and go2 places!

Reply via email to