博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SublimeText插件之CodeFormatter
阅读量:4288 次
发布时间:2019-05-27

本文共 1411 字,大约阅读时间需要 4 分钟。

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

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

CodeFormatter支持的语言:

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

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

Git地址:

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

PackageControl官网地址:

更多插件地址:

特别注意,对于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 

1. 格式化模式使用regexp比较理想

"formatter_version": "regexp", 

2.启用保存时格式化,很不错

"format_on_save": true, // Format on save

更多插件:

你可能感兴趣的文章
Android中通知的提示音、震动和LED灯效果小例子
查看>>
SQLite数据库创建、更新入门
查看>>
SQLite数据库的增删改查
查看>>
Adb connection Error:远程主机强迫关闭一个现有的连接--解决方法
查看>>
Tomcat服务器热启动,解决部署源码时每次手动重启Tomcat问题
查看>>
mysql数据库 向表中添加字段
查看>>
根据图片完整路径,获得图片的宽和高,判断是横版还是竖版图片
查看>>
Linux服务器上修改Mysql的密码
查看>>
Fragment碎片入门教程
查看>>
Android UI根据屏幕分辨率决定加载布局
查看>>
Java面试总结
查看>>
Processing of multipart/form-data request failed. Stream ended unexpectedly
查看>>
Linux上定时备份MySQL数据库
查看>>
xml解析之PULL
查看>>
安卓大神开源项目
查看>>
快递轨迹第三方接口接入(快递鸟)
查看>>
java多线程详解(一)
查看>>
Eclipse背景颜色修改--护眼色,黑色
查看>>
Servlet技术浅析(九)之-----下载文件和上传文件
查看>>
一台linux操作系统上配置多台Tomcat服务
查看>>