这是我的Visual Studio Code设置和扩展,用于提高生产力和改善开发体验。
设置
以下是我的settings.json
文件:
{
"editor.fontFamily": "JetBrains Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 14,
"editor.fontLigatures": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.renderWhitespace": "boundary",
"editor.rulers": [80, 100],
"editor.minimap.enabled": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"editor.suggestSelection": "first",
"editor.acceptSuggestionOnCommitCharacter": true,
"editor.acceptSuggestionOnEnter": "on",
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
"editor.quickSuggestionsDelay": 10,
"editor.wordBasedSuggestions": true,
"editor.parameterHints.enabled": true,
"editor.inlineSuggest.enabled": true,
"editor.stickyScroll.enabled": true,
"editor.linkedEditing": true,
"editor.wordWrap": "off",
"editor.accessibilitySupport": "off",
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "on",
"editor.find.addExtraSpaceOnTop": false,
"editor.guides.bracketPairs": "active",
"editor.bracketPairColorization.enabled": true,
"editor.hover.sticky": true,
"editor.largeFileOptimizations": true,
"editor.smoothScrolling": true,
"editor.unfoldOnClickAfterEndOfLine": true,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.stickyTabStops": true,
"editor.gotoLocation.multipleDefinitions": "goto",
"editor.gotoLocation.multipleDeclarations": "goto",
"editor.gotoLocation.multipleImplementations": "goto",
"editor.gotoLocation.multipleReferences": "goto",
"editor.gotoLocation.multipleTypeDefinitions": "goto",
"editor.experimental.stickyScroll.enabled": true,
"editor.scrollBeyondLastLine": false,
"editor.formatOnPaste": false,
"editor.mouseWheelZoom": true,
"editor.copyWithSyntaxHighlighting": false,
"editor.definitionLinkOpensInPeek": true,
"editor.emptySelectionClipboard": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.renderControlCharacters": true,
"editor.renderLineHighlight": "all",
"editor.selectionHighlight": true,
"editor.snippetSuggestions": "top",
"editor.suggest.filterGraceful": true,
"editor.suggest.localityBonus": true,
"editor.suggest.preview": true,
"editor.suggest.shareSuggestSelections": true,
"editor.suggest.showIcons": true,
"editor.suggest.showMethods": true,
"editor.suggest.showStatusBar": true,
"editor.suggestFontSize": 14,
"editor.suggestLineHeight": 24,
"editor.tabCompletion": "on",
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.includeComments": false,
"editor.unicodeHighlight.includeStrings": false,
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
"editor.wordWrapColumn": 100,
"editor.wrappingIndent": "same",
"editor.foldingImportsByDefault": true,
"editor.showFoldingControls": "always",
"editor.foldingMaximumRegions": 10000,
"editor.language.brackets": [],
"editor.language.colorizedBracketPairs": [],
"editor.guides.indentation": true,
"editor.guides.highlightActiveIndentation": true,
"editor.hover.delay": 300,
"editor.hover.above": true,
"editor.lightbulb.enabled": true,
"editor.occurrencesHighlight": true,
"editor.padding.bottom": 0,
"editor.padding.top": 0,
"editor.quickSuggestionsDelay": 10,
"editor.rename.enablePreview": true,
"editor.roundedSelection": true,
"editor.scrollbar.horizontal": "auto",
"editor.scrollbar.vertical": "auto",
"editor.scrollbar.horizontalScrollbarSize": 12,
"editor.scrollbar.verticalScrollbarSize": 12,
"editor.scrollBeyondLastColumn": 5,
"editor.selectionClipboard": true,
"editor.semanticHighlighting.enabled": true,
"editor.semanticTokenColorCustomizations": {},
"editor.showDeprecated": true,
"editor.showUnused": true,
"editor.stablePeek": false,
"editor.tokenColorCustomizations": {},
"editor.unusualLineTerminators": "prompt",
"editor.useTabStops": true,
"editor.dragAndDrop": true,
"editor.folding": true,
"editor.glyphMargin": true,
"editor.lineHeight": 0,
"editor.lineNumbers": "on",
"editor.matchBrackets": "always",
"editor.mouseWheelScrollSensitivity": 1,
"editor.overviewRulerBorder": true,
"editor.renderFinalNewline": true,
"editor.scrollPredominantAxis": true,
"editor.selectionHighlight": true,
"editor.smoothScrolling": true,
"editor.suggest.insertMode": "insert",
"editor.suggest.showClasses": true,
"editor.suggest.showColors": true,
"editor.suggest.showConstants": true,
"editor.suggest.showConstructors": true,
"editor.suggest.showCustomcolors": true,
"editor.suggest.showDeprecated": true,
"editor.suggest.showEnumMembers": true,
"editor.suggest.showEnums": true,
"editor.suggest.showEvents": true,
"editor.suggest.showFields": true,
"editor.suggest.showFiles": true,
"editor.suggest.showFolders": true,
"editor.suggest.showFunctions": true,
"editor.suggest.showInterfaces": true,
"editor.suggest.showIssues": true,
"editor.suggest.showKeywords": true,
"editor.suggest.showModules": true,
"editor.suggest.showOperators": true,
"editor.suggest.showProperties": true,
"editor.suggest.showReferences": true,
"editor.suggest.showSnippets": true,
"editor.suggest.showStructs": true,
"editor.suggest.showTypeParameters": true,
"editor.suggest.showUnits": true,
"editor.suggest.showUsers": true,
"editor.suggest.showValues": true,
"editor.suggest.showVariables": true,
"editor.suggest.showWords": true,
"editor.suggest.snippetsPreventQuickSuggestions": true,
"editor.unicodeHighlight.allowedCharacters": {},
"editor.unicodeHighlight.allowedLocales": {
"vi": true
},
"editor.wordBasedSuggestionsMode": "matchingDocuments",
"editor.wrappingStrategy": "simple",
"editor.experimental.pasteActions.enabled": true,
"editor.find.autoFindInSelection": "multiline",
"editor.find.cursorMoveOnType": true,
"editor.find.loop": true,
"editor.find.seedSearchStringFromSelection": "selection",
"editor.formatOnSaveMode": "file",
"editor.inlayHints.enabled": "on",
"editor.inlayHints.fontSize": 11,
"editor.inlayHints.padding": true,
"editor.letterSpacing": 0,
"editor.linkedEditing": true,
"editor.links": true,
"editor.minimap.maxColumn": 120,
"editor.minimap.renderCharacters": true,
"editor.minimap.scale": 1,
"editor.minimap.showSlider": "always",
"editor.minimap.side": "right",
"editor.multiCursorLimit": 10000,
"editor.multiCursorMergeOverlapping": true,
"editor.multiCursorPaste": "full",
"editor.occurrencesHighlight": "singleFile",
"editor.quickSuggestions": {
"other": "on",
"comments": "off",
"strings": "off"
},
"editor.rename.enablePreview": true,
"editor.renderLineHighlightOnlyWhenFocus": false,
"editor.scrollBeyondLastLine": true,
"editor.selectionClipboard": true,
"editor.stickyScroll.maxLineCount": 5,
"editor.stickyTabStops": true,
"editor.suggest.hideStatusBar": false,
"editor.suggest.showInlineDetails": true,
"editor.suggest.showDeprecated": true,
"editor.suggest.matchOnWordStartOnly": true,
"editor.tokenColorCustomizations": {},
"editor.trimAutoWhitespace": true,
"editor.unfoldOnClickAfterEndOfLine": true,
"editor.unicodeHighlight.allowedLocales": {
"vi": true
},
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.includeComments": true,
"editor.unicodeHighlight.includeStrings": true,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.unicodeHighlight.nonBasicASCII": false,
"editor.wordBasedSuggestions": "matchingDocuments",
"editor.wordWrap": "off",
"editor.wordWrapColumn": 80,
"editor.wrappingIndent": "none",
"editor.wrappingStrategy": "simple",
"explorer.compactFolders": false,
"explorer.confirmDelete": true,
"explorer.confirmDragAndDrop": true,
"explorer.incrementalNaming": "smart",
"explorer.sortOrder": "default",
"files.associations": {
"*.mdx": "markdown"
},
"files.autoSave": "onFocusChange",
"files.eol": "\n",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"git.untrackedChanges": "separate",
"javascript.format.enable": false,
"javascript.preferences.quoteStyle": "single",
"javascript.suggest.autoImports": true,
"javascript.suggest.completeFunctionCalls": true,
"javascript.suggest.enabled": true,
"javascript.suggest.includeAutomaticOptionalChainCompletions": true,
"javascript.suggest.includeCompletionsForImportStatements": true,
"javascript.suggest.jsdoc.generateReturns": true,
"javascript.suggest.names": true,
"javascript.suggest.paths": true,
"javascript.suggestionActions.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.validate.enable": true,
"search.exclude": {
"**/.git": true,
"**/.github": true,
"**/.nuxt": true,
"**/.output": true,
"**/.pnpm": true,
"**/.vscode": true,
"**/.yarn": true,
"**/bower_components": true,
"**/dist/**": true,
"**/logs": true,
"**/node_modules": true,
"**/out/**": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/tmp": true,
"**/yarn.lock": true
},
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.fontFamily": "JetBrains Mono, Menlo, Monaco, 'Courier New', monospace",
"terminal.integrated.fontSize": 14,
"terminal.integrated.lineHeight": 1.2,
"terminal.integrated.persistentSessionReviveProcess": "never",
"terminal.integrated.tabs.enabled": true,
"typescript.format.enable": false,
"typescript.preferences.quoteStyle": "single",
"typescript.suggest.autoImports": true,
"typescript.suggest.completeFunctionCalls": true,
"typescript.suggest.enabled": true,
"typescript.suggest.includeAutomaticOptionalChainCompletions": true,
"typescript.suggest.includeCompletionsForImportStatements": true,
"typescript.suggest.jsdoc.generateReturns": true,
"typescript.suggest.objectLiteralMethodSnippets.enabled": true,
"typescript.suggest.paths": true,
"typescript.suggestionActions.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.validate.enable": true,
"window.autoDetectColorScheme": true,
"window.commandCenter": true,
"window.dialogStyle": "custom",
"window.nativeTabs": true,
"window.titleBarStyle": "custom",
"window.zoomLevel": 0,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "GitHub Dark",
"workbench.editor.closeOnFileDelete": true,
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 8,
"workbench.editor.tabCloseButton": "right",
"workbench.editor.tabSizing": "shrink",
"workbench.editor.untitled.hint": "hidden",
"workbench.editor.wrapTabs": false,
"workbench.iconTheme": "material-icon-theme",
"workbench.list.smoothScrolling": true,
"workbench.preferredDarkColorTheme": "GitHub Dark",
"workbench.preferredLightColorTheme": "GitHub Light",
"workbench.settings.editor": "json",
"workbench.settings.openDefaultSettings": true,
"workbench.settings.useSplitJSON": true,
"workbench.sideBar.location": "left",
"workbench.startupEditor": "none",
"workbench.tree.expandMode": "singleClick",
"workbench.tree.indent": 12,
"workbench.tree.renderIndentGuides": "always",
"zenMode.centerLayout": true,
"zenMode.fullScreen": true,
"zenMode.hideActivityBar": true,
"zenMode.hideLineNumbers": false,
"zenMode.hideStatusBar": true,
"zenMode.hideTabs": true,
"zenMode.restore": true,
"zenMode.silentNotifications": true,
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
扩展
以下是我推荐的一些扩展:
主题
- GitHub Theme - GitHub的官方VS Code主题
- Material Icon Theme - 为VS Code提供Material Design图标
代码质量
- ESLint - 集成ESLint到VS Code
- Prettier - Code formatter - 代码格式化工具
语言支持
- JavaScript and TypeScript Nightly - 最新的TypeScript和JavaScript功能
- MDX - MDX语言支持
生产力工具
- GitHub Copilot - 由AI驱动的代码补全
- GitLens - 增强Git功能
- Path Intellisense - 自动补全文件名
- Import Cost - 显示导入包的大小
- Todo Tree - 显示TODO注释
远程开发
- Remote - SSH - 通过SSH打开远程文件夹
- Remote - Containers - 在容器中打开文件夹
调试
- JavaScript Debugger - JavaScript调试器
- Error Lens - 在编辑器中突出显示错误
其他
- Live Share - 实时协作编辑和调试
- Code Spell Checker - 拼写检查器