问题
I want to create a key binding in Sublime Text 3 for the command Tools > Babel > Babel Transform
.
I have used the menu item Preferences > Key Bindings
to open the user keymap, and I have added this line:
{ "keys": ["ctrl+shift+b"], "command": "babel_transform" },
However, pressing Ctrl-Shift-B has no effect. If I use a different command (such as "prompt_open_folder"
), the key binding words correctly, so I assume that it is the "babel_transform"
command which I have got wrong.
How should I write this keymap line correctly?
回答1:
The command for Babel Transform is babel
therefore, this will work:
{ "keys": ["ctrl+shift+b"], "command": "babel" }
The way figure out a command is to:
Open console and turn on logging of commands:
sublime.log_commands(True)
Then
Tools > Babel > Babel Transform
The output will be:
command: babel
来源:https://stackoverflow.com/questions/54763197/sublime-text-set-key-binding-for-tools-babel-babel-transform