Skip to content

Instantly share code, notes, and snippets.

@JoeArauzo
Last active September 19, 2025 01:43
Show Gist options
  • Save JoeArauzo/e9291b84eb074b8c43f88df519045abe to your computer and use it in GitHub Desktop.
Save JoeArauzo/e9291b84eb074b8c43f88df519045abe to your computer and use it in GitHub Desktop.
Vim Mode Plus for Karabiner-Elements - Complete setup guide with installation, configuration, and key mappings for system-wide Vim modal editing on macOS.

Vim Mode Plus for Karabiner-Elements

Prerequisites

  • macOS 10.15 or later

  • Karabiner-Elements 15.0 or later

  • External keyboard recommended (tested with Kinesis Freestyle2 MAC)

Installation

Step 1: Install Karabiner-Elements

Download and install Karabiner-Elements from https://karabiner-elements.pqrs.org/

Step 2: Grant Required Permissions

  1. System Settings > Privacy & Security > Input Monitoring

    • Enable karabiner_grabber

    • Enable karabiner_observer (if present)

  2. System Settings > General > Login Items & Extensions > Driver Extensions

    • Enable .Karabiner-VirtualHIDDevice-Manager

Step 3: Enable Keyboard Device

  1. Open Karabiner-Elements

  2. Go to Devices tab

  3. Find your keyboard and enable "Modify events"

Step 4: Import Configuration

  1. Go to Complex Modifications tab

  2. Click "Add your own rule"

  3. Copy and paste the complete JSON configuration below

  4. Click Add to import all 11 rules

Step 5: Enable All Rules

Enable each rule in the Complex Modifications list:

  • (Vim 1/11) caps_lock → on, caps_lock, esc, control+[ or any pointing_button → off

  • (Vim 2/11) finger on trackpad + any key → off

  • (Vim 3/11) visual mode + h,j,k,l,e,b,0,^,$,gg,G,{,} + d,y,c,x

  • (Vim 4/11) dd,de,db,d0,d^,d$,dgg,dG,d{,d}

  • (Vim 5/11) yy,ye,yb,y0,y^,y$,ygg,yG,y{,y}

  • (Vim 6/11) cc,ce,cb,c0,c^,c$,cgg,cG,c{,c}

  • (Vim 7/11) x,X,p,P,u,control+r

  • (Vim 8/11) h,j,k,l (+ control/option/command/shift),e,b,0,^,$,gg,G,{,}

  • (Vim 9/11) i,I,a,A,o,O

  • (Vim 10/11) s,m,spacebar → Hammerspoon modals

  • (Vim 11/11) disable unused keys

Usage

Basic Operation

  1. Enter Normal Mode: Press Caps Lock

    • Notification appears: "NORMAL - Vim Mode Enabled"

  2. Exit to Insert Mode: Press i or use any insert command

    • Notification disappears

  3. Navigation: Use h, j, k, l for arrow key movement

Navigation Commands

Key Action

h, j, k, l

Left, Down, Up, Right arrows

b

Jump to beginning of previous word

e

Jump to end of next word

0

Jump to line beginning

^ (Shift+6)

Jump to first non-space character

$ (Shift+4)

Jump to line end

gg

Jump to document top

G (Shift+g)

Jump to document bottom

Insert Mode Commands

Key Action

i

Insert at cursor position

I (Shift+i)

Insert at line beginning

a

Insert after cursor (append)

A (Shift+a)

Insert at line end

o

Insert new line below cursor

O (Shift+o)

Insert new line above cursor

Delete Commands

Key Action

dd

Delete entire line

de

Delete to end of word

db

Delete to beginning of word

d0

Delete to line beginning

d$ (d+Shift+4)

Delete to line end

dgg

Delete to document top

dG (d+Shift+g)

Delete to document bottom

x

Delete character forward

X (Shift+x)

Delete character backward

Copy (Yank) Commands

Key Action

yy

Copy entire line

ye

Copy to end of word

yb

Copy to beginning of word

y0

Copy to line beginning

y$ (y+Shift+4)

Copy to line end

ygg

Copy to document top

yG (y+Shift+g)

Copy to document bottom

Visual Mode

  1. Press v in Normal mode to enter Visual mode

  2. Use navigation keys to select text

  3. Use d to delete, y to copy, c to change selection

  4. Press v again to return to Normal mode

Other Commands

Key Action

p

Paste after cursor

P (Shift+p)

Paste before cursor

u

Undo

Ctrl+r

Redo

Escape

Exit to Insert mode

Ctrl+[

Exit to Insert mode

Troubleshooting

Caps Lock Still Functions Normally

  • Verify "Modify events" is enabled for your keyboard in Devices tab

  • Restart Karabiner-Elements completely

  • Check that all 11 rules are enabled in correct order

No Notifications Appear

  • This is normal - functionality should still work

  • The configuration uses built-in Karabiner notifications

  • Focus on testing actual key behavior rather than notifications

Some Keys Don’t Work

  • Test in TextEdit or Notes (simple applications work best)

  • Ensure you’re in Normal mode (press Caps Lock first)

  • Check that specific rule is enabled in Complex Modifications

Corporate Security Software Issues

  • Contact IT department if using managed Mac with endpoint security

  • CrowdStrike Falcon and similar tools may block key modification

  • Request whitelisting of Karabiner-Elements processes

Configuration JSON

Copy and paste the complete Vim Mode Plus JSON configuration here. The configuration should include all 11 rules from (Vim 1/11) through (Vim 11/11).

{
  "title": "Vim Mode Plus",
  "maintainers": [
    "gilitos92"
  ],
  "rules": [
    {
      "description": "(Vim 1/11) caps_lock -> on, caps_lock, esc, control+[ or any pointing_button -> off",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock"
          },
          "to_if_alone": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "halt": true,
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": "NORMAL - Vim Mode Enabled"
              }
            }
          ],
          "to_if_held_down": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": "NORMAL - Vim Mode Enabled"
              }
            }
          ],
          "to_after_key_up": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_unless",
              "value": 1
            }
          ],
          "parameters": {
            "basic.to_if_alone_threshold_milliseconds": 0,
            "basic.to_if_held_down_threshold_milliseconds": 100
          }
        },
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "escape"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "control"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "any": "key_code"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_if",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "any": "pointing_button"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 2/11) finger on trackpad + any key -> off",
      "available_since": "12.6.9",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "any": "key_code"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "name": "multitouch_extension_finger_count_total",
              "type": "variable_unless",
              "value": 0
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 3/11) visual mode + h,j,k,l,e,b,0,^,$,gg,G,{,} + d,y,c,x",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "v"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": "VISUAL - Visual Mode Enabled"
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "visual_mode",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "v"
          },
          "to": [
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "escape"
          },
          "to": [
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "h"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "j"
          },
          "to": [
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_shift"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "k"
          },
          "to": [
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_shift"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "l"
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "e"
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "b"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "0"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "6",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "4",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "g_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "g_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "g_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "g_pressed",
                "value": 0
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "g_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "a",
              "modifiers": [
                "left_shift",
                "left_control"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "e",
              "modifiers": [
                "left_shift",
                "left_control"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "d"
          },
          "to": [
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "y"
          },
          "to": [
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "c"
          },
          "to": [
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "x"
          },
          "to": [
            {
              "key_code": "delete_or_backspace"
            },
            {
              "set_variable": {
                "name": "visual_mode",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 1
              }
            },
            {
              "set_notification_message": {
                "id": "visual_mode_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_shift",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_shift"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_shift",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_shift"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "any": "key_code",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "vk_none"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "visual_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 4/11) dd,de,db,d0,d^,d$,dgg,dG,d{,d}",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "d"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "d_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "d"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "e"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "b"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "0"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "6",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "4",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "dg_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "dg_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "dg_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "dg_pressed",
                "value": 0
              }
            },
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "dg_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "a",
              "modifiers": [
                "left_control",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "d_pressed",
                "value": 0
              }
            },
            {
              "key_code": "k",
              "modifiers": [
                "left_control"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "d_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 5/11) yy,ye,yb,y0,y^,y$,ygg,yG,y{,y}",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "y"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "y_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "y"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "e"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "b"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "0"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "6",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "4",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "yg_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "yg_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "yg_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "yg_pressed",
                "value": 0
              }
            },
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "yg_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "a",
              "modifiers": [
                "left_control",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "y_pressed",
                "value": 0
              }
            },
            {
              "key_code": "e",
              "modifiers": [
                "left_control",
                "left_shift"
              ]
            },
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "y_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 6/11) cc,ce,cb,c0,c^,c$,cgg,cG,c{,c}",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "c"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "c_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "c"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "e"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "b"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_shift",
                "left_alt"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "0"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "6",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "4",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "set_variable": {
                "name": "cg_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "cg_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "cg_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "cg_pressed",
                "value": 0
              }
            },
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "cg_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_shift",
                "left_command"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "a",
              "modifiers": [
                "left_control",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "c_pressed",
                "value": 0
              }
            },
            {
              "key_code": "e",
              "modifiers": [
                "left_control",
                "left_shift"
              ]
            },
            {
              "key_code": "x",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "c_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 7/11) x,X,p,P,u,control+r",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "x"
          },
          "to": [
            {
              "key_code": "delete_forward"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "x",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "delete_or_backspace"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "p"
          },
          "to": [
            {
              "key_code": "v",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "p",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "v",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "u"
          },
          "to": [
            {
              "key_code": "z",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "r",
            "modifiers": {
              "mandatory": [
                "control"
              ]
            }
          },
          "to": [
            {
              "key_code": "z",
              "modifiers": [
                "left_command",
                "left_shift"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 8/11) h,j,k,l (+ control/option/command/shift),e,b,0,^,$,gg,G,{,}",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "h",
            "modifiers": {
              "optional": [
                "control",
                "option",
                "command",
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "j",
            "modifiers": {
              "optional": [
                "control",
                "option",
                "command",
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "k",
            "modifiers": {
              "optional": [
                "control",
                "option",
                "command",
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "l",
            "modifiers": {
              "optional": [
                "control",
                "option",
                "command",
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "e"
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_alt"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "b"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_alt"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "0"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "6",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "4",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "set_variable": {
                "name": "g_pressed",
                "value": 1
              }
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "g_pressed",
                  "value": 0
                }
              }
            ]
          },
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 500
          },
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "g_pressed",
              "type": "variable_unless",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g"
          },
          "to": [
            {
              "key_code": "up_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "g_pressed",
                "value": 0
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            },
            {
              "name": "g_pressed",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "a",
              "modifiers": [
                "left_control"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "e",
              "modifiers": [
                "left_control"
              ]
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 9/11) i,I,a,A,o,O",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "i"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "i",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "a"
          },
          "to": [
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "a",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "o"
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "return_or_enter"
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "o",
            "modifiers": {
              "mandatory": [
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_command"
              ]
            },
            {
              "key_code": "return_or_enter"
            },
            {
              "key_code": "up_arrow"
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 10/11) s,m,spacebar -> Hammerspoon modals",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "s"
          },
          "to": [
            {
              "key_code": "f20"
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "m"
          },
          "to": [
            {
              "key_code": "f19"
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "spacebar"
          },
          "to": [
            {
              "key_code": "f18"
            },
            {
              "set_variable": {
                "name": "vim_mode",
                "value": 0
              }
            },
            {
              "set_notification_message": {
                "id": "vim_mode_plus_enabled",
                "text": ""
              }
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    },
    {
      "description": "(Vim 11/11) disable unused keys",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_shift",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_shift"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_shift",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_shift"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_control",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_control",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_control"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_option",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_option"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_option",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_option"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_command"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_command"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "any": "key_code",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "vk_none"
            }
          ],
          "conditions": [
            {
              "type": "frontmost_application_unless",
              "bundle_identifiers": []
            },
            {
              "name": "vim_mode",
              "type": "variable_if",
              "value": 1
            }
          ]
        }
      ]
    }
  ]
}

Credits

This configuration is adapted from the "Vim Mode Plus with better notifications" by gilitos92, originally hosted at https://ke-complex-modifications.pqrs.org/. The configuration has been modified to use Karabiner’s built-in notification system instead of external shell commands for improved compatibility with corporate security environments.

License

This configuration is provided as-is for educational and personal use. Modify and redistribute freely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment