PiyoPiyoDucky

Don't Do Agile, Be Agile

Emmet for Sublime Text 2 Pluginのキーバインドを修正する

Emmet for Sublime Text 2 pluginは行末に移動しようとすると悲劇が起こることで有名なプラグインです。

Preferences > Package Settings > Emmet > Key Bindings – Defaultを直接書き換える方法をよく見かけますが、パッケージのアップデートで元に戻ってしまいます。

直接編集しなくても、Ctrl DCtrl Eを再定義することでユーザー設定側に書くことができます。具体的にはPreferences > Key Bindings – Userに以下の内容を書きます。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[
    {
        "keys": [
            "ctrl d"
        ],
        "command": "right_delete"
    },
    {
        "keys": [
            "ctrl e"
        ],
        "command": "move_to",
        "args": {
            "to": "hardeol"
        }
    },
    {
        "keys": [
            "shift super x"
        ],
        "args": {
            "action": "match_pair_outward"
        },
        "command": "run_emmet_action",
        "context": [
            {
                "key": "emmet_action_enabled.match_pair_outward"
            }
        ]
    },
    {
        "keys": [
            "super e"
        ],
        "args": {
            "action": "expand_abbreviation"
        },
        "command": "run_emmet_action",
        "context": [
            {
                "key": "emmet_action_enabled.expand_abbreviation"
            }
        ]
    }
]

参考

Comments