如何重新映射键盘键以避免VIM中的RSI [英] How to remap keyboard keys to avoid RSI in VIM

查看:125
本文介绍了如何重新映射键盘键以避免VIM中的RSI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这不会纯粹出于引发对话的目的而发生.

我大量使用vim(每天5-10个小时),并且我发现我的左手腕是第一个开始疼痛的人.标准键盘布局(请参见下图)几乎可以确保您患有关节炎.

I use vim a great deal (5-10 hours a day) and I noticed my left wrist is the first to start aching. The standard keyboard layout (see image below) is almost guaranteed to give you arthritis.

当前,我已重新映射

  • Ctrl Shift
  • Shift Caps Lock
  • 大写锁定 Ctrl
  • Ctrl to Shift
  • Shift to Caps Lock
  • Caps Lock to Ctrl

帮助使用常见命令,例如 Ctrl f Shift 2 ( @ ),但是我仍然必须扭动手腕才能获得这些组合.无论如何,有没有重新映射按键的方式,以避免这种扭曲在左手腕上发生(也许使用 Tab 按键)?我只是觉得奇怪的是,对于专门为程序员设计的文本编辑器,它会大量使用这些烦人的键.我已经考虑过重新映射到旧的键盘布局(请参见下图),但是我不想知道它是否会遇到与当前重新映射相同的基本问题.

This helps with common commands such as Ctrlf or Shift2 (@), but I still have to twist my wrist to get at those combinations. Is there anyway to remap the keys so as to avoid this twisting on the left wrist (maybe use the Tab key)? I just find it odd that for a text editor designed specifically for programmers, it would make heavy use of these out of the way keys. I have considered remapping to the old keyboard layout (see below image), but I don't want to learn that if it is going to have the same fundamental problems as my current remapping.

推荐答案

注意:我不是医生,而是另一位手腕疼痛的打字员.


根据我的经验,只需将 Caps 映射到 Ctrl (或者如果您必须拥有 Caps ),并使用 Ctrl + [代替 Esc 会产生很大的不同. Ctrl + [不需要在vim中进行其他映射,因为它等效于 Esc .如果您可以教自己这个小改变,那么考虑到在vim中使用 Esc 的频率时,您的动作就会大大减少.

Note: I am not a doctor, just another typist that suffered from wrist pain.


In my experience, just mapping Caps to Ctrl (or swapping the two if you must have a Caps) and using Ctrl+[ instead of Esc make a big difference. Ctrl+[ does not require an additional mapping in vim as it is equivalent to Esc. If you can teach yourself this small change you reduce your movement by a great deal when you consider how often you use Esc in vim.

Caps Ctrl 的映射无法在vim内完成,因此必须在系统范围内进行,但是必须具有 Ctrl 在更方便的位置也将对使用 Ctrl 组合的其他应用程序有所帮​​助.根据所使用的操作系统,有不同的重新映射键的方法.一些常见的选项是:

The Caps to Ctrl mapping can't be done inside vim and will have to be made system-wide, however, having Ctrl in the more convenient location will also help in other applications that use Ctrl combinations. There are different methods of remapping keys depending on which OS you're using. A few common options are:

  • xmodmap (GNU/Linux)
  • KeyRemap4Macbook (OSX)
  • KeyTweak (Windows)

尽管这可能会改善您的处境,但如果您仍然感到疼痛,则应该考虑去看医生和/或购买设计更符合人体工程学的键盘.我拥有旧版本的 Kinesis Advantage ,我在Ebay上以大约100美元(美元)的价格购买了该版本),我再也不会开心了.可以直接在键盘上对按键进行编程,因此不需要软件来交换按键或为经常使用的按键创建自己的键盘宏.

While this will probably improve your situation you really should consider seeing a doctor and/or purchasing a more ergonomically designed keyboard if your pain persists. I own an older version of the Kinesis Advantage that I picked up used on Ebay for about $100 (USD) and I couldn't be happier. The keys can be programmed directly on the keyboard so no software is needed to swap keys or create your own keyboard macros for frequently used key strokes.

我在您的帖子中看到您还提到了 Ctrl + f Shift + 2 之类的组合要求您扭动手腕才能按一下.在我看来,您只使用键盘左侧的 Ctrl Shift 键.您实际上应该同时使用这两组键,无论您要修改的键在哪一边.那会否定手腕的运动.

I see in your post you also mention combinations like Ctrl+f and Shift+2 requiring you to twist your wrist to press. It sounds to me like you're only using the Ctrl and Shift keys on the left side of your keyboard. You should really be using both sets of these keys, using whichever one is on the opposite hand of the key you're modifying. That would negate this wrist movement.

这篇关于如何重新映射键盘键以避免VIM中的RSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