Skip to content

Instantly share code, notes, and snippets.

@samvv
Last active December 23, 2023 17:23
Show Gist options
  • Save samvv/ec705a91ba44c1d027517bf644499425 to your computer and use it in GitHub Desktop.
Save samvv/ec705a91ba44c1d027517bf644499425 to your computer and use it in GitHub Desktop.
Make control a secondary escape-key on Windows using AutoHotKey
; New version based on author fwompner gmail com in the Vim wiki
; https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_Windows#AutoHotkey
#Requires AutoHotkey v2.0
#SingleInstance
SetCapsLockState "AlwaysOff"
*Capslock::
{
Send "{LControl Down}"
KeyWait "CapsLock"
Send "{LControl Up}"
if ( A_PriorKey = "CapsLock" )
{
Send "{Esc}"
}
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment