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.
*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
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