Created
November 12, 2012 13:57
-
-
Save branquito/4059537 to your computer and use it in GitHub Desktop.
#VIM -- vim-caps-to-esc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AutoHotKey script which makes CAPSLOCK key function as ESC only in VIM application. Other apps remain untouched by this implementation. Very useful script :)