Sunday, December 27, 2009

Re: this nmap and imap work, but the vmap does not

Ben Fritz wrote:
> On Dec 25, 9:54 pm, Bee <200...@calcentral.com> wrote:
> > visually select 4 lines
> > This vmap does NOT work. How to make it work?
> > vmap <F5> <F5>gv
> >
>
> This mapping does not (as you seem to intend) trigger the normal-mode
> mapping for <F5>, because it never leaves visual mode. Instead, it
> just continually calls itself recursively until it reaches the limit
> defined in Vim, I think by a configurable option.
>
> You probably want something like:
>
> vmap <F5> <ESC><F5>gv

Thank you, I understand what you are saying.

Adding <esc> did allow it to work, but only on the last line of the
selection.

How can the selection be passed on?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: