VSCode配置
json
{
// ===================== 通用配置 =====================
// 主题设置
"workbench.colorTheme": "GitHub Light",
// 编辑器基础设置
"editor.detectIndentation": false,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "selection",
"editor.fontSize": 16.5,
"editor.fontLigatures": false,
"editor.fontVariations": false,
// 字体设置 (通用字体,按顺序降级)
"editor.fontFamily": "Hack Nerd Font, JetBrains Mono Nerd Font, 霞骛新晰黑 ,Noto Sans SC,vivo Sans,LXGW WenKai,Consolas,monospace",
"terminal.integrated.fontFamily": "Hack Nerd Font, JetBrains Mono Nerd Font,HONOR Sans Cn,LXGW WenKai Mono,monospace",
"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontSize": 14.5,
"terminal.integrated.lineHeight": 1.2,
// ===================== 操作系统特定配置 =====================
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"args": ["-NoProfile", "-NoExit", "-Command", "chcp 65001"]
},
"GitBash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
"args": ["-i", "-l"]
}
},
"terminal.integrated.defaultProfile.windows": "Windows PowerShell",
"python.defaultInterpreterPath": "C:\\Python313\\python.exe",
// ===================== 编辑器功能配置 =====================
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic"
}
}
]
},
"editor.rulers": [100],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100,
"files.autoGuessEncoding": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"editor.minimap.enabled": false,
"opencclint.autoFixOnSave": true,
"opencclint.converterOptions": "hk=>cn",
// ===================== 语言特定配置 =====================
// C/C++ 配置
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.formatting": "clangFormat",
// Python 配置
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnType": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"isort.path": ["isort"],
"black-formatter.args": ["--line-length", "100"],
"isort.args": ["--profile", "black", "--line-length", "100"],
"files.insertFinalNewline": true,
// Markdown 配置
"[markdown]": {
"editor.wordWrap": "wordWrapColumn"
},
// JS 配置 (根据 .editorconfig)
"[js]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// JSON 配置 (根据 .editorconfig)
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// mjs 配置 (根据 .editorconfig)
"[mjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// ===================== Code Runner 配置 =====================
"code-runner.executorMap": {
"c": "cd $dir && gcc -std=c17 -g -Wall $fileName -o D:\\TMP\\BUILD\\$fileNameWithoutExt.exe && D:\\TMP\\BUILD\\$fileNameWithoutExt.exe",
"cpp": "cd $dir && g++ -std=c++17 -g -Wall $fileName -o D:\\TMP\\BUILD\\$fileNameWithoutExt.exe && D:\\TMP\\BUILD\\$fileNameWithoutExt.exe"
},
"code-runner.saveFileBeforeRun": true,
"code-runner.fileDirectoryAsCwd": true,
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.runInTerminal": true,
"code-runner.clearPreviousOutput": true,
"debug.terminal.clearBeforeReusing": true,
// ===================== Doxygen 配置 =====================
"doxdocgen.file.copyrightTag": ["@copyright Copyright (c) {year}"],
"doxdocgen.file.fileTemplate": "@file {name}",
"doxdocgen.file.versionTag": "@version 1.0",
"doxdocgen.generic.authorEmail": "[email protected]",
"doxdocgen.generic.authorName": "huping",
"doxdocgen.generic.authorTag": "@author {author} ({email})",
"doxdocgen.generic.order": ["brief", "tparam", "param", "return"],
"doxdocgen.generic.paramTemplate": "@param {param}",
"doxdocgen.generic.returnTemplate": "@return {type}",
"doxdocgen.generic.splitCasingSmartText": true,
"doxdocgen.file.fileOrder": ["file", "brief", "version", "date", "author", "copyright"],
// ===================== 文件管理配置 =====================
"files.associations": {},
"files.exclude": {
"**/*.exe": true,
"**/build": true,
"**/testing": true,
"**/.git": true,
"**/node_modules": true,
"**/.DS_Store": true,
"**/dist": true,
"**/*.timestamp-*": true,
"vercel.json": true,
".opencclintrc.json": true,
".editorconfig": true,
"package.json": true,
".markdownlint.json": true,
"pnpm-lock.yaml": true,
".gitignore": true
},
// ===================== 工作区和界面配置 =====================
"editor.accessibilitySupport": "off",
"extensions.ignoreRecommendations": true,
"workbench.startupEditor": "none",
"explorer.confirmDelete": false,
"output.smartScroll.enabled": false,
// ===================== CodeGeex 配置 =====================
"Codegeex.Comment.LanguagePreference": "中文",
"Codegeex.Chat.LanguagePreference": "中文",
"Codegeex.SidebarUI.LanguagePreference": "中文",
"Codegeex.Explanation.LanguagePreference": "zh-CN",
"Codegeex.Privacy": true,
// ===================== 安全配置 =====================
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.startupPrompt": "never",
"cmake.options.statusBarVisibility": "visible",
"explorer.confirmDragAndDrop": false,
"github.copilot.enable": {
"*": false,
"plaintext": false,
"markdown": false,
"scminput": false,
"cpp": true
},
"roo-cline.allowedCommands": [
"npm test",
"npm install",
"tsc",
"git log",
"git diff",
"git show"
],
"editor.smoothScrolling": true,
"workbench.list.smoothScrolling": true,
"terminal.integrated.smoothScrolling": true,
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "on",
"git.confirmSync": false,
"cline.preferredLanguage": "Simplified Chinese - 简体中文",
"git.enableSmartCommit": true,
"github.copilot.editor.enableAutoCompletions": true,
"github.copilot.renameSuggestions.triggerAutomatically": false,
"window.newWindowProfile": "默认",
"pasteImage.path": "${currentFileDir}/../img/",
// "editor.unicodeHighlight.nonBasicASCII": false,
// "editor.unicodeHighlight.invisibleCharacters": false,
// "editor.unicodeHighlight.includeComments": false,
// 注释里的中文逗号会高亮,去掉
"editor.unicodeHighlight.ambiguousCharacters": false
}
json
{
// ===================== 通用配置 =====================
// 主题设置
"workbench.colorTheme": "One Dark Pro",
// 编辑器基础设置
"editor.detectIndentation": false,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "selection",
"editor.fontSize": 15.8,
"editor.fontLigatures": false,
"editor.fontVariations": false,
// 字体设置 (通用字体,按顺序降级)
"editor.fontFamily": "Hack Nerd Font,LXGW Neo XiHei,LXGW WenKai,Consolas,monospace",
"terminal.integrated.fontFamily": "Hack Nerd Font,JetBrains Mono Nerd Font,Iosevka,Noto Sans Mono,LXGW WenKai Mono,monospace",
"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontSize": 14.5,
"terminal.integrated.lineHeight": 1.2,
// ===================== 操作系统特定配置 =====================
// macOS 特定配置
"terminal.external.osxExec": "WarpTerminal",
"terminal.integrated.shell.osx": "/bin/zsh",
"python.defaultInterpreterPath": "/opt/homebrew/bin/python",
// Windows 特定配置 (已注释,需要时启用)
// "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
// "python.defaultInterpreterPath": "C:\\Python310\\python.exe",
// ===================== 编辑器功能配置 =====================
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic"
}
}
]
},
"editor.rulers": [100],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100,
"files.autoGuessEncoding": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"editor.minimap.enabled": false,
// "opencclint.autoFixOnSave": true,
// "opencclint.converterOptions": "cn=>hk",
// ===================== 语言特定配置 =====================
// C/C++ 配置
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.formatting": "clangFormat",
// Python 配置
"[python]": {
"editor.formatOnType": true
},
// Markdown 配置
"[markdown]": {
"editor.wordWrap": "wordWrapColumn"
},
// JS 配置 (根据 .editorconfig)
"[js]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// JSON 配置 (根据 .editorconfig)
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// mjs 配置 (根据 .editorconfig)
"[mjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
},
// ===================== Code Runner 配置 =====================
// macOS 配置
"code-runner.executorMap": {
"c": "cd $dir && gcc -std=c17 -g -Wall -O3 $fileName -o ~/build/$fileNameWithoutExt_c && ~/build/$fileNameWithoutExt_c",
"cpp": "cd $dir && g++ -std=c++17 -g -Wall -O3 $fileName -o ~/build/$fileNameWithoutExt_cpp && ~/build/$fileNameWithoutExt_cpp"
},
// Windows 配置 (已注释,需要时启用)
// "code-runner.executorMap": {
// "c": "cd $dir && gcc -std=c17 -g -Wall -O3 $fileName -o %USERPROFILE%\\build\\$fileNameWithoutExt_c.exe && %USERPROFILE%\\build\\$fileNameWithoutExt_c.exe",
// "cpp": "cd $dir && g++ -std=c++17 -g -Wall -O3 $fileName -o %USERPROFILE%\\build\\$fileNameWithoutExt_cpp.exe && %USERPROFILE%\\build\\$fileNameWithoutExt_cpp.exe"
// },
"code-runner.saveFileBeforeRun": true,
"code-runner.fileDirectoryAsCwd": true,
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.runInTerminal": true,
"code-runner.clearPreviousOutput": true,
"debug.terminal.clearBeforeReusing": true,
// ===================== Doxygen 配置 =====================
"doxdocgen.file.copyrightTag": ["@copyright Copyright (c) {year}"],
"doxdocgen.file.fileTemplate": "@file {name}",
"doxdocgen.file.versionTag": "@version 1.0",
"doxdocgen.generic.authorEmail": "[email protected]",
"doxdocgen.generic.authorName": "huping",
"doxdocgen.generic.authorTag": "@author {author} ({email})",
"doxdocgen.generic.order": ["brief", "tparam", "param", "return"],
"doxdocgen.generic.paramTemplate": "@param {param}",
"doxdocgen.generic.returnTemplate": "@return {type}",
"doxdocgen.generic.splitCasingSmartText": true,
"doxdocgen.file.fileOrder": ["file", "brief", "version", "date", "author", "copyright"],
// ===================== 文件管理配置 =====================
"files.associations": {},
"files.exclude": {
"**/*.exe": true,
"**/build": true,
"**/testing": true,
"**/.git": true,
"**/node_modules": true,
"**/.DS_Store": true,
"**/dist": true,
"**/*.timestamp-*": true,
"vercel.json": true,
".opencclintrc.json": true,
".editorconfig": true,
"package.json": true,
".markdownlint.json": true,
"pnpm-lock.yaml": true,
".gitignore": true
},
"C_Cpp.files.exclude": {
"**/.vscode": true
},
// ===================== 工作区和界面配置 =====================
"editor.accessibilitySupport": "off",
"extensions.ignoreRecommendations": true,
"workbench.startupEditor": "none",
"explorer.confirmDelete": false,
"output.smartScroll.enabled": false,
// ===================== CodeGeex 配置 =====================
"Codegeex.Comment.LanguagePreference": "中文",
"Codegeex.Chat.LanguagePreference": "中文",
"Codegeex.SidebarUI.LanguagePreference": "中文",
"Codegeex.Explanation.LanguagePreference": "zh-CN",
"Codegeex.Privacy": true,
// ===================== 安全配置 =====================
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.startupPrompt": "never",
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false
}