一个好的前端码农,拥有一款主题简单,编码舒服的编辑器是必不可少的。从之前的Adobe Dreamweaver到webStorm,再到现在的VScode我都用过,而现今需要编辑器都具有IDE功能,VsCode是我认为迄今为止用的最舒服的一款编辑器,配置简单,界面舒服。
我的编辑器外观

配置settings.json
{
"workbench.colorTheme": "Solarized Dark",
"editor.minimap.enabled": false,
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
// Fira Code 支持需要开启
"editor.fontLigatures": true,
"editor.tabSize": 2,
"editor.lineHeight": 24,
"editor.lineNumbers": "on",
"editor.renderIndentGuides": false,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
}
],
// 保存自动修复
"eslint.autoFixOnSave": true,
"editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?",
// 参考线
"guides.normal.color.dark": "rgba(91, 91, 91, 0.6)",
"guides.normal.color.light": "rgba(220, 220, 220, 0.7)",
"guides.active.color.dark": "rgba(210, 110, 210, 0.6)",
"guides.active.color.light": "rgba(200, 100, 100, 0.7)",
"guides.active.style": "dashed",
"guides.normal.style": "dashed",
"guides.stack.style": "dashed",
"editor.wordWrap": "on",
"todohighlight.isEnable": true,
"workbench.iconTheme": "eq-material-theme-icons",
// 缩进规则,主要看公司要求和个人习惯
"[javascript]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
// 设置选中范围是尖角还是圆角
"editor.roundedSelection": true,
// 将一些不必要的搜索范围去掉
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
"**/.git": true
},
"editor.fontSize": 13,
"workbench.tree.indent": 14,
"breadcrumbs.enabled": false,
}
配置文件中涉及到的插件
- Chinese (Simplified) Language Pack 中文语言包
- Solarized Dark 配色主题
- Fira Code 字体
- Material Theme 主题
- Dracula Official 吸血鬼主题
- Material Theme Icons 文件夹图标
- ESlint 代码风格检查
- Path Intellisense 自动路径不全
- Bracket Pair Colorizer 为代码中的括号们添上一抹亮色
- Auto Close Tag 修改html标签,自动帮你完成尾部闭合标签的同步修改
- GitLens 丰富的git日志插件
- Git History git提交历史
- Guides
与内置的缩进参考线不同,Guides 能够让你通过配置项来修改参考线的颜色、样式、缩进空白的背景色等 - Image preview 图片预览
- Vetur
- Code Runner
如果你需要学习或者接触各种各样的开发语言,那么 Code Runner 插件可以让你不用搭建各种语言的开发环境,直接通过此插件就可以直接运行对应语言的代码,非常适合学习或测试各种开发语言 - Debugger for Chrome
在Chrome中进行Debug调试 - Vue Peek
该扩展使用扩展功能扩展了Vue代码编辑,Go To Definition并Peek Definition支持单文件组件中的组件和文件.vue名。它允许快速跳转或浏览作为组件(从模板)或模块导入(从脚本)引用的文件