Eliminating lag when remapping 'd' key in VIM

筅森魡賤 提交于 2019-12-10 18:35:41

问题


I use a Dvorak keyboard layout, and so I've made a few adjustments to the default VIM mappings-- one change I've made is to remap the right-side home row keys to

noremap d h
noremap h j
noremap t k
noremap n l

So that movement keys are conveniently positioned, as they would be for a QWERTY user. h, t, and n do their job fine and are very responsive. d, however, lags for a moment before moving left the way its supposed to. I think this is because there are key-sequence commands that start with d (like dd for delete line), so VIM is waiting to receive the second stroke in the sequence before executing the command for just a single 'd'. I've remapped dd:

noremap dd hh

But this isn't doing the trick. Yet commands for things like d3w or d$ (text objects after d) aren't working (after remapping d), so they couldn't be causing the issue. Anyone know how to get rid of the lag? BTW, even after disabling all plugins I have the same issues. I also have no other mappings with d in my vimrc.


回答1:


AFAIK, d, c and their "operator pending" friends are not really mappings. This means that you can't :unmap d. The delay you experience can't really be avoided without side effects, I believe.

You might want to play with :h timeout and :h timeoutlen.

For what it's worth, the alternative layouts/Vim story is… complicated. And not settled at all.



来源:https://stackoverflow.com/questions/12322998/eliminating-lag-when-remapping-d-key-in-vim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!