MAC Karabiner Vi Mode Code

MAC Karabiner Vi Mode Code

in

맥에서 여러가지 키변경을 위한 프로그램으로 Karabiner를 가장 많이 사용하는 것 같습니다. Karabiner에서는 여러 기능키 조합을 통해 json 형식으로 다른 단축키를 생성할 수 있는 기능이 있습니다.

아래 코드는 Hyper Key + h, j, k, l 키를 방향키처럼 사용할 수 있는 코드 입니다.

Vim의 커서이동에 익숙한 사람이라면 Vim이 아닌 환경에서도 방향키에 손을 옮기지 않고 이동할 수 있기때문에 굉장히 유용 합니다.

Karabiner Vi Mode code (hyper + hjkl. shift/option/command + arrow working)

{
  "title": "Hyper + HJKL navigation",
  "rules": [
    {
      "description": "Change Hyper + H/J/K/L to Arrow Keys, X to forward delete",
      "manipulators": [
        {
          "from": {
            "key_code": "h",
            "modifiers": {
              "mandatory": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "j",
            "modifiers": {
              "mandatory": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "k",
            "modifiers": {
              "mandatory": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "l",
            "modifiers": {
              "mandatory": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "x",
            "modifiers": {
              "mandatory": [
                "left_shift",
                "left_command",
                "left_control",
                "left_option"
              ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "delete_forward"
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}