VIM Colemak取消重新映射问题 [英] VIM Colemak yank remapping issues
问题描述
因此,我在Mac(Colemak)上使用了备用键盘布局,并且通过这样编辑.vimrc
文件(仅两行以便获得图片)就重新映射了colemak布局的vim:
So I am using an alternate Keyboard layout on my Mac (Colemak) and I have vim remapped for colemak layout by editing the .vimrc
file as such (just two lines so that you get the picture):
noremap y o
noremap p r
... (and so on)
所以现在,在VIM中,当按Qemert布局上的 L 键(在QWERTY布局上)时,它类似于colemak上的 I ,它会按需打开插入模式.但是,当我按 y y 拉线时,它先执行 y ,然后执行 o .我现在需要将 y y 重新映射到 o 吗?
So now, in VIM when hitting the L key (on QWERTY layout) resembles I on colemak, it opens the Insert mode as it should. However, when I hit y y to yank a line, it instead executes y and then o. Do I need to remap y y to o now?
:map o yy
但这意味着在编辑模式下, o 会显示 y y ,不是吗?如果我写错了,请纠正我,并帮助我解决这个问题.
But that would mean that in editing mode an o would turn out y y, wouldn't it? Please correct me if I'm wrong and help me to solve this quirk.
推荐答案
在.vimrc
文件中的某个地方,您的y -> o
映射似乎仅适用于
It looks like somewhere in your .vimrc
file your y -> o
mapping is made to only apply for operator-pending mode, since from what you wrote your first y registers as y.
您可以通过以下几种方法解决此问题:
You can work around this in a few ways:
- 取消映射 运算符的密钥仅模式:
- Unmap the key for operator mode only:
:ounmap y
o -> yy
映射到 仅正常模式 (因此它不会影响您的编辑):
o -> yy
to only normal mode (so it won't affect your editing):
:nnoremap o yy
这篇关于VIM Colemak取消重新映射问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!