2021-10-03 02:28:37 +00:00
|
|
|
|
{
|
2021-11-12 08:44:13 +00:00
|
|
|
|
"files.defaultLanguage": "cpp", // ctrl+N新建文件后默认的语言
|
|
|
|
|
"editor.formatOnType": true, // 输入时就进行格式化,默认触发字符较少,分号可以触发
|
|
|
|
|
"editor.snippetSuggestions": "top", // snippets代码优先显示补全
|
|
|
|
|
|
|
|
|
|
"code-runner.runInTerminal": true, // 设置成false会在“输出”中输出,无法输入
|
|
|
|
|
"code-runner.executorMap": {
|
|
|
|
|
"c": "cd $dir && gcc *.c -fexec-charset=gb2312 -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe",
|
|
|
|
|
"cpp": "cd $dir && g++ *.cpp -fexec-charset=gb2312 -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe"
|
|
|
|
|
// "c": "cd $dir && clang $fileName -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw -std=c11 && $dir$fileNameWithoutExt",
|
|
|
|
|
// "cpp": "cd $dir && clang++ *.cpp -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw-g++ -std=c++17 && $dir$fileNameWithoutExt"
|
|
|
|
|
// "cpp": "cd $dir && clang++ *.cpp -o $fileNameWithoutExt.exe -Wall -g -Og -static-libgcc -fcolor-diagnostics --target=x86_64-w64-mingw -std=c++14 && $dir$fileNameWithoutExt"
|
|
|
|
|
}, // 设置code runner的命令行
|
|
|
|
|
"code-runner.saveFileBeforeRun": true, // run code前保存
|
|
|
|
|
"code-runner.preserveFocus": true, // 若为false,run code后光标会聚焦到终端上。如果需要频繁输入数据可设为false
|
|
|
|
|
"code-runner.clearPreviousOutput": false, // 每次run code前清空属于code runner的终端消息
|
|
|
|
|
|
|
|
|
|
"C_Cpp.clang_format_sortIncludes": true, // 格式化时调整include的顺序(按字母排序)
|
|
|
|
|
"C_Cpp.intelliSenseEngine": "Default", // 可以为Default或Tag Parser,后者较老,功能较简单。具体差别参考cpptools扩展文档
|
|
|
|
|
"C_Cpp.errorSquiggles": "Disabled", // 因为有clang的lint,所以关掉
|
|
|
|
|
"C_Cpp.autocomplete": "Disabled", // 因为有clang的补全,所以关掉
|
|
|
|
|
|
|
|
|
|
"clang.cflags": [ // 控制c语言静态检测的参数
|
|
|
|
|
"--target=x86_64-w64-mingw",
|
|
|
|
|
"-std=c11",
|
|
|
|
|
"-Wall"
|
|
|
|
|
],
|
|
|
|
|
"clang.cxxflags": [ // 控制c++静态检测时的参数
|
|
|
|
|
"--target=x86_64-w64-mingw",
|
|
|
|
|
"-std=c++17",
|
|
|
|
|
"-Wall"
|
|
|
|
|
],
|
|
|
|
|
"clang.completion.enable": true,
|
|
|
|
|
"files.associations": {
|
|
|
|
|
"iostream": "cpp",
|
|
|
|
|
"string": "cpp",
|
|
|
|
|
"array": "cpp",
|
|
|
|
|
"atomic": "cpp",
|
|
|
|
|
"*.tcc": "cpp",
|
|
|
|
|
"cctype": "cpp",
|
|
|
|
|
"clocale": "cpp",
|
|
|
|
|
"cmath": "cpp",
|
|
|
|
|
"cstdarg": "cpp",
|
|
|
|
|
"cstddef": "cpp",
|
|
|
|
|
"cstdint": "cpp",
|
|
|
|
|
"cstdio": "cpp",
|
|
|
|
|
"cstdlib": "cpp",
|
|
|
|
|
"cwchar": "cpp",
|
|
|
|
|
"cwctype": "cpp",
|
|
|
|
|
"deque": "cpp",
|
|
|
|
|
"unordered_map": "cpp",
|
|
|
|
|
"vector": "cpp",
|
|
|
|
|
"exception": "cpp",
|
|
|
|
|
"algorithm": "cpp",
|
|
|
|
|
"memory": "cpp",
|
|
|
|
|
"memory_resource": "cpp",
|
|
|
|
|
"optional": "cpp",
|
|
|
|
|
"string_view": "cpp",
|
|
|
|
|
"system_error": "cpp",
|
|
|
|
|
"tuple": "cpp",
|
|
|
|
|
"type_traits": "cpp",
|
|
|
|
|
"utility": "cpp",
|
|
|
|
|
"fstream": "cpp",
|
|
|
|
|
"initializer_list": "cpp",
|
|
|
|
|
"iosfwd": "cpp",
|
|
|
|
|
"istream": "cpp",
|
|
|
|
|
"limits": "cpp",
|
|
|
|
|
"new": "cpp",
|
|
|
|
|
"ostream": "cpp",
|
|
|
|
|
"sstream": "cpp",
|
|
|
|
|
"stdexcept": "cpp",
|
|
|
|
|
"streambuf": "cpp",
|
|
|
|
|
"typeinfo": "cpp"
|
|
|
|
|
} // 效果效果比cpptools要好
|
|
|
|
|
}
|