vscode 设置/setting.json
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.iconTheme": "vscode-icons",
// "workbench.colorTheme": "Cobalt2",
/** -------- 编辑器配置 Start -------- **/
// 按住 Ctrl 键并滚动鼠标滚轮时对编辑器字体大小进行缩放。
"editor.mouseWheelZoom": true,
// 控制编辑器是否显示缩进参考线
"editor.renderIndentGuides": false,
// 一个制表符等于的空格数。
"editor.tabSize": 2,
// 将在视区宽度处换行
"editor.wordWrap": "on",
// 控制折行的缩进。
// - none: 没有缩进。折行从第 1 列开始。
// - same: 折行的缩进量与其父级相同。
// - indent: 折行的缩进量比其父级多 1。
// - deepIndent: 折行的缩进量比其父级多 2。
"editor.wrappingIndent": "same",
// 控制字体大小。
"editor.fontSize": 14,
// 控制字体粗细。
"editor.fontWeight": "normal",
// 控制行高。
"editor.lineHeight": 18,
// 控制行号的显示。
// - off: 不显示行号。
// - on: 将行号显示为绝对行数。
// - relative: 将行号显示为与光标相隔的行数。
// - interval: 每 10 行显示一次行号。
"editor.lineNumbers": "interval",
// 控制光标的动画样式。
"editor.cursorBlinking": "blink",
// 控制光标样式。
"editor.cursorStyle": "line",
// 当 `editor.cursorStyle` 设置为 `line` 时,控制光标的宽度。
"editor.cursorWidth": 6,
/** -------- 编辑器配置 End -------- **/
// 启用后,将在文件打开时尝试猜测字符集编码。可以按语言对此项进行配置。
"files.autoGuessEncoding": true,
// 在读取和写入文件时使用的默认字符集编码。可以按语言对此项进行配置。
// "files.encoding": "utf8",
// off : 关闭自动保存(默认)
// afterDelay: 延迟xx时间后保存,可在 "files.autoSaveDelay" 中配置延迟时间;
// onFocusChange: 编辑器失去焦点时自动保存;
// onWindowChange: 窗口失去焦点时(编辑器窗口的切换,桌面窗口的切换)自动保存;
"files.autoSave": "onFocusChange", // "off" "afterDelay"
/* Live Server的配置 Start */
// 使用: 按F1,然后在输入栏中输入 Live Server: Open Live Server to start a server 打开服务,或者 Live Server: Close Live Server to stop a server 关闭服务
"liveServer.settings.port": 5500, //设置本地服务的端口号
"liveServer.settings.root": "/", //设置根目录,也就是打开的文件会在该目录下找
"liveServer.settings.CustomBrowser": "chrome", //设置默认打开的浏览器
"liveServer.settings.AdvanceCustomBrowserCmdLine": "chrome --incognito --remote-debugging-port=9222",
"liveServer.settings.ChromeDebuggingAttachment": false, // 启用Chrome调试到Live Server的附件
"liveServer.settings.donotVerifyTags": true, // 如果HTML中缺少正文,头部或其他支持标签,则关闭提示警告消息
"liveServer.settings.NoBrowser": false, // 如果为真,则实时服务器将在没有打开浏览器的情况下启动。
"liveServer.settings.ignoredFiles": [
//忽略特定的文件更改
".vscode/**",
"**/*.scss",
"**/*.sass"
],
/* Live Server的配置 End */
// 格式化 *.json 文件
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
// 格式化 *.vue 文件
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"vetur.format.options.tabSize": 2,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": true, // 格式化不加分号
"singleQuote": false, // 格式化以单引号为主
"trailingComma": "none" // 关闭prettier尾随逗号(对象或数组最后一个元素后面是否加逗号)
}
},
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
"vetur.format.defaultFormatter.js": "vscode-typescript",
// 格式化 *.js 文件
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
// 格式化 *.html 文件
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"html.format.indentHandlebars": true,
"html.format.indentInnerHtml": true,
"html.format.wrapLineLength": 200,
// 图片预览高度
"gutterpreview.imagePreviewMaxHeight": 200,
// 格式化 *.scss 文件
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// 格式化 *.md 文件
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
},
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
"editor.formatOnType": false,
"[json]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vetur.format.defaultFormatter.html": "prettyhtml",
"javascript.updateImportsOnFileMove.enabled": "always",
"px2rem.rootFontSize": 10,
"vetur.validation.templateProps": true,
"vetur.ignoreProjectWarning": true,
"editor.linkedEditing": true,
"fileheader.configObj": {
"autoAdd": false, // 默认开启
"createHeader": true, // 新建文件自动添加头部注释,默认打开
"prohibitAutoAdd": [ // 禁止.json .md文件,自动添加头部注释
"json",
"md"
],
"folderBlacklist": [ // 文件夹或文件名禁止自动添加头部注释
"node_modules",
"webpack.config.js",
"bin",
"build",
"dist",
"public",
"assets",
"layout",
"directive",
"router",
"store",
"permission.js",
"settings.js",
"main.js",
"App.vue",
"babel.config.js",
"package.json",
"vue.config.js",
".gitignore",
".eslintrc.js",
".eslintignore",
".env.staging",
".env.production",
".env.development",
".editorconfig"
]
},
"fileheader.customMade": {
"Description": "", // 文件描述(自定义)
"Author": "tianhui", // 文件创建者(不变)
"Date": "Do not edit", // 文件创建时间(不变)
"LastEditors": "tianhui", // 文件最后编辑者
"LastEditTime": "Do not edit", // 文件最后编辑时间
"FilePath": "Do not edit", // 文件在项目中的相对路径 自动更新
"Copyright": "Copyright (c) 2016~2021 tianhui(1114860254@qq.com)"
},
"highlight-matching-tag.styles": {
"opening": {
"left": {
"custom": {
"borderWidth": "0 0 0 2px",
"borderStyle": "solid",
"borderColor": "yellow",
"borderRadius": "5px",
"overviewRulerColor": "white"
}
},
"right": {
"custom": {
"borderWidth": "0 2px 0 0",
"borderStyle": "solid",
"borderColor": "yellow",
"borderRadius": "5px",
"overviewRulerColor": "white"
}
}
}
},
"css.enabledLanguages": [
"html"
],
"view-in-browser.customBrowser": "chrome",
"security.workspace.trust.untrustedFiles": "open",
"todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"TODO",
"XXX",
"[ ]",
"[x]"
],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)"
}