Visual Studio Code设定与插件

因为小弟最近买了新电脑,顺便记录一下各式各样的插件,首先安装以下几个东西~

Node.jsVS CodeGit

接下来开始介绍套件拉~

indent-rainbow

使缩排增加颜色,比较美观~
indent-rainbow 预览图片


vscode-icons

提供有够潮的 icon
vscode-icons 预览图片


cdnjs

按下 F1,输入 cdnjs,可以快速查找 cdn
cdnjs 预览图片


Prettier

快速排版~快捷键 Ctrl + Shift + F
以下为小弟习惯的设定:
1.切换视窗时自动存档
2.存档后自动执行
3.使用单引号

{  "files.autoSave": "onWindowChange",  "editor.formatOnSave": true,  "prettier.singleQuote": true}

Prettier 预览图片


Bracket Pair Colorizer

括号颜色与括号对应~
Bracket Pair Colorizer 预览图片


Preview on Web Server

于本机开启 Web Server,即时预览程式码
Preview on Web Server 预览图片


Live Server

于本机开启 Web Server,即时预览程式码
Live Server 预览图片


Live Sass Compiler

可以帮 sass 或 scss 编译出 css 档案
以下为设定总共做了几件事:
1.设定产出档案的路径与资料夹名称
2.各浏览器的 prefix
3.不产出 map 档

{  "liveSassCompile.settings.formats": [    {      "format": "expanded",      "extensionName": ".css",      "savePath": "/src/css"    },    {      "format": "compressed",      "extensionName": ".min.css",      "savePath": "/dist/css"    }  ],  "liveSassCompile.settings.autoprefix": ["> 1%", "last 2 versions"],  "liveSassCompile.settings.generateMap": false,}

Live Sass Compiler 预览图片


ESLint

能为程式码增加规範,使程式码更整齐
ESLint 预览图片


Git History

可以直接看到 commit 纪录
Git History 预览图片


git-autoconfig

切换 git 使用者
git-autoconfig 预览图片


GitLens

在程式码后方可以看到 commit 详细资讯
GitLens 预览图片


gitignore

有两种 gitignore 套件
1.自动产生对应语言的 .gitignore 档案
2.右键可将档案加入 .gitignore
gitignore 预览图片


gitflow

开启专案各种 branch
gitflow 预览图片


Auto Rename Tag

可以一次更改前后 Tag
Auto Rename Tag 预览图片


vue

能让 .vue 档案较容易阅读
vue 预览图片


Vue 2 Snippets

新增一些 vue 的常用模板
Vue 2 Snippets 预览图片


Vetur

补齐一些 vue 的提示与片段功能
Vetur 预览图片


以上就是小弟常用的一些插件
附上所有设定,字体: source-code-pro、FiraCode

{  // 更改字体  "editor.fontFamily": "'Fira Code', 'Source Code Pro', Consolas, 'Microsoft JhengHei'",  // 开启连字符号  "editor.fontLigatures": true,  // 主题  "workbench.colorTheme": "One Dark Pro",  // icon  "workbench.iconTheme": "vscode-icons",  // 将 tab 设定为 2 个空白键  "editor.tabSize": 2,  // 将 Terminal 修改为 Git Bash  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",  // 删除档案时确认  "explorer.confirmDelete": false,  // git 自动 fetch  "git.autofetch": true,  // 拖曳移动档案不弹出确认视窗  "explorer.confirmDragAndDrop": false,  // js 与 ejs 可使用 emmet  "emmet.includeLanguages": {    "javascript": "html",    "ejs": "html"  },    // Format 设定 - 使用套件 Prettier  // 切换视窗自动储存  "files.autoSave": "onWindowChange",  // 储存时自动排版  "editor.formatOnSave": true,  // 每行宽度  "prettier.printWidth": 80,  // JS 使用单引号  "prettier.singleQuote": true,  // 尽可能省略箭头函式的括号  "prettier.arrowParens": "avoid",  // 字与括号保有空格  "prettier.bracketSpacing": true,  // 尽可能不加逗号  "prettier.trailingComma": "none",  // 句尾加上分号  "prettier.semi": true,    // eslint 自动修正  "eslint.autoFixOnSave": true,  // eslint 排版 html 与 vue 档  "eslint.validate": [    "javascript",    "javascriptreact",    {      "language": "html",      "autoFix": true    },    {      "language": "vue",      "autoFix": true    }  ],  "eslint.options": {    "plugins": [      "html"    ]  },    // liveSassCompile 产出设定  "liveSassCompile.settings.formats": [    {      "format": "expanded",      "extensionName": ".css",      "savePath": "/src/css"    },    {      "format": "compressed",      "extensionName": ".min.css",      "savePath": "/dist/css"    }  ],  // autoprefix 设定  "liveSassCompile.settings.autoprefix": [    "> 1%",    "last 2 versions"  ],  // 不产生 cssmap  "liveSassCompile.settings.generateMap": false,    // Vetur 不验证模板  "vetur.validation.template": false,    // git 设定使用者  "git-autoconfig.configList": [    {      "user.email": "XXXXXXXXX@gmail.com",      "user.name": "XXXXXX"    }  ]}

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章