带 Emacs 或 VIM 的 Colemak 键盘

发布于 2024-07-08 01:19:42 字数 1477 浏览 16 评论 0原文

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

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

发布评论

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

评论(8

场罚期间 2024-07-15 01:19:42

我使用的设置与 Graham 类似(上、下、左、右,是 hkjl (Qwerty hnyu))但不使用 noremap,而是在我的 .vimrc 中使用 langmap 重新映射:

set langmap=hk,jh,kj

这具有更改使用这些移动键(例如 g、z 和 Cw)的其他命令的额外优点,而无需手动重新定义所有这些命令,即 C-wh 移动向上移动一个窗口,C-wk 向下移动一个窗口,等等。

I'm using a similar set up to Graham (up, down, left, right, is hkjl (Qwerty hnyu)) but instead of using noremap, remap using langmap in my .vimrc:

set langmap=hk,jh,kj

This has the added advantage of changing other commands that use these movement keys (e.g. g, z and C-w) without having to redefine all these commands manually, i.e. C-wh moves up a window, C-wk moves down a window, etc.

送你一个梦 2024-07-15 01:19:42

我最近切换到 Colemak,并且还使用 Vim 作为我的主要编辑器。

我可以告诉你,无需重新映射移动键 - 或任何其他 Vim 键。 您的大脑将快速学习移动键的新位置。 对于助记键,绝对不需要重新映射 - 您希望将助记键含义保留在按键后面。

如果您重新映射 Vim 移动键,您将处于无法以任何实际效率操作普通 Vim 的不幸境地 - 例如,如果您需要 SSH 到服务器。 我认为,对于大多数人来说,这比必须使用没有安装 Colemak 的计算机要常见得多。

同样,有一天你可能会得到一些 Vim 插件,它们会与你的重新映射发生冲突,或者有一天你会读到一篇关于某项功能的 Vim 提示,但你现在无法使用该功能,因为你已经重新映射了一些东西。

这对你来说真的很痛苦,所以我不会费心进行任何重新映射。

I have recently switched to Colemak and I also use Vim as my main editor.

I can tell you that there is no need to remap the movement keys - or any other Vim keys for that matter. Your brain will quickly learn the new positions of the movement keys. For the mnemonic keys there is definitely no need to remap - you want to keep the mnemonic meanings behind the keys.

If you remap the Vim movement keys you will be in the unfortunate position of not being able to operate a vanilla Vim with any real efficiency - for example if you need to SSH to a server. I argue that for most people that will be much more common than having to use someone's computer that does not have Colemak.

As well, there are Vim plugins you may get one day that will clash with your remappings, or you will read a Vim tip one day about a feature which you can't now use because you have remapped things.

It will be a real pain for you, so I wouldn't bother with any remappings.

七堇年 2024-07-15 01:19:42

很高兴看到另一个 Colemak 用户 :)

对于 Emacs 来说,确实不需要重新映射,因为最初的“快捷方式”并不是设计为彼此靠近的。 如果有什么不同的话,那就是在 Colemak 上使用 Emacs 会比在 Qwerty 上使用更舒服(至少我是这样)。

在 Vim 中,这要棘手得多,因为 hjkl 会完全混乱。 话又说回来,我一直觉得hlkl坏了,应该改成jkj; 或 ijkl,因此重新映射可能是一件好事。 以下是 Colemak 论坛上有关 Colemak+Vim 的更广泛讨论:http://forum.colemak。 com/viewtopic.php?id=50

Glad to see another Colemak user :)

For Emacs there really isn't a need to remap, since the initial "shortcuts" aren't designed to be close to each other. If anything, you're gonna be more comfortable using Emacs on Colemak than on Qwerty (at least I was).

In Vim it's a lot trickier since hjkl will be completely messed-up. Then again, I've always felt that hlkl was broken and should have instead been jkj; or ijkl, so a remap is probably a good thing. Here's a broader discussion about Colemak+Vim on the Colemak forum: http://forum.colemak.com/viewtopic.php?id=50

記憶穿過時間隧道 2024-07-15 01:19:42

.vimrc 中的这将更改 Colemak 的光标移动,而不会影响其他 vim 映射,因为它只影响 h/j/k 字母。

  • 上 = h(在键盘上标记为“h”)
  • 下 = k(在键盘上标记为“n”)
  • 左 = j(在键盘上标记为“y”)
  • 右 = l(在键盘上标记为“u”)键盘)

这是映射:

noremap h k
noremap j h
noremap k j

This in your .vimrc will change the cursor movement for Colemak without affecting other vim mappings, because it only affects the h/j/k letters.

  • up = h (labelled as "h" on the keyboard)
  • down = k (labelled as "n" on the keyboard)
  • left = j (labelled as "y" on the keyboard)
  • right = l (labelled as "u" on the keyboard)

Here is the mapping:

noremap h k
noremap j h
noremap k j
拿命拼未来 2024-07-15 01:19:42

我已经使用德沃夏克很多年了(大概 4 年)。 我还使用 vim 来实现您必须使用 vim 之类的所有标准原因(更少,有自己的编辑器(visudo 等)等的配置编辑)。 Emacs 实际上是我学到的第一个 Unix 程序(我是苹果世界的本地人),在受到 Yegge 的漫无边际的批评后,我现在又重新拾起了它,因为它是多么棒。

从严格的键盘布局角度来看,我认为 Emacs 可能是赢家,因为不需要重新映射。 除了将 Caps-Lock 键换成 Control 键(确实应该这样做,Caps-Lock 键就像每个键盘的高中吻痕)之外,我想说的是,每个键绑定在 Dvorak 上使用都比在 Dvorak 上使用更舒服Qwerty。 我特别发现经常使用的 Cx 和 Mx 绑定打字起来非常舒服。

不过vim确实没什么大不了的。 “j”和“k”仍然相邻。 “h”和“l”至少在一方面很方便,并且位于主行的上方。 除此之外,这只是重新映射您头脑中的按键,以便在编辑器中执行您希望发生的操作。 我个人认为没有任何理由重新映射任何东西,而且我面临 RSI 的高风险(因此转向德沃夏克)。 对于像 vim 和 emacs 这样以键盘为中心的应用程序,我可以在不改变的情况下舒适地使用它们,这应该是相当令人印象深刻的。 :)

祝你好运!

I've run with Dvorak for a number of years now (probably ~4). I have also used vim for all of the standard reasons you have to use vim like things (less, config edits that have their own editors (visudo, etc.), etc.). Emacs was actually the first Unix program that I learned (I'm a native to the Apple world) and I currently picked it back up after being castigated by Yegge's ramblings about how ridiculously awesome it is.

From a strictly keyboard layout stance, I would say that Emacs is probably the winner here because no remapping is required. Other than swapping the Caps-Lock key for a Control key (which should really be done period, the Caps-Lock key is like every keyboard's high-school hickey), I would say that every keybinding is more comfortable to use with Dvorak than with Qwerty. I especially find the constantly used C-x and M-x bindings to be very comfortable to type.

However, vim is really no big deal. 'j' and 'k' are still right next to each other. 'h' and 'l' are at least conveniently on one hand and are on and above the home row. Other than that, it's simply about remapping the keys in your mind for doing things in the editor that you want to hae happen. I personally don't see any reason to remap anything, and I'm high risk for RSI (hence the switch to Dvorak). For keyboard centric apps like vim and emacs, the fact that I can use them comfortably unaltered should be fairly impressive. :)

Good luck!

心的位置 2024-07-15 01:19:42

我正在使用 Ryan Heise 的 Vim 解决方案:

我想出了“NEST”导航绑定,它保留了物理
向上/向下导航的位置
键(左/右不同,但
仍在主排):

N = 向下 E = 向上 S = 向左 T = 向右

用于设置此功能的命令是
在我的 Colemak 页面底部:

http://www.ryanheise.com/colemak/

大多数情况下,这些绑定允许您
使用常规的 vim 备忘单来学习
命令,除了导航
当然。

在 NEST 中分配的 4 个键中,
“N”(“n”扩展搜索结果)和“E”
(移动当前单词的“e”nd)是
频繁但吞噬。 我重新映射
他们回到原来的 QWERTY
位置,所以他们是唯一的两个
没有它们的命令
原始逻辑名称。

取自 https://forum.colemak.com/topic/50 -colemak-vim/p2/#p2514

I'm using Ryan Heise's solution for Vim:

I came up with the "NEST" navigation bindings which preserve the physical
location of the up/down navigation
keys (left/right are different but
still on the home row):

N = down E = up S = left T = right

The commands for setting this up are
on my Colemak page at the bottom:

http://www.ryanheise.com/colemak/

Mostly, these bindings allow you to
use a regular vim cheat sheet to learn
the commands, except for navigation of
course.

Of the 4 keys assigned in N-E-S-T, the
"N" ("n"ext search result) and "E"
(move "e"nd of current word) were
frequent but gobbled up. I remapped
them back to their original QWERTY
positions and so they are the only two
commands that don't have their
original logical names.

Taken from https://forum.colemak.com/topic/50-colemak-vim/p2/#p2514

水染的天色ゝ 2024-07-15 01:19:42

我是 vim+qwerty 用户(我尝试过学习 dvorak,但事实证明打字速度不是我的速度限制因素,而且我没有 RSI 问题)。 vi(m) 中只有 hjkl 光标移动键与位置相关,其他所有键都是助记符。 我在 Colemak 布局上看到,h/l 模糊地位于左/右,但 j/k 位于下/上。 尽管如此,我怀疑这会成为一个重大的绊脚石。 您可以使用箭头键代替,或者继续使用 hjkl 并处理有趣的位置。

我不会倾向于尝试根据键盘布局重新映射 vim 功能。 这对我来说似乎有太多潜在的困惑。

I'm a vim+qwerty user (I've tried learning dvorak, but it turns out typing speed is not my rate limiting factor and I don't have RSI issues). Only the hjkl cursor movement keys in vi(m) are position dependent, everything else is mnemonic. I see on the Colemak layout, that h/l are vaguely left/right, but j/k are down/up. Nevertheless, I doubt that would be a significant stumbling block. You could either use the arrow keys instead, or continue to use hjkl and deal with the funny positions.

I wouldn't be inclined to try to remap the vim functions depending on the keyboard layout. That seems like too much potential confusion for me.

鯉魚旗 2024-07-15 01:19:42

这是上一篇文章,应该会对您有所帮助。 那里有一些讨论,一些用户不重新映射。 有些是这样的。

实际上我要在周末重新映射。 去年我使用了 Dvorak 的默认映射。

Here is a previous post that should help you some. There is some discussion on there, some users don't remap. Some do.

I am going to remap over the weekend actually. I have for the past year used the default mappings, with Dvorak.

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