duanou2016 2016-08-05 14:35
浏览 359
已采纳

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

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?

  • 写回答

1条回答 默认 最新

  • dpgf42422 2016-08-05 18:53
    关注

    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 <kbd>Ctrl+Shift+Alt+P</kbd> or <kbd>Shift+Ctrl+P</kbd> (MacOS) to view the scope selector for the current position.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 vue2(标签-chrome|关键词-浏览器兼容)
  • ¥15 python网络流自动生成系统 医学领域
  • ¥15 sql查询仓库里都有什么
  • ¥15 代码的修改,添加和运行完善
  • ¥15 krpano-场景分组和自定义地图分组
  • ¥15 lammps Gpu加速出错
  • ¥15 关于PLUS模型中kapaa值的问题
  • ¥15 关于博途V17进行仿真时无法建立连接问题
  • ¥15 机器学习教材中的例题询问
  • ¥15 求.net core 几款免费的pdf编辑器