anbt-sql-formatter


Ⅰ. 插件描述

A tool for SQL formatting written in Ruby.

Ⅱ. 基本信息

创建日期:  2010-02-20
使用用户:  1
Github星:  58
插件作者:  sonota88

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'sonota/anbt-sql-formatter'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'sonota/anbt-sql-formatter'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'sonota/anbt-sql-formatter'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/sonota/anbt-sql-formatter

Ⅳ. 文档说明

= anbt-sql-formatter

(C) 2010-2018 sonota88 (yosiot8753@gmail.com)

== Description

A tool for SQL formatting ported from
{BlancoSqlFormatter}[http://sourceforge.jp/projects/blancofw/releases/?package_id=4732].

== Install

$ ruby setup.rb

== Usage

$ echo "select a,b from c;" | anbt-sql-formatter
SELECT

     a
     , b
 FROM
     c

;
$

== License

GNU Lesser General Public License.

== Authors

sonota:: Porting to Ruby

Following are Authors of BlancoSqlFormatter(original Java version).

渡辺義則 / Yoshinori WATANABE / A-san:: Early development
伊賀敏樹 (Tosiki Iga / いがぴょん):: Maintainance

== Customize

  • In AnbtSql::Rule:

    • Function names
    • Rules for linefeed and indentation
    • Characters for indentation
    • Upcase or Downcase
  • More farther:
    Override AnbtSql::Formatter#format_list_main_loop

by inheritance or monkeypathcing.

== Test

$ ./test.sh

添加新评论