打造完美编辑器--VS code

主题设置

  • 颜色主题 One Dark Pro
  • 图标主题 vscode-icons

格式化

  • Prettier

代码检查

  • ESLint: 检查 js 语法规范
  • TSLint: TypeScript检测
  • Stylelint: 检查 CSS/SCSS/Less 语法规范
  • Markdownlint: 检查 markdown 语法规范

自动补全

  • Auto Close Tag: 自动闭合 html 等标签 (</...>)
  • Auto Rename Tag: 修改 html 标签时,自动修改闭合标签)
  • Path Intellisense: 自动提示补全路径
  • Path Autocomplete: 自动补全路径

功能扩展

  • Chinese (Simplified) Language Pack for Visual Studio Code: 设置中文
  • Live Server: 一键在本地启动服务器
  • Vetur: Vue语法格式支持
  • Sass: Sass支持:
  • Settings Sync: 同步编辑器配置
  • koro1FileHeader: 注释模板

小程序插件

  • minapp: 微信小程序标签、属性的智能补全
  • Dot Template: 自动写入项目模板中的文件

自定义配置(User Settings)

{
    "editor.fontFamily": "Menlo, Consolas, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "editor.fontSize": 24,
    "editor.fontWeight": "500",
    "editor.lineHeight": 24,
    "editor.lineNumbers": "on",
    "editor.minimap.enabled": false,
    "editor.renderIndentGuides": false,
    "editor.rulers": [120],
    "editor.formatOnPaste": true,
    "workbench.colorTheme": "One Dark Pro",
    "workbench.iconTheme": "vscode-icons",
    "vsicons.dontShowNewVersionMessage": true,
    "explorer.confirmDelete": false,
    "terminal.integrated.fontFamily": "monospace",
    // "eslint.autoFixOnSave": true,
    "editor.formatOnSave": true,
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {
            "language": "html",
            "autoFix": true
        },
        {
            "language": "vue",
            "autoFix": true
        },
        {
            "language": "typescript",
            "autoFix": true
        },
        "typescriptreact"
    ],
    "eslint.options": {
        "plugins": ["html"]
    },
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "name": "Comments",
                "scope": "comment, punctuation.definition.comment",
                "settings": {
                    "fontStyle": ""
                }
            },
            {
                "name": "js/ts italic",
                "scope": "entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super",
                "settings": {
                    "fontStyle": ""
                }
            },
            {
                "name": "js ts this",
                "scope": "var.this,variable.language.this.js,variable.language.this.ts,variable.language.this.jsx,variable.language.this.tsx",
                "settings": {
                    "fontStyle": ""
                }
            }
        ]
    },
    "files.autoSave": "afterDelay",
    "window.zoomLevel": 0,
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "search.location": "panel",
    // prettier插件 自动化格式代码设置
    "prettier.eslintIntegration": true,
    "prettier.singleQuote": true, // 强制单引号
    "prettier.trailingComma": "all", // 尾随逗号
    "prettier.tabWidth": 4, // 4格缩进
    "prettier.arrowParens": "always", // 围绕箭头函数参数强制使用括号
    "editor.detectIndentation": false,
    "editor.tabCompletion": "on",
    "liveServer.settings.donotShowInfoMsg": true,
    "typescript.updateImportsOnFileMove.enabled": "always",
    // vetur格式化插件的配置
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatter.ts": "vscode-typescript",
    "vetur.format.options.tabSize": 4,
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "force-aligned"
        },
        "prettyhtml": {
            "printWidth": 100,
            "singleQuote": true,
            "wrapAttributes": false,
            "sortAttributes": false
        }
    },
    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "sync.gist": "e9ec7974d53f0325e050467baabafc3a",

    // koroFileHeader插件配置修改
    "fileheader.configObj": {
        "timeNoDetail": true
    },
    // 头部注释
    "fileheader.customMade": {
        "Description": "file content",
        "Author": "tgb",
        "Date": "Do not edit"
    }
}

复制代码

转载于:https://juejin.im/post/5c88aa8ae51d45747674f77d

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值