我正在使用 colemak,因此我已经像这样重新映射了方向键
noremap n h
noremap e j
noremap i k
noremap o l
noremap h n
noremap j e
noremap k i
noremap l o
问题是视口(viewport)导航不支持这些键绑定(bind)。例如。当我按 ^w+n
时,我想将焦点转移到左侧的视口(viewport),但会打开一个新的空视口(viewport)。
如何帮助单独重新绑定(bind)所有视口(viewport)导航键?
最佳答案
这个主题在 colemak 论坛上已经被打得半死了:
- http://colemak.com/forum/viewtopic.php?id=50 (5 页,其中有 colemak 设计师的积极贡献,他(曾经)也是一位狂热的 vim 用户)。
列出了许多指向
的链接- 键盘映射
- 插件脚本
我觉得 Shai 自己的脚本走得太远了 - 所做的不仅仅是将 Colemak 集成到 vim 中(例如将 C-w 重新映射到关闭选项卡,显示出对面向选项卡的编辑器的一些偏见,人们提示内/独占 Action ( diw、daB 等)不再工作等)。
我想最好的建议是stick with the defaults,正如之前给出的那样。并执行以下操作:
Keyboard bindings for Vim
Vim is an extremely efficient text editor that I use for writing emails and editing any sort of text file. Vim's commands are all controlled from the keyboard: 'd' for delete, 'w' to move the cursor forward one word, 'dw' to delete the text moved over by 'w', '2dw' to delete two words, etc. Left/Down/Up/Right navigation is located on the QWERTY keys H/J/K/L so that the typist's hands never need to reach for arrow keys or the mouse.
Unfortunately, these navigation keys are not so intuitive under Colemak and so I needed to find some more appropriate mappings. After experimenting with many alternatives, here is what I finally decided on and am very happy with:
noremap n j|noremap <C-w>n <C-w>j|noremap <C-w><C-n> <C-w>j noremap e k|noremap <C-w>e <C-w>k|noremap <C-w><C-e> <C-w>k noremap s h noremap t l noremap f e noremap k n noremap K N noremap U <C-r>
关于vim - 视口(viewport)导航不支持 vim 方向键的重新映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8544246/