Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Developer - Auto Formatting option

As you know, the shortcut for auto formatting the code written in Oracle SQL Developer is [Ctrl] + [F7], by default. My question is how I can edit the style of formatting of the code and especially if I can export this formatting, so that it can be applied to another computer? Thank you!

like image 571
K. H. Avatar asked Mar 13 '23 04:03

K. H.


2 Answers

From the Tools menu (or on OS X, the SQL Developer menu) go to Preferences. In versions up to 4.1.5, in the preference pane expand the Database section, and then the SQL Formatter section.

enter image description here

The top level lets you import and export settings, and the Oracle Formatting section lets you choose how you want your code to be formatted.

enter image description here

You can have multiple profiles with their own specific formatting if that's useful to you - maybe if you work on projects with different coding/style standards.


As @thatjeffsmith mentioned in a comment, since 4.2.0 this has moved to Preferences->Code Editor->Format->Advanced Format:

enter image description here

There is a section on this in the documentation.

like image 111
Alex Poole Avatar answered Mar 19 '23 13:03

Alex Poole


Go to:

Tools --> Preferences --> Database --> SQL Formatter --> Import/Export
like image 40
Lalit Kumar B Avatar answered Mar 19 '23 11:03

Lalit Kumar B