我可以将多个不同的命令用于带有代码跑步者扩展名的单个文件类型吗?
"code-runner.executorMap": {
"cpp": "cd $dir && g++ -Wall -Wextra -O2 -std=c++14 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
},
CodeRunner具有运行.cpp代码的命令,但是如果我想使用另一个命令,例如添加“< input.txt”,我将不得不转到settings.json进行更改。有没有办法在单一文件的VS代码上设置多个命令,这样我就可以简单地切换而无需更改设置。
"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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在更改
code> code> code-runner.executormap
在工作区的.vscode/settings.json
文件中?但是,您只需在用户设置中更改它。另请参见 https://code.visalstudio.com/docs/docs/docs/getstarted/settings/settings 。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 (usePreferences: 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.