Chapter 5. Template Accelerators

Table of Contents

An Accelerator is a keyword that maps to a template for a particular edit mode. Using accelerators, a user can now call a template without having to navigate the Templates drop down menu or the Templates Tree view, allowing for a more continuous editing experience. Furthermore, having different accelerators per edit modes allows a users the flexibility of using the same accelerator keyword to generate different template text based on the edit context. For example, if you have the 'if' accelerator keyword map to different templates of the if construct for different programming languages, expanding 'if' in a Java source file would generate different text than if you had expanded 'if' in a Python source file.

Configuring Template Accelerators

You can add/change/remove accelerators from jEdit's Global Options dialog. From the dialog, go to Templates>Accelerators. Select an edit mode from the Mode drop down list box to view the current accelerators for a given mode. The accelerators will be listed on the list box to the left. Select an accelerator, and the template for that accelerator will be selected on the template tree on the right. To change the template of an accelerator, select that accelerator, select the new template, and press Save. To add a new accelerator press Add, enter the accelerator keyword when prompted, select the desired template, and press Save. To delete an existing accelerator, select the accelerator and press Remove. Remember that when adding/changing/removing templates to make sure that the correct mode is selected, since accelerator keywords can map to different templates for different edit modes.