【VScode】自定义setting.json

入口

 setting.json

{
    "minapp-vscode.disableAutoConfig": true,

    // emmet
    "emmet.includeLanguages": { 
        "wxml": "html" 
    },
    "emmet.syntaxProfiles": {
        "vue-html":"html",
        "vue":"html"
    },
    // git
    "git.enableSmartCommit": true,

    // 开启 vscode 文件路径导航
    "breadcrumbs.enabled": true,

    // "less.compile": {
    //   "outExt": ".wxss" // 输出文件的后缀,默认为.css
    // },

    // vscode的icons
    "workbench.iconTheme": "vscode-icons",
    "workbench.editorAssociations": [],

    "diffEditor.maxComputationTime": 0,
    "diffEditor.ignoreTrimWhitespace": false,

    "php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
    "php-cs-fixer.lastDownload": 1623310948391,

    "settingsSync.ignoredSettings": [],

    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript",
        "*.vue": "vue"
    },
    // 这些文件将不会显示在工作空间中
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.js": {
            "when": "$(basename).ts" //ts编译后生成的js文件将不会显示在工作空中
        },
        "**/node_modules": true
    },
    // 延时保存
    "files.autoSave": "afterDelay",
    //让函数(名)和后面的括号之间加个空格
    "javascript.format.insertSpaceBeforeFunctionParenthesis": false, 
    // 窗口缩放比例
    "window.zoomLevel": 1,
    // 根据文件类型自动设置tabsize的选项
    "editor.detectIndentation": false,
    // tab 为4个空格
    "editor.tabSize": 4,
    // 100 列后换行
    "editor.wordWrapColumn": 100,
    // 文字大小
    "editor.fontSize": 10,
    // 显示 markdown 中英文切换时产生的特殊字符
    "editor.renderControlCharacters": true,
    // 粘贴时自动格式化
    "editor.formatOnPaste": true,
    // 运算符两侧不添加空格
    "editor.formatOnType": false,
    // 保存时,自动调整 import 语句相关顺序,能够让你的 import 语句按照字母顺序进行排列
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    // 自动换行
    "editor.wordWrap": "on",
    // 主题
    "editor.semanticTokenColorCustomizations": null,
    //将特殊符号变得更加清晰,比如=>会连在一起
    "editor.fontLigatures": null, 
    //每120列就显示一条线
    "editor.rulers": [120],


    // 保存时格式化  和 "editor.formatOnSave": true 选一即可 影响 function () {} 格式
    "eslint.autoFixOnSave": true, //  启用保存时自动修复,默认只支持.js文件
    // eslint规则检测文件类型
    "eslint.validate": [
        //  用eslint的规则检测js文件
        "javascript", 
        "javascriptreact",
        {
            "language": "html",
            "autoFix": true
        },
        {
            // 检测vue文件
            "language": "vue",
            //  为vue文件开启保存自动修复的功能
            "autoFix": true
        },
        "html",
        "vue"
    ],
    "eslint.options": {
        "extensions": [
            ".js",
            ".vue"
        ]
    },
    "eslint.codeAction.showDocumentation": {
        "enable": true
    },

    // vue中的js按"prettier"格式进行格式化
    "vetur.format.defaultFormatter.html": "js-beautify-html", //格式化.vue中html
    "vetur.format.defaultFormatter.js": "vscode-typescript", //让vue中的js按编辑器自带的ts格式进行格式化
    "vetur.grammar.customBlocks": {
        "docs": "md",
        "i18n": "json"
    },
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            // "wrap_attributes": "auto" //属性强制折行对齐
        },
        "prettier": {
            "semi": false, //格式化不加分号
            "singleQuote": false //格式化为单引号
        }
    },

    // Prettier 格式化设置
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宾果的救星

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值