Skip to content

Instantly share code, notes, and snippets.

@ezekg
Created October 22, 2024 20:11
Show Gist options
  • Save ezekg/7a9c776ba36835601ad1de2ff4081328 to your computer and use it in GitHub Desktop.
Save ezekg/7a9c776ba36835601ad1de2ff4081328 to your computer and use it in GitHub Desktop.
AutoHotKey script to help ease the pain of switching from macOS to Windows
#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.
; Docs:
; https://autohotkey.com/docs/Hotkeys.htm
; https://autohotkey.com/docs/KeyList.htm
; Ref https://autohotkey.com/board/topic/60675-osx-style-command-keys-in-windows/
; You need to disable "Between input languages" shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys
; Universal shotcuts
$!x::Send ^x
$!c::Send ^c
$^+c::Send ^\ ; sigquit
$!+c::Send ^\ ; sigquit
$!v::Send ^+v ; ^v
$!s::Send ^s
$!a::Send ^a
$!z::Send ^z
$!+z::Send ^y
$!w::Send ^w
$!f::Send ^f
$!+f::Send ^+f
$!+e::Send ^+e ; vscode explorer shortcut
$!n::Send ^n
$!q::Send !{f4}
$!r::Send ^{f5}
$!m::Send {LWin Down}{Down}{LWin Up}
$!`::Send {Alt Down}{Shift Down}{Tab}{Shift Up}
$!/::Send ^/ ; comment
$!=::Send ^{=} ; zoom in
$!-::Send ^- ; zoom out
$!Space::Send #. ; emoji keyboard
; Quick Switch Tab shotcuts
$!1::Send ^1
$!2::Send ^2
$!3::Send ^3
$!4::Send ^4
$!5::Send ^5
$!6::Send ^6
$!7::Send ^7
$!8::Send ^8
$!9::Send ^9
$!0::Send ^0
; Chrome shotcuts
$!t::Send ^t
$!+t::Send ^+t
$!+]::Send {Ctrl Down}{Tab Down}{Tab Up}{Ctrl Up}
$!+[::Send {Ctrl Down}{Shift Down}{Tab Down}{Tab Up}{Shift Up}{Ctrl Up}
$!l::Send ^l
; input methods
; $+,::Send ^,
; $+.::Send ^.
; navigation, selection, delete a word/till end
$!Left::Send {Home}
$!Right::Send {End}
$!Up::Send {Lctrl down}{Home}{Lctrl up}
$!Down::Send {Lctrl down}{End}{Lctrl up}
$#Left::Send {ctrl down}{Left}{ctrl up}
$#Right::Send {ctrl down}{Right}{ctrl up}
$#+Left::Send {ctrl down}{shift down}{Left}{shift up}{ctrl up}
$#+Right::Send {ctrl down}{shift down}{Right}{shift up}{ctrl up}
$!+Left::Send {shift down}{Home}{shift up}
$!+Right::Send {shift down}{End}{shift up}
$!+Up::Send {Ctrl Down}{shift down}{Home}{shift up}{Ctrl Up}
$!+Down::Send {Ctrl Down}{shift down}{End}{shift up}{Ctrl Up}
!BS::Send {LShift down}{Home}{LShift Up}{Del}
#BS::Send {LCtrl down}{BS}{LCtrl up}
; $#Space::Send {Ctrl Down}{LWin Down}{Space}{LWin Up}{Ctrl Up}
; disable ctrl opening file menu
~LAlt::Send {Blind}{vkE8}
; music function keys
f7::Media_Prev
f8::Media_Play_Pause
f9::Media_Next
; music function keys
f10::Volume_Mute
f11::Volume_Down
f12::Volume_Up
!+-::Send {U+2013} ; en-dash
^+-::Send {U+2014} ; em-dash
^;::Send {U+2026} ; ellipsis
; affinity
#IfWinActive ahk_exe Designer.exe
~LAlt up:: ; disable alt menu select
Send, {Shift down}
Send, {Escape}
Send, {Shift up}
Return
#IfWinActive
; disable ctrl+space to swap active window (for gaming e.g. a slide jump)
^Space::return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment