vscode配置总结可收藏/vscode用户设置大全/vue代码模板

265 阅读6分钟

//用户设置

{
 
//-------- 搜索配置 --------
 
"search.exclude": {
 
"**/node_modules": true,
 
"**/bower_components": true,
 
"**/.git": true,
 
"**/.DS_Store": true,
 
"**/*.meta": true,
 
"**/*.*.meta": true,
 
"**/*.unity": true,
 
"**/*.unityproj": true,
 
"**/*.mat": true,
 
"**/*.fbx": true,
 
"**/*.FBX": true,
 
"**/*.tga": true,
 
"**/*.cubemap": true,
 
"**/**.prefab": true,
 
"**/Library": true,
 
"**/ProjectSettings": true,
 
"**/Temp": true,
 
"**/*.exe": true
 
},
 
// 配置 glob 模式以排除文件和文件夹。
 
"files.exclude": {
 
"**/.git": true,
 
"**/.DS_Store": true,
 
"**/*.meta": true,
 
"**/*.*.meta": true,
 
"**/*.unity": true,
 
"**/*.unityproj": true,
 
"**/*.mat": true,
 
"**/*.fbx": true,
 
"**/*.FBX": true,
 
"**/*.tga": true,
 
"**/*.cubemap": true,
 
"**/**.prefab": true,
 
"**/Library": true,
 
"**/ProjectSettings": true,
 
"**/Temp": true,
 
"**/*.exe": true
 
}, //前两个配置会引起全局搜索失效
 
// 控制编辑器是否应呈现空白字符
 
"editor.renderWhitespace": "all",
 
// 控制字体大小。
 
"editor.fontSize": 12,
 
// 是否启用了 GIT
 
"git.enabled": true,
 
// 控制编辑器是否应呈现空白字符
 
"editor.renderWhitespace": "all",
 
//自动换行
 
"editor.wordWrap": "on",
 
// 是否应该呈现缩进指南
 
"editor.renderIndentGuides":true,
 
// Ctrl + 鼠标滚轴可以缩放视图
 
"editor.mouseWheelZoom" : true,
 
// 这样 visual code 就可以调试和运行 python代码了! 当前了也要安装插件
 
"python.pythonPath": "E:/Program Files/Python35/python.exe",
 
// Whether to lint Python files.
 
"python.linting.enabled": false,
 
// 打开多个文件的时候 Tab页的方式显示(否则只能是分屏显示)
 
"workbench.editor.showTabs": true,
 
// 新打开的显示在最左面
 
"workbench.editor.openPositioning": "left",
 
"window.zoomLevel": 1,
 
"files.autoSave": "off",
 
"liveServer.settings.donotShowInfoMsg": true,
 
"workbench.colorTheme": "Visual Studio Dark",
 
"explorer.confirmDragAndDrop": false,
 
// lua 的调试工具 Lua and Ravi 5.3 Debugger https://marketplace.visualstudio.com/items?itemName=ravilang.ravi-debug
 
// go 插件也有调试功能, 但是要配置具体的环境变量!
 
//ctrl+space被切换输入法快捷键占用
 
"files.associations": {
 
// "*.vue":"vue",
"*.vue":"html",
 
"*.css": "scss"
 
},
 
//react代码提示
 
"emmet.includeLanguages": {
 
"javascript": "javascriptreact"
 
},
"gitlens.advanced.messages": {
    "suppressGitDisabledWarning": true
},
"git.autofetch": true,
"sync.gist": "d509341bf0b35c92262563e737e76dad",
"sync.quietSync": false,
"sync.removeExtensions": true,
"sync.syncExtensions": true,
"sync.autoDownload": false,
"sync.autoUpload": false,
"sync.forceDownload": false,
"liveServer.settings.donotVerifyTags": true,
"powermode.enabled":true,
"powermode.enableShake": false,
 
"powermode.presets": "particles",
 
"powermode.enableShake": false,//这个代表桌面是否震动
"powermode.presets": "particles",//这个是样式
 // 时间间隔  
//  "powermode.comboTimeout":8 ,
 "eslint.autoFixOnSave": true,  //  启用保存时自动修复,默认只支持.js文件
    "eslint.validate": [
       "javascript",  //  用eslint的规则检测js文件
       {
         "language": "vue",   // 检测vue文件
         "autoFix": true   //  为vue文件开启保存自动修复的功能
       },
       {
         "language": "html",
         "autoFix": true
       },
     ],
 
}
  • 常用插件:
  • View In Browser
    • 预览页面(ctrl+F1)
  • vscode-icons
    • 侧栏的图标,对于一个有视觉强迫症的人是必须要的
  • HTML Snippets
    • 支持HTML5的标签提示
  • HTML CSS support
    • css自动补齐
  • jQuery Code Snippets
  • jquery 自动提示
  • Path Autocomplete
    • 路径自动补齐
  • Npm Intellisense
    • npm包代码提示
  • ESLint
    • 检测JS必备
  • Debugger for Chrome
    • 方便调试
  • Auto Rename Tag
    • 自动同步修改标签
  • Bootstrap 3 Snippets
    • bootstrap必备
  • Vue 2 Snippets
    • vue必备
  • vetur
  • Prettier - Code formatter
  • 代码格式化美化
    • vue高亮
  • background
    • 一个萌萌的插件,可以自己设置vsc的背景图
  • Live Server
  • 服务器
  • open in Browser
  • 浏览器打开
  • Bracket Pair Colorizer
  • 括号颜色匹配
  • React Native Tools
  • react必备
  • Code Spell Checker
  • 检测写代码时错词
  • Nest Comments
  • 可以覆盖注释一段有代码注释的代码 ctrl+alt+/
  • htmltagwrap
  • 一键添加外围标签 /Alt + W 默认p,可调整为div
  • javascript console utils
  • 一键添加console.log() / shift+ctrl+l
  • GitLens
  • git 提交
  • Power Mode
  • 输入时有炫酷特效
  • "powermode.enabled":true,
  • "powermode.enableShake": false,
  • "powermode.presets": "particles",
  • "powermode.enableShake": false,//这个代表桌面是否震动
  • "powermode.presets": "particles",//这个是样式
  • Clipboard History 查看剪切板的记录 或者window自带 w+v
  • time master 时间管理插件,可以显示本日使用编辑器时长
  • JSON to TS json转ts

