Loading ...
Sorry, an error occurred while loading the content.

Man outputs lines that are too long

Expand Messages
  • Guido Van Hoecke
    The man.vim script assumes that foldcolumn and numberwidth are 0. If they are not, the generated lines are too long. Here s a patch to fix this: ~$ diff -u
    Message 1 of 2 , Dec 3, 2006
    • 0 Attachment
      The man.vim script assumes that foldcolumn and numberwidth are 0. If
      they are not, the generated lines are too long.
      Here's a patch to fix this:

      ~$ diff -u /usr/share/vim/vim70/ftplugin/man.vim
      /home/guivho/.vim/ftplugin/man.vim
      --- /usr/share/vim/vim70/ftplugin/man.vim 2006-10-20
      11:48:47.000000000 +0200
      +++ /home/guivho/.vim/ftplugin/man.vim 2006-12-03 09:15:37.000000000 +0100
      @@ -141,7 +141,13 @@

      setl ma
      silent exec "norm 1GdG"
      - let $MANWIDTH = winwidth(0)
      + " leave room for foldcolumn and numberwidth
      + let s:notfree = &numberwidth + &foldcolumn
      + if &foldcolumn == 4
      + " one extra col allows for man pages > 999 lines, e.g. bash
      + let s:notfree = s:notfree + 1
      + endif
      + let $MANWIDTH = winwidth(0) - s:notfree
      silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
      " Remove blank lines from top and bottom.
      while getline(1) =~ '^\s*$'
      ~$

      Guido
    • Bram Moolenaar
      ... Do you really want line numbers and a foldcolumn in you man page window? I suppose not. Then it s easier to do ... -- Windows M!uqoms /// Bram Moolenaar
      Message 2 of 2 , Dec 3, 2006
      • 0 Attachment
        Guido Van Hoecke wrote:

        > The man.vim script assumes that foldcolumn and numberwidth are 0. If
        > they are not, the generated lines are too long.
        > Here's a patch to fix this:
        >
        > ~$ diff -u /usr/share/vim/vim70/ftplugin/man.vim
        > /home/guivho/.vim/ftplugin/man.vim
        > --- /usr/share/vim/vim70/ftplugin/man.vim 2006-10-20
        > 11:48:47.000000000 +0200
        > +++ /home/guivho/.vim/ftplugin/man.vim 2006-12-03 09:15:37.000000000 +0100
        > @@ -141,7 +141,13 @@
        >
        > setl ma
        > silent exec "norm 1GdG"
        > - let $MANWIDTH = winwidth(0)
        > + " leave room for foldcolumn and numberwidth
        > + let s:notfree = &numberwidth + &foldcolumn
        > + if &foldcolumn == 4
        > + " one extra col allows for man pages > 999 lines, e.g. bash
        > + let s:notfree = s:notfree + 1
        > + endif
        > + let $MANWIDTH = winwidth(0) - s:notfree
        > silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
        > " Remove blank lines from top and bottom.
        > while getline(1) =~ '^\s*$'
        > ~$

        Do you really want line numbers and a foldcolumn in you man page window?
        I suppose not. Then it's easier to do

        :setlocal nonumber foldcolumn=0

        --
        Windows
        M!uqoms

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.