SqlBeautifier
A sublime plugin to format SQL. It supports both sublime 2 and 3.
Details
Installs
- Total 153K
- Win 81K
- Mac 53K
- Linux 18K
| Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 7 | 10 | 10 | 5 | 6 | 12 | 8 | 8 | 6 | 16 | 2 | 4 | 5 | 7 | 22 | 11 | 12 | 0 | 3 | 13 | 18 | 12 | 18 | 10 | 2 | 8 | 4 | 17 | 8 | 8 | 12 | 2 | 3 | 3 | 11 | 9 | 10 | 17 | 12 | 0 | 13 | 15 | 27 | 17 | 9 | 5 |
| Mac | 7 | 16 | 11 | 2 | 4 | 14 | 8 | 12 | 9 | 6 | 1 | 1 | 14 | 10 | 16 | 18 | 13 | 1 | 1 | 13 | 13 | 6 | 10 | 2 | 0 | 5 | 6 | 7 | 13 | 5 | 3 | 3 | 1 | 7 | 7 | 7 | 3 | 13 | 6 | 4 | 11 | 14 | 12 | 17 | 13 | 3 |
| Linux | 0 | 2 | 3 | 0 | 0 | 3 | 4 | 1 | 0 | 0 | 0 | 0 | 1 | 4 | 0 | 2 | 3 | 0 | 1 | 2 | 2 | 3 | 1 | 4 | 0 | 1 | 1 | 1 | 1 | 4 | 4 | 2 | 1 | 2 | 4 | 4 | 4 | 2 | 0 | 2 | 4 | 1 | 2 | 1 | 1 | 1 |
Readme
- Source
- raw.githubusercontent.com
SqlBeautifier
This is a SQL formatter plugin using python-sqlparse for both Sublime 2 and 3.
Enjoy!
Installation
Please install Sublime Package Control first. Then inside Package Control: Install Package, type SqlBeautifier and then click to confirm.
Settings
The default key binding for Mac is
{ "keys": ["super+k", "super+f"], "command": "sql_beautifier" }
- Kindly note that the
superkey here is generally replaced byCommand (⌘)key
The default key binding for Windows / Linux is
{ "keys": ["ctrl+k", "ctrl+f"], "command": "sql_beautifier" }
Options for formatter
To change the options, click through Package Settings -> Sql Beautifier -> Settings User and add the overrided options in JSON like this
{
"indent_tabs": true,
"indent_width": 1
}
This overrides the default option at Package Settings -> Sql Beautifier -> Settings Default.
Here is the list of options the formatter supports:
keyword_case: Changes how keywords are formatted. Allowed values are “upper”, “lower” and “capitalize” and null (leaves case intact).
identifier_case: Changes how identifiers are formatted. Allowed values are “upper”, “lower”, and “capitalize” and null (leaves case intact).
strip_comments: If True comments are removed from the statements.
reindent: If True the indentations of the statements are changed.
indent_tabs: If True tabs instead of spaces are used for indentation.
indent_width: The width of the indentation, defaults to 2.