额外 插件列表

名称 简述

Auto Close Tag 自动闭合HTML标签

Auto Import Typescript自动import提示

Auto Rename Tag 修改HTML标签时,自动修改匹配的标签

Beautify css/sass/scss/less css/sass/less格式化

Better Align 对齐赋值符号和注释

Better Comments 编写更加人性化的注释

Bookmarks 添加行书签

Bracket Pair Colorizer 用不同颜色高亮显示匹配的括号

Can I Use HTML5、CSS3、SVG的浏览器兼容性检查

Code Runner 运行选中代码段(支持大量语言,包括Node)

Code Spellchecker 单词拼写检查

CodeBing 在VSCode中弹出浏览器并搜索,可编辑搜索引擎

Color Highlight 颜色值在代码中高亮显示

Color Info 小窗口显示颜色值,rgb,hsl,cmyk,hex等等

Color Picker 拾色器

Dash 集成Dash

Debugger for Chrome 调试Chrome

Document This 注释文档生成

ESLint ESLint插件,高亮提示

EditorConfig for VS Code EditorConfig插件

Emoji 在代码中输入emoji

File Peek 根据路径字符串,快速定位到文件

Font-awesome codes for html FontAwesome提示代码段

Git Blame 在状态栏显示当前行的Git信息

Git History(git log) 查看git log

GitLens 显示文件最近的commit和作者,显示当前行commit信息

Guides 高亮缩进基准线

Gulp Snippets Gulp代码段

HTML CSS Class Completion CSS class提示

HTML CSS Support css提示(支持vue)

HTMLHint HTML格式提示

htmltagwrap 包裹HTML

Import Cost 行内显示导入(import/require)的包的大小

Indenticator 缩进高亮

IntelliSense for css class names css class输入提示

JavaScript (ES6) code snippets ES6语法代码段

JavaScript Standard Style Standard风格

JSON to TS JSON结构转化为typescript的interface

JSON Tools 格式化和压缩JSON

Less IntelliSense less变量与混合提示

Lodash Lodash代码段

Log Wrapper 生产打印选中变量的代码

MochaSnippets Mocha代码段

Node modules resolve 快速导航到Node模块

Code Outline 展示代码结构树

Output Colorizer 彩色输出信息

Partial Diff 对比两段代码或文件

Path Autocomplete 路径完成提示

Path Intellisense 另一个路径完成提示

PostCss Sorting css排序

Prettify JSON 格式化JSON

Project Manager 快速切换项目

Quokka.js 不需要手动运行,行内显示变量结果

REST Client 发送REST风格的HTTP请求

React Native Storybooks storybook预览插件,支持react

React Playground 为编辑器提供一个react组件运行环境,方便调试

React Standard Style code snippets react standar风格代码块

Sass sass插件

Settings Sync VSCode设置同步到Gist

Sort Typescript Imports typescript的import排序

Sort lines 排序选中行

String Manipulation 字符串转换处理(驼峰、大写开头、下划线等等)

SVG Viewer SVG查看器

Syncing vscode设置同步到gist

TODO Parser Todo管理

TS/JS postfix completion ts/js后缀提示

TSLint TypeScript语法检查

Test Spec Generator 测试用例生成(支持chai、should、jasmine)

TypeScript Import TS自动import

TypeSearch TS声明文件搜索

Types auto installer 自动安装@types声明依赖

VSCode Great Icons 文件图标拓展

Version Lens package.json文件显示模块当前版本和最新版本

View Node Package 快速打开选中模块的主页和代码仓库

VueHelper Vue2代码段(包括Vue2 api、vue-router2、vuex2)

filesize 状态栏显示当前文件大小

ftp-sync 同步文件到ftp

gitignore .gitignore文件语法

htmltagwrap 快捷包裹html标签

language-stylus Stylus语法高亮和提示

markdownlint Markdown格式提示

npm Intellisense 导入模块时,提示已安装模块名称

npm 运行npm命令

stylelint css/sass/less代码风格

vetur 目前比较好的Vue语法高亮

vscode-database 操作数据库,支持mysql和postgres

vscode-icons 文件图标,方便定位文件

vscode-random 随机字符串生成器

vscode-spotify 集成spotify,播放音乐

vscode-styled-components styled-components高亮支持

vscode-styled-jsx styled-jsx高亮支持

vue代码模板

{
 
"Print to console": {
 
"prefix": "vue",
 
"body": [
 
"<script>",
 
" new Vue({",
 
" el: '#box',",
 
         " data: {",
 
         " ", 
 
" },",
 
" methods: {",
 
         " greet: function (event) {",
 
         " ",
 
" }",
 
" }",
 
" })",
 
"</script>"
 
],
 
"description": "Log output to console"
 
}
 
}