Skip to content

Instantly share code, notes, and snippets.

@fljot
Last active January 9, 2023 07:12
Show Gist options
  • Save fljot/58e46c92e99e7072ab56 to your computer and use it in GitHub Desktop.
Save fljot/58e46c92e99e7072ab56 to your computer and use it in GitHub Desktop.
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
upd@2019:
https://twitter.com/BenLesh/status/1166383304616161283
Ben Lesh says:
> I have a Windows keyboard and a Mac.. So, naturally, I've switched the CTRL and Windows keys in OSX.
HOWEVER, I RDP into a Windows machine every day and now it's backwards THERE.
And sometimes I have to work directly on that Windows machine.
Solutions?
> Okay... so this did it.
Reset keys to default in OSX
I installed Karabiner Elements on the Mac.
Swap keys for my MS keyboard only there. (not the MBP keys)
Then download/import a rule for Remote Desktop that switched CMD + CTRL only in Remote Desktop
Everything "just works"
------------------------------------------------------------------
1. Use SharpKeys app to swap modifier keys.
LControl becomes Winkey
Winkey becomes LAlt
LAlt becomes LControl
This is not typical Mac Control-Alt-Command layout, but don't worry, we will make shortcuts work in the same manner your fingers are used to. The reason why we can't simply swap Win & Alt is because IntelliJ IDEA requires a lot of shortcuts with "Command" key (which would be Windows key in our case), and it's impossible to make them work well. So we stick to more traditional "Control"-shortcuts on the OS level. But, again, don't worry, in the end shortcuts physically will be the same os on Mac OS X.
2. Use AutoHotkey script "OS X keyboard for Windows" to remap basic shortcuts (see "OS X keyboard for Windows" AutoHotkey script).
3. For IntelliJ IDEA users:
3.1. Disable Winkey OS shortcuts (e.g. http://www.askvg.com/tip-how-to-disable-all-win-keyboard-shortcuts-hotkeys-in-windows/)
3.2. Use provided "" keymap.
http://codingmatters.blogspot.co.uk/2010/02/i-always-thought-its-not-possible-to.html
http://youtrack.jetbrains.com/issue/IDEA-119932
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta X" />
<keyboard-shortcut first-keystroke="shift DELETE" />
<keyboard-shortcut first-keystroke="control X" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="meta V" />
<keyboard-shortcut first-keystroke="shift INSERT" />
<keyboard-shortcut first-keystroke="control V" />
</action>
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift meta Z" />
<keyboard-shortcut first-keystroke="shift alt BACK_SPACE" />
<keyboard-shortcut first-keystroke="shift control Z" />
</action>
<action id="$SelectAll">
<keyboard-shortcut first-keystroke="meta A" />
<keyboard-shortcut first-keystroke="control A" />
</action>
<action id="$Undo">
<keyboard-shortcut first-keystroke="meta Z" />
<keyboard-shortcut first-keystroke="control Z" />
</action>
<action id="ActivateChangesToolWindow">
<keyboard-shortcut first-keystroke="meta 9" />
<keyboard-shortcut first-keystroke="control 9" />
</action>
<action id="ActivateDebugToolWindow">
<keyboard-shortcut first-keystroke="meta 5" />
<keyboard-shortcut first-keystroke="control 5" />
</action>
<action id="ActivateFavoritesToolWindow">
<keyboard-shortcut first-keystroke="meta 2" />
<keyboard-shortcut first-keystroke="control 2" />
</action>
<action id="ActivateMessagesToolWindow">
<keyboard-shortcut first-keystroke="meta 0" />
<keyboard-shortcut first-keystroke="control 0" />
</action>
<action id="ActivateProjectToolWindow">
<keyboard-shortcut first-keystroke="meta 1" />
<keyboard-shortcut first-keystroke="control 1" />
</action>
<action id="ActivateRunToolWindow">
<keyboard-shortcut first-keystroke="meta 4" />
<keyboard-shortcut first-keystroke="control 4" />
</action>
<action id="ActivateStructureToolWindow">
<keyboard-shortcut first-keystroke="meta 7" />
<keyboard-shortcut first-keystroke="control 7" />
</action>
<action id="ActivateTODOToolWindow">
<keyboard-shortcut first-keystroke="meta 6" />
<keyboard-shortcut first-keystroke="control 6" />
</action>
<action id="AutoIndentLines">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt I" />
</action>
<action id="Back">
<keyboard-shortcut first-keystroke="meta OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="meta alt LEFT" />
<mouse-shortcut keystroke="button4" />
<keyboard-shortcut first-keystroke="control OPEN_BRACKET" />
</action>
<action id="CallHierarchy">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt H" />
</action>
<action id="ChangeSignature">
<keyboard-shortcut first-keystroke="meta F6" />
<keyboard-shortcut first-keystroke="control F6" />
</action>
<action id="ChangeTypeSignature">
<keyboard-shortcut first-keystroke="shift meta F6" />
<keyboard-shortcut first-keystroke="shift control F6" />
</action>
<action id="ChangesView.AddUnversioned">
<keyboard-shortcut first-keystroke="meta alt A" />
<keyboard-shortcut first-keystroke="control alt A" />
</action>
<action id="CheckinProject">
<keyboard-shortcut first-keystroke="meta K" />
<keyboard-shortcut first-keystroke="control K" />
</action>
<action id="ChooseDebugConfiguration">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt D" />
</action>
<action id="ChooseRunConfiguration">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt R" />
</action>
<action id="ClassNameCompletion">
<keyboard-shortcut first-keystroke="control alt SPACE" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt SPACE" />
</action>
<action id="CloseActiveTab">
<keyboard-shortcut first-keystroke="meta W" />
<keyboard-shortcut first-keystroke="control W" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift F4" />
</action>
<action id="CloseContent">
<keyboard-shortcut first-keystroke="meta W" />
<keyboard-shortcut first-keystroke="control W" />
</action>
<action id="CodeCompletion">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="SPACE" />
</action>
<action id="CollapseAllRegions">
<keyboard-shortcut first-keystroke="shift meta SUBTRACT" />
<keyboard-shortcut first-keystroke="shift meta MINUS" />
<keyboard-shortcut first-keystroke="shift control SUBTRACT" />
<keyboard-shortcut first-keystroke="shift control MINUS" />
</action>
<action id="CollapseBlock">
<keyboard-shortcut first-keystroke="shift meta PERIOD" />
<keyboard-shortcut first-keystroke="shift control PERIOD" />
</action>
<action id="CollapseRegion">
<keyboard-shortcut first-keystroke="meta SUBTRACT" />
<keyboard-shortcut first-keystroke="meta MINUS" />
<keyboard-shortcut first-keystroke="control SUBTRACT" />
<keyboard-shortcut first-keystroke="control MINUS" />
</action>
<action id="CollapseSelection">
<keyboard-shortcut first-keystroke="meta PERIOD" />
<keyboard-shortcut first-keystroke="control PERIOD" />
</action>
<action id="CommentByBlockComment">
<keyboard-shortcut first-keystroke="meta alt SLASH" />
<keyboard-shortcut first-keystroke="meta alt DIVIDE" />
<keyboard-shortcut first-keystroke="shift control SLASH" />
<keyboard-shortcut first-keystroke="shift control DIVIDE" />
<keyboard-shortcut first-keystroke="shift meta SLASH" />
<keyboard-shortcut first-keystroke="shift meta DIVIDE" />
<keyboard-shortcut first-keystroke="control alt SLASH" />
<keyboard-shortcut first-keystroke="control alt DIVIDE" />
</action>
<action id="CommentByLineComment">
<keyboard-shortcut first-keystroke="meta SLASH" />
<keyboard-shortcut first-keystroke="meta DIVIDE" />
<keyboard-shortcut first-keystroke="control SLASH" />
<keyboard-shortcut first-keystroke="control DIVIDE" />
</action>
<action id="CompareDirs">
<keyboard-shortcut first-keystroke="meta D" />
<keyboard-shortcut first-keystroke="control D" />
</action>
<action id="Compile">
<keyboard-shortcut first-keystroke="shift meta F9" />
<keyboard-shortcut first-keystroke="shift control F9" />
</action>
<action id="CompileDirty">
<keyboard-shortcut first-keystroke="meta F9" />
<keyboard-shortcut first-keystroke="control F9" />
</action>
<action id="Console.History.Browse">
<keyboard-shortcut first-keystroke="meta alt E" />
<keyboard-shortcut first-keystroke="control alt E" />
</action>
<action id="Console.SplitLine">
<keyboard-shortcut first-keystroke="meta ENTER" />
<keyboard-shortcut first-keystroke="control ENTER" />
</action>
<action id="CopyPaths">
<keyboard-shortcut first-keystroke="shift meta C" />
<keyboard-shortcut first-keystroke="shift control C" />
</action>
<action id="CopyReference">
<keyboard-shortcut first-keystroke="shift meta alt C" />
<keyboard-shortcut first-keystroke="shift control alt C" />
</action>
<action id="Debug">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="D" />
</action>
<action id="DebugClass">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift D" />
</action>
<action id="EditSource">
<keyboard-shortcut first-keystroke="meta DOWN" />
<keyboard-shortcut first-keystroke="F4" />
<keyboard-shortcut first-keystroke="control DOWN" />
</action>
<action id="Editor Copy">
<keyboard-shortcut first-keystroke="control C" />
</action>
<action id="Editor Cut">
<keyboard-shortcut first-keystroke="control X" />
</action>
<action id="Editor Paste">
<keyboard-shortcut first-keystroke="control V" />
</action>
<action id="Editor Redo">
<keyboard-shortcut first-keystroke="shift control Z" />
</action>
<action id="Editor SelectAll">
<keyboard-shortcut first-keystroke="control A" />
</action>
<action id="Editor Undo">
<keyboard-shortcut first-keystroke="control Z" />
</action>
<action id="EditorChooseLookupItemAlways">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="ENTER" />
</action>
<action id="EditorChooseLookupItemCompleteStatement">
<keyboard-shortcut first-keystroke="shift meta ENTER" />
<keyboard-shortcut first-keystroke="shift control ENTER" />
</action>
<action id="EditorChooseLookupItemDot">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="PERIOD" />
</action>
<action id="EditorCodeBlockEnd">
<keyboard-shortcut first-keystroke="meta alt CLOSE_BRACKET" />
<keyboard-shortcut first-keystroke="control alt CLOSE_BRACKET" />
</action>
<action id="EditorCodeBlockEndWithSelection">
<keyboard-shortcut first-keystroke="shift meta alt CLOSE_BRACKET" />
<keyboard-shortcut first-keystroke="shift control alt CLOSE_BRACKET" />
</action>
<action id="EditorCodeBlockStart">
<keyboard-shortcut first-keystroke="meta alt OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="control alt OPEN_BRACKET" />
</action>
<action id="EditorCodeBlockStartWithSelection">
<keyboard-shortcut first-keystroke="shift meta alt OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="shift control alt OPEN_BRACKET" />
</action>
<action id="EditorCompleteStatement">
<keyboard-shortcut first-keystroke="shift meta ENTER" />
<keyboard-shortcut first-keystroke="shift control ENTER" />
</action>
<action id="EditorCutLineEnd">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="K" />
</action>
<action id="EditorDeleteLine">
<keyboard-shortcut first-keystroke="control BACK_SPACE" />
</action>
<action id="EditorDown">
<keyboard-shortcut first-keystroke="DOWN" />
</action>
<action id="EditorDuplicate">
<keyboard-shortcut first-keystroke="meta D" />
<keyboard-shortcut first-keystroke="control D" />
</action>
<action id="EditorJoinLines">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift J" />
</action>
<action id="EditorLeft">
<keyboard-shortcut first-keystroke="LEFT" />
</action>
<action id="EditorLineEnd">
<keyboard-shortcut first-keystroke="END" />
<keyboard-shortcut first-keystroke="meta RIGHT" />
<keyboard-shortcut first-keystroke="control RIGHT" />
</action>
<action id="EditorLineEndWithSelection">
<keyboard-shortcut first-keystroke="shift END" />
<keyboard-shortcut first-keystroke="shift meta RIGHT" />
<keyboard-shortcut first-keystroke="shift control RIGHT" />
</action>
<action id="EditorLineStart">
<keyboard-shortcut first-keystroke="HOME" />
<keyboard-shortcut first-keystroke="meta LEFT" />
</action>
<action id="EditorLineStartWithSelection">
<keyboard-shortcut first-keystroke="shift HOME" />
<keyboard-shortcut first-keystroke="shift meta LEFT" />
<keyboard-shortcut first-keystroke="shift control LEFT" />
</action>
<action id="EditorLookupDown">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="DOWN" />
</action>
<action id="EditorLookupUp">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="UP" />
</action>
<action id="EditorMoveToPageBottom">
<keyboard-shortcut first-keystroke="meta PAGE_DOWN" />
<keyboard-shortcut first-keystroke="control PAGE_DOWN" />
</action>
<action id="EditorMoveToPageBottomWithSelection">
<keyboard-shortcut first-keystroke="shift meta PAGE_DOWN" />
<keyboard-shortcut first-keystroke="shift control PAGE_DOWN" />
</action>
<action id="EditorMoveToPageTop">
<keyboard-shortcut first-keystroke="meta PAGE_UP" />
<keyboard-shortcut first-keystroke="control PAGE_UP" />
</action>
<action id="EditorMoveToPageTopWithSelection">
<keyboard-shortcut first-keystroke="shift meta PAGE_UP" />
<keyboard-shortcut first-keystroke="shift control PAGE_UP" />
</action>
<action id="EditorPasteSimple">
<keyboard-shortcut first-keystroke="shift meta alt V" />
<keyboard-shortcut first-keystroke="shift control alt V" />
</action>
<action id="EditorRight">
<keyboard-shortcut first-keystroke="RIGHT" />
</action>
<action id="EditorSplitLine">
<keyboard-shortcut first-keystroke="meta ENTER" />
<keyboard-shortcut first-keystroke="control ENTER" />
</action>
<action id="EditorStartNewLineBefore">
<keyboard-shortcut first-keystroke="meta alt ENTER" />
<keyboard-shortcut first-keystroke="control alt ENTER" />
</action>
<action id="EditorTextEnd">
<keyboard-shortcut first-keystroke="meta END" />
<keyboard-shortcut first-keystroke="control END" />
</action>
<action id="EditorTextEndWithSelection">
<keyboard-shortcut first-keystroke="shift meta END" />
<keyboard-shortcut first-keystroke="shift control END" />
</action>
<action id="EditorTextStart">
<keyboard-shortcut first-keystroke="meta HOME" />
<keyboard-shortcut first-keystroke="control HOME" />
</action>
<action id="EditorTextStartWithSelection">
<keyboard-shortcut first-keystroke="shift meta HOME" />
<keyboard-shortcut first-keystroke="shift control HOME" />
</action>
<action id="EditorToggleCase">
<keyboard-shortcut first-keystroke="shift meta U" />
<keyboard-shortcut first-keystroke="shift control U" />
</action>
<action id="EditorToggleColumnMode">
<keyboard-shortcut first-keystroke="shift meta 8" />
<keyboard-shortcut first-keystroke="shift control 8" />
</action>
<action id="Exit">
<keyboard-shortcut first-keystroke="meta Q" />
<keyboard-shortcut first-keystroke="control Q" />
</action>
<action id="ExpandAllRegions">
<keyboard-shortcut first-keystroke="shift meta ADD" />
<keyboard-shortcut first-keystroke="shift meta EQUALS" />
<keyboard-shortcut first-keystroke="shift control ADD" />
<keyboard-shortcut first-keystroke="shift control EQUALS" />
</action>
<action id="ExpandRegion">
<keyboard-shortcut first-keystroke="meta ADD" />
<keyboard-shortcut first-keystroke="meta EQUALS" />
<keyboard-shortcut first-keystroke="control ADD" />
<keyboard-shortcut first-keystroke="control EQUALS" />
</action>
<action id="ExportToTextFile" />
<action id="ExtractMethod">
<keyboard-shortcut first-keystroke="meta alt M" />
<keyboard-shortcut first-keystroke="control alt M" />
</action>
<action id="FileChooser.GotoHome">
<keyboard-shortcut first-keystroke="meta 1" />
<keyboard-shortcut first-keystroke="control 1" />
</action>
<action id="FileChooser.GotoModule">
<keyboard-shortcut first-keystroke="meta 3" />
<keyboard-shortcut first-keystroke="control 3" />
</action>
<action id="FileChooser.GotoProject">
<keyboard-shortcut first-keystroke="meta 2" />
<keyboard-shortcut first-keystroke="control 2" />
</action>
<action id="FileChooser.NewFolder">
<keyboard-shortcut first-keystroke="alt INSERT" />
<keyboard-shortcut first-keystroke="meta N" />
<keyboard-shortcut first-keystroke="control N" />
</action>
<action id="FileChooser.TogglePathShowing">
<keyboard-shortcut first-keystroke="meta P" />
<keyboard-shortcut first-keystroke="control P" />
</action>
<action id="FileStructurePopup">
<keyboard-shortcut first-keystroke="meta F12" />
<keyboard-shortcut first-keystroke="control F12" />
</action>
<action id="Find">
<keyboard-shortcut first-keystroke="meta F" />
<keyboard-shortcut first-keystroke="control F" />
</action>
<action id="FindInPath">
<keyboard-shortcut first-keystroke="shift meta F" />
<keyboard-shortcut first-keystroke="shift control F" />
</action>
<action id="FindNext">
<keyboard-shortcut first-keystroke="meta G" />
<keyboard-shortcut first-keystroke="control G" />
</action>
<action id="FindPrevious">
<keyboard-shortcut first-keystroke="shift meta G" />
<keyboard-shortcut first-keystroke="shift control G" />
</action>
<action id="FindUsagesInFile">
<keyboard-shortcut first-keystroke="meta F7" />
<keyboard-shortcut first-keystroke="control F7" />
</action>
<action id="ForceRunToCursor">
<keyboard-shortcut first-keystroke="meta alt F9" />
<keyboard-shortcut first-keystroke="control alt F9" />
</action>
<action id="Forward">
<keyboard-shortcut first-keystroke="meta CLOSE_BRACKET" />
<keyboard-shortcut first-keystroke="meta alt RIGHT" />
<mouse-shortcut keystroke="button5" />
<keyboard-shortcut first-keystroke="control CLOSE_BRACKET" />
</action>
<action id="Generate">
<keyboard-shortcut first-keystroke="meta N" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="ENTER" />
<keyboard-shortcut first-keystroke="control N" />
</action>
<action id="Git.Push">
<keyboard-shortcut first-keystroke="shift meta K" />
<keyboard-shortcut first-keystroke="shift control K" />
</action>
<action id="GotoAction">
<keyboard-shortcut first-keystroke="shift meta A" />
<keyboard-shortcut first-keystroke="shift control A" />
</action>
<action id="GotoBookmark0">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="0" />
</action>
<action id="GotoBookmark1">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="1" />
</action>
<action id="GotoBookmark2">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="2" />
</action>
<action id="GotoBookmark3">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="3" />
</action>
<action id="GotoBookmark4">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="4" />
</action>
<action id="GotoBookmark5">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="5" />
</action>
<action id="GotoBookmark6">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="6" />
</action>
<action id="GotoBookmark7">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="7" />
</action>
<action id="GotoBookmark8">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="8" />
</action>
<action id="GotoBookmark9">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="9" />
</action>
<action id="GotoClass">
<keyboard-shortcut first-keystroke="meta O" />
<keyboard-shortcut first-keystroke="control O" />
</action>
<action id="GotoCustomRegion">
<keyboard-shortcut first-keystroke="meta alt PERIOD" />
<keyboard-shortcut first-keystroke="control alt PERIOD" />
</action>
<action id="GotoDeclaration">
<keyboard-shortcut first-keystroke="meta B" />
<mouse-shortcut keystroke="meta button1" />
<mouse-shortcut keystroke="button2" />
<keyboard-shortcut first-keystroke="control B" />
<mouse-shortcut keystroke="control button1" />
</action>
<action id="GotoFile">
<keyboard-shortcut first-keystroke="shift meta O" />
<keyboard-shortcut first-keystroke="shift control O" />
</action>
<action id="GotoImplementation">
<keyboard-shortcut first-keystroke="meta alt B" />
<mouse-shortcut keystroke="meta alt button1" />
<keyboard-shortcut first-keystroke="control alt B" />
<mouse-shortcut keystroke="control alt button1" />
</action>
<action id="GotoLine">
<keyboard-shortcut first-keystroke="meta L" />
<keyboard-shortcut first-keystroke="control L" />
</action>
<action id="GotoRelated">
<keyboard-shortcut first-keystroke="control meta UP" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="control UP" />
</action>
<action id="GotoSuperMethod">
<keyboard-shortcut first-keystroke="meta U" />
<keyboard-shortcut first-keystroke="control U" />
</action>
<action id="GotoSymbol">
<keyboard-shortcut first-keystroke="meta alt O" />
<keyboard-shortcut first-keystroke="control alt O" />
</action>
<action id="GotoTest">
<keyboard-shortcut first-keystroke="shift meta T" />
<keyboard-shortcut first-keystroke="shift control T" />
</action>
<action id="Groovy.Shell.Execute">
<keyboard-shortcut first-keystroke="meta ENTER" />
<keyboard-shortcut first-keystroke="control ENTER" />
</action>
<action id="HighlightUsagesInFile">
<keyboard-shortcut first-keystroke="shift meta F7" />
<keyboard-shortcut first-keystroke="shift control F7" />
</action>
<action id="Images.EditExternally">
<keyboard-shortcut first-keystroke="meta alt F4" />
<keyboard-shortcut first-keystroke="control alt F4" />
</action>
<action id="Images.ShowThumbnails">
<keyboard-shortcut first-keystroke="shift meta T" />
<keyboard-shortcut first-keystroke="shift control T" />
</action>
<action id="Images.Thumbnails.ToggleRecursive">
<keyboard-shortcut first-keystroke="meta MULTIPLY" />
<keyboard-shortcut first-keystroke="control MULTIPLY" />
</action>
<action id="ImplementMethods">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="I" />
</action>
<action id="Inline">
<keyboard-shortcut first-keystroke="meta alt N" />
<keyboard-shortcut first-keystroke="control alt N" />
</action>
<action id="InsertLiveTemplate">
<keyboard-shortcut first-keystroke="meta J" />
<keyboard-shortcut first-keystroke="control J" />
</action>
<action id="IntroduceConstant">
<keyboard-shortcut first-keystroke="meta alt C" />
<keyboard-shortcut first-keystroke="control alt C" />
</action>
<action id="IntroduceField">
<keyboard-shortcut first-keystroke="meta alt F" />
<keyboard-shortcut first-keystroke="control alt F" />
</action>
<action id="IntroduceParameter">
<keyboard-shortcut first-keystroke="meta alt P" />
<keyboard-shortcut first-keystroke="control alt P" />
</action>
<action id="IntroduceVariable">
<keyboard-shortcut first-keystroke="meta alt V" />
<keyboard-shortcut first-keystroke="control alt V" />
</action>
<action id="JumpToLastChange">
<keyboard-shortcut first-keystroke="shift meta BACK_SPACE" />
<keyboard-shortcut first-keystroke="shift control BACK_SPACE" />
</action>
<action id="MethodDown">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="DOWN" />
</action>
<action id="MethodHierarchy">
<keyboard-shortcut first-keystroke="shift meta H" />
<keyboard-shortcut first-keystroke="shift control H" />
</action>
<action id="MethodUp">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="UP" />
</action>
<action id="MinimizeCurrentWindow">
<keyboard-shortcut first-keystroke="meta M" />
<keyboard-shortcut first-keystroke="control M" />
</action>
<action id="MoveStatementDown">
<keyboard-shortcut first-keystroke="shift meta DOWN" />
<keyboard-shortcut first-keystroke="shift control DOWN" />
</action>
<action id="MoveStatementUp">
<keyboard-shortcut first-keystroke="shift meta UP" />
<keyboard-shortcut first-keystroke="shift control UP" />
</action>
<action id="Mvc.RunTarget">
<keyboard-shortcut first-keystroke="meta alt G" />
<keyboard-shortcut first-keystroke="control alt G" />
</action>
<action id="NewElement">
<keyboard-shortcut first-keystroke="meta N" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="ENTER" />
<keyboard-shortcut first-keystroke="control N" />
</action>
<action id="NewElementSamePlace">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt N" />
</action>
<action id="NewScratchFile">
<keyboard-shortcut first-keystroke="shift meta N" />
<keyboard-shortcut first-keystroke="shift control N" />
</action>
<action id="NextEditorTab">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift RIGHT" />
</action>
<action id="NextOccurence">
<keyboard-shortcut first-keystroke="meta alt DOWN" />
<keyboard-shortcut first-keystroke="control alt DOWN" />
</action>
<action id="NextProjectWindow">
<keyboard-shortcut first-keystroke="meta BACK_QUOTE" />
<keyboard-shortcut first-keystroke="control BACK_QUOTE" />
</action>
<action id="NextTab">
<keyboard-shortcut first-keystroke="shift meta CLOSE_BRACKET" />
<keyboard-shortcut first-keystroke="shift control CLOSE_BRACKET" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="RIGHT" />
</action>
<action id="OptimizeImports">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="alt O" />
</action>
<action id="OverrideMethods">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="O" />
</action>
<action id="ParameterInfo">
<keyboard-shortcut first-keystroke="meta P" />
<keyboard-shortcut first-keystroke="control P" />
</action>
<action id="PasteMultiple">
<keyboard-shortcut first-keystroke="shift meta V" />
<keyboard-shortcut first-keystroke="shift meta INSERT" />
<keyboard-shortcut first-keystroke="shift control V" />
<keyboard-shortcut first-keystroke="shift control INSERT" />
</action>
<action id="PopupHector">
<keyboard-shortcut first-keystroke="shift meta alt H" />
<keyboard-shortcut first-keystroke="shift control alt H" />
</action>
<action id="PreviousEditorTab">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift LEFT" />
</action>
<action id="PreviousOccurence">
<keyboard-shortcut first-keystroke="meta alt UP" />
<keyboard-shortcut first-keystroke="control alt UP" />
</action>
<action id="PreviousProjectWindow">
<keyboard-shortcut first-keystroke="shift meta BACK_QUOTE" />
<keyboard-shortcut first-keystroke="shift control BACK_QUOTE" />
</action>
<action id="PreviousTab">
<keyboard-shortcut first-keystroke="shift meta OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="shift control OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="LEFT" />
</action>
<action id="QuickChangeScheme">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="BACK_QUOTE" />
</action>
<action id="QuickEvaluateExpression">
<keyboard-shortcut first-keystroke="meta alt F8" />
<mouse-shortcut keystroke="alt button1" />
<keyboard-shortcut first-keystroke="control alt F8" />
</action>
<action id="QuickImplementations">
<keyboard-shortcut first-keystroke="alt SPACE" />
<keyboard-shortcut first-keystroke="meta Y" />
<keyboard-shortcut first-keystroke="control Y" />
</action>
<action id="QuickJavaDoc">
<keyboard-shortcut first-keystroke="F1" />
<mouse-shortcut keystroke="control button2" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="J" />
</action>
<action id="RecentChangedFiles">
<keyboard-shortcut first-keystroke="shift meta E" />
<keyboard-shortcut first-keystroke="shift control E" />
</action>
<action id="RecentFiles">
<keyboard-shortcut first-keystroke="meta E" />
<keyboard-shortcut first-keystroke="control E" />
</action>
<action id="Refactorings.QuickListPopupAction">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="T" />
</action>
<action id="ReformatCode">
<keyboard-shortcut first-keystroke="meta alt L" />
<keyboard-shortcut first-keystroke="control alt L" />
</action>
<action id="Refresh">
<keyboard-shortcut first-keystroke="meta R" />
<keyboard-shortcut first-keystroke="control R" />
</action>
<action id="RemoveFromFavorites">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="DELETE" />
</action>
<action id="Replace">
<keyboard-shortcut first-keystroke="meta R" />
<keyboard-shortcut first-keystroke="control R" />
</action>
<action id="ReplaceInPath">
<keyboard-shortcut first-keystroke="shift meta R" />
<keyboard-shortcut first-keystroke="shift control R" />
</action>
<action id="Rerun">
<keyboard-shortcut first-keystroke="meta R" />
<keyboard-shortcut first-keystroke="control R" />
</action>
<action id="RerunTests">
<keyboard-shortcut first-keystroke="control meta R" />
<keyboard-shortcut first-keystroke="shift alt R" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="control R" />
</action>
<action id="Resume">
<keyboard-shortcut first-keystroke="meta alt R" />
<keyboard-shortcut first-keystroke="control alt R" />
</action>
<action id="Run">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="R" />
</action>
<action id="RunAPT">
<keyboard-shortcut first-keystroke="shift meta alt F9" />
<keyboard-shortcut first-keystroke="shift control alt F9" />
</action>
<action id="RunClass">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift R" />
</action>
<action id="RunInspection">
<keyboard-shortcut first-keystroke="shift meta alt I" />
<keyboard-shortcut first-keystroke="shift control alt I" />
</action>
<action id="RunTargetAction">
<keyboard-shortcut first-keystroke="shift meta F10" />
<keyboard-shortcut first-keystroke="shift control F10" />
</action>
<action id="SafeDelete">
<keyboard-shortcut first-keystroke="meta DELETE" />
<keyboard-shortcut first-keystroke="meta BACK_SPACE" />
<keyboard-shortcut first-keystroke="control DELETE" />
<keyboard-shortcut first-keystroke="control BACK_SPACE" />
</action>
<action id="SaveAll">
<keyboard-shortcut first-keystroke="meta S" />
<keyboard-shortcut first-keystroke="control S" />
</action>
<action id="SelectAllOccurrences">
<keyboard-shortcut first-keystroke="control meta G" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="control G" />
</action>
<action id="ShowBookmarks">
<keyboard-shortcut first-keystroke="meta F3" />
<keyboard-shortcut first-keystroke="control F3" />
</action>
<action id="ShowContent">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="DOWN" />
</action>
<action id="ShowErrorDescription">
<keyboard-shortcut first-keystroke="meta F1" />
<keyboard-shortcut first-keystroke="control F1" />
</action>
<action id="ShowFilePath">
<keyboard-shortcut first-keystroke="meta alt F12" />
<keyboard-shortcut first-keystroke="control alt F12" />
</action>
<action id="ShowNavBar">
<keyboard-shortcut first-keystroke="meta UP" />
<keyboard-shortcut first-keystroke="alt HOME" />
<keyboard-shortcut first-keystroke="control UP" />
</action>
<action id="ShowProjectStructureSettings">
<keyboard-shortcut first-keystroke="meta SEMICOLON" />
<keyboard-shortcut first-keystroke="control SEMICOLON" />
</action>
<action id="ShowSettings">
<keyboard-shortcut first-keystroke="meta COMMA" />
<keyboard-shortcut first-keystroke="control COMMA" />
</action>
<action id="ShowSettingsAndFindUsages">
<keyboard-shortcut first-keystroke="shift meta alt F7" />
<keyboard-shortcut first-keystroke="shift control alt F7" />
</action>
<action id="ShowUsages">
<keyboard-shortcut first-keystroke="meta alt F7" />
<keyboard-shortcut first-keystroke="control alt F7" />
</action>
<action id="SmartTypeCompletion">
<keyboard-shortcut first-keystroke="shift control SPACE" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift SPACE" />
</action>
<action id="Stop">
<keyboard-shortcut first-keystroke="meta F2" />
<keyboard-shortcut first-keystroke="control F2" />
</action>
<action id="SurroundWith">
<keyboard-shortcut first-keystroke="meta alt T" />
<keyboard-shortcut first-keystroke="control alt T" />
</action>
<action id="SurroundWithLiveTemplate">
<keyboard-shortcut first-keystroke="meta alt J" />
<keyboard-shortcut first-keystroke="control alt J" />
</action>
<action id="SwitchApply">
<keyboard-shortcut first-keystroke="shift alt ENTER" />
</action>
<action id="SwitchDown">
<keyboard-shortcut first-keystroke="shift alt DOWN" />
</action>
<action id="SwitchLeft">
<keyboard-shortcut first-keystroke="shift alt LEFT" />
</action>
<action id="SwitchRight">
<keyboard-shortcut first-keystroke="shift alt RIGHT" />
</action>
<action id="SwitchUp">
<keyboard-shortcut first-keystroke="shift alt UP" />
</action>
<action id="Synchronize">
<keyboard-shortcut first-keystroke="meta alt Y" />
<keyboard-shortcut first-keystroke="control alt Y" />
</action>
<action id="ToggleBookmark0">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 0" />
</action>
<action id="ToggleBookmark1">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 1" />
</action>
<action id="ToggleBookmark2">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 2" />
</action>
<action id="ToggleBookmark3">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 3" />
</action>
<action id="ToggleBookmark4">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 4" />
</action>
<action id="ToggleBookmark5">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 5" />
</action>
<action id="ToggleBookmark6">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 6" />
</action>
<action id="ToggleBookmark7">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 7" />
</action>
<action id="ToggleBookmark8">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 8" />
</action>
<action id="ToggleBookmark9">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift 9" />
</action>
<action id="ToggleFullScreen">
<keyboard-shortcut first-keystroke="control meta F" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="control F" />
</action>
<action id="ToggleLineBreakpoint">
<keyboard-shortcut first-keystroke="meta F8" />
<keyboard-shortcut first-keystroke="control F8" />
</action>
<action id="ToggleTemporaryLineBreakpoint">
<keyboard-shortcut first-keystroke="shift meta alt F8" />
<keyboard-shortcut first-keystroke="shift control alt F8" />
</action>
<action id="TypeHierarchy">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="H" />
</action>
<action id="Unwrap">
<keyboard-shortcut first-keystroke="shift meta DELETE" />
<keyboard-shortcut first-keystroke="shift control DELETE" />
</action>
<action id="Vcs.QuickListPopupAction">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="V" />
</action>
<action id="Vcs.ShowMessageHistory">
<keyboard-shortcut first-keystroke="meta E" />
<keyboard-shortcut first-keystroke="control E" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="M" />
</action>
<action id="Vcs.UpdateProject">
<keyboard-shortcut first-keystroke="meta T" />
<keyboard-shortcut first-keystroke="control T" />
</action>
<action id="VcsHistory.ShowAllAffected">
<keyboard-shortcut first-keystroke="control meta A" />
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="control A" />
</action>
<action id="VcsShowNextChangeMarker">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift alt DOWN" />
</action>
<action id="VcsShowPrevChangeMarker">
<keyboard-shortcut first-keystroke="WINDOWS" second-keystroke="shift alt UP" />
</action>
<action id="ViewBreakpoints">
<keyboard-shortcut first-keystroke="shift meta F8" />
<keyboard-shortcut first-keystroke="shift control F8" />
</action>
<action id="ViewSource">
<keyboard-shortcut first-keystroke="meta ENTER" />
<keyboard-shortcut first-keystroke="control ENTER" />
</action>
</keymap>
;
; AutoHotkey Version: 1.x
;
;
; --------------------------------------------------------------
; Emulate OSX keymap layout
; on Windows
; --------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
GroupAdd, IntelliJ_Group, ahk_class SunAwtFrame
GroupAdd, IntelliJ_Group, ahk_class SunAwtDialog
return
; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
; ^ = CTRL
; + = SHIFT
; # = WIN
; Disable start menu on left winkey
LWin & vk07::return
LWin::return ; (or run Launchy)
; Switching between windows
LCtrl & Tab::AltTab
; win + arrows for window alignment
; TODO
;following section remaps alt-delete keys to mimic OSX
;command-delete deletes whole line
^BS::Send {LShift down}{Home}{LShift Up}{Del}
;alt-function-delete deletes next word
!Delete::Send {LShift down}{LCtrl down}{Right}{Lctrl up}{LShift Up}{Del}
;alt-delete deletes previous word
!BS::Send {LShift down}{LCtrl down}{Left}{Lctrl up}{LShift Up}{Del}
;following section mimics command-q and command-w
;behaviour to close windows
^SC011::^F4 ;w
^SC010::Send {LAlt down}{Ctrl up}{F4}{LAlt up} ;q
; Ctrl+H (cmd+h) to hide window
^SC023::WinMinimize,a ;h
;following section remaps alt-arrow and command-arrow
;keys to mimic OSX behaviour
^Up::Send {Lctrl down}{Home}{Lctrl up}
^Down::Send {Lctrl down}{End}{Lctrl up}
^Left::Send {Home}
^Right::Send {End}
^+Up::Send {Shift down}{Lctrl down}{Home}{Lctrl up}{Shift up}
^+Down::Send {Shift down}{Lctrl down}{End}{Lctrl up}{Shift up}
^+Left::Send {Shift down}{Home}{Shift up}
^+Right::Send {Shift down}{End}{Shift up}
; The following remapings should NOT be applied to IntelliJ windows
#IfWinNotActive, ahk_group IntelliJ_Group
; IntelliJ IDEA has it's own shortcuts for these
!Up::Send {PgUp}
!Down::Send {PgDn}
!Left::Send ^{Left}
!Right::Send ^{Right}
!+Up::Send {Shift down}{PgUp}
!+Down::Send {Shift down}{PgDn}
!+Left::Send {Shift down}{Lctrl down}{Left}{Lctrl up}{Shift up}
!+Right::Send {Shift down}{Lctrl down}{Right}{Lctrl up}{Shift up}
#IfWinNotActive
; Language switching
; NB! The trick here is to send winkey/ctrl up at the proper time
^Space::Send {LAlt down}{LCtrl up}{LShift down}{LShift up}{LAlt up}
; Tabs switching
^!Left::Send {LCtrl down}{LShift down}{Tab}{LShift up}{LCtrl up}
^!Right::Send {LCtrl down}{Tab}{LCtrl up}
; Switching between windows of the same app
^SC056:: ; Next window Cmd+\ (left from Z)
WinGetClass, ActiveClass, A
WinGet, WinClassCount, Count, ahk_class %ActiveClass%
IF WinClassCount = 1
Return
Else
WinSet, Bottom,, A
WinActivate, ahk_class %ActiveClass%
return
; en dash
!SC00c::Send {asc 0150}
; --------------------------------------------------------------
; Application specific
; --------------------------------------------------------------
; Google Chrome
#IfWinActive, ahk_class Chrome_WidgetWin_1
; Show Web Developer Tools with cmd + alt + i
^!SC017::Send {F12} ;i
; Show source code with cmd + alt + u
^!SC016::Send {Alt up}{LCtrl down}{SC016}{LCtrl up} ;u
#IfWinActive
;
; AutoHotkey Version: 1.x
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; --------------------------------------------------------------
; Scriptlet to find Scancode of a Key by SKAN
; from http://www.autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/
SetFormat, Integer, Hex
Gui +ToolWindow -SysMenu +AlwaysOnTop
Gui, Font, s14 Bold, Arial
Gui, Add, Text, w100 h33 vSC 0x201 +Border, {SC000}
Gui, Show,, % "// ScanCode //////////"
Loop 9
OnMessage( 255+A_Index, "ScanCode" ) ; 0x100 to 0x108
Return
ScanCode( wParam, lParam ) {
Clipboard := "SC" SubStr((((lParam>>16) & 0xFF)+0xF000),-2)
GuiControl,, SC, %Clipboard%
}
; --------------------------------------------------------------
@fljot
Copy link
Author

fljot commented Jun 29, 2020

@rbreaves thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment