vim - 视口(viewport)导航不支持 vim 方向键的重新映射

标签 vim viewport keymapping colemak

我正在使用 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 论坛上已经被打得半死了:

列出了许多指向

的链接
  • 键盘映射
  • 插件脚本

我觉得 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/

相关文章:

vim - 如何在 Vim 中不进入插入模式的情况下在光标所在位置插入换行符?

c++ - Vim 中突出显示的类和函数名

vim - 如何在vim中编辑现有的键映射?

three.js - 是否可以在 Threejs 中勾勒出 View 端口?

visual-studio-2010 - 如何覆盖 Visual Studio 的菜单加速器快捷方式?

emacs - 如何在 Emacs 次要模式下重新绑定(bind) TAB 和 RET?

vim - 为什么离开插入模式会将光标位置向左移动

c++ - 在 C++ 中使用 ctags 查找用构造函数声明的变量

javascript - 当 float 元素在视口(viewport)之外时,如何获取它的左偏移量?

html - iOS 7 中的视口(viewport)单位错误