Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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