在vim-airline中,如何在操作员待定模式下显示重新映射的密钥而不是原始密钥?

时间:2019-10-17 10:21:35

标签: vim vim-airline

我在一年前发现了Vim,而且我对它越来越上瘾了。

我重新映射了我的法式dvorak式bépo布局的每个键,以坚持普通模式下的qwerty布局,如本页“重新配置总体”中所述:https://bepo.fr/wiki/Vim,主要是因为我从中学到了Vim Adventures游戏。

效果很好:

例如,yr重映射为cl:该命令将字符向右剪切并进入插入模式。

但是,在显示c之前,vim状态行显示y一秒钟:

y displayed instead of c in nvim status line

我从以下位置更改了映射:

noremap y c

对此:

map <nowait> y c

没有成功。

任何人都知道是否可以立即显示重新映射的操作员待处理键,即在我的情况下为“ c”吗?

2 个答案:

答案 0 :(得分:2)

这与vim-airline或任何其他插件无关。

由于const response = { ...users, total, } 标准选项,显示了挂起的运算符。 AFAIK,除了完全禁用(const response = { data: users, total: total, } return res.json(response).status(200); 或修补Vim的源代码外,无法更改它。

答案 1 :(得分:1)

代替重新映射每个键组合,一个更简单的解决方案是使用langmap。这为显示重新映射的命令键提供了额外的好处。

来自:h langmap

This option allows switching your keyboard into a special language
mode.  When you are typing text in Insert mode the characters are
inserted directly.  When in Normal mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key.  This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.

要测试:

:set langmap=éw在正常模式下将é重新映射为w

:set showcmd在状态行中显示w而不是é

相关问题