Remap Ctrl+C, Ctrl+V, and Ctrl-X only [duplicate]

I know that I can globally swap the Control and Command in Mac OS and this is not what I need. What I would like to do is keep both buttons as they are and only and make Ctrl+C, Ctrl+V, and Ctrl-X work as if they were pressed with the Command button. What is the easiest way to do this?


Solution 1:

One option would be to use DefaultKeyBinding.dict, but it wouldn't work in all applications or text views.

{
    "^x" = cut:;
    "^c" = copy:;
    "^v" = paste:;
}

KeyRemap4MacBook would work almost everywhere, and it also allows excluding specific applications.

Here's the definition of the remapping selected in the screenshot:

<item>
  <name>Use PC Style Copy/Paste</name>
  <appendix>(Control+C to Command_L+C)</appendix>
  <appendix>(Control+V to Command_L+V)</appendix>
  <appendix>(Control+X to Command_L+X)</appendix>
  <appendix>(Except in Terminal, VM, RDC, Emacs, X11, Eclipse)</appendix>
  <identifier>remap.copy_paste_winstyle_no_term</identifier>
  <not>EMACS, TERMINAL, VIRTUALMACHINE, REMOTEDESKTOPCONNECTION, X11, ECLIPSE</not>
  <autogen>--KeyToKey-- KeyCode::C, VK_CONTROL, KeyCode::C, ModifierFlag::COMMAND_L</autogen>
  <autogen>--KeyToKey-- KeyCode::V, VK_CONTROL, KeyCode::V, ModifierFlag::COMMAND_L</autogen>
  <autogen>--KeyToKey-- KeyCode::X, VK_CONTROL, KeyCode::X, ModifierFlag::COMMAND_L</autogen>
</item>

Solution 2:

You can install and configue Karabiner app with the following configuration of private.xml file (edit in Misc tab):

<?xml version="1.0"?>
<root>
  <item>
    <name>Copy with Ctrl-C</name>
    <identifier>private.use_ctrl_c_for_copy</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::C, ModifierFlag::CONTROL_L,
        KeyCode::C, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Cut with Ctrl-X</name>
    <identifier>private.use_ctrl_x_for_cut</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::X, ModifierFlag::CONTROL_L,
        KeyCode::X, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Paste with Ctrl-V</name>
    <identifier>private.use_ctrl_v_for_paste</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::V, ModifierFlag::CONTROL_L,
        KeyCode::V, ModifierFlag::COMMAND_L
    </autogen>
  </item>
</root>

and enable newly created item after reloading the file in the Change Key tab.

Solution 3:

Another option would be to use BetterTouchTool.
It is pretty straightforward to use, and you can set it up to trigger any action from a keyboard shortcut: BetterTouchTool screenshot

However, by doing this, CTRL+C or CTRL+X no longer works as expected inside the terminal. But you can disable BTT for Terminal completely to handle this case.