Abbreviations

An abbreviation is a string, that when inserted in the buffer, expands into a longer and harder to type string. For example, you can define an abbreviation "sout" that expands to "System.out.println" in Java mode.

There are two types of abbreviations; global abbrevs and mode-specific abbrevs. Global abbrevs can be expanded in any edit mode, and mode-specific ones only affect one particular edit mode.

Edit>Expand Abbreviation (keyboard shortcut: Control-E Control-X) will attempt to expand the word before the caret. If no expansion could be found, it will offer to define one.

Figure 4-9. The Add Abbreviation dialog box

If automatic abbreviation expansion is enabled, entering a non-alphanumeric character will automatically try to expand the word before the caret. This is a very powerful feature, but it takes some getting used to, hence it is disabled by default.

If automatic expansion is enabled and you want to enter a non-alphanumeric character without expanding the current word, prefix the character with Control-E Control-V. For example, to enter a space without expanding the current word, you would type Control-E Control-V Space.

Abbreviations can be edited in the Abbreviations pane of the Utilities>Global Options dialog box; see the section called The Global Options Dialog Box in Chapter 8. Abbreviations are preserved across editing sessions.

Warning

Automatic abbreviation expansion behaves in an unpredictable manner when used from a macro - don't rely on automatic abbrev expansion when recording macros.