Sublime 3 - Goto 定義関数のキーマップを設定する 質問する

Sublime 3 - Goto 定義関数のキーマップを設定する 質問する

関数/メソッドを開くためのEclipse スタイルのショートカットCtrl+を作成したいと思います。 Sublime Text 3 にはすでにこの関数が呼び出されていますが、 にバインドされています。MouseClickgoto_definitionF12

しかし、このバインディングをどうやって作成すればいいのか分かりません。ここドキュメント用に探しましたが、複雑すぎました。この簡単なキーバインディングについて、どなたか教えていただけませんか?

編集:この記事に従って、次のようにするように言われました:http://webtempest.com/better-definition-navigation-in-sublime-text-3/

[
    {
        "button": "button1", 
        "count": 1, 
        "modifiers": ["super", "shift"],
        "press_command": "drag_select",
        "command": "goto_definition"
    }
]

これは動作しないようです。ctrl+ shift+ はclick何も実行しません。

ベストアンサー1

For anyone else who wants to set Eclipse style goto definition, you need to create .sublime-mousemap file in Sublime User folder.

Windows - create Default (Windows).sublime-mousemap in %appdata%\Sublime Text 3\Packages\User

Linux - create Default (Linux).sublime-mousemap in ~/.config/sublime-text-3/Packages/User

Mac - create Default (OSX).sublime-mousemap in ~/Library/Application Support/Sublime Text 3/Packages/User

Now open that file and put the following configuration inside

[
    {
        "button": "button1", 
        "count": 1, 
        "modifiers": ["ctrl"],
        "press_command": "drag_select",
        "command": "goto_definition"
    }
]

You can change modifiers key as you like.


Since Ctrl-button1 on Windows and Linux is used for multiple selections, adding a second modifier key like Alt might be a good idea if you want to use both features:

[
    {
        "button": "button1", 
        "count": 1, 
        "modifiers": ["ctrl", "alt"],
        "press_command": "drag_select",
        "command": "goto_definition"
    }
]

Alternatively, you could use the right mouse button (button2) with Ctrl alone, and not interfere with any built-in functions.

おすすめ記事