只需要settings.json其他的可以忽略
删除中间文件
@REM C++相关中间文件
del *.exe /q /s
del tempCodeRunnerFile.c /q /s
del tempCodeRunnerFile.cpp /q /s
del a.out /q /s
del *.o /q /s
@REM Java相关中间文件
del *.class /q /s
del tempCodeRunnerFile.java /q /s
插件
- Atom One Dark Theme
- Chinese (Simplified) Language Pack for Visual Studio Code
- Code Runner
- koroFileHeader
- markdownlint
- markdown-index(自动生成标题序列)
- Markdown All in One
- Bracket Pair Colorizer
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "D:\\VScode\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
settings.json
{
"code-runner.runInTerminal": true, // 在内置终端运行
"code-runner.saveFileBeforeRun": true, // 运行前保存
"code-runner.executorMap": {
"c": "cd $dir && gcc '$fileName' -o '$fileNameWithoutExt.exe' -Wall -g -O2 -static-libgcc -std=c11 -fexec-charset=GBK && &'$dir$fileNameWithoutExt'",
"cpp": "cd $dir && g++ '$fileName' -o '$fileNameWithoutExt.exe' -std=c++11 -fexec-charset=GBK && &'$dir$fileNameWithoutExt'",
// 带包的程序 javac -encoding utf-8 -d. Test.java; java a.Test
// 编译 javac package/dd/Test.java
"java": "cd $dir && javac -encoding utf-8 $fileName && java $fileNameWithoutExt"
},
"fileheader.customMade": {
"Author": "hxj0x",
"Date": "Do not edit",
"LastEditTime": "Do not edit",
"Url": ""
},
"fileheader.configObj": {
"prohibitAutoAdd": [ "json", "md" ], // 禁止.json .md文件,自动添加头部注释
"wideSame": true, // 设置为true开启
"wideNum": 13, // 字段长度 默认为13
"specialOptions": {
"Date": "since",
"LastEditTime": "LastEditTime",
"createHeader": true, // 默认打开
},
"workbench.iconTheme": "vscode-icons", // 图标
"workbench.colorTheme": "Atom One Dark", // 主题
"editor.fontSize": 18,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"explorer.compactFolders": false,
"editor.mouseWheelZoom": true,
"diffEditor.ignoreTrimWhitespace": false,
"explorer.sortOrder": "type",
},
"editor.minimap.enabled": false,
"editor.quickSuggestionsDelay": 100,
"workbench.iconTheme": "vscode-icons",
"editor.mouseWheelZoom": true,
"editor.fontSize": 16
}
tasks.json
{
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "D:\\VScode\\mingw64\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-std=c++17"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"version": "2.0.0"
}