Skip to content

Instantly share code, notes, and snippets.

@ColinTheRobot
Forked from burtlo/private.xml
Last active March 24, 2021 03:59
Show Gist options
  • Save ColinTheRobot/88744ae95c7d9800e346 to your computer and use it in GitHub Desktop.
Save ColinTheRobot/88744ae95c7d9800e346 to your computer and use it in GitHub Desktop.
TMUX: Rebinding CAPS LOCK to CTRL + B

Disabling CAPS LOCK

If you haven't already done so, gain an extra key and open up your System Preferences > Keyboard > Modifier Keys ... and rebind CAPSLOCK to No Action.

Rebinding CAPSLOCK to CONTROL_R (Right Control Key)

  • Install Seil
  • Open System Preferences > Seil
  • Change "Caps Lock" to keycode 62.

Rebinding CONTROL_R (Right Control Key) to CONTROL + B

  • Install Karabiner

  • Open System Preferences > Karabiner> Misc & Uninstall

  • Click "Open private.xml"

  • Copy and Paste the private.xml provided with in this gist.

  • Open System Preferences > Karabiner > Change Key

  • Click "ReloadXML"

  • Toggle open "TMUX Key Remappings"

  • Check "TMUX: Right Control to Control+B

If instead of replacing your private.xml you add:

    <item>
      <name>TMUX: Right Control to Ctrl+B</name>
      <appendix>TMUX Key Remappings</appendix>
      <identifier>private.right_control_to_control_b</identifier>
      <autogen>
        --KeyToKey-- 
        KeyCode::CONTROL_R,
        KeyCode::B, ModifierFlag::CONTROL_L
      </autogen>
    </item>

to your existing private.xml, then it also works in iTerm.

<?xml version="1.0"?>
<root>
<appdef>
<appname>Terminal</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<item>
<name>TMUX Key Remappings</name>
<item>
<name>TMUX: Right Control to Ctrl+B</name>
<identifier>private.right_control_to_control_b</identifier>
<only>Terminal</only>
<autogen>
--KeyToKey--
KeyCode::CONTROL_R,
KeyCode::B, ModifierFlag::CONTROL_L
</autogen>
</item>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment