Skip to content

Instantly share code, notes, and snippets.

@handcoding
Last active January 4, 2017 09:57
Show Gist options
  • Save handcoding/224a5d81ce9fe111b436902cba2b0577 to your computer and use it in GitHub Desktop.
Save handcoding/224a5d81ce9fe111b436902cba2b0577 to your computer and use it in GitHub Desktop.
Ashley’s private.xml file for Karabiner to make Excel 2016’s and Word 2016’s keyboard shortcuts be more Mac-like (and also Skype)
<?xml version="1.0"?>
<root>
<!--
If you have any questions about these bits (or any suggestions for improvements), feel free to tweet me at @handcoding.
- Ashley
-->
<appdef>
<appname>SKYPE</appname>
<equal>com.skype.skype</equal>
</appdef>
<item>
<name>Fix Skype’s shortcut keys to be more Mac-like</name>
<appendix>* Command+Shift+[ Command+Shift+] to switch between conversations: <!-- Skype wants you to use Option+Command+Right (and Option+Command+Left) to switch between conversation, but it seemed like it might be easier to mimic Safari’s Command+Shift+] (and Command+Shift+[) shortcuts.--></appendix>
<identifier>private.skype_shortcuts</identifier>
<only>SKYPE</only>
<!-- Command+Shift+[ Command+Shift+] to Option+Command+Left and Option+Command+Right switch between sheets -->
<autogen>
__KeyToKey__
KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L,
KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L
</autogen>
</item>
<appdef>
<appname>EXCEL</appname>
<equal>com.microsoft.Excel</equal>
</appdef>
<item>
<name>Fix Excel’s shortcut keys to be more Mac-like</name>
<appendix>* Command+Enter to F2 to edit cells in Excel: Since F2 (to edit a cell) can be a bit awkward to hit on a Kinesis.</appendix>
<appendix>* Command+Shift+[ Command+Shift+] to switch between sheets: <!-- Excel wants you to use Option+Right (and Option+Left) to switch between sheets, but it seemed like it might be easier to mimic Safari’s Command+Shift+] (and Command+Shift+[) shortcuts.--></appendix>
<appendix>* Remap Command+F to Ctrl+Shift+F so that it triggers the "Find..." dialog instead of the simple find view</appendix>
<appendix>* Remap Shift+Enter to Option+Enter to make it easier to insert a carriage return into a cell</appendix>
<identifier>private.excel_shortcuts</identifier>
<only>EXCEL</only>
<!-- Excel’s shortcut keys via: https://support.office.com/en-us/article/Keyboard-shortcuts-in-Excel-2016-for-Mac-acf5419e-1f87-444d-962f-4e951a658ccd -->
<!-- Command+Enter to F2 to edit cells in Excel -->
<autogen>
__KeyToKey__
KeyCode::RETURN, ModifierFlag::COMMAND_L,
KeyCode::F2
</autogen>
<!-- Command+Shift+[ Command+Shift+] to Option+Left and Option+Right switch between sheets -->
<autogen>
__KeyToKey__
KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L,
KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L
</autogen>
<!-- Remap Command+F to Ctrl+Shift+F so that it triggers the "Find..." dialog instead of using the simple in-window find -->
<autogen>
__KeyToKey__
KeyCode::F, ModifierFlag::COMMAND_L,
KeyCode::F, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L
</autogen>
<!-- Remap Shift+Enter to Option+Enter to make it easier to insert a carriage return within a cell -->
<autogen>
__KeyToKey__
KeyCode::RETURN, ModifierFlag::SHIFT_L,
KeyCode::RETURN, ModifierFlag::OPTION_L
</autogen>
</item>
<item>
<name>Excel: Command+Left and Command+Right to move within cells</name>
<appendix>For some reason, Excel wants you to use Home (and presumably End) to move to the beginning or end of a line within a cell, which is bogus.</appendix>
<appendix>This also remaps Command+Up and Command+Down so that they move the cursor to the top or bottom of the current cell.</appendix>
<identifier>private.excel_fix_command_arrow_keys</identifier>
<only>EXCEL</only>
<uielementrole_only>AXTextArea, AXTextField</uielementrole_only>
<!-- You don’t really want Command+Left and Command+Right to be overridden all the time since that normally allows you to navigate via data regions: http://www.adventuresincre.com/6-indispensable-key-strokes-for-moving-around-excel-fast/ -->
<!-- Command+Left and Command+Right to move within cells in Excel -->
<autogen>
__KeyToKey__
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
KeyCode::HOME
</autogen>
<autogen>
__KeyToKey__
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::END
</autogen>
<!-- Command+Up and Command+Down to move to the top/bottom of the cell within Excel -->
<autogen>
__KeyToKey__
KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L,
KeyCode::HOME, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L,
KeyCode::END, ModifierFlag::COMMAND_L
</autogen>
</item>
<appdef>
<appname>WORD</appname>
<equal>com.microsoft.Word</equal>
</appdef>
<item>
<name>Fix Word’s shortcut keys to be more Mac-like</name>
<appendix>* Make Command+Up and Command+Down go to the top/bottom of the document.</appendix>
<appendix>* Make Option+Up and Option+Down go to the previous/next paragraph.</appendix>
<identifier>private.word_shortcuts</identifier>
<only>WORD</only>
<!-- Word'd shortcut keys via: https://support.office.com/en-us/article/Keyboard-shortcuts-in-Word-2016-for-Mac-3256d48a-7967-475d-be81-a6e3e1284b25 -->
<!-- Command+Up and Command+Down to move to the top/bottom of the document within Word -->
<autogen>
__KeyToKey__
KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L,
KeyCode::HOME, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L,
KeyCode::END, ModifierFlag::COMMAND_L
</autogen>
<!-- Option+Up and Option+UP to move to the previous/next paragraph within Word -->
<autogen>
__KeyToKey__
KeyCode::CURSOR_UP, ModifierFlag::OPTION_L,
KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::CURSOR_DOWN, ModifierFlag::OPTION_L,
KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment