Skip to content
Advertisement

how to get field names to each be on their own line

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:

enter image description here

The result that I want is this:

enter image description here

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
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement