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

发布于 2024-12-21 19:43:25 字数 266 浏览 2 评论 0原文

我正在使用 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

。问题是视口导航不支持这些键绑定。例如。当我按 ^w+n 时,我想将焦点转移到左侧的视口,但会打开一个新的空视口。

如何帮助单独重新绑定所有视口导航键?

I am using colemak and thus I have remapped my direction keys like so

noremap n h
noremap e j
noremap i k
noremap o l

noremap h n
noremap j e
noremap k i
noremap l o

The problem is that these keybindings are not honored by the viewport navigation. Eg. when I press ^w+n I want to shift focus to the viewport to the left but instead a new empty viewport is opened.

How can I help rebinding all the viewport navigation keys individually?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心作怪 2024-12-28 19:43:25

这个主题在 colemak 论坛上已经被彻底打死了:

有许多指向

  • 键盘映射
  • 插件脚本

的链接,我觉得 Shai 自己的脚本走得太远了 - 所做的不仅仅是将 Colemak 集成到 vim 中(将 Cw 重新映射到关闭选项卡,例如,显示出对面向选项卡的编辑器的一些偏见,人们已经抱怨内部/排他性动议(diw、daB 等)不再起作用等)。

我想最好的建议,正如之前给出的那样,是坚持使用默认值并执行以下操作:

Vim 的键盘绑定

Vim 是一个非常高效的文本编辑器,我用它来编写电子邮件和
编辑任何类型的文本文件。 Vim 的命令全部由
键盘:“d”为删除,“w”为光标向前移动一个单词,“dw”为
删除“w”移动的文本,“2dw”删除两个单词等。
左/下/上/右导航位于 QWERTY 键 H/J/K/L 上,以便
打字员的手永远不需要接触箭头键或鼠标。

不幸的是,这些导航键在 Colemak 和
所以我需要找到一些更合适的映射。尝试后
有很多选择,这是我最终决定并且非常满意的:

noremap nj|noremap n j|noremap ; j
noremap ek|noremap e k|noremap ; k
诺雷图SH
诺雷图TL

诺雷图菲
诺地图 kn
正向图 KN
noremap U

This subject has been somewhat beaten to death over at the colemak forums:

There are a number of listed links to

  • keymaps
  • plugin scripts

I feel Shai's own script is going way too far - doing way more than just integrate Colemak into vim (remapping C-w to Close Tab e.g., showing some bias towards tab-oriented editors, people have complained about in-/exclusive motions (diw, daB etc) not working any more etc).

I guess the best advice, as has been given before is to stick with the defaults and do:

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>
永不分离 2024-12-28 19:43:25

我认为您必须通过执行以下操作来显式映射 窗口导航命令:

noremap <C-W>n <C-W>h
noremap <C-W>e <C-W>j
noremap <C-W>i <C-W>k
noremap <C-W>o <C-W>l

noremap <C-W>h <C-W>n
noremap <C-W>j <C-W>e
noremap <C-W>k <C-W>i
noremap <C-W>l <C-W>o

I think you'll have to map the <C-W> window navigation commands explicitly, by doing something like:

noremap <C-W>n <C-W>h
noremap <C-W>e <C-W>j
noremap <C-W>i <C-W>k
noremap <C-W>o <C-W>l

noremap <C-W>h <C-W>n
noremap <C-W>j <C-W>e
noremap <C-W>k <C-W>i
noremap <C-W>l <C-W>o
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文