January 23, 2006, at 03:07 PM by-
Added lines 1-102:
(:title Electrics Primer:)
> I would like some method to replace \su with \subseteq and \ri with \rightarrow. > Is there any way to facilitate math symbology without trying to remember > lots of keyboard shortcuts or wade through the LaTeX menu? Thanks.
Yes. Alpha is shipped with several different 'electric' features that are ideal for these sorts of tasks. The term "electric" is used throughout Alpha in the sense of
which is intended to save time, keystrokes, and brainpower. The "Electric Completions" and "Electric Expansions" features are very useful for typing in a 'hint' and turning that into some pre-defined text that you really want.
This wiki page is a quick and dirty introduction that addresses
Note that Alpha uses several different methods to determine what the completion/expansion should be as explained in the file
Help > Electrics Help
This page just provides some examples for TeX mode. Many modes (including TeX) also offer more information via the menu item
Config > Mode Prefs > Completions Tutorial
Invoking electric completions/expansions
These packages are be turned on by default, but you need to adjust your FAQ.SpecialKeys using the
Config > Special Keys
dialog to set your "complete" and "expand" shortcuts. These functions operate on the text immediately preceding the cursor, by determing an initial "hint" and then performing a series of tests to determine the proper text to insert.
How do electric completions work?
It is really very simple. For example, if you are in TeX mode and you type
and then press your "complete" key you'll be offered a set of completion options -- completing
will reduce the number of choices.
(Tip: the Config > Preferences > Interface > Completions dialog includes a checkbox for "List Pick For Mult Cmps " -- this toggles the display of choices in a dialog vs the status bar.)
How do electric expansions work?
Expansions behave in a similar way, but the initial "hint" is an acronym rather than the start of a word. For example (again in TeX mode), if you "expand"
you will be offered choices for
(Tip: the Config > Preferences > Interface > Completions dialog includes a checkbox for "List Pick For Mult Expns " -- this toggles the display of choices in a dialog vs the status bar.)
Defining personalized completions/expansions
The menu command(s)
Config > Preferences > Electric Completions/Expansions > Add Global C/E
allow you to define your own completions/expansions. These will always take precedence over any other completions defined by the mode of the active window. They are also available no matter what mode is active -- at present it is not possible to define a mode specific completion using this interface.