### 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. User startup 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 in the Eddie app directory. You may add a second UserStartup file at ~/config/settings/Eddie/UserStartup. You can add your own private changes to the main UserStartup file to ~/config/settings/Eddie/UserStartup, extending the UserStartup that comes with Eddie. Eddie will read both files, first the main UserStartup, then your customized version. This way you do not have to re-edit the UserStartup each time you get a new version of Eddie. Note that in addition to SetKey commands you may use the UnsetKey command to undefine keyboard commands in the main UserStartup that you do not care for.

#### 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 unboud 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.

##### SetDefaultKeymap

Format:

    	SetDefaultKeymap <keymapName>

Makes a specified keymap the default keymap.

##### SetAlternate1Keymap SetAlternate2Keymap SetAlternate3Keymap SetAlternate4Keymap

Format:

    	SetAlternate1Keymap <keymapName>

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

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 addon, Execute dialog entries, Worksets window context menu items and the default search path for the Open Selection command.