To help make Mac keyboard shortcuts more like Windows/Linux, and/or just customize them to your liking and boost your productivity.
The instructions here worked for me on macOS Ventura 13.4.1 (22F82) and with Karabiner-Elements (where applicable) version 14.12.0.
This is the condensed version of the guide, meant for advanced users or as reference. For more complete explanation and explicit instructions see the standard version.
- Open the
System Settings
app - Go to
Keyboard
->Keyboard Shortcuts...
->Modifier Keys
- Select the desired keyboard from the dropdown menu
- Map the
Control (^) Key
to⌘ Command
- Map the
Command (⌘) Key
to^ Control
Some macOS shortcuts are configurable in the System Settings app.
- Open the
System Settings
app - Go to
Keyboard
->Keyboard Shortcuts...
Where you can remap e.g. Mission Control's Move left/right a space
shortcuts to be like Windows' win+left/right
shortcuts for desktop switching. Double-click a shortcut to edit it.
Some macOS shortcuts -- those that deal with navigating, selecting or manipulating text -- are configurable via adding/editing an XML property list file at ~/Library/KeyBindings/DefaultKeyBinding.dict
. Be sure to restart your apps after editing/saving this file, for the changes to take effect.
NOTE: Some apps have their own full or partial overrides of these shortcuts, so these remaps may not work everywhere (see Karabiner Complex Modifications
for a solution). E.g. Webstorm has its own customizable shortcuts for these actions, and Slack will honor moveWord[Left/Right]
remaps but not moveTo[Beginning/End]OfLine
remaps.
Here is my full file as of now, to make text navigation and manipulation more like Windows/Linux:
{
"@\UF702" = moveWordLeft:; // cmd-left
"@\UF703" = moveWordRight:; // cmd-right
"@$\UF702" = moveWordLeftAndModifySelection:; // cmd-shift-left
"@$\UF703" = moveWordRightAndModifySelection:; // cmd-shift-right
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
"@\UF729" = moveToBeginningOfDocument:; // cmd-home
"@\UF72B" = moveToEndOfDocument:; // cmd-end
"$@\UF729" = moveToBeginningOfDocumentAndModifySelection:; // cmd-shift-home
"$@\UF72B" = moveToEndOfDocumentAndModifySelection:; // cmd-shift-end
"@\U007F" = deleteWordBackward:; // cmd-backspace
"@\UF728" = deleteWordForward:; // cmd-delete
}
There's a lot more you can do with this file/method. See these resources for more info:
- https://github.com/ttscoff/KeyBindings (lots of examples, including multi-stroke and multi-action)
- https://gist.github.com/trusktr/1e5e516df4e8032cbc3d (has non-printable key codes, note osx delete)
- https://developer.apple.com/documentation/swiftui/keyequivalent (key codes)
- https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding (actions)
- Other/old:
- https://apple.stackexchange.com/questions/127023/how-do-i-know-what-to-put-in-defaultkeybinding-dict
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
- https://web.archive.org/web/20220608191954/http://www.hcs.harvard.edu/~jrus/Site/cocoa-text.html
Doing this will free up your alt key for shortcuts:
- Open System Settings app
- Go to
Keyboard
- Under the
Text Input
section, in theInput Sources
subsection click theEdit...
button - Turn on
Show Input menu in menu bar
- If
Unicode Hex Input
is not listed in the input sources on the left:- Click the
+
in the lower left of the dialog - In the language selection on the left, scroll all the way down and select
Others
- In the list on the right select
Unicode Hex Input
- Click the
Add
button
- Click the
- In the system menu bar (upper-right), click the Input menu (probably says
US
) and selectUnicode Hex Input
Use Karabiner-Element's Simple Modifications
feature for simple single-key/button to single key/button remaps. It's pretty self-explanatory when you see it.
E.g. if my keyboard doesn't have mouse capability in its firmware, I'll map keypad_enter
to a key (in a firmware or layout editor, like https://usevia.app), then use Karabiner to map keypad_enter
to button1
(left mouse button).
Karabiner's Complex Modifications
feature can give you even more capabilities.
To edit the rules, you can create/modify the ~/.config/karabiner/karabiner.json
file directly, or you can try the steps below for a more gui-oriented process.
Note on mice / pointer devices: To map mouse buttons to actions, you may have to go the the "Devices" section of Karabiner settings, and enable the "Modify events" option for your mouse. I found that my logitech mouse had two entries in "Devices" -- one as a keyboard (for some reason) and one as a mouse, and it seems "Modify events" was off by default for the mouse entry.
NOTE: This app and the methods I've found for configuring remaps are quite strange and non-user-friendly. But if you carefully follow these steps and the tips here, you should have success.
Because Slack does not honor moveToEndOfLine
remaps, let's rectify that by doing the following:
- Open Karabiner-Elements app
- Copy the following to clipboard:
{
"title": "Ian's rules",
"rules": [
{
"description": "Slack Home/End",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "home",
"modifiers": { "optional": ["left_shift"] }
},
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com.tinyspeck.slackmacgap"]
}
],
"to": [{
"key_code": "left_arrow",
"modifiers": ["left_command"]
}]
},
{
"type": "basic",
"from": {
"key_code": "end",
"modifiers": { "optional": ["left_shift"] }
},
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"com.tinyspeck.slackmacgap"
]
}
],
"to": [{
"key_code": "right_arrow",
"modifiers": ["left_command"]
}]
}
]
}
]
}
- In your web browser, go to https://genesy.github.io/karabiner-complex-rules-generator/
- Paste the JSON into the lower text box on the right side of the webpage
- Click outside the text box (this will trigger the JSON to load)
- Click the
Install!
button -- this should open a dialog in the Karabiner app - Click the
Import
button - Click
Enable
next to the Slack Home/End rule, or clickEnable All
in the lower right of theIan's rules
section - Home/End should go to the beginning/end of line in Slack now, and shift+Home/End should select to the beginning/end of line. Voilà!
Use Karabiner's EventViewer (accessible by clicking its menu bar status icon) to find key codes, bundle identifiers, and app file paths.
- Docs: https://karabiner-elements.pqrs.org/docs/
- Example rules: https://ke-complex-modifications.pqrs.org/
This is not a remap of a native feature, but it's something I find so incredibly useful (especially on a small, single monitor) on both Windows (via AutoHotkey) and Mac, that I'll put it here.
To assign cmd+ctrl+s
to Slack, import the following JSON into Karabiner:
{
"title": "Ian's rules",
"rules": [
{
"description": "App switcher/launchers",
"manipulators": [
{
"type": "basic",
"from": { "key_code": "s", "modifiers": { "mandatory": ["left_control", "left_command"] } },
"to": [{ "shell_command": "open '/Applications/Slack.app'" } ]
}
]
}
]
}
...add a "manipulator" entry for each app you commonly use, and your productivity will instantly increase.
ctrl+F2
is the default shortcut for moving focus to the system menu bar, but it doesn't seem to work for me on macOS 14.1.1 -- going toSystem settings > Keyboard > Keyoboard Shortcuts > Keyboard
and swapping it withMove focus to the Dock
(ctrl+F3
) seems to allow both to work.
Karabiner's complex modifications can be used to add layers to your keyboard, so you don't need to stray far from the home row for e.g. arrows keys and everything else.