Vim 用户,你们的右手放在哪里?

发布于 2024-11-24 12:27:07 字数 1431 浏览 3 评论 0原文

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

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

发布评论

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

评论(5

鹤仙姿 2024-12-01 12:27:07

我认为jkl;实际上是vi更合适的用法。首先,hl 确实没有那么重要。 web 对于水平导航更加有用。额外的好处是,如果语言需要的话,; 很容易获得。将较弱的手指放在 k 上会很痛,并且您不需要将最强的手指放在 h 上,而应该放在 j 上,因为可能是四个中最常用的。

I think that jkl; is actually the more appropriate usage for vi. For one, h and l really don't matter that much. w, e, and b are significantly more useful for horizontal navigation. As a bonus, ; is easy to get at if the language requires it. Having a weaker finger on k hurts, and you don't need your strongest finger on the h, when it should be on the j which is probably the most used of the four.

生死何惧 2024-12-01 12:27:07

前两个解决方案都不是 100% 令人满意 我提出第三种方法,一种结合了两全其美的方法

我的建议:“下-上-左-右”

保持上/下在原处,然后进行第三个和第三个。第四根手指 & right

然后,为了避免覆盖基本的 Vim 功能:将 ; 上以前的内容扔到现在空的 h 按钮上

作为一个可爱的奖励, “l”键现在代表“”;)

noremap l h
诺地图;我
诺地图 h ;


The previous "runners-up", who both use "left-down-up-right" layout:


选择 1:“hjkl”

@alternative 的推荐。键绑定保持默认 (hjkl),右手 保持在主行 (jkl;)

  • 优点:
    • j(向下)k(向上) 留在您的主要 2 个手指上,它们应该放在适当的位置
  • 缺点:
    • 您必须伸手h(向左)。即使这不像 w,e,b 那样使用,它仍然是一个该死的箭头按钮,如果放在主行上就好了
    • 基本上:所有 4 个手指都不会自然地放在箭头按钮上。这让我的手感到困惑

选择2:“jkl;”

将这 4 个绑定滑到 1 上,以便它们位于主行:

诺地图;我
noremap l k
noremap k j
noremap jh

  • 优点:
    • 没有手指混乱;所有的箭头自然地在手指下方
  • 缺点:
    • 正如 @alternative 所说,向上/向下位于第二根和第三根手指上是非常“非最佳”的
    • 同样,最强的手指在左边也是一种浪费

Intro

Neither of the previous 2 solutions was 100% satisfactory. I propose a 3rd way, one that combines the best of both worlds

My Recomendation: "down-up-left-right"

Keep up/down where they are, then make 3rd & 4th fingers left & right

Then, to avoid overwriting base Vim features: Toss whatever used to be on ; to the now-empty h button

As a cute bonus, the "l" key now stands for "left" ;)

noremap l h
noremap ; l
noremap h ;


The previous "runners-up", who both use "left-down-up-right" layout:


Choice 1: "hjkl"

@alternative's recommendation. Keybinds stay default (hjkl), right hand stays on home row (jkl;)

  • pros:
    • j (down) and k (up) stay on your primary 2 fingers, where they deserve
  • cons:
    • You have to reach over for h (left). Even if this isn't as used as w,e,b, it's still a bloody arrow button and it would be nice to have on home row
    • Basically: All 4 fingers aren't naturally resting on arrow buttons. This confuses my hand

Choice 2: "jkl;"

Slide those 4 binds over 1 so they sit on the home row:

noremap ; l
noremap l k
noremap k j
noremap j h

  • pros:
    • No finger confusion; all the arrows are under the fingers naturally
  • cons:
    • As @alternative said, up/down being on the 2nd and 3rd finger is very "non-optimal"
    • Similarly, the strongest finger being on left is also a waste
冷清清 2024-12-01 12:27:07

我以正常的盲打打字员的方式将手放在主排上。我很少使用 h 键进行移动,因为向左移动一个空格通常不是一种有效的移动方式(并且并不真正符合 Vim 的本质)。

I keep my hands on the home row, in the normal touch-typist manner. Rarely do I use the h key for movement, as moving one space to the left is not usually an efficient way to move (and does not really fit the essence of Vim).

春风十里 2024-12-01 12:27:07

据我所知, hjkl 的使用是出于历史原因(即 这就是为什么 vim 使用 hjkl 键作为方向键),这并不是基于任何人体工程学原理。

我个人更喜欢遵循 ​​i3 窗口管理器 推荐的方法,如 为什么默认配置使用jkl;而不是 hjkl? 是符合人体工程学的选择。

i3 使用 jkl; 因为这些键在盲打时构成了右手下方的“主行”。

检查 vim 重新映射 hjkljkl;

I understand, that hjkl is used for historic reasons (i.e. Here is why vim uses the hjkl keys as arrow keys) and it is not based on any ergonomic rationale.

I personally prefer to follow the approach recommended by i3 window manager which as explained in the FAQ on Why does the default config use jkl; instead of hjkl? is an ergonomic choice.

i3 uses jkl; because these keys make up the "home row" underneath your right hand when touch typing.

Check this on vim remapping the hjkl to jkl;

羁绊已千年 2024-12-01 12:27:07

虽然我理解 Vim 的理念,即在主行中提供所有运动,但我发现 hjkl 是违反直觉的。我认为一个更加理智的地图应该是一个类似于 wasd 的 ijkl 设置,

    nnoremap j h
    nnoremap k j
    nnoremap i k

我发现这非常容易自然地导航。

j:left
i:up
k:down
l:right

为了切换进入/退出插入/正常模式,我个人使用 Alt-e 因为我几乎总是使用 Gvim 并且不必担心某些终端存在 Alt 问题。

    nnoremap <A-e> i
    inoremap <A-e> <esc>l

While I understand Vim's philosophy of having all the movement available in the home row, I found hjkl to be counter intuitive. A much more saner map I thought would be a wasd-like setup with ijkl

    nnoremap j h
    nnoremap k j
    nnoremap i k

I found this to be very easy to navigate with very natrually.

j:left
i:up
k:down
l:right

For toggling in/out of insert/normal mode, I personally use Alt-e since I almost always use Gvim and not have to worry that some terminals have issues with Alt.

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