試してみたブログ

AI関連・iPhone/Pixelなどのガジェット・音声入力・サーマルプリンタなど興味をある事をどんどん試してみた際の記録

Karabiner-Elementsで行頭移動、行末移動、単語移動(Foward-word/Back-word)を割り当てた

背景

  • 元々Karabiner-Elementsを使って、hjklでの移動を割り当てていた
  • 「英数」を押しながらhjklでの移動が出来ていた
  • 行頭移動(a/^e)と単語移動(option+←→)のショートカットがあるのは知りつつも、左手小指の操作に慣れなかった

試してみた

  • Karabiner-Elementsの既にブループリントに既に、「(enthumble)無変換/英数+「A,E」で「Ctrl-A、Ctrl+E」があったので有効化
{
    "description": "(enthumble) 無変換/英数 + 「A,E」で「Ctrl-A, Ctrl-E」",
    "extra_description_level": 1,
    "extra_descriptions": ["無変換/英数 + A,E -> Ctrl-A, Ctrl-E"],
    "manipulators": [
        {
            "from": {
                "key_code": "international5",
                "modifiers": { "optional": ["any"] }
            },
            "to": [
                {
                    "key_code": "fn",
                    "lazy": true
                }
            ],
            "to_if_alone": [{ "key_code": "japanese_eisuu" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "lang2",
                "modifiers": { "optional": ["any"] }
            },
            "to": [
                {
                    "key_code": "fn",
                    "lazy": true
                }
            ],
            "to_if_alone": [{ "key_code": "japanese_eisuu" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "a",
                "modifiers": {
                    "mandatory": ["fn"],
                    "optional": ["shift", "control", "caps_lock"]
                }
            },
            "to": [
                {
                    "key_code": "a",
                    "modifiers": ["control"]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "e",
                "modifiers": {
                    "mandatory": ["fn"],
                    "optional": ["shift", "control", "caps_lock"]
                }
            },
            "to": [
                {
                    "key_code": "e",
                    "modifiers": ["control"]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 単語移動のは見当たらなかったのでjsonに追加した
{
    "description": "Change right_command+hjkl to arrow keys",
    "manipulators": [
        {
            "from": {
                "key_code": "h",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["any"]
                }
            },
            "to": [{ "key_code": "left_arrow" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "j",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["any"]
                }
            },
            "to": [{ "key_code": "down_arrow" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "k",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["any"]
                }
            },
            "to": [{ "key_code": "up_arrow" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "l",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["any"]
                }
            },
            "to": [{ "key_code": "right_arrow" }],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "w",
                "modifiers": {
                    "mandatory": ["fn"],
                    "optional": ["any"]
                }
            },
            "to": [
                {
                    "key_code": "right_arrow",
                    "modifiers": ["left_option"]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "b",
                "modifiers": {
                    "mandatory": ["fn"],
                    "optional": ["any"]
                }
            },
            "to": [
                {
                    "key_code": "left_arrow",
                    "modifiers": ["left_option"]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "f",
                "modifiers": {
                    "mandatory": ["fn"],
                    "optional": ["any"]
                }
            },
            "to": [
                {
                    "key_code": "right_arrow",
                    "modifiers": ["left_option"]
                }
            ],
            "type": "basic"
        }
    ]
}

振り返り

  • 設定は苦労したが、これで効率はだいぶあがりそう
  • ツールと自分、どっちが合わせるか|honeshabri これにもあるように、ツール側にあわせるか自分側に合わせるかはある物の、今まで活用出来なかった事を活用出来る様にするという観点で許容した。
  • BQのコンソール上でクエリを書く事が多いので、単語移動、行頭末移動を使いこなしていきたい