Bind shortcut to command palette command?

后端 未结 2 1341
醉酒成梦
醉酒成梦 2021-01-31 20:46

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 shortcu

2条回答
  •  误落风尘
    2021-01-31 21:38

    It's actually very easy to find the name of a command but it requires a few steps.

    • Open Sublime Text's built-in console (control+`)
    • Type in sublime.log_commands(True)
    • Trigger the command from the command palette

    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" }
    

    I provided a similar answer here: Keymap Sublime Text 2 File Type?

提交回复
热议问题