Charles E Campbell wrote:
> Murukesh Mohanan wrote:
>> Typically man pages have bold and underlines displayed using |x\bx|
>> and |_\bx|, |\b| being the backspace and |x| the letter in question
>> (Thomas Dickey talks about this in this Unix & Linux post
>> <http://unix.stackexchange.com/a/271553/70524>). That's what makes
>> using just |vim -| as the manpager annoying. The workaround I have
>> seen posted in a number of places is to filter out the backspaces, and
>> the characters that would have been printed over. Typically:
>>
>> |MANPAGER='col -b | vim -' |
>>
>> There's no reason to do this with |col -b|, of course. You could do
>> something like:
>>
>> if !empty($MAN_PN)
>>     autocmd StdinReadPost * set ft=man | file $MAN_PN | call PrepManPager()
>> endif
>>
>> And |PrepManPager()| defined in some suitable place:
>>
>> function! PrepManPager()
>>     setlocal modifiable
>>     %s/.\b\(.\)/\1/g
>>     1
>>     setlocal nomodified
>>     setlocal nomodifiable
>> endfunction
>> ------------------------------------------------------------------------
>>
>> Aside:
>>
>> In the Unix & Linux post mentioned above, I'd posted my method, which
>> involves keeping the backspaces and concealing them, instead of
>> removing them. Personally, I feel the loss of functionality in
>> searching is balanced by the added syntax highlighting I can do with
>> the backspaces retained. There are manpages for which the standard
>> |syntax/man.vim| is useless, because it has no way to know what the
>> actual page would have highlighted. (Pick any C++ STL manpage, for
>> example.) If anyone's interested, here's how I use conceal for this
>> <https://github.com/murukeshm/vim-manpager/blob/master/after/syntax/man.vim>.
>>
>>
> Have you tried ManPageView?  I use the kornshell, but it should work
> with bash also:
>
> # man: {{{2
> function man
> {
> gv -c "Man $*" -c "sil! only"
> }
>
> then   man printf  brings up ManPageView in vim.  (you can get
> ManPageView from
> http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW).
>
I'd like to note that ManPageView, which can be run from within vim as
:Man, also supports help for php, perl, python, tex, and vim, as well as
the usual man pages.  One thing I like about its support for regular man
pages involves a map for <s-left> and <s-right>, supporting man pages in
different "books".  Ie.
 for printf:  man 1 printf, man 1p printf, man 3 printf, and man 3p
printf  are all on my system.  I can do a man printf (which will bring
up manpageview interpreting the manpage), then shift-rightmouse until I
get to the printf help I want.

Regards,
Chip Campbell

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui