Skip to content

Instantly share code, notes, and snippets.

@branquito
Created November 12, 2012 13:57
Show Gist options
  • Save branquito/4059537 to your computer and use it in GitHub Desktop.
Save branquito/4059537 to your computer and use it in GitHub Desktop.
#VIM -- vim-caps-to-esc
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
@branquito
Copy link
Author

AutoHotKey script which makes CAPSLOCK key function as ESC only in VIM application. Other apps remain untouched by this implementation. Very useful script :)

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