前言
请确保已安装vscode和keil5,并知道安装目录。
一、安装C编译器
官网下载,并安装,记住安装路径。(建议下载压缩包,zip文件。
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/
二、安装相应插件
Vscode点击扩展,搜索如下插件。
三、配置路径及基础设置
ctrl+shifit+P,搜索setting.json,选择用户设置,将以下代码复制进去即可。代码注释在最后。
{
"window.commandCenter": true,
"workbench.colorTheme": "Noctis Lilac",//主题
"editor.fontSize": 17,//字体大小
"editor.fontLigatures": false,
"workbench.editorAssociations": {
"*.db": "default",
"*.xls": "default"
},
"code-runner.runInTerminal": true,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.cursorBlinking": true,
"C_Cpp.default.compilerPath": "D:\\Cstudy\\mingw\\mingw64\\bin\\gcc.exe",//C语言安装路径
"cmake.configureOnOpen": true,
"data.preview.theme": "light",
"KeilAssistant.MDK.Uv4Path": "D:\\keilu5\\UV4\\UV4.exe",//keil安装路径
"Codegeex.Privacy": false,
"notebook.editorOptionsCustomizations": {},
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"update.mode": "none",
"files.autoGuessEncoding": true,
"C_Cpp.intelliSenseEngineFallback": "disabled",
"C_Cpp.intelliSenseEngine": "Tag Parser",
}
// 设置窗口命令中心为true
"window.commandCenter": true,
// 设置主题
"workbench.colorTheme": "Noctis Lilac",
// 设置字体大小
"editor.fontSize": 17,
// 禁用字体 ligatures
"editor.fontLigatures": false,
// 设置工作区默认编辑器
"workbench.editorAssociations": {
"*.db": "default",
"*.xls": "default"
},
// 设置代码运行在终端中
"code-runner.runInTerminal": true,
// 在终端中复制选中项
"terminal.integrated.copyOnSelection": true,
// 启用终端高亮
"terminal.integrated.cursorBlinking": true,
// 设置C语言编译器路径
"C_Cpp.default.compilerPath": "D:\\Cstudy\\mingw\\mingw64\\bin\\gcc.exe",
// 设置CMake在打开时配置
"cmake.configureOnOpen": true,
// 设置数据预览主题
"data.preview.theme": "light",
// 设置Keil助手Keil安装路径
"KeilAssistant.MDK.Uv4Path": "D:\\keilu5\\UV4\\UV4.exe",
// 设置Codegeex隐私设置
"Codegeex.Privacy": false,
// 设置笔记本编辑器选项自定义
"notebook.editorOptionsCustomizations": {},
// 设置终端默认配置
"terminal.integrated.defaultProfile.windows": "Command Prompt",
// 禁用更新模式
"update.mode": "none",
// 自动猜测编码
"files.autoGuessEncoding": true,
// 禁用C语言智能感知
"C_Cpp.intelliSenseEngineFallback": "disabled",
// 设置C语言智能感知引擎
"C_Cpp.intelliSenseEngine": "Tag Parser",