vscode 基本配置

本文介绍常用编辑器 vscode 的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{
"workbench.colorTheme": "Default Dark+",
"workbench.iconTheme": "vscode-great-icons",
"editor.fontWeight": "bold",
"editor.lineHeight": 20,
"editor.fontSize": 16,
"editor.multiCursorModifier": "ctrlCmd", // 通过使用鼠标滚轮同时按住 Ctrl 可缩放编辑器的字体
"editor.mouseWheelZoom": true,
"editor.suggestOnTriggerCharacters": true, // tab锁紧
"editor.tabSize": 2, // 空格变成......
"editor.renderWhitespace": "none",
"editor.tabCompletion": "on",
"editor.wordWrapColumn": 100,
"editor.renderControlCharacters": true,
"editor.cursorWidth": 2,
"editor.cursorStyle": "line",
"editor.fontLigatures": true,
"editor.renderLineHighlight": "none",
"editor.minimap.enabled": true,
"editor.detectIndentation": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true,
"source.fixAll.eslint": true
},
"editor.cursorBlinking": "solid",
"editor.suggestSelection": "first",
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"editor.formatOnType": true,
"editor.wordWrap": "on",
"editor.largeFileOptimizations": false,
"editor.linkedEditing": true,
"editor.foldingImportsByDefault": false,
"editor.unicodeHighlight.ambiguousCharacters": false, // "editor.hover.enabled": false,
"editor.unicodeHighlight.includeStrings": false,
"editor.inlineSuggest.enabled": true, // "editor.snippetSuggestions": "top",
"emmet.includeLanguages": {
"wxml": "html"
}, //  #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"git.confirmSync": false,
"git.enableSmartCommit": true, // 不同文件的格式化方式设置
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[renderjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[nunjucks]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"explorer.confirmDelete": false, // 控制资源管理器是否在把文件删除到废纸篓时进行确认。
"git.ignoreMissingGitWarning": true,
"emmet.triggerExpansionOnTab": true,
"breadcrumbs.enabled": true,
"projectManager.openInNewWindowWhenClickingInStatusBar": true,
"projectManager.git.baseFolders": [],
"workbench.editor.closeEmptyGroups": false,
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.untitled.hint": "hidden",
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript",
"*.vue": "vue",
"*.nvue": "vue",
"*.json": "jsonc"
},
"javascript.preferences.quoteStyle": "double",
"javascript.updateImportsOnFileMove.enabled": "always",
"js/ts.implicitProjectConfig.experimentalDecorators": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": true,
"projectManager.git.ignoredFolders": ["*.lock", "node_modules", "out", "typings", "test", ".haxelib"],
"terminal.integrated.cursorBlinking": true,
"explorer.confirmDragAndDrop": false,
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": true,
"suppressGitMissingWarning": true,
"suppressGitVersionWarning": true,
"suppressLineUncommittedWarning": true
},
"search.followSymlinks": false,
"extensions.autoUpdate": false, // 文件自动保存
"extensions.autoCheckUpdates": false,
"html.format.indentInnerHtml": true,
"html.format.indentHandlebars": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
"security.workspace.trust.untrustedFiles": "open",
"prettier.htmlWhitespaceSensitivity": "strict",
"prettier.endOfLine": "auto",
"prettier.trailingComma": "none", // "eslint.codeAction.disableRuleComment": { //   "enable": false // },
"eslint.codeAction.showDocumentation": {
"enable": true
},
"typescript.validate.enable": false,
"typescript.suggest.includeCompletionsForImportStatements": false,
"typescript.suggest.jsdoc.generateReturns": false,
"prettier.printWidth": 150,
"gitlens.views.showRelativeDateMarkers": false,
"gitlens.views.worktrees.avatars": false,
"prettier.vueIndentScriptAndStyle": false,
"prettier.bracketSameLine": true,
"diffEditor.ignoreTrimWhitespace": false,
"editor.autoClosingQuotes": "always",
"emmet.showSuggestionsAsSnippets": true, // eslint生效
"eslint.enable": true, // 执行eslint命令的时候有效
"eslint.options": {
"extensions": [".js", ".vue", ".ts", ".tsx"]
}, // eslint检查的语言
"eslint.validate": ["javascript", "vue", "html", "javascript", "javascriptreact", "typescript", "typescriptreact"],
// "vetur.validation.script": false,
// "vetur.validation.style": false,
// "vetur.validation.template": false,
// "vetur.validation.interpolation": false,
// "vetur.validation.templateProps": true,
"editor.formatOnSave": true,
"window.zoomLevel": 1
}