Skip to content

Instantly share code, notes, and snippets.

@farzher
Last active August 30, 2017 21:38
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 farzher/4513450 to your computer and use it in GitHub Desktop.
Save farzher/4513450 to your computer and use it in GitHub Desktop.
Colemak For Developers
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment