launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"preLaunchTask": "build",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]
}
]
}
VScode是以文件夹的形式管理工程的,因此我们首先新建一个文件夹,我这里取名
插件
Bracket Pair Colorizer
给嵌套的各种括号加上不同的颜色。
Path Intellisense
智能路径提示,可以在你输入文件路径时智能提示。
Markdown Preview
实时预览 markdown
Import Cost
引入包大小计算,对于项目打包后体积掌握很有帮助
Prettier
比Beautify更好用的代码格式化插件
vetur
语法高亮、智能感知、Emmet等
GitLens
详细的 Git 提交日志。
Git 重度使用者必备,尤其是多人协作时:哪一行代码,何时、何人提交都有记录。
code runner
cmake
cake tools
reference:https://zhuanlan.zhihu.com/p/264384194
https://blog.csdn.net/weixin_43374723/article/details/84064644?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165016946116782184691017%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165016946116782184691017&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-84064644.142^v9^pc_search_result_cache,157^v4^control&utm_term=ubuntu+vscode+c%2B%2B%E9%85%8D%E7%BD%AE&spm=1018.2226.3001.4187#commentBox