竞赛vscode配置指南
chapter 1 基础配置
step 0. 排除风险
- 打开cmd,输入
whoami 。 如果用户名是中文,建议更改用户名为英文,或新建一个用户名为英文的用户。 - 所有安装路径推荐填写无中文、无空格等特殊字符的路径。
step 1. 安装wingw-w64
step 3. 安装vscode
step 4. 配置vscode
-
在你想的位置新建一个文件夹,作为竞赛工作空间,你的代码将在这里保存运行。注意 不要有中文、不要有空格 -
右键用code打开 打开这个工作空间,并新建test.cpp 用于配置测试。 -
按Ctrl+shitf+P , 输入settings,点击打开工作区设置 -
将下面内容填充到setting.json
- 为使目录变的简洁,编译生成的.exe文件均会被命名为a.exe,如果有新编译的程序,则会自动替换掉原来的。这样文件夹中就不会乱糟糟的了
- 如果你不想要这个效果,可以修改第76行
-
{
"files.associations": {
"ostream": "cpp",
"*.tcc": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"complex": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"iterator": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"string_view": "cpp",
"fstream": "cpp",
"future": "cpp",
"istream": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"thread": "cpp",
"functional": "cpp",
"regex": "cpp",
"tuple": "cpp",
"valarray": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"random": "cpp",
"array": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"map": "cpp",
"memory": "cpp",
"numeric": "cpp",
"ratio": "cpp",
"set": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp"
},
"code-runner.executorMap": {
"cpp": " cd $dir && g++ $fileName -D LOCAL -o a.exe && .\\a.exe",
},
}
-
设置设置拓展程序
-
-
点击在settings.json中编辑 -
将下面配置填入文件
- 注意其中第7行和第10行务必根据自己实际情况填写,如果严格跟随本教程,则直接复制即可
{
"explorer.confirmDelete": false,
"debug.onTaskErrors": "showErrors",
"explorer.confirmDragAndDrop": false,
"code-runner.saveFileBeforeRun": true,
"code-runner.runInTerminal": true,
"C_Cpp.default.compilerPath": "C:\\mingw64\\bin\\g++.exe",
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.includePath": [
"C:\\mingw64\\lib"
],
"C_Cpp.default.intelliSenseMode": "gcc-x64",
"files.autoGuessEncoding": true,
},
}
chapter 2 竞赛优化
chapter 3 使用技巧 客制化
|