ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sql​Beautifier

by zsong ALL Trending

A sublime plugin to format SQL. It supports both sublime 2 and 3.

Details

Installs

  • Total 151K
  • Win 80K
  • Mac 52K
  • Linux 18K
Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20
Windows 2 18 9 15 10 11 5 12 17 15 14 14 7 9 11 13 11 21 24 7 2 16 19 20 16 11 4 3 19 22 15 10 7 1 1 11 15 15 14 13 2 4 13 16 20 18
Mac 0 15 16 19 10 2 4 16 16 11 12 13 4 3 12 15 15 12 15 11 7 13 20 14 9 15 0 2 6 11 14 14 5 0 0 10 12 15 18 7 3 3 8 17 11 11
Linux 0 4 1 7 3 1 2 2 2 1 2 1 0 1 2 3 2 3 3 1 1 5 1 5 5 3 0 2 0 5 3 4 2 0 0 2 1 6 2 4 1 0 2 1 5 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 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" }

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.