Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim ESC 键的解决方案 #54

Open
lei4519 opened this issue Mar 25, 2024 · 0 comments
Open

Vim ESC 键的解决方案 #54

lei4519 opened this issue Mar 25, 2024 · 0 comments

Comments

@lei4519
Copy link
Owner

lei4519 commented Mar 25, 2024

2024-03-25

esc 键的便利性直接决定了 vim 的使用体验,多数的解决方案是将 caps lock 映射为 esc,或者使用 jj / jk 等方案

我的方案是将 command(Mac) 单击时映射为 esc 键,组合时仍然是原始功能

思路是:ctrl / alt / command / shift 正常情况下都是组合使用的,单独点击是无意义的,所以通过映射将单击行为利用起来

Mac

使用 karabiner-elementscomplex_modifications 功能进行如下配置

{  
  "profiles": [  
    {  
      "complex_modifications": {  
        "rules": [  
          {  
            "description": "Alone Command to Esc",  
            "manipulators": [  
              {  
                "from": {  
                  "key_code": "left_gui",  
                  "modifiers": {  
                    "optional": ["any"]  
                  }  
                },  
                "to": [  
                  {  
                    "key_code": "left_gui",  
                    "lazy": true  
                  }  
                ],  
                "to_if_alone": [  
                  {  
                    "key_code": "escape"  
                  }  
                ],  
                "type": "basic"  
              }  
            ]  
          }  
        ]  
      }  
    }  
  ]  
}  

Linux

参考 Arch Linux 系统配置篇 > 按键映射,或者使用 xcape

Windows

可以使用 Capsicain 实现,但是我用了这个之后老是出现按键延迟、粘连的现象

这也是弃用 Windows 的一大原因

AHK 也可以实现,但是我自己没玩明白

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant