Skip to content

Instantly share code, notes, and snippets.

@rednebmas
Last active January 12, 2017 17:11
Show Gist options
  • Save rednebmas/10f6e43881aaed36c94a1c9b5511f21b to your computer and use it in GitHub Desktop.
Save rednebmas/10f6e43881aaed36c94a1c9b5511f21b to your computer and use it in GitHub Desktop.
Karabiner (https://pqrs.org/osx/karabiner/) customization file
<?xml version="1.0"?>
<root>
<appdef>
<appname>GOOGLE_CHROME</appname>
<equal>com.google.Chrome</equal>
</appdef>
<appdef>
<appname>TERMINAL</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<appdef>
<appname>SUBLIME</appname>
<equal>com.sublimetext.3</equal>
</appdef>
<item>
<name>Switch tabs in sublime</name>
<identifier>switch-tabs-in-sublime</identifier>
<only>SUBLIME</only>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
</item>
<item>
<name>Switch tabs in chrome</name>
<identifier>switch-tabs-in-chrome</identifier>
<only>GOOGLE_CHROME</only>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L
</autogen>
</item>
<item>
<name>Switch tabs in terminal</name>
<identifier>switch-tabs-in-terminal</identifier>
<only>TERMINAL</only>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
</item>
<item>
<name>VimEm: control+jklh to arrow keys and control+shift+jklh to shift+arrow_keys</name>
<identifier>private-vim-em-arrow-keys</identifier>
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::CURSOR_UP
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT
</autogen>
<!-- Allows you to use LEFT shift to select -->
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L
</autogen>
<!-- Allows you to use RIGHT shift to select -->
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_R
</autogen>
</item>
<item>
<name>VimEm: control+command+jklh to command+arrow_keys</name>
<identifier>private-vim-like-arrows-command</identifier>
<not>XCODE</not>
<!-- Allows you to use LEFT COMMAND to jump -->
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L
</autogen>
</item>
<item>
<name>VimEm: control+command+shift+jklh to command+shift+arrow_keys</name>
<identifier>private-vim-like-arrows-command-plus-shift</identifier>
<not>XCODE</not>
<!-- Allows you to use LEFT COMMAND to jump -->
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::J, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::K, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_R | ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L | ModifierFlag::COMMAND_L
</autogen>
</item>
<item>
<name>VimEm: option+h and option+l to option+left_arrow and option+right_arrow</name>
<identifier>private-vim-like-byword</identifier>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L
</autogen>
</item>
<item>
<name>VimEm: shift+option+h and shift+option+l to option+left_arrow and option+right_arrow</name>
<not>XCODE</not>
<identifier>private-vim-like-byword-with-shift</identifier>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::H, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R
</autogen>
<autogen>
__KeyToKey__
KeyCode::L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment