On Dec 4, 5:39 am, "Ajay Jain" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using putty (on Windows) to login to a linux machine.
>
> I wish to read the manpages using Vim. I have added the followig to my
> .bashrc:
>
> export PAGER="/bin/sh -c \"unset PAGER;col -b -x | view -c 'set ft=man
> nomod nolist' -c 'map q :q<CR>' -c 'map <SPACE> <C-D>' -c 'map b <C-U>'
> -c 'nmap K :Man <C-R>=expand(\\\"<cword>\\\")<CR><CR>' -\""
>
> However, I am not able to read the manpages correctly. Some characters
> are distorted etc etc. Can somebody share his tested settings, so that I
> can read these pages in the best possible way.
>
> Thanks and Regards,
> Ajay.
Here is what works for me -- just two steps:
1. Put this near the top of your ~/.vimrc on the remote host.
That's two single quotes ('') which means to reset it to empty
so Vim won't try to call itself if you follow links inside of one
man page to another:
let $PAGER=''
2. Add this to your ~/.bashrc on the remote host
(or add to whatever Bourne family shell rc file you use).
Be sure that you don't have PAGER defined anywhere else:
export PAGER="/bin/sh -c \"unset PAGER;col -b -x | \
vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' \
-c 'map <SPACE> <C-D>' -c 'map b <C-U>' \
-c 'nmap K :Man <C-R>=expand(\\\"<cword>\\\")<CR><CR>' -\""
2 Alternate: If you are a CSH weirdo then this works so-so. Put this
in your
~/.cshrc file. I have not figured out all the stupid csh quoting rules
to make all the mappings work:
setenv PAGER /bin/sh\ -c\ \"unset\ PAGER\;col\ -b\ -x\ \|\ \
vim\ -c\ \'set\ ft=man\ nomod\ nolist\'\ -\"
That makes Vim work as your default pager (what man calls for
paging).
It's pretty much like your regular Vim with a few mapping to make it
a little bit more or less like "more" or "less" pagers.
<SPACE> - scroll down half page
b - scroll up half page
q - quit the Vim pager
K - follow man page links to other man pages.
That's a capital k (shift k).
You might also want to consider using Cygwin+xterm instead of putty.
Xterm has better terminal emulation than PuTTY.
--
Noah Spurrier
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---