Auto Replace
Auto replace is like a spell checker; in fact, this feature actually does correct some spelling errors as well as correct obsolete code. This feature is activated via the space bar. It takes the last item entered since the prior space bar and compares it to a list. If the text is found in the list, the auto replace item is automatically substituted.
This feature is nice for long column names perhaps (although Toad Insights is a better mechanism for this), but it is used more for commonly entered items such as sf for SELECT * FROM or pl for DBMS_OUTPUT.PUTLINE( );.
Chapter 6 discusses a way to use existing code templates and how to add your own.
In an editor window, type in “teh” and when you press the space bar, it will be corrected quickly to “the.” The space bar activates the check. If an item is in the Auto Replace panel, it is substituted.
To remove some auto correct items or to add your own (a good place to add any coding shortcut!), choose View → Toad Options, visit Editor → Behavior, and click the Auto Replace button on the lower-right part of the Behavior panel.
This button opens the dialog in Figure 3.30. Notice the “teh” in the left side and the “the” in the right column.
FIGURE 3.30 Adding an Auto Replace correct item
To add your own code assistants, click the Add button and fill in the grid as shown in Figure 3.30. One of the authors uses DBMS_OUTPUT.Put_Line frequently, so he wants a pl shortcut for it. Figure 3.31 shows the output when pl is entered and the space bar is tapped.
FIGURE 3.31 Auto Replace used for coding shortcuts