編輯器要添加的
settings.json
打開這個:
{ "editor.fontSize": 20,//編輯字號 "files.autoSave": "afterDelay",//自動保存 "workbench.colorTheme": "One Monokai",//主題 "command-runner.commands": { "Run": "start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}" }//方便一鍵運行 }
第三個需要安裝插件:
第四個需要安裝插件:
keybindings.json
快捷鍵設置
打開位置同理
[ { "key": "f11", "command": "workbench.action.tasks.build" },//編譯運行 { "key": "f10", "command": "command-runner.run", "args":{ "command": "Run" }, "when": "editorTextFocus" }//運行,配合上面的command runner插件 ]
每個文件內
想要進行編譯:
c_cpp_properties.json
配置編譯器位置和語言
{ "configurations": [ { "name": "MinGW", "intelliSenseMode": "gcc-x64", "compilerPath": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/g++.exe",//編譯器位置,安裝Dev C++才有這個路徑。。。 "includePath": [ "${workspaceFolder}" ], "cStandard": "c11", "cppStandard": "c++11" } ], "version": 4 }
settings.json
暫時不知道有什么用
{ "files.associations": { "array": "cpp", "atomic": "cpp", "*.tcc": "cpp", "bitset": "cpp", "cctype": "cpp", "cfenv": "cpp", "chrono": "cpp", "cinttypes": "cpp", "clocale": "cpp", "cmath": "cpp", "complex": "cpp", "condition_variable": "cpp", "csetjmp": "cpp", "csignal": "cpp", "cstdarg": "cpp", "cstdint": "cpp", "cstdio": "cpp", "cstdlib": "cpp", "cstring": "cpp", "ctime": "cpp", "cwchar": "cpp", "cwctype": "cpp", "deque": "cpp", "forward_list": "cpp", "list": "cpp", "unordered_map": "cpp", "unordered_set": "cpp", "vector": "cpp", "exception": "cpp", "fstream": "cpp", "functional": "cpp", "future": "cpp", "initializer_list": "cpp", "iomanip": "cpp", "iosfwd": "cpp", "iostream": "cpp", "istream": "cpp", "limits": "cpp", "mutex": "cpp", "new": "cpp", "ostream": "cpp", "numeric": "cpp", "ratio": "cpp", "scoped_allocator": "cpp", "sstream": "cpp", "stdexcept": "cpp", "streambuf": "cpp", "system_error": "cpp", "thread": "cpp", "type_traits": "cpp", "tuple": "cpp", "typeindex": "cpp", "typeinfo": "cpp", "utility": "cpp", "valarray": "cpp" } }
tasks.json
編譯命令
{ "version": "2.0.0", "tasks": [ { "label": "Compile", "type": "shell", "command": "g++ -Wall -std=c++11 -O2 -Wl,-stack=512000000 \"${file}\" -o \"${fileDirname}\\${fileBasenameNoExtension}\" && start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}", "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true } }, { "label": "Run", "type": "shell", "command": "start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}", "problemMatcher": [] }, { "type": "shell", "label": "g++.exe build active file", "command": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/g++.exe", "args": [ "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin" } } ] }
額外插件
除了上述兩個
還有:
前兩個是C++語言的配置
最后一個是中文漢化
效果圖