Hello everyone, I am a c++ games developer and I have recently switched to sublime text 4 from visual studio. One of reasons why I switched was because of the customisability and powerful build system configuration which sublime text offered. So far it has been great, however I have run into a few issues when trying to set up my build systems.
What I like to do when I am developing c++ games, is to have 2 seperate keybindings for compiling the code (Ctrl+b) and for running the code (Ctrl+e). So far I have made 2 build systems for running and compiling the code which I have called cpp_run.sublime-build
and cpp_build.sublime-build
, I have checked to see if these have worked individually and they have worked. However, when it came time to try and put these commands into a keybinding I have had some issues:
The keybindings I have added are the following:
[
{ "keys": ["Ctrl+s"], "command": "save {\"async\": true}"},
{
"keys": ["Ctrl+b"],
"command": "run_multiple_commands",
"args": {
"commands": [
{ "command": "set_build_system {\"file\": \"Packages/User/cpp_build.sublime-build\"}", "context": "window" },
{ "command": "build", "context": "window" }
]
}
},
{
"keys": ["Ctrl+e"],
"command": "run_multiple_commands",
"args": {
"commands": [
{ "command": "set_build_system {\"file\": \"Packages/User/cpp_run.sublime-build\"}", "context": "window" },
{ "command": "build", "context": "window" }
]
}
}
]
I have installed and used a package called run_multiple_commands (link to github repo: https://github.com/johnyluyte/sublime-text-multi-commads) to allow me to run multiple commands in a keybinding (this is from this sublime text discussion: How to bind multiple commands for a keybinding?). For some reason it will build the code but it will not select the specified build system I have specified (it will just stick to the default build system which was already selected when I started sublime). I have tried adding "context": "window"
to the command for selecting the build system however this also did not make any difference.
Is there a way I can solve this?