3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Karabiner-Elements] イコール (=) を長押ししたらコロンイコール (:=) と入力できるようにする

Posted at

概要

Go を書いているときに、代入文で Shift-; + = と入力するのが少々面倒だったので、
= を長押ししたら := と入力できるようにしました。

Karabiner-Elements とは

設定

~/.config/karabiner/karabiner.json を開いて
profiles > complex_modifications > rules の中に下記ルールを追加してください。

{
  "description": "イコール(=)を長押ししたらコロンイコール(:=)に置換する",
  "manipulators": [
      {
          "from": {
              "key_code": "equal_sign",
              "modifiers": {
                  "optional": [
                      "caps_lock"
                  ]
              }
          },
          "to": {
              "key_code": "equal_sign",
              "repeat": false
          },
          "to_if_held_down": [
              {
                  "key_code": "delete_or_backspace"
              },
              {
                  "key_code": "semicolon",
                  "modifiers": [
                      "left_shift"
                  ]
              },
              {
                  "key_code": "equal_sign",
                  "repeat": false
              }
          ],
          "parameters": {
              "basic.to_if_held_down_threshold_milliseconds": 200
          },
          "type": "basic"
      }
  ]
}

下記はお好みの長さに調節してください。この設定だと 200 ミリ秒長押ししたときに := になります。

"basic.to_if_held_down_threshold_milliseconds": 200
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?