SublimeText插件之CodeFormatter

CodeFormatter插件用来对代码进行格式化,使用方式,快捷键 ctrl+alt+f

codeformatter是Sublime Text 2 / 3的插件,支持格式(美化)源代码。

CodeFormatter支持的语言:

  • PHP - By phpfmt
  • JavaScript/JSON - By JSBeautifier
  • HTML - By Custom fork of BeautifulSoup
  • CSS - By JSBeautifier
  • SCSS - By Nishutosh Sharma
  • Python - By PythonTidy (only ST2)
  • Visual Basic/VBScript
  • Coldfusion/Railo/Lucee

下载方式:将Git源代码,clone到Sublime Text插件目录

SublimeText插件之CodeFormatter_第1张图片

Git地址:

https://github.com/akalongman/sublimetext-codeformatter

https://github.com/akalongman/sublimetext-codeformatter.git

PackageControl官网地址:

https://packagecontrol.io/packages/CodeFormatter

更多插件地址:

https://packagecontrol.io/


特别注意,对于HTML格式化的配置:

    "codeformatter_html_options":
    {
        "syntaxes": "html,blade,asp,xml", // Syntax names which must process HTML formatter
        "format_on_save": true, // Format on save
        "formatter_version": "regexp", // Which formatter to use. Current options are "bs4" and "regexp". If an error occurs while loading the bs4 formatter, the regexp formatter will automatically be used
        "indent_size": 4, // indentation size
        "indent_char": " ", // Indentation character
        "indent_with_tabs": true, // Indent with one tab (overrides indent_size and indent_char options)
        "exception_on_tag_mismatch": false, // If the last closing tag is not at the same indentation level as the first opening tag, there's probably a tag mismatch in the file
        "expand_javascript": true, // (Under construction) Expand JavaScript inside of 
                    
                    

你可能感兴趣的:(开发工具)