Wednesday, March 21, 2018

Questions about mapping information

I am trying to debug an issue with my plugin (µcomplete) and auto-pairs,
and I have a couple of questions about the way Vim displays information
about mappings.

I have these definitions in my vimrc:

imap <plug>MyCR <plug>(MUcompleteCR)
imap <cr> <plug>MyCR

Auto-pairs maps <cr>, too, and it tries hard not to override an existing
mapping. After loading, :verbose imap <cr> shows this:

i <CR> &@<Plug>(MUcompleteCR)<SNR>24_AutoPairsReturn
Last set from
~/.vim/pack/bundle/start/auto-pairs/plugin/auto-pairs.vim


i <CR> <Plug>MyCR
Last set from ~/.vim/vimrc

I think auto-pairs expands the current mapping and appends its own
definition.

First question: why are there two definitions instead of one? I.e., why
is the mapping from my vimrc shown at all?

Second question: what does &@ mean in the first definition?

For the record, the issue is that, with those definitions in place,
when I type <cr>, Vim inserts <plug>(MUcompleteCR) literally in the
buffer, although that plug exists.

Thanks,
Life.

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