There’s a plugin called SQLUtilities that will format your SQL nicely; however, it’s really bothering me that it cannot put a column on it’s own separate line:
The result that I want is this:
Advertisement
Answer
Toggling the g:sqlutil_align_comma setting aligns by comma but leaves the first field on the same line as the SELECT statment:
:SQLUToggleValue g:sqlutil_align_comma :1,$SQLUFormatter
Sample result:
SELECT f.id , f.firstname , f.lastname ...
SQLUtilities has additional documentation via
:help sqlutilties
Or full screen
:tab help sqlutilities