Home » Support » Index of All Documentation » Wing IDE Reference Manual » Customization »

2.3. Key Equivalents

The command a key will invoke may be modified by selecting a different key map or by specifying a custom key binding. A custom key binding will override any binding for a particular key found in the keymap. Custom key bindings are set via the Custom Key Bindings preference.

To add a binding, click the insert button, then press the key to be bound in the Key field, and enter the name of the command to invoke in the Command field.

Key bindings defined by default or overriden by this preference will be shown in any menu items that implement the same command. In cases where a command is given more than one key equivalent, only the last equivalent found will be displayed (although both bindings will work from the keyboard).

Key maps

Wing ships with several key equivalency maps found in WINGHOME, including keymap.normal, keymap.emacs, keymap.vi, among others. These are used as default key maps for the corresponding editor personalities.

For developing entirely new key bindings or debugging key bindings, it is possible to create a custom key equivalency map and use it as your default map through Key Map File preference. This is not recommended for most users, since completely replacing the default key maps will require manual tracking of changes in commands across Wing versions.

In a key map file, each key equivalent is built from names listed in the Key Names section. These names can be combined as follows:

  • A single unmodified key is specified by its name alone, for example 'Down' for the down arrow key.
  • Modified keys are specified by hyphenating the key names, for example 'shift-Down' for the down arrow key pushed while shift is held down. Multiple modifiers may also be specified, as in 'ctrl-shift-Down'.
  • Multi-key combinations can be specified by listing multiple key names separated by a space. For example, to define a key equivalent that consists of first pushing ctrl-x and then pushing the a key by itself, use 'ctrl-x a' as the key sequence.

The command portion of the key equivalency definition may be any of the commands listed in section Command Reference. Use None to remove the given key equivalent entirely.

Specifying a key binding that already exists in the default key binding simply replaces that binding with your override.

Examples

Here is an example of adding a key binding for a command. If the command already has a default key binding, both bindings will work:

'Ctrl-X P': 'debug-attach'

This example removes a key equivalent entirely:

'Ctrl-C Ctrl-C': None

These can be combined to changes the key binding for a command without retaining its default key binding:

'Ctrl-C Ctrl-C': None
'Ctrl-G': 'debug-continue'

Wing always retains only the last key binding for a given key combination. This example binds Ctrl-X to 'quit' and no other command:

'Ctrl-X': 'debug-stop'
'Ctrl-X': 'quit'

« 2.2.1. Preferences File FormatTable of Contents2.3.0. Key Names »

Section Contents

2.3.0. Key Names