Skip to content

Instantly share code, notes, and snippets.

@justinschuldt
Created December 9, 2019 13:16
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 justinschuldt/23bb3db655afccdeccceb56e2f86c3bd to your computer and use it in GitHub Desktop.
Save justinschuldt/23bb3db655afccdeccceb56e2f86c3bd to your computer and use it in GitHub Desktop.
vim-like navigation with AutoHotkey
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetCapsLockState, AlwaysOff
; avoid bad state of CAPS pressed when not down
GetKeyState, state, CapsLock
if state = D
{
Suspend On
SetCapsLockState, off
Send {CapsLock Up}
}
h::
{
SendInput {Left}
return
}
j::
{
SendInput {Down}
return
}
k::
{
SendInput {Up}
return
}
l::
{
SendInput {Right}
return
}
CapsLock::Suspend Off
~*CapsLock Up::Suspend On
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment