Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/babarot/vim-sqlfmt

A plugin for SQL formatter like gofmt
https://github.com/babarot/vim-sqlfmt

formatter sql vim

Last synced: 22 days ago
JSON representation

A plugin for SQL formatter like gofmt

Awesome Lists containing this project

README

        

vim-sqlfmt
==========

A plugin for SQL formatter like gofmt

## Installation

With [vim-plug](https://github.com/junegunn/vim-plug),

```vim
Plug 'b4b4r07/vim-sqlfmt'
```

Requirement:

Available plugins | Paste on your `.vimrc`
---|---
[jackc/sqlfmt](https://github.com/jackc/sqlfmt) |

let g:sqlfmt_command = "sqlfmt"
let g:sqlfmt_options = ""

[andialbrecht/sqlparse](https://github.com/andialbrecht/sqlparse) |
let g:sqlfmt_command = "sqlformat"
let g:sqlfmt_options = "-r -k upper"

... | ...

## Usage

Run `:w` to format automatically. If you set `g:sqlfmt_auto` to 0, this behavior will be disabled.

It can also be executed directly as follows:

```vim
:SQLFmt [files...]
```

## License

MIT

## Author

b4b4r07