Sublime Text 3 - 特定语言转到定义键盘快捷键 [英] Sublime Text 3 - Language specific Goto definition Keyboard Shortcut
问题描述
如何根据我正在使用的语言设置Goto Definition工作。
例如:
在Python中,我想使用PythonIDE的定义:
pre $ {
keys:[ ctrl + d],
command:python_goto_definition
},
另外,对于任何其他语言,例如Go,我想使用GoSublime的定义:
{
keys:[ctrl + d],
command:go_sublime_goto_definition
},
我在想如何设置上下文?
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $' :[ctrl + d],
command:python_goto_definition,
context:[
{key:selector,operator:equal ,operand:source.python}
]
},
您可以根据需要添加更多或更少的特异性。使用 Ctrl + Shift + Alt + P 或 Shift + Ctrl + P (MacOS)可查看当前位置的范围选择器。
How can I set "Goto Definition" work according to the language I'm working on.
For example:
In Python I want to use PythonIDE's go to definition:
{
"keys": ["ctrl+d"],
"command": "python_goto_definition"
},
And, for any other language, for instance Go, I want to use GoSublime's go to definition:
{
"keys": ["ctrl+d"],
"command": "go_sublime_goto_definition"
},
I'm wondering how can I set the context?
The context that you want is for 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.
这篇关于Sublime Text 3 - 特定语言转到定义键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!