安装环境 : Mac OX
1 . sublime自带的整型方法 :
Edit --> line --> Reindent
2. 安装 CodeFormatter 插件 。
在Sublime Text 3中编写代码,需要一个能自动格式代码的插件。它能支持常见的几种编程语言:
* PHP
* JavaScript/JSON
* HTML
* CSS
* SCSS
* Python
* Visual Basic/VBScript
* Coldfusion/Railo/Lucee
S1: Ctrl + ` 调出console 。 安装 Package Control , 若已安装,跳过此步。
参考链接: https://packagecontrol.io/installation
S2: Command + shift + P , 再选择 "Package Control: Install Package",
S3: Default 快捷键是 : Ctrl + option + F 调整代码格式。
也可以通过 Preference --> Package Settings --> CodeFormatter --> Setting User
3: SQL Formatter
https://github.com/zsong/SqlBeautifier
This is a SQL formatter plugin using python-sqlparse for both Sublime 2 and 3.
安装:
Please install Sublime Package Control first.
Then inside Package Control: Install Package, type SqlBeautifier and then click to confirm.
设置:
The default key binding for Mac is
{ "keys": ["super+k", "super+f"], "command": "sql_beautifier" }
Kindly note that the super key here is generally replaced by Command (⌘) key
The default key binding for Windows / Linux is
{ "keys": ["ctrl+k", "ctrl+f"], "command": "sql_beautifier" }
Over!