Skip to content

macos – Can I swap the command and control only in iterm2 with karabiner?

  • by
Spread the love


So I’m new to Karabiner, and I’m trying to swap the command and control key only when I’m in iterm2. Here’s the json file I came up with. Currently it swaps the control key to a command key but does not switch the command key to a control key.

{
  "title": "CTRL/CMD Key Swap",
  "rules": [
    {
      "description": "swap left control/command keys for iterm2",
      "manipulators": [

        {
          "type": "basic",
          "from": {
            "key_code": "left_command"
          },
          "to": {
            "key_code": "left_control"
          },
          "conditions": [
            {
              "type": "frontmost_application_if",
              "bundle_identifiers": [
                "^com.googlecode.iterm2$"
              ]
            }
          ]
        },
         {
          "type": "basic",
          "from": {
            "key_code": "left_control"
          },
          "to": {
            "key_code": "left_command"
          },
          "conditions": [
            {
              "type": "frontmost_application_if",
              "bundle_identifiers": [
                "^com.googlecode.iterm2$"
              ]
            }
          ]
        }
      ]
    }
  ]
}

How can I swap the command and control key only when I’m in iterm2 app?

Leave a Reply

Your email address will not be published. Required fields are marked *