绑定命令调色板命令的快捷方式? [英] Bind shortcut to command palette command?
问题描述
我刚刚安装了一个名为CodeSniffer(http://soulbroken.co.uk/code/sublimephpcs)的插件,我想将其中的一个命令从命令面板链接到键盘快捷方式,因为我经常使用它.
I just installed a plugin called CodeSniffer (http://soulbroken.co.uk/code/sublimephpcs), and I want to link one of it's commands from the command palette to a keyboard shortcut because I use it so often.
有没有简单的方法可以做到这一点?还是只需要问开发人员命令的名称是什么(在命令选项板中是"PHP CodeSniffer:清除嗅探标记")?
Is there any easy way to do this? Or will I just need to ask the developer what the name of the command is (in the command palette it is 'PHP CodeSniffer: Clear sniffer marks')?
谢谢
推荐答案
查找命令名称实际上非常容易,但是需要一些步骤.
It's actually very easy to find the name of a command but it requires a few steps.
- 打开Sublime Text的内置控制台(control +`)
- 键入
sublime.log_commands(True)
- 从命令选项板中触发命令
命令名称将被记录到控制台.然后打开用户的快捷键,并创建一个新的快捷键,如下所示:
The name of the command will be logged to the console. Then open your user keybindings and create a new keybinding like this:
{ "keys": ["YOUR_SEQUENCE"], "command": "YOUR_COMMAND" }
我在这里提供了类似的答案: Keymap Sublime Text 2文件类型?
I provided a similar answer here: Keymap Sublime Text 2 File Type?
这篇关于绑定命令调色板命令的快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!