• Re: Using 'vim' as a man pager (Was: New mini project: mnpgr.)

    From Chris Elvidge@21:1/5 to Kenny McCormack on Sun Oct 15 17:52:14 2023
    On 15/10/2023 17:23, Kenny McCormack wrote:
    In article <ugh237$j6fg$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    I don't think I'll use 'txr', but your post made me think about the
    task...

    Indeed. It seems unlikely that anyone would take on TXR just for this purpose.

    Anyway, just to take your idea a bit firther, I'm actually quite pleased
    with the effect of:

    $ /usr/bin/man ls | vi -c 'set syntax=man nomod|split' -


    I use a function (to save typing):

    vman ()
    {
    COLUMNS=$((COLUMNS-5)) /usr/bin/man ${@-man} | col -bpx | iconv -c |
    view -c 'set ft=man nomod' -c 'set noeb vb t_vb=' -c 'map q
    <Esc>:q!<cr>' -c 'map i <nop>' -
    }

    and then alias man to vman


    --
    Chris Elvidge, England
    I WILL NOT YELL "FIRE" IN A CROWDED CLASSROOM

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sun Oct 15 16:23:40 2023
    In article <ugh237$j6fg$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    I don't think I'll use 'txr', but your post made me think about the
    task...

    Indeed. It seems unlikely that anyone would take on TXR just for this
    purpose.

    Anyway, just to take your idea a bit firther, I'm actually quite pleased
    with the effect of:

    $ /usr/bin/man ls | vi -c 'set syntax=man nomod|split' -

    --
    Elect a clown, expect a circus.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kenny McCormack on Sun Oct 15 17:27:14 2023
    On 2023-10-15, Kenny McCormack <[email protected]> wrote:
    In article <ugh237$j6fg$[email protected]>,
    Janis Papanagnou <[email protected]> wrote:
    ...
    I don't think I'll use 'txr', but your post made me think about the
    task...

    Indeed. It seems unlikely that anyone would take on TXR just for this purpose.

    Anyway, the code captures the requirements of a particular working
    solution; it would be easier to clone what that program is doing, than
    to research and develop this from scratch.

    The syntax highlighting file (mnpgr.vim) can be reused in a compatible
    solution written in another scripting language.

    If someone writes mnpgr.tl in another language, and is willing to put it
    under the same BSD-1 license, I will add it to the tree.

    Anyway, just to take your idea a bit firther, I'm actually quite pleased
    with the effect of:

    $ /usr/bin/man ls | vi -c 'set syntax=man nomod|split' -

    Won't remember your most recent position in that man page;
    won't accurately colorize all the words that are marked up in the
    original man page.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @[email protected]
    NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Chris Elvidge on Mon Oct 16 12:43:28 2023
    On 15.10.2023 18:52, Chris Elvidge wrote:
    On 15/10/2023 17:23, Kenny McCormack wrote:
    Anyway, just to take your idea a bit firther, I'm actually quite pleased
    with the effect of:

    $ /usr/bin/man ls | vi -c 'set syntax=man nomod|split' -

    I use a function (to save typing):

    vman ()
    {
    COLUMNS=$((COLUMNS-5)) /usr/bin/man ${@-man} | col -bpx | iconv -c |
    view -c 'set ft=man nomod' -c 'set noeb vb t_vb=' -c 'map q
    <Esc>:q!<cr>' -c 'map i <nop>' -
    }

    and then alias man to vman

    Yes, having that in a function (or in a local script) is recommended.
    (Might make it also possible to make the PAGER variables work better.)

    I'd maybe also add the :split - it's useful when you want the synopsis
    visible and skim through the options in the other section - OTOH, it's
    also simply typed when needed; how often do I want it?

    Anyway, having an editor as pager allows a lot interesting functions.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)