Closed blueyed closed 9 years ago
Not sure what's going on, I can implement the solution on #117 but, since that won't work for those using <C-C>
to leave insert mode, I'll try to find out what's going on first. Let me know if you find out anything else.
Could you try this code:
set langmap=01
imap 1 <C-R>=2<CR>
call feedkeys('i0')
I think the issue is with using the expression register in the mapping.
But matchpairs doesn't rely on <C-R>=
. I'll keep looking.
OK, it still seems to be related to using expression with imap:
set langmap=01
imap <expr>1 2
call feedkeys('i0')
Well,
set langmap=01
imap 1 2
call feedkeys('i0')
also inserts 2 here. Let me know if it also does for you.
You did not set langnoremap
, did you?
Using this, it inserts 0 for me with the last two comments/examples.
Some update:
This triggers it - anything where the rhs
is used by delimitMate - but not for the closing pairs ()
):
set langmap=a( langnoremap
call feedkeys('ia')
inserts a
, and not ()
.
Vim 7.4.542.
but not for the closing pairs (
)
):
Well, while langmap=a]
inserts a
, langmap=+]
inserts ]
though, which is where I've noticed it.
Also, langmap=ü(
does work as expected (inserting ü
in insert mode).
It looks like a bug in Vim: https://groups.google.com/d/msg/vim_dev/Ro4eRg7Nb5w/K-RfngrLLf8J I've submitted a patch there (https://github.com/blueyed/vim/compare/fix-langmap-in-insmode?expand=1).
That's great news.
I am experimenting with Vim's langmap feature, and noticed that
langmap=+]
will cause Vim to enter]
instead of+
in insert mode (the langmap is not supposed to be applied in insert mode).This only happens when delimitMate is active.
Any idea where this might come from?
It happens both with Vim and NeoVim, both built fairly recently.
The same applies to
*}
(mapping*
to}
), which inserts}
on*
. It smells like it might be related to some regexp, where*
and+
are not handled properly maybe?!