Giter Club home page Giter Club logo

sublime-sql-formatter's Introduction

sublime-sql-formatter

A Sublime Text plugin that runs the cli-sql-formatter node library on the current file. cli-sql-formatter is in turn a command line interface for the sql-formatter node library.

Installation

Dependencies

This plugin requires node.js, and also requires cli-sql-formatter to be globally installed.

npm install -g cli-sql-formatter

Plugin Installation

This plugin is installable via Package Control

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.

  2. When the plugin list appears, type sql-formatter. Among the entries you should see sql-formatter. Select this entry to install it.

Commands

Command Palette

  • Format SQL: Runs the formatter with the default dialect defined in your settings.
  • Format SQL With Dialect: Runs the formatter with a dialect of your choosing.

Default Hotkeys

By default, these hotkeys will run the formatter with the default dialect defined in your settings.

  • Linux/Windows: [Ctrl + KQ]
  • Mac: [Cmd + KQ]

Settings

By default the following settings are used:

{
	// The paths to look for executables
	"paths": {
		"linux": [],
		"osx": [],
		"windows": []
	},

	// The default dialect to use for formatting
	// Options:
	// "sql" - Standard SQL
	// "n1ql" - Couchbase N1QL
	// "db2" - IBM DB2
	// "pl/sql" - Oracle PL/SQL
	"default_dialect": "sql",

	// The number of spaces to indent with
	"indent_size": 2,

	// Indent with tabs instead of spaces
	"use_tabs": false
}

You can modify any settings by going to Preferences > Package Settings > sql-formatter > Settings.

Project-Specific Settings Override

To override global plugin configuration for a specific project, add a settings object with an sql-formatter key in your .sublime-project. This file is accessible via Project -> Edit Project.

For example:

{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"use_tabs": true
	}
}

sublime-sql-formatter's People

Contributors

kufii avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.