Skip to content

Instantly share code, notes, and snippets.

@colelawrence
Last active October 14, 2022 16:17
Show Gist options
  • Save colelawrence/eac39bdb83fbb3697337a6bcefda5e71 to your computer and use it in GitHub Desktop.
Save colelawrence/eac39bdb83fbb3697337a6bcefda5e71 to your computer and use it in GitHub Desktop.
Making crucial keybindings similar on Windows to expected on personal macOS
#SingleInstance Force
; Debugging
; https://www.autohotkey.com/scite4ahk/pages/debugger.htm
; Map Capslock to control (macOS is Capslock as Command, so most keybindings feel similar)
CapsLock::RControl
; Left Ctrl Tab -> Left Alt Tab
<^Tab::>!Tab
; Ctrl + Space to Windows Search (with Capslock Ctrl, this feels like Caps + Space Spotlight/Alfred in macOS)
>^Space::
; Activate explorer so we definitely send the keys to the right place
WinActivate ahk_exe Explorer.EXE
; enable slight key delay for reliability https://www.autohotkey.com/docs/commands/SetKeyDelay.htm
SetKeyDelay,0,0
; Win + S
SendInput {RWin Down}s{RWin Up}
return
; Fix alt left + right changing history (on macOS Opt + Left & Right is a selection move)
#IfWinActive ahk_exe chrome.exe
{
<^Tab::>!Tab
LAlt::LControl
return
}
; Fix alt left + right changing history (on macOS Opt + Left & Right is a selection move)
#IfWinActive ahk_exe msedge.exe
{
<^Tab::>!Tab
LAlt::LControl
return
}
; No overrides, yet
#IfWinActive ahk_exe Code.exe
{
; <^Tab::>!Tab
; ::LControl
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment