Monday, November 16, 2015

Re: How to pass the word under curor as the para to the command

imlegendlzz@gmail.com wrote:
> command! -nargs=1 -bar Pyhelp :call ShowPydoc(<f-args>)
> nnoremap <buffer> <silent> K :exe ":Pyhelp expand('<cword>')"
>
> I define a ShowPydoc func,
>
> If you type ":Pyhelp xxx"
>
> you will get the help of xxx.
>
> Now I want to map the K to the that if I move the curor on the word that I want to get the helpdoc.
>
> But expand('<cword>') here can't get the word under curor and pass the "expand(<'cword'>)" to the func.
>
> And I try :echo expand(<'cword'>) it worked,
>
You could use :ManPageView for this, you know; it does the "k" map for
python already.

Manpageview is available at:

http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW (cutting
edge)
http://vim.sourceforge.net/scripts/script.php?script_id=489 (stable)

Installation is simple:

vim manpageview.vba.gz
:so %
:q

Regards,
Chip Campbell

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: