写在前面
由于本人喜欢用VS Code这种轻量的编辑器,但是却不能开箱即用,有时重装系统后就要从新配置,所以写下此篇来记录部分语言的配置方法.
C/C++
1.安装gcc等编译器:
下载地址:https://winlibs.com/
下载后安装到任意位置,再Windows的环境的path中添加:你的安装的地址/mingw64/bin.
记得要将/bin下的mingw32-make.exe名称改为make.exe,以便make命令能正常使用.
2.VS Code配置:
安装插件:

一般安装第一个后面两个就会提示安装.
3.调试配置:
这是我的编译和调试配置:
tasks:
♾️ json 代码:{
"tasks": [
{
"type": "shell",
"label": "g++ build",
"command": "C:\\CodePath\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": "$gcc",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "make build",
"type": "shell",
"command": "make",
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": "$gcc",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
}
],
"version": "2.0.0"
}
luanch
♾️ json 代码:{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ g++",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build"
},
{
"name": "C/C++ make",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "make build"
}
]
}
GO
1.安装GO编译器:
官网地址:https://golang.google.cn/
下载安装msi基本就可以,一般不需要多余的配置.
一般默认开启了go111module,也就不需要配置传统gopath了
要调整一下源:
♾️ text 代码:#重新设置成七牛镜像源(推荐)或阿里镜像源(用原有的会比较慢)
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy
2.VS Code配置
安装go语言插件:

再VS Code的命令面板输入Go: install/update tools
以安装调试所需依赖.
3.调试配置
这是我的调试配置:
luanch:
♾️ json 代码:{
"version": "0.2.0",
"configurations": [
{
"name": "Go Debug",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${fileDirname}/${fileBasenameNoExtension}.go",
"console": "integratedTerminal"
}
]
}
Node.js
1.下载安装Node.js
Node.js官网地址:https://nodejs.org/zh-cn
下载安装,并在安装目录下设立两个文件夹:node_global
,node_cache
.
配置一下环境变量:
在系统环景变量中添加:NODE_HOME
内容为你的安装的地址/nodejs
.
在系统环境变量中的path添加:%NODE_home%/node_global
和%NODE_home%/node_cache
.
把用户环境变量中的:C:User/用户名/AppDate/Roaming/npm
改为你的安装的地址/nodejs/node_global
执行一下命令:
- 设置缓存位置
npm config set cache 你的安装的地址/nodejs/node_cache
- 设置全局模块地址
npm config set prefix 你的安装的地址/nodejs/node_global
换源
执行以下命令换镜像源:
♾️ text 代码:npm config set registry http://mirrors.cloud.tencent.com/npm/ #腾讯云
npm config set registry https://npm.aliyun.com #阿里云
2.VS Code配置
安装一下插件即可:

设置权限
设置安装目录nodejs的权限,开启用户的完全控制权限,并在管理员权限下的powershell执行一下命令:Set-ExecutionPolicy Unrestricted
否者npm会无法安装插件或者VS Code下npm命令无法使用.
HTML + CSS +Javascript
一般安装一下插件即可:

这两个用来方便编写代码:

