To use an abbreviation, type it and use the Expand Abbreviation command or the Ctrl+B key. The abbreviation is replaced by an expansion defined in the Abbreviations file. You can open the Abbreviations file with a command in the Options menu and add abbreviations.
Each line in the files looks like "abbreviation=expansion".
The abbreviations names can have any character (except perhaps control chars, surely for CR and LF), including high Ascii chars (accented chars).
Names have properties files limits: they cannot start with sharp (#) or space or tab (but can have spaces inside); and they cannot have '=' character inside.
Abbreviations names are limited to 32 characters. It is probably enough for abbreviations...
An expansion may contain new line characters indicated by '\n' and a caret position indicated by the '|' character. To include a literal '|' character, use '||'.
Some simple examples are included in the distributed Abbreviations file.
When expanding, the names don't need to be separated from the previous text. Ie. if you define 'é' as 'é', you can expand it inside a word.
If a name is the ending of another one, only the shorter will ever be expanded. Ie. if you define 'ring' and 'gathering', the later will see only the 'ring' part expanded.
The Abbreviations file is in the Options menu of SciTE. Have a look at the syntax required to use them. You can add some of you own into the list.
| Using Abbreviations in a script |
| A small tutorial for starting a GUI project. RED words are abbreviations, that expand after Spacebar ( or Ctrl+B ). This '|' is the caret (curser). First type 'setupgui', without the single quotes. |
|
| Then press Spacebar. Now it is expanded as shown below. |
|
| The caret is located at end of 'GUICreate' and before the ')'. Typing '(' first will make Calltip popup with help on parameters for the function. Moving along, if you move the caret to the end of 'selectloop', then press Spacebar, a loop function is expanded, as shown below. |
|
| If 5 Case statements are not enough, move the caret to the end of the last Case statement, delete '$msg = ' and type 'moremsg'. Then press Spacebar. |
|
Case moremsg| |
| Then press Spacebar. 5 more Case statements will be expanded. Now, if you move your caret to the end of 'functions', press Spacebar,a list of 10 functions will be expanded as shown below. You can rename the functions to better names to suit. |
|
|
As above displays, with little effort, a basic script structure can be created easily with Abbreviations in SciTE. Only 4 Abbreviations used, to create the script above. |