Sublime Text 3 - 特定于语言的 Goto 定义键盘快捷键

2024-04-15

如何根据我正在使用的语言设置“Goto Definition”工作。

例如:

在 Python 中,我想使用 PythonIDE 的 go to 定义:

{
        "keys": ["ctrl+d"],
        "command": "python_goto_definition"
    },

而且,对于任何其他语言,例如 Go,我想使用 GoSublime 的 go to 定义:

{
        "keys": ["ctrl+d"],
        "command": "go_sublime_goto_definition"
    },

我想知道如何设置上下文?


您想要的上下文是selector:

{
    "keys": ["ctrl+d"],
    "command": "python_goto_definition",
    "context": [
        { "key": "selector", "operator": "equal", "operand": "source.python" }
    ]
},

You can add more or less specificity as needed. Use Ctrl+Shift+Alt+P or Shift+Ctrl+P (MacOS) to view the scope selector for the current position.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Sublime Text 3 - 特定于语言的 Goto 定义键盘快捷键 的相关文章