In Sublime Text 3, how to have shortcuts for “Buil

2020-07-13 07:45发布

问题:

In Sublime Text 3,when we press Ctrl+Shift+B, we are given the option to either do "Build and Run" or "only Build", whereas Ctrl+B executes the previously chosen operation among the two. But I want it to be like, it should directly build and run when I press Ctrl+Shift+B and only build when I press Ctrl+B like it was in Sublime Text 2. Can someone help me out?

回答1:

Addings this to your sublime-keymap should result in the expected behavior:

{ "keys": ["ctrl+b"], "command": "build", "args": { "variant": "" } },
{ "keys": ["ctrl+shift+b"], "command": "build", "args": { "variant": "Run" } },

However you might want to remap keep the list of options to alt+b:

{ "keys": ["alt+b"], "command": "build", "args": { "select": true } },