public
Last active

Colemak For Developers

  • Download Gist
colemak_developer.ahk
AutoHotkey
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Event ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode RegEx
#MaxHotkeysPerInterval 10000
 
; reload script
^!+s::Reload
; capslock is another escape
Capslock::Esc
; disable a single press of alt, so it's not so annoying
Alt::Return
; Alt+F12 used to toggle between colemak and qwerty
!F12::Suspend
; Alt+; = add semicolon to end of line
!p:: Send, {End}`;
+!p:: Send, +{End}`;
^!p:: Send, ^{End}`;
^+!p:: Send, ^+{End}`;
; Alt+, = add comma to end of line
!,:: Send, {End}`,
+!,:: Send, +{End}`,
^!,:: Send, ^{End}`,
^+!,:: Send, ^+{End}`,
; Alt+Backspace = Home
!Backspace:: Send, {Home}
+!Backspace:: Send, +{Home}
^!Backspace:: Send, ^{Home}
^+!Backspace:: Send, ^+{Home}
; Alt+Enter = End
!Enter:: Send, {End}
+!Enter:: Send, +{End}
^!Enter:: Send, ^{End}
^+!Enter:: Send, ^+{End}
; While Alt is down, remap ijkl to arrow keys
!j:: Send, {Left}
+!j:: Send, +{Left}
^!j:: Send, ^{Left}
^+!j:: Send, ^+{Left}
!i:: Send, {Up}
+!i:: Send, +{Up}
^!i:: Send, ^{Up}
^+!i:: Send, ^+{Up}
!k:: Send, {Down}
+!k:: Send, +{Down}
^!k:: Send, ^{Down}
^+!k:: Send, ^+{Down}
!l:: Send, {Right}
+!l:: Send, +{Right}
^!l:: Send, ^{Right}
^+!l:: Send, ^+{Right}
 
; test running a python script
!c::Run, python C:\Users\Farzher\Documents\GitHub\cmd\farzher.py
; super + t = open terminal
#f::run explorer "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows PowerShell\Windows PowerShell.lnk"
 
; Redefine only when the active window is a console window
#IfWinActive ahk_class ConsoleWindowClass
; Close Command Window with Ctrl+w
$^w::
WinGetTitle sTitle
If (InStr(sTitle, "-")=0) {
Send EXIT{Enter}
} else {
Send ^w
}
return
; Ctrl+up / Down to scroll command window back and forward
^Up::Send {WheelUp}
^Down::Send {WheelDown}
; Paste in command window
^V::Send !{Space}ep
#IfWinActive
 
$!RButton::
While GetKeyState("RButton","p"){ ; While it is held down
Click right
Sleep 10
}
return
 
; standard colemak
e::f
r::p
t::g
y::j
u::l
i::u
o::y
p::`;
s::r
d::s
f::t
g::d
j::n
k::e
l::i
`;::o
n::k

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.