Skip to content

Instantly share code, notes, and snippets.

@andreyka26-git
Last active February 2, 2026 01:42
Show Gist options
  • Select an option

  • Save andreyka26-git/6ea6aac06fee02825637f524131a9fee to your computer and use it in GitHub Desktop.

Select an option

Save andreyka26-git/6ea6aac06fee02825637f524131a9fee to your computer and use it in GitHub Desktop.
VimMode for Windows via AutoHotkey
#Requires AutoHotkey v2.0
SetCapsLockState "AlwaysOff"
; --- CAPS LOCK MODIFIER LOGIC ---
*CapsLock::return
*CapsLock up:: {
if (A_PriorKey = "CapsLock") {
Send "{Esc}"
}
}
; --- VIM MOTIONS (With Selection Support) ---
; The "*" allows Shift, Ctrl, etc. to be held while pressing these keys
#HotIf GetKeyState("CapsLock", "P")
*h::Send "{Blind}{Left}"
*j::Send "{Blind}{Down}"
*k::Send "{Blind}{Up}"
*l::Send "{Blind}{Right}"
*u::Send "{Blind}{PgUp}"
*d::Send "{Blind}{PgDn}"
*w::Send "{Blind}^{Right}"
*b::Send "{Blind}^{Left}"
*4::Send "{Blind}{End}"
*-::Send "{Blind}{Home}"
#HotIf
; --- RIGHT ALT MOTIONS ---
>!h::Send "{Blind}{Left}"
>!j::Send "{Blind}{Down}"
>!k::Send "{Blind}{Up}"
>!l::Send "{Blind}{Right}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment