7

I am used to vim and like to move with H, J, K, L. I would like to avoid switching to the arrow keys when I am in a text field for example.

Is there a way to remap the following keys in all application on Mac OS X, so that:

can also be triggered by OPTION H

can also be triggered by OPTION J

can also be triggered by OPTION K

can also be triggered by OPTION L

3 Answers 3

7

You can use Karabiner to remap keys.

A powerful and stable keyboard customizer for OS X.

This page details how to add custom behaviors.

3
  • Can anyone please share the relevant config to get this done? Commented Feb 28, 2015 at 12:59
  • I second this. I downloaded Karabiner, but couldn't get it to work on my own. Commented Aug 21, 2022 at 13:16
  • The linked page is not available
    – ahmedjaad
    Commented Feb 15 at 16:51
0

Just done using Better Touch Tool for osx. It features a wweet options to sync your settings online. When it comes to browsing, it doesn't beat vimium. I'm using both

0

After installing Karabiner and giving required permissions, go to "Complex Modifications" tab on the left and click the "Add your own rule" button. Then paste this code:

{
"description": "Remap arrow keys to Option+JKLI",
"manipulators": [
    {
        "from": {
            "key_code": "i",
            "modifiers": {
                "mandatory": [
                    "option"
                ]
            }
        },
        "to": [
            {
                "key_code": "up_arrow"
            }
        ],
        "type": "basic"
    },
    {
        "from": {
            "key_code": "j",
            "modifiers": {
                "mandatory": [
                    "option"
                ]
            }
        },
        "to": [
            {
                "key_code": "left_arrow"
            }
        ],
        "type": "basic"
    },
    {
        "from": {
            "key_code": "k",
            "modifiers": {
                "mandatory": [
                    "option"
                ]
            }
        },
        "to": [
            {
                "key_code": "down_arrow"
            }
        ],
        "type": "basic"
    },
    {
        "from": {
            "key_code": "l",
            "modifiers": {
                "mandatory": [
                    "option"
                ]
            }
        },
        "to": [
            {
                "key_code": "right_arrow"
            }
        ],
        "type": "basic"
    }
]
}

Feel free to change to the keys you want. This remaps the arrow keys to Option+JKLI

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .