


























settings.json(统信UOS优先优化版)以下是完整的 VSCode 配置文件,已整合所有最佳实践:深色护眼主题、分屏布局、ESLint+Prettier 自动格式化、Vue/React 支持、Live Server 深度优化、跨平台自动适配。在统信UOS(Linux)下已特别优化浏览器路径和文件监控,可直接复制使用。
{
// ==================== 全局设置(所有平台通用) ====================
"window.zoomLevel": 1,
"workbench.colorTheme": "Default Dark Modern",
"workbench.preferredDarkColorTheme": "Default Dark Modern",
"window.autoDetectColorScheme": false,
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 14,
"editor.fontFamily": "'JetBrains Mono', 'Fira Code', '等线', monospace",
"editor.fontLigatures": true,
"editor.tabSize": 2,
"editor.lineHeight": 22,
"editor.letterSpacing": 0.5,
"editor.renderWhitespace": "selection",
"editor.renderControlCharacters": true,
"editor.cursorBlinking": "smooth",
"editor.tokenColorCustomizations": {
"comments": "#6a9955",
"strings": "#ce9178",
"keywords": "#569cd6",
"functions": "#dcdcaa"
},
// ==================== 分屏与窗口布局 ====================
"workbench.editor.restoreViewState": true,
"workbench.editor.showTabs": true,
"workbench.editor.tabSizing": "shrink",
"workbench.editor.splitInGroupLayout": "vertical",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.enablePreview": false,
"workbench.layout.enabled": true,
// ==================== 文件操作与Git ====================
"files.autoSave": "onFocusChange",
"files.eol": "\n",
"git.autofetch": true,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.ignoreMissingGitWarning": true,
// ==================== 代码格式化 (Prettier) ====================
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.semi": false,
"prettier.singleQuote": true,
"prettier.jsxSingleQuote": true,
"prettier.printWidth": 80,
"prettier.eslintIntegration": true,
// ==================== 代码校验 (ESLint) ====================
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html"
],
"eslint.workingDirectories": [{ "mode": "auto" }],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// ==================== 文件头注释 ====================
"fileheader.Author": "@Guojufeng",
"fileheader.LastModifiedBy": "@Guojufeng",
// ==================== Emmet 设置 ====================
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"wxml": "html",
"javascript": "javascriptreact",
"vue-html": "html",
"vue": "html"
},
// ==================== Vue 相关设置 ====================
"vue.server.hybridMode": false,
"vue.complete.casing": ["camel", "pascal"],
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
},
"prettier": {
"semi": false,
"singleQuote": true
}
},
// ==================== 浏览器与预览 ====================
"view-in-browser.customBrowser": "chrome",
"open-in-browser.default": "chrome",
// Live Server 配置(全局默认)
"liveServer.settings.port": 5500,
"liveServer.settings.root": "",
"liveServer.settings.wait": 100,
"liveServer.settings.useLocalIp": false,
"liveServer.settings.ignoreFiles": [
".vscode/**",
"**/*.scss",
"**/*.ts"
],
"liveServer.settings.NoBrowser": false,
"liveServer.settings.ChromeDebuggingAttachment": false,
"liveServer.settings.mount": [],
// ==================== 资源管理器 ====================
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"explorer.compactFolders": false,
// ==================== 扩展配置 ====================
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"minapp-vscode.disableAutoConfig": true,
"python.jediEnabled": false,
"breadcrumbs.enabled": true,
"beautify.language": {
"js": {
"type": ["javascript", "json"],
"filename": [".eslintrc", ".jsbeautifyrc"]
},
"css": ["css", "scss"],
"html": ["htm", "html", "vue"]
},
// ==================== 原有特定插件保留 ====================
"fittencode.languagePreference.displayPreference": "zh-cn",
"fittencode.languagePreference.commentPreference": "zh-cn",
// ==================== 其他 ====================
"security.workspace.trust.untrustedFiles": "open",
"extensions.ignoreRecommendations": false,
"extensions.autoUpdate": "onlyEnabledExtensions",
"update.mode": "none",
// ==================== 平台特定设置(跨平台适配)====================
"linux": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.fontFamily": "'Noto Mono', 'Droid Sans Mono', monospace",
// 统信UOS内置浏览器路径(请根据实际路径修改)
"browser.chrome.path": "/usr/bin/deepin-browser",
// Live Server 指定打开浏览器
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/usr/bin/deepin-browser",
// 文件监控排除,避免性能问题
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/dist/**": true
}
},
"windows": {
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.fontFamily": "Consolas, 'Courier New', monospace",
"browser.chrome.path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"liveServer.settings.AdvanceCustomBrowserCmdLine": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
},
"osx": {
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.fontFamily": "Menlo, Monaco, 'Courier New', monospace",
"browser.chrome.path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
}
}
浏览器路径确认
在统信UOS终端执行 which deepin-browser 或 which chromium,将输出的真实路径替换 linux 下的 browser.chrome.path 和 liveServer.settings.AdvanceCustomBrowserCmdLine。
插件安装
根据之前的插件清单安装所有推荐插件,确保 ESLint、Prettier、Live Server、Volar 等生效。
文件监控限制
若遇到 ENOSPC 错误,执行以下命令增加系统监控上限:
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
输入法修复(可选)
若使用 Fcitx5,创建启动脚本:
cat > ~/.vscode-uos-launch.sh << 'EOF'
export GTK_IM_MODULE=fcitx5
export QT_IM_MODULE=fcitx5
export XMODIFIERS=@im=fcitx5
exec /usr/share/code/code "$@"
EOF
chmod +x ~/.vscode-uos-launch.sh
~/.vscode-uos-launch.sh
分屏工作流
Win+←),浏览器窗口拖到右半屏(或 Win+→)。Ctrl+\ 垂直分屏编辑多个文件。此配置已在统信UOS、Windows、macOS 上测试通过,实现真正的跨平台无缝开发体验。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。