Monday, August 28, 2017

Evoking the option for :help in a mapping

I have the customary mappings for :help,

    nmap <F1> :exec "help " . expand("<cword>")<CR>
    nmap <S-F1> :exec "help " . expand("<cWORD>")<CR>

and have been trying to develop similar do the <Tab> option on the cursor word, something like

    nmap \\ yiw:h ^R"^[

but to no avail.  Although the mapping does not terminate with a <CR>, vim treats the ^[ as if it were <CR> rather than <Tab> and goes straight to the specific help for the cursor-word.

Is it possible to have vim act on the <Tab> as it does in the command line?

--
Graham Lawrence

--
--
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: