Enable word wrap in Oracle SQL Developer

How to enable word wrap in Oracle SQL Developer?

Actually there is no such option in Oracle SQL Developer as of version 4.02 (this may be changed in further releases). To enable similar feature you’ll need to set a line break at some line width and format the text using CTRL + F7 key combination. Here’s how to do it:

To set maximum line width in characters go to Tools / Preferences:


Choose Database / SQL Formatter / Oracle Formatting. Choose a profile to edit (default is Old Preferences) and click Edit:


Set Max Line Width up to as many characters you want (here 80):


Query is still unformatted and some lines are outside the grey right margin line set at 80 characters:


Press CTRL and F7 to format the query. In result the text will be wrapped to the right margin:


Note that as of Oracle SQL Developer 4.02 the right margin line will be always set at 80 characters line width, even if you change that. So if you set Max Line Width at more than 80, the query will be formatted and wrapped up to that width, but the right margin line will be visible after 80 characters.

See the post on how to enable the word wrap feature in Toad.

Auto replace shortcuts in Oracle SQL Developer

How to enable auto replace shortcuts in Oracle SQL Developer?

In the Auto replace shortcuts in Toad post I showed you how to add auto-replace shortcuts in a Toad client. You can acheive the same in Oracle SQL Developer – here that feature is called SQL Editor Code Templates.


How to add a code template shortcut in SQL Developer?

First, go to Tools / Preferences:


Choose Database / SQL Editor Code Templates and click on Add Template button. For example add these two code templates:

saf - SELECT * FROM 

Now to use the auto replace code template type the shortcut and press CTRL and SPACEBAR keys. Shortcut will be replaced with a pre-defined statement.