2
"code-runner.executorMap": {
    "cpp": "cd $dir && g++ -Wall -Wextra -O2 -std=c++14 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
},

Coderunner has a command to run .cpp code, but if I want to use another command, such as adding " < input.txt", I would have to go to settings.json to change it. Is there a way to set up multiple commands on VS Code for a single kind of file so I can just simply switch without having to change settings.json?

starball
  • 20,030
  • 7
  • 43
  • 238
ElfIv
  • 21
  • 2

1 Answers1

0

I assume you're changing the value of code-runner.executorMap in a workspace's .vscode/settings.json file? But you can just change it in you user settings.json file (use Preferences: Open User Settings (JSON) in the command palette), and that should apply to all your workspaces then by default. See also https://code.visualstudio.com/docs/getstarted/settings.

starball
  • 20,030
  • 7
  • 43
  • 238