打开 文件
> 首选项
> 用户设置(U)
,(忽略覆盖工做区提示)javascript
{ // 一个制表符等于的空格数。该设置在 `editor.detectIndentation` 启用时根据文件内容进行重写。 "editor.tabSize": 2, "editor.lineHeight": 24, "editor.renderLineHighlight": "none", "editor.renderWhitespace": "none", // 控制字体系列。 "editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace,'宋体'", "editor.fontLigatures": true, // 以像素为单位控制字号。 "editor.fontSize": 14, "editor.cursorBlinking": "smooth", "editor.wordWrap": "on", "editor.formatOnSave": true, "editor.formatOnPaste": true, // 控制选取范围是否有圆角 "editor.roundedSelection": false, // 建议小组件的字号 "editor.suggestFontSize": 16, // 是否容许自定义的snippet片断提示,好比自定义的vue片断开启后就能够智能提示 "editor.snippetSuggestions": "top", "editor.quickSuggestions": { "strings": true }, // 执行文字相关的导航或操做时将用做文字分隔符的字符 "editor.wordSeparators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?", // 在“打开的编辑器”窗格中显示的编辑器数量。将其设置为 0 可隐藏窗格。 "explorer.openEditors.visible": 0, "git.path": "D:/Program Files/Git/bin/git.exe", // 是否已启用自动刷新 "git.autorefresh": true, // git是否启用自动拉取 "git.autofetch": false, // 以像素为单位控制终端的字号,这是 editor.fontSize 的默认值。 "terminal.integrated.fontSize": 14, // 控制终端游标是否闪烁。 "terminal.integrated.cursorBlinking": true, "workbench.startupEditor": "newUntitledFile", "workbench.iconTheme": "eq-material-theme-icons-palenight", "workbench.colorTheme": "Material Theme Palenight High Contrast", "materialTheme.fixIconsRunning": false, "html.suggest.angular1": false, "html.suggest.ionic": false, "files.trimTrailingWhitespace": true, // VScode 文件搜索区域配置 "search.exclude": { "**/dist": true, "**/build": true, "**/elehukouben": true, "**/.git": true, "**/.gitignore": true, "**/.svn": true, "**/.DS_Store": true, "**/.idea": true, "**/.vscode": false, "**/yarn.lock": true, "**/tmp": true }, // 排除文件搜索区域,好比node_modules(贴心的默认设置已经屏蔽了) "files.exclude": { "**/.idea": true, "**/yarn.lock": true, "**/tmp": true }, // 配置文件关联,以便启用对应的智能提示,好比wxss使用css "files.associations": { "*.vue": "vue", "*.wxss": "css" }, // 配置emmet是否启用tab展开缩写 "emmet.triggerExpansionOnTab": true, // 配置emmet对文件类型的支持,好比vue后缀文件按照html文件来进行emmet扩写 "emmet.syntaxProfiles": { "vue-html": "html", "vue": "html", "javascript": "javascriptreact", // xml类型文件默认都是单引号,开启对非单引号的emmet识别 "xml": { "attr_quotes": "single" } }, // 在react的jsx中添加对emmet的支持 "emmet.includeLanguages": { "jsx-sublime-babel-tags": "javascriptreact" }, // 是否开启eslint检测 "eslint.enable": true, // 文件保存时,是否自动根据eslint进行格式化 "eslint.autoFixOnSave": true, // eslint配置文件 "eslint.options": { "plugins": [ "html", "javascript", { "language": "vue", "autoFix": true }, "vue" ] }, // eslint可以识别的文件后缀类型 "eslint.validate": [ "javascript", "javascriptreact", "html", "vue", { "language": "html", "autoFix": true }, "typescript", "typescriptreact" ], // 快捷键方案,使用sublime的一套快捷键 "sublimeTextKeymap.promptV3Features": true, // 格式化快捷键 shirt+alt+F // prettier进行格式化时是否安装eslint配置去执行,建议false "prettier.eslintIntegration": true, //分号 "prettier.semi": false, // 若是为true,将使用单引号而不是双引号 "prettier.singleQuote": true, "prettier.tabWidth": 2, "prettier.useTabs": false, // vetur插件格式化使用beautify内置规则 "vetur.format.defaultFormatter.html": "js-beautify-html", //函数前加空格 "javascript.format.insertSpaceBeforeFunctionParenthesis": true, // 没有下边这个 上边不生效 "vetur.format.defaultFormatter.js": "vscode-typescript", // 细节,配置gitlen中git提交历史记录的信息显示状况 "gitlens.advanced.messages": { "suppressCommitHasNoPreviousCommitWarning": false, "suppressCommitNotFoundWarning": false, "suppressFileNotUnderSourceControlWarning": false, "suppressGitVersionWarning": false, "suppressLineUncommittedWarning": false, "suppressNoRepositoryWarning": false, "suppressResultsExplorerNotice": false, "suppressUpdateNotice": true, "suppressWelcomeNotice": false }, // 对不属于任何工程的 JavaScript 文件启用或禁用 "experimentalDecorators" 设置。如有 jsconfig.json 或 tsconfig.json 文件,将覆盖此设置。要求工做区使用高于 2.3.1 版本的 TypeScript。 "javascript.implicitProjectConfig.experimentalDecorators": true, "powermode.enabled": true, "powermode.presets": "flames", // 开启apicloud在vscode中的wifi真机同步 "apicloud.port": "23450", // 设置apicloud在vscode中的wifi真机同步根目录 "apicloud.subdirectories": "/apiclouduser", "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" }
打开 文件
> 首选项
> 用户代码片断
> (搜索代码语言)
css
HTML片断html
{ "ss": { "prefix": "ss", "body": [ "<script src=\"$1\"></script>" ], "description": "<script src=\"...\"></script>" }, "html5": { "prefix": "html5", "body": [ "<!DOCTYPE html>", "<html lang=\"zh-CN\">", "", "<head>", " <meta charset=\"UTF-8\">", " <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">", " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">", " <title>${1:Document}</title>", "</head>", "", "<body>", " $2", "</body>", "", "</html>" ], "description": "HTML5" } }
JavaScript / JavaScript Reactvue
{ "cl": { "prefix": "cl", "body": [ "console.log($1)" ], "description": "console.log('')" }, "dg": { "prefix": "dg", "body": [ "document.getElementById($1)" ], "description": "document.getElementById(id)" }, "jsdoc": { "prefix": "__", "body": [ "/**", " * $1", " */" ], "description": "/** */" } }
// 将键绑定放入此文件中以覆盖默认值 [ // ctrl+shift+d 复制当前行到下一行 { "key": "ctrl+shift+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus && !editorReadonly" }, // ctrl+shift+f 格式化代码 { "key": "ctrl+shift+f", "command": "editor.action.formatDocument", "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly" }, // alt+/ 代码提示 { "key": "alt+/", "command": "editor.action.triggerSuggest", "when": "editorTextFocus" }, // ctrl+shift+/ 多行注释 { "key": "ctrl+shift+/", "command": "editor.action.blockComment", "when": "editorTextFocus" } ]
提示:VS Code自带有代码格式化功能,能够格式化HTML、CSS、JavaScript、JSON文件,格式JSX文件时须要设置缩进方式为空格·html5
Auto Close Tag (自动关闭HTML标签) Auto Rename Tag (HTML标签自动更名) Babel ES6/ES7 VS Code JavaScript (ES6) snippets (ES6语法提示) Beautify css/sass/scss/less Brackets Light (主题) Complete JSDoc Tags (js文档注释提示) Git History (查看git提交记录) HTML CSS Support (HTML中提示可用的class) npm Intellisense (提示能够require的模块名称(最新版的vscode已经集成此功能)) One Dark Theme (主题) Path Intellisense (路径补全) Prettier (格式化,使用标准风格,快捷键 alt+shift +F) Reactjs code snippets (reactjs代码提示) Sass SCSS IntelliSense Sublime Babel Sublime Text Keymap for VS Code (sublime键映射) VSCode Great Icons (文件图标) vscode-icons (文件图标) HTMLHint (html代码检查) HTML Snippets (超级实用且初级的 H5代码片断以及提示) Document this (js 的注释模板 (注意:新版的vscode已经原生支持,在function上输入/** tab)) cssrem (将css中的px自动转换为rem.不再用计算器了) Vetur (添加对.vue后缀文件的快速书写支持) Vue 2 Snippets (快速新建vue页面)