1 {
2 //设置文字大小
3 "editor.fontSize": 18,
4 //设置文字行高
5 "editor.lineHeight": 24,
6 //开启行数提示
7 "editor.lineNumbers": "on",
8 // 在输入时显示含有参数文档和类型信息的小面板。
9 "editor.parameterHints.enabled": true,
10 // 文件目录
11 "workbench.iconTheme": "vscode-icons",
12 // 设置字体
13 // "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
14 // 自动换行
15 // "editor.wordWrap": "on",
16 // 自定义vscode面板颜色
17 // "workbench.colorCustomizations": {
18 // "tab.activeBackground": "#253046", // 活动选项卡的背景色
19 // "activityBar.background": "#253046", //活动栏背景色
20 // "sideBar.background": "#253046", //侧边栏背景色
21 // "activityBar.foreground": "#23f8c8", //活动栏前景色(例如用于图标)
22 // "editor.background": "#292a2c" //编辑器背景颜色
23 // },
24 // vscode默认启用了根据文件类型自动设置tabsize的选项
25 "editor.detectIndentation": false,
26 // 重新设定tabsize
27 "editor.tabSize": 2,
28 // #每次保存的时候自动格式化
29 "editor.formatOnSave": true,
30 // 开启 vscode 文件路径导航
31 "breadcrumbs.enabled": true,
32 // prettier 设置语句末尾不加分号
33 "prettier.semi": false,
34 // prettier 设置强制单引号
35 "prettier.singleQuote": true,
36 // 使用单引号
37 "javascript.preferences.quoteStyle": "single",
38 "typescript.preferences.quoteStyle": "single",
39 "prettier.jsxSingleQuote": true,
40 // 显示 markdown 中英文切换时产生的特殊字符
41 "editor.renderControlCharacters": true,
42 // #让函数(名)和后面的括号之间加个空格
43 "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
44 // 保存时运行的代码ESLint操作类型。
45 "editor.codeActionsOnSave": {
46 "source.fixAll.eslint": true
47 },
48 // 添加emmet支持vue文件
49 "emmet.includeLanguages": {
50 "wxml": "html",
51 "vue": "html"
52 },
53 //快速预览(右侧)
54 "editor.minimap.enabled": true,
55 // tab 代码补全
56 "files.associations": {
57 "*.wpy": "vue",
58 "*.vue": "vue",
59 "*.cjson": "jsonc",
60 "*.wxss": "css",
61 "*.wxs": "javascript"
62 },
63 // 用来配置如何使用ESLint CLI引擎API启动ESLint。 默认为空选项
64 "eslint.options": {
65 "extensions": [".js", ".vue"]
66 },
67 // 在onSave还是onType时执行linter。默认为onType。
68 "eslint.run": "onSave",
69 // 启用ESLint作为已验证文件的格式化程序。
70 "eslint.format.enable": true,
71 // 语言标识符的数组,为此ESLint扩展应被激活,并应尝试验证文件。
72 "eslint.probe": ["javascript", "javascriptreact", "vue-html", "vue", "html"],
73 //关闭rg.exe进程 用cnpm导致会出现rg.exe占用内存很高
74 "search.followSymlinks": false,
75 // #这个按用户自身习惯选择
76 "vetur.format.defaultFormatter.html": "js-beautify-html",
77 // #让vue中的js按编辑器自带的ts格式进行格式化
78 "vetur.format.defaultFormatter.js": "vscode-typescript",
79 // 给js-beautify-html设置属性隔断
80 "vetur.format.defaultFormatterOptions": {
81 "js-beautify-html": {
82 "wrap_attributes": "aligned-multiple",
83 "wrap_line_length": 900,
84 "end_with_newline": false
85 },
86 "prettyhtml": {
87 "printWidth": 500,
88 "singleQuote": false,
89 "wrapAttributes": false,
90 "sortAttributes": false
91 },
92 "prettier": {
93 "semi": false,
94 "singleQuote": true
95 }
96 },
97 // style默认偏移一个indent
98 "vetur.format.styleInitialIndent": true,
99 // 定义匿名函数的函数关键字后面的空格处理。
100 "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
101 // 定义函数参数括号前的空格处理方式。
102 "typescript.format.insertSpaceBeforeFunctionParenthesis": true,
103 // 新版本消息
104 "vsicons.dontShowNewVersionMessage": false,
105 // 控制资源管理器是否在把文件删除到废纸篓时进行确认。
106 "explorer.confirmDelete": false,
107 // 使用eslint-plugin-vue验证<template>中的vue-html
108 "vetur.validation.template": false,
109 // 格式化js时候{}中内容不自动换行
110 "beautify.config": {
111 "brace_style": "collapse,preserve-inline"
112 },
113 "beautify.language": {
114 "js": {
115 "type": ["javascript", "json", "jsonc"],
116 "filename": [".jshintrc", ".jsbeautifyrc"]
117 },
118 "css": ["css", "less", "scss"],
119 "html": ["htm", "html"]
120 },
121 "terminal.integrated.confirmOnExit": true,
122 "terminal.integrated.copyOnSelection": true,
123 "terminal.integrated.cursorBlinking": true,
124 "json.trace.server": "messages",
125 // 自动格式化粘贴内容
126 "editor.formatOnPaste": true,
127 // 写入一行后是否自动格式化
128 "editor.formatOnType": true,
129 // 指定用在工作台中的颜色主题。
130 "workbench.colorTheme": "Default Light+",
131 "debug.javascript.suggestPrettyPrinting": false,
132 "[vue]": {
133 // "editor.defaultFormatter": "esbenp.prettier-vscode",
134 "editor.defaultFormatter": "octref.vetur" // 使用 vetur 格式化规则
135 },
136 // "[json]": {
137 // "editor.defaultFormatter": "vscode.json-language-features"
138 // },
139 // "[jsonc]": {
140 // "editor.defaultFormatter": "vscode.json-language-features"
141 // },
142 // "[javascript]": {
143 // "editor.defaultFormatter": "dbaeumer.vscode-eslint"
144 // },
145 "[json]": {
146 "editor.defaultFormatter": "esbenp.prettier-vscode"
147 },
148 "[jsonc]": {
149 "editor.defaultFormatter": "esbenp.prettier-vscode"
150 },
151 "[javascript]": {
152 "editor.defaultFormatter": "esbenp.prettier-vscode"
153 },
154 "[typescript]": {
155 "editor.defaultFormatter": "esbenp.prettier-vscode"
156 },
157 "[javascript|react]": {
158 "editor.defaultFormatter": "esbenp.prettier-vscode"
159 },
160 "[typescript|react]": {
161 "editor.defaultFormatter": "esbenp.prettier-vscode"
162 },
163 "[less]": {
164 "editor.defaultFormatter": "esbenp.prettier-vscode"
165 },
166 "[css]": {
167 "editor.defaultFormatter": "esbenp.prettier-vscode"
168 },
169 "editor.quickSuggestions": {
170 "strings": true
171 }
172 }