Skip to content

Instantly share code, notes, and snippets.

@narze
Last active August 9, 2022 22:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save narze/861e2167784842d38771 to your computer and use it in GitHub Desktop.
Save narze/861e2167784842d38771 to your computer and use it in GitHub Desktop.
Super Duper mode for Karabiner
<?xml version="1.0"?>
<root>
<!--
Adapted from the built-in "Simultaneous Vi Mode" option:
https://github.com/tekezo/KeyRemap4MacBook/blob/6aa99ba/src/core/server/Resources/include/checkbox/simultaneouskeypresses_vi_mode.xml#L4
-->
<item>
<name>(S)uper (D)uper Mode</name>
<item>
<name>What's (S)uper (D)uper Mode?</name>
<identifier vk_config="true">notsave.com.jasonrudolph.simultaneouskeypresses_vimode</identifier>
<autogen>__ShowStatusMessage__ (S)uper (D)uper Mode</autogen>
<appendix>To activate, push S and D keys simultaneously and hold them down.</appendix>
<appendix>Now you're in (S)uper (D)uper mode. It's like a secret keyboard _inside_ your keyboard. (Whoa.)</appendix>
<appendix>It's optimized for keeping you on the home row, or very close to it.</appendix>
<appendix>---</appendix>
<appendix>Now you can:</appendix>
<appendix>- Use H/J/K/L for Left/Down/Up/Right</appendix>
<appendix>- Use F for Delete</appendix>
<appendix>- Use A for Option (AKA Alt)</appendix>
<appendix>- Use Space for Shift</appendix>
<appendix>- Use M to copy</appendix>
<appendix>- Use , to paste</appendix>
<appendix>- Use MM to copy current line</appendix>
<appendix>- Use A+J/K for Page Down/Up</appendix>
<appendix>- Use I/O to move left/right between tabs</appendix>
<appendix>- Use U/P to go to the first/last tab (in most apps)</appendix>
<appendix>- Use A+H/L to move to previous/next word in all apps (including iTerm 2)</appendix>
<appendix>- Use G/; to delete/forward delete</appendix>
<appendix>- Use A+G/; to delete to previous/next word (including iTerm 2)</appendix>
<autogen>__KeyToKey__ KeyCode::A, KeyCode::OPTION_L</autogen>
<block>
<only>TERMINAL</only>
<autogen>
--KeyToKey--
{{VI_H}}, VK_OPTION | ModifierFlag::NONE,
KeyCode::ESCAPE,
KeyCode::RawValue::0xb <!-- Esc + B : Move to previous word -->
</autogen>
<autogen>
--KeyToKey--
{{VI_L}}, VK_OPTION | ModifierFlag::NONE,
KeyCode::ESCAPE,
KeyCode::RawValue::0xe <!-- Esc + F : Move to next word -->
</autogen>
<autogen>
__KeyToKey__
KeyCode::G, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::RawValue::0xd | ModifierFlag::CONTROL_L, <!-- Ctrl + W : Delete Word -->
</autogen>
<autogen>
__KeyToKey__
KeyCode::SEMICOLON, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::ESCAPE,
KeyCode::RawValue::0x5 <!-- Esc + D : Forward Delete Word -->
</autogen>
</block>
<autogen>
__KeyToKey__
{{VI_J}}, VK_OPTION | ModifierFlag::NONE,
KeyCode::PAGEDOWN
</autogen>
<autogen>
__KeyToKey__
{{VI_K}}, VK_OPTION | ModifierFlag::NONE,
KeyCode::PAGEUP
</autogen>
<autogen>__KeyToKey__ {{VI_H}}, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ {{VI_J}}, KeyCode::CURSOR_DOWN</autogen>
<autogen>__KeyToKey__ {{VI_K}}, KeyCode::CURSOR_UP</autogen>
<autogen>__KeyToKey__ {{VI_L}}, KeyCode::CURSOR_RIGHT</autogen>
<autogen>__KeyToKey__ KeyCode::F, KeyCode::DELETE</autogen>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::SHIFT_L</autogen>
<block>
<lastpressedphysicalkey_only>KeyCode::M</lastpressedphysicalkey_only>
<elapsedtimesincelastpressed_lessthan>Millisecond::RawValue::200</elapsedtimesincelastpressed_lessthan>
<autogen>
__KeyToKey__
KeyCode::M,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L,
KeyCode::C, ModifierFlag::COMMAND_L
</autogen>
</block>
<autogen>
__KeyToKey__
KeyCode::M,
KeyCode::C, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::COMMA,
KeyCode::V, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::I, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::VK_MOUSEKEY_SCROLL_DOWN
</autogen>
<autogen>
__KeyToKey__
KeyCode::O, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::VK_MOUSEKEY_SCROLL_UP
</autogen>
<autogen>
__KeyToKey__
KeyCode::U, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::VK_MOUSEKEY_SCROLL_LEFT
</autogen>
<autogen>
__KeyToKey__
KeyCode::P, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::VK_MOUSEKEY_SCROLL_RIGHT
</autogen>
<autogen>
__KeyToKey__
KeyCode::I,
KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::O,
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::U,
KeyCode::KEY_1, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::P,
KeyCode::KEY_9, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::SEMICOLON, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::DELETE, ModifierFlag::OPTION_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::SEMICOLON, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::DELETE
</autogen>
<autogen>
__KeyToKey__
KeyCode::SEMICOLON,
KeyCode::FORWARD_DELETE
</autogen>
<autogen>
__KeyToKey__
KeyCode::G,
KeyCode::DELETE
</autogen>
<autogen>
__KeyToKey__
KeyCode::G, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::DELETE, ModifierFlag::OPTION_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::SEMICOLON, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::FORWARD_DELETE, ModifierFlag::OPTION_L
</autogen>
</item>
<item>
<name>Simultaneous Key Presses [S+D] turns on "(S)uper (D)uper mode"</name>
<identifier>remap.com_jasonrudolph_simultaneouskeypresses_vimode_sd</identifier>
<autogen>
__SimultaneousKeyPresses__
KeyCode::D, KeyCode::S, KeyCode::VK_CONFIG_SYNC_KEYDOWNUP_notsave_com_jasonrudolph_simultaneouskeypresses_vimode
</autogen>
</item>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment