Skip to content

Instantly share code, notes, and snippets.

@Andrew-Chen-Wang
Last active August 23, 2021 03:06
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 Andrew-Chen-Wang/ea5d0e00a54568048857e63e11194a67 to your computer and use it in GitHub Desktop.
Save Andrew-Chen-Wang/ea5d0e00a54568048857e63e11194a67 to your computer and use it in GitHub Desktop.
Using Karabiner to let me press CMD+Return/Enter/Shift to edit cells in MacOS Excel 2016+

Shortcuts that I overrode for Excel:

  • Editing a cell is now CMD + Return/Enter/Shift (used to be Option + U or F2)

Setup:

  1. Install Karabiner-Elements
  2. Set everything up properly
  3. Go to your terminal and run cd ~/.config/karabiner/assets/complex_modifications && touch excel.json
  4. Copy and paste everything from the json content below into excel.json
  5. Go to Karabiner-Elements > Complex Modifications > Import Rule then enable the Excel rule thingy
{
"title": "Mac Excel Commands Built-In Override Shortcuts",
"rules": [
{
"description": "Change cmd+enter to fn+f2 for excel edit cell",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "return_or_enter",
"modifiers": {
"mandatory": ["command"]
}
},
"to": [
{"key_code": "f2"},
{"apple_vendor_top_case_key_code": "keyboard_fn"}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com.microsoft.Excel"]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"mandatory": ["command"]
}
},
"to": [
{"key_code": "f2"},
{"apple_vendor_top_case_key_code": "keyboard_fn"}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com.microsoft.Excel"]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"mandatory": ["command"]
}
},
"to": [
{"key_code": "f2"},
{"apple_vendor_top_case_key_code": "keyboard_fn"}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": ["com.microsoft.Excel"]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment