Coder Social home page Coder Social logo

thejj / emacs-sql-indent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alex-hhh/emacs-sql-indent

0.0 1.0 0.0 265 KB

Syntax based indentation for SQL files inside GNU Emacs

License: GNU General Public License v3.0

Emacs Lisp 97.80% PLpgSQL 0.47% PLSQL 1.50% TSQL 0.23%

emacs-sql-indent's Introduction

Syntax based indentation for SQL files for GNU Emacs

CI

sql-indent.el is a GNU Emacs minor mode which adds support for syntax-based indentation when editing SQL code: TAB indents the current line based on the syntax of the SQL code on previous lines. This works like the indentation for C and C++ code.

The package also defines align rules so that the align function works for SQL statements, see sqlind-align-rules for which rules are defined. This can be used to align multiple lines around equal signs or "as" statements, like this.

sqlind-minor-mode together with the align rules can assist in writing tidy SQL code or formatting existing SQL code. The indentation rules are customizable and they can be adapted to match your coding style.

See the manual for more details.

Installation

You can install a released version of this package from GNU ELPA, by running the following commands in Emacs:

M-x package-install RET sql-indent RET

To install sql-indent from this repository, open the file sql-indent.el in Emacs and type:

M-x package-install-from-buffer RET

The syntax-based indentation of SQL code can be turned ON/OFF at any time by enabling or disabling sqlind-minor-mode:

M-x sqlind-minor-mode RET

To enable syntax-based indentation for every SQL buffer, you can add sqlind-minor-mode to sql-mode-hook. First, bring up the customization buffer using the command:

M-x customize-variable RET sql-mode-hook RET

Than, click on the "INS" button to add a new entry and put "sqlind-minor-mode" in the text field.

emacs-sql-indent's People

Contributors

alex-hhh avatar brendan-r avatar monnier avatar pierretechoueyres avatar thijs avatar vbmithr avatar

Watchers

 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.