- Original message -
Hello there, I have a plug-in that relies on imappings. When ...

Could be something weird about your terminal's left arrow control
sequence (what vim sees when you type <left>). Try instead :inoremap (
()<ESC>i which will tell vim to leave insert mode -- leaving the
cursor over the ")" -- and then re-enter insert mode. See? The arrow
keys are bad for the vim user, even in mappings and scripts!

Also the inoremap command should be used to prevent an infinite loop
since the mapping contains the mapped key "(" - this might also be the
source of the weirdness with "." But I'm not at a computer to test
this idea. In any case, always use noremap for mapping when the
mapping contains the character being mapped. Man, are there better
terms for the two pieces of a mapping, anyone? "LHS"/"RHS" or
"Mapping"/"Mappee"? What an awkward thing to talk precisely about!

HTH

On 10/18/09, Israel Chauca F. <[email protected]> wrote:
>
> Hello there,
>
> I have a plug-in that relies on imappings. When <Left>, <Right> or
> <BS> is in the mapping, the repeat command "." repeats everything
> typed after those special keys, ignoring all the previous keys.
>
> Let's say, I have set the following mapping:
> imap ( ()<Left>
>
> If I enter insert mode and type: (123
> Vim writes: (123)
> Enter normal mode and type '.', Vim writes: 123
>
> Which kind of makes the '.' command useless when the plug-in is used.
> Is there a workaround for that?
>
> Thanks!
> Israel
> >
>

-- 
Sent from Gmail for mobile | mobile.google.com

Christopher Suter
www.grooveshark.com

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

Reply via email to