Customizing Eddie with the UserStartup files

The UserStartup file is intended to be used to set up Eddie to personal preferences. By modifying the UserStartup file you may customize keyboard shortcuts, the commands in the execute dialog, context menus in the Worksets window, etc. UserStartup is a plain text file that you may edit — changes to the UserStartup file will be picked up the next time you start Eddie.

Setting up a personal UserStartup file

The main UserStartup file is located inside the Eddie app bundle. Instead of editing it directly, you may use the local UserStartup file at ~/Library/Preferences/com.el34.eddie/UserStartup. You may add your changes to either the main or local UserStartup file — Eddie reads both files in sequence. However, by keeping your changes in the local UserStartup copy, you do not have to worry about merging these each time you get a new version of Eddie with a new copy of the main UserStartup. Note that in addition to SetKey commands you may use the UnsetKey command to undefine keyboard commands from the main UserStartup that you do not care for. Note for instance how to customize Eddie to use traditional MPW shortcuts

Setting up keyboard maps in UserStartup.

Most of the entries in UserStartup contain setup of the different keyboard maps. To configure a keyboard shortcut in the current keymap you may use the SetKey command.

To add a new keymap, choose a specific keymap for editing or set an alternate keymap you may use the following commands. These commands are actual Eddie shell commands and can also be executed in the Worksheet:

EditKeymap

Selects a keymap to be used when defining a shortcut with SetKey

NewKeymap

defines a new keymap and makes it used with SetKey

CopyKeymap

creates a new keymap, initially a copy of an existing one

SetDefaultKeymap

Makes a specified keyboard the default keyboard

SetAlternate1Keymap

Sets specified keyboard to be alternate1

SetAlternate2Keymap

Sets specified keyboard to be alternate2

SetAlternate3Keymap

Sets specified keyboard to be alternate3

SetAlternate4Keymap

Sets specified keyboard to be alternate4

EditKeymap

Format:

EditKeymap [ <keymapName> ]

When executed without arguments in the Worksheet, EditKeymap prints all the defined keyboard maps. When a keymap name is used, EditKeymap will apply all the successive SetKey and UnsetKey commands to the specified keymap.

NewKeymap

Format:

NewKeymap <keymapName> [-explicit | -beeping] [-oneShot] [-mapHint  <hintString> ]

After using this command SetKey calls will have effect on the specified map. If you specify an unknown map, a new map with that name will be created.

If -explicit specified, any undefined keyboard combination will be treated as being bound to a NoOp command (the default behavior is that all unbound keyboard combinations are passed on to the text engine).

If -beeping specified, every undefined keyboard combination will cause a beep.

If -oneShot is specified, the keymap will only be active for one keyboard command, after the keyboard command is executed the default keyboard will be activated. A one shot keymap may be used for Emacs or vi style special mode keymaps that are only active for one command.

If -mapHint is specified the specified hint string is displayed in the Status bar when the specified keymap becomes active. This is useful for multiple keymap setups, such as the Emacs emulation mode. In Emacs mode, pressing Esc will switch you to the Meta keymap and a "M-" will appear in the Status bar.

Note that unlike SetKey, EditKeyMap and some of the other built-in Eddie commands that can be executed directly in the Worksheet, NewKeymap only works in the context of a UserStartup file.
SetDefaultKeymap

Format:

SetDefaultKeymap <keymapName>

Makes a specified keymap the default keymap.

Note that unlike SetKey, EditKeyMap and some of the other built-in Eddie commands that can be executed directly in the Worksheet, SetDefaultKeymap only works in the context of a UserStartup file.
SetAlternate1Keymap SetAlternate2Keymap SetAlternate3Keymap SetAlternate4Keymap

Format:

SetAlternate1Keymap <keymapName>

Makes specified keyboards alternate1 through 4; Alternate keyboards may be activated using a corresponding primitive function.

Note that unlike SetKey, EditKeyMap and some of the other built-in Eddie commands that can be executed directly in the Worksheet, SetAlternateXKeymap commands only work in the context of a UserStartup file.

Fragment of a vi-like map setup from a UserStartup file, illustrating how maps are defined:

NewKeymap vi_like -beeping
#default keymap, beep if wrong/undefined keyboard shortcut pressed

SetKey Shift-:      ActivateAlternate1Map
#switch to an alternate map
SetKey I            ActivateAlternate2Map
#switch to an alternate map

NewKeymap vi_command -oneShot -beeping
#special one-shot keymap 

SetKey W            Save
SetKey B            Beep

NewKeymap vi_insertion

SetKey Escape       ActivateDefaultMap


... more shortcuts here

SetDefaultKeymap vi_like
#make vi_like the main/default keymap 

SetAlternate1Keymap vi_command
#make vi_command the the first alternate keymap, accessible from the main
#keymap by pressing Shift-:

SetAlternate2Keymap vi_insertion
#make vi_command the the second alternate keymap, accessible from the main
#keymap by pressing I

More UserStartup commands

In addition to setting up keyboard shortcuts, UserStartup can be used to define user defined keywords for the syntax coloring plugin, Context menu items, Find and Replace menu patterns, Worksets window context menu items and the default search path for the Open Selection command.