Skip to content

Instantly share code, notes, and snippets.

@theothermattm
Created December 2, 2021 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theothermattm/715ff8652e2a936e467536ffc3d8fe6a to your computer and use it in GitHub Desktop.
Save theothermattm/715ff8652e2a936e467536ffc3d8fe6a to your computer and use it in GitHub Desktop.
Windows AutoHotKey Remap CAPSLOCK+HJKL to Vim Movement Keys
; Main Navigation
CAPSLOCK & j::MoveCursor("{DOWN}")
CAPSLOCK & l::MoveCursor("{RIGHT}")
CAPSLOCK & k::MoveCursor("{UP}")
CAPSLOCK & h::MoveCursor("{LEFT}")
; Navigation Combos
MoveCursor(key) {
shift := GetKeyState("SHIFT","P")
control := GetKeyState("CONTROL","P")
controlShift := control && shift
if controlShift {
Send, ^+%key%
}
else if shift {
Send, +%key%
}
else if control {
Send, ^%key%
}
else {
Send, %key%
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment