( vue 、C语言)vscode ctrl+s保存自动格式化代码 配置


一、格式化代码

Auto Close Tag
**Auto Close Tag**
Auto Rename Tag
在这里插入图片描述

Beautify
在这里插入图片描述
Bracket Pair Colorizer
在这里插入图片描述
Color Highlight
在这里插入图片描述

Dracula Official
在这里插入图片描述
ESLint
在这里插入图片描述
HTML CSS Support

在这里插入图片描述
JavaScript (ES6) code snippets

在这里插入图片描述
JavaScript Snippet Pack

在这里插入图片描述
jQuery Code Snippets

在这里插入图片描述
Manta’s Stylus Supremacy

在这里插入图片描述

Path Intellisense
在这里插入图片描述
Prettier - Code formatter

在这里插入图片描述
stylus

在这里插入图片描述

Bootstrap 3 Snippets
在这里插入图片描述

二、vue相关

Vetur
在这里插入图片描述

vue
在这里插入图片描述

Vue 2 Snippets
在这里插入图片描述

Vue 3 Snippets
在这里插入图片描述

Vue VSCode Snippets
在这里插入图片描述

vue-beautify
在这里插入图片描述

vue-color
在这里插入图片描述

vue-format
在这里插入图片描述

vue-helper
在这里插入图片描述

三、C语言以及c++

C/C++
在这里插入图片描述

C/C++ Extension Pack
在这里插入图片描述

C/C++ Runner
在这里插入图片描述

C/C++ Snippets
在这里插入图片描述

C/C++ Themes
在这里插入图片描述

Better C++ Syntax
在这里插入图片描述

Code Runner
在这里插入图片描述

CodeLLDB
在这里插入图片描述

四、设置配置代码

{
    
    
  
    // 是否允许自定义的snippet片段提示
    "editor.snippetSuggestions": "top",
    "editor.fontSize": 15,
    "editor.fontWeight": "400",
    "editor.formatOnType": true,
    "guides.enabled": false,
    "editor.tabSize": 2,
    // 配置文件关联,以便启用对应的提示
    "files.associations": {
    
    
      "*.vue": "vue",
      "*.wxss": "css"
    },
    // 配置emmet是否启用tab展开缩写
    "emmet.triggerExpansionOnTab": true,
    // 配置emmet对文件类型的支持
    "emmet.syntaxProfiles": {
    
    
      "javascript": "jsx",
      "vue": "html",
      "vue-html": "html"
    },
    // 是否开启eslint检测
    "eslint.enable": true,
    // 文件保存时是否根据eslint进行格式化
    "eslint.autoFixOnSave": true,
    // eslint配置文件
    "eslint.options": {
    
    
      "extensions": [
        ".js",
        ".vue"
      ]
    },
    // eslint能够识别的文件后缀类型
    "eslint.validate": [
      "javascript",
      {
    
    
        "language": "vue",
        "autoFix": true
      },
      "html",
      "vue"
    ],
    "search.exclude": {
    
    
      "**/node_modules": true,
      "**/bower_components": true,
      "**/dist": true
    },
    // 格式化快捷键(默认):Shift+Alt+F
    // #每次保存的时候将代码按eslint格式进行修复 
    "prettier.eslintIntegration": true,
    "terminal.integrated.rendererType": "dom",
    "diffEditor.renderSideBySide": false,
    // vscode默认启用了根据文件类型自动设置tabsize的选项
    "editor.detectIndentation": false,
    // #每次保存的时候自动格式化 
    "editor.formatOnSave": true,
    //  #去掉代码结尾的分号 
    "prettier.semi": false,
    //  #使用单引号替代双引号 
    "prettier.singleQuote": true,
    //  #让函数(名)和后面的括号之间加个空格
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    "vetur.format.enable": true,                           
    "vetur.validation.template": true,                        
    "vetur.validation.interpolation": false,
    // #这个按用户自身习惯选择 
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    // #让vue中的js按编辑器自带的ts格式进行格式化 
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatterOptions": {
    
    
      "js-beautify-html": {
    
    
        "wrap_attributes": "force-aligned"
        // #vue组件中html代码格式化样式
      }
    },
    // 格式化stylus, 需安装Manta's Stylus Supremacy插件
    "stylusSupremacy.insertColons": false, // 是否插入冒号
    "stylusSupremacy.insertSemicolons": false, // 是否插入分好
    "stylusSupremacy.insertBraces": false, // 是否插入大括号
    "stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
    "stylusSupremacy.insertNewLineAroundBlocks": false,
    "workbench.colorTheme": "Dracula",
    "editor.codeActionsOnSave": {
    
    
      "source.fixAll.eslint": true
    },
    "code-runner.runInTerminal": true,
    "workbench.editor.enablePreview": false, // 两个选择器中是否换行
    "editor.parameterHints": true,
"editor.quickSuggestions": {
    
    
    "other": true,
    "comments": true,
    "strings": true
},
"vetur.experimental.templateInterpolationService": true
  }

猜你喜欢

转载自blog.csdn.net/linan996/article/details/123792960
今日推荐