为什么将Esc重映射到Vim中的CAPS LOCK如此复杂? [英] Why is so complicated to remap Esc to CAPS LOCK in Vim?

查看:301
本文介绍了为什么将Esc重映射到Vim中的CAPS LOCK如此复杂?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了vim Wiki提示,它说,要将Esc重新映射到CAPS LOCK,必须编辑以下Windows代码:

I saw the vim wiki tips and it says that in order to remap Esc to CAPS LOCK you have to edit the following windows code:

REGEDIT4
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00

是否可以通过仅在_vimrc中添加或修改行来将Esc重新映射到CAPS LOCK?

Is it possible to remap Esc to CAPS LOCK by only adding or modifying lines in the _vimrc?

推荐答案

我建议您为此使用AutoHotkey.

I recommend that you use AutoHotkey for this.

您可以更改每个应用程序的热键:

You can do a per-application hotkey change:

SetTitleMatchMode,2
#IfWinActive,VIM
   CAPSLOCK::ESC
return

#IfWinActive
   CAPSLOCK::CTRL
return

例如,此脚本将大写字母设置为在vim中转义,并控制其他地方.

This script, for example sets caps to escape in vim, and control everywhere else.

这篇关于为什么将Esc重映射到Vim中的CAPS LOCK如此复杂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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