In Sublime Text 3, how do I have shortcuts for "Build and Run" and "Build only" separately, as in Sublime Text 2?

In Sublime Text 3, when we press Ctrl + Shift + B, we are given the opportunity to do "Build and Run" or "Only Build", while Ctrl + B performs the previously selected operation among the two. But I want it to look like: it should build and run directly when I press Ctrl + Shift + B and build only when I press Ctrl + B, as in Sublime Text 2. Can someone help me?

+6
source share
2 answers

The additions specified in your sublime-keymap book should lead to the expected behavior:

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

However, you can reassign the options list to alt + b:

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

You can edit your .sublime-build to have it, and it should work:

 { "cmd": ["make"], "variants": [ { "name":"Run", "cmd": ["./a.out"] } ] } 
0
source

Source: https://habr.com/ru/post/1243215/


All Articles