可映射模式下的字符挂起命令

Character pending commands in mappable mode

如果 imap ab c,那么我希望击键 rab 将光标下的字符更改为 c,就像在 替换模式 [=23= 中所做的那样] (R).

tf 等其他字符挂起命令相同。

我该怎么做?

:help r 解释了如何做到这一点:

{char} can be entered as a digraph. :lmap mappings apply to {char}. The CTRL-^ command in Insert mode can be used to switch this on/off.

所以,一种方法是通过 digraphs:

:digraph ab 99

或通过 :lmap,但您必须先通过 <C-^> 启用语言映射。

:lnoremap ab c