How to map esc to caps lock in vim?
PHPz
PHPz 2017-05-16 16:42:27
0
4
1177

Actually, I mainly don’t know how to express the cap key. For example, esc is <ESC>

PHPz
PHPz

学习是最好的投资!

reply all(4)
滿天的星座

I searched around and came back, but there is no way to express Caps Lock (see link below):

http://stackoverflow.com/questions/21...

You can choose the method provided on the page

滿天的星座

Usually, you need to re-modify the keyboard mapping in the system, or you can buy a HHKB

洪涛

Because vim can’t capture CapsLock~
Generally speaking, this exchange is at the OS level
Under Windows, use remapkey and GUI drag and drop. The backend will automatically change the registry. Once the changes are completed, log out and it will take effect
Under linux, use the configuration file by changing the xmodmap command. And xmodmap is not valid under the Linux text interface (tty1-6)... I heard that the kernel mapping needs to be changed, but I don't know.

阿神

用AutoHotkey,脚本如下:

classname = ""
keystate = ""

*Capslock::
WinGetClass, classname, A
if (classname = "Vim")
{
SetCapsLockState, Off
Send, {ESC}
}
else
{
GetKeyState, keystate, CapsLock, T
if (keystate = "D")
SetCapsLockState, Off
else
SetCapsLockState, On
return
}
return

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template