zoukankan      html  css  js  c++  java
  • VSCode

    注: 本文摘自 黑火巨雷 - 简书

    1. 在工作目录下建立.jsbeautifyrc文件

    官方文档

    {
       "brace_style": "none,preserve-inline",
       "indent_size": 2,
       "indent_char": " ",
       "jslint_happy": true,
       "unformatted": [""],
       "css": {
         "indent_size": 2
       }
     }
    

    注释

    • brace_style,格式风格,详见官方说明(为避免和eslint默认检查冲突,建议此属性设置为 none,preserve-inline)
    • indent_size,缩进长度(为避免和eslint默认检查冲突,建议此属性设置为 2)
    • indent_char,缩进填充的内容(充满♂)
    • jslint_happy:true,若你要搭配jslint使用,请开启此选项
    • unformatted:["a","pre"],这里放不需要格式化的标签类型。注意 template 也是默认不格式化的,.vue 的template 标签如果需要格式化请在 .jsbeautifyrc 重新定义不带 template 的声明属性

    2. 启用保存时自动

    在VSCode的配置文件里添加 editor.formatOnSave:true 即可实现保存时自动格式化

    3. 快捷键

    在 VS Code 的键盘快捷方式文件里添加

    {
      "key": "cmd+b", // 自己定键位
      "command": "HookyQR.beautify",
      "when": "editorFocus"
    }
    
  • 相关阅读:
    Integer to English Words
    Word Ladder II
    Word Ladder
    Distinct Subsequences
    Interleaving String
    Scramble String
    【转】ROC和AUC介绍以及如何计算AUC
    Minimum Size Subarray Sum
    Minimum Window Substring
    Edit Distance
  • 原文地址:https://www.cnblogs.com/hukuangjie/p/11226948.html
Copyright © 2011-2022 走看看