In addition to bash commands, binary command line tools, shell scripts, etc., Eddie defines some special commands that are integrated into the shell and allow the user to perform Eddie-specific shell commands:
opens a file |
|
selects a line |
|
prints the paths of all the open windows |
|
define keyboard shortcuts for editor commands |
|
forget keyboard shortcuts for editor commands |
|
activate a specific keymap for editing |
|
defines a new keymap and makes it used with SetKey |
|
Makes a specified keyboard the default keyboard |
|
Sets specified keyboard to be alternate1 thru alternate4 |
|
creates a new keymap, initially a copy of an existing one |
|
print out all keyboard primitives |
|
Version |
print Eddie version |
You can run tellEddie -h to display an overview of all the built-in shell commands. All the built-in shell commands can be invoked with the -h argument do display brief help or --help to display full help text.
Format:
File <filename> [-shell] [-forceText]
Opens a file specified by a full path. If -shell specified document will be opened as a shell. If -forceText specified, file will be opened as a text document even though it is a workset.
Format:
Line <lineNumber>
Selects the specified line number.
Like other commands, you may execute two semicolon-separated Eddie commands at once:
File "${EDDIE_HOME}"/'Release notes'; Line 10
It is not an accident that this is in fact the format in which the Metrowerks compiler, mwcc, generates it's error output. You can just select the error output in a shell window right after the compiler stops and execute it to select the line with the error.
Format:
Windows [-o]
Prints the paths of all the open windows. Using the -o option causes File to be prepended to each line - this let's one reopen all the files by selecting and executing the list.
Format:
SetKey [-verbose [-nowrap] ] [-html] [ [<modifier-keys>] <key> [ <primitiveFunction> ] ]
Binds the specified key-modifier combination with an editor primitive function. For instance:
SetKey Command-Control-Option-Shift-X ExtendToLine
Try not to break your fingers when testing this one. When you execute a command like this in a shell window, the keyboard combination remains active until it gets redefined or until Eddie quits. To make it permanent, add the command to the UserStartup file. If the editor command (primitive) appears in the app menus, any keyboard shortcut assigned to it by SetKey will be shown in the corresponding menu item, reflecting the current keyboard shortcut. (Note that a lot of the menu items are dynamic — they only appear when you press various modifier keys).
If you execute SetKey without any parameters, you get a listing of all the keyboard combinations in the current key map. Note that they are in a ready-to execute format — you may edit them slightly and execute them in the worksheet to change/edit a given key binding.
If you are trying to find out which shortcut a particular command is bound to, you may use the following format:
SetKey | grep SmartSwap
In the example above, we are looking at which keyboard shortcut SmartSwap is bound to. Note that SetKey, as well as other Eddie commands are integrated with the rest of the bash shell and operations, such as piping or redirecting input and output work as expected.
The following modifier keys may be specified:
Shift |
Command |
Control |
Caps |
ScrollLock |
NumLock |
Option |
LeftShift |
RightShift |
LeftCommand |
RightCommand |
LeftControl |
RightControl |
LeftOption |
RightOption |
The left/right flavors of the various modifiers bind a keyboard shortcut to that specific modifier only (for instance SetKey RightShift-A will have no effect when pressing A with the left shift key down). The modifier names without the left/right flavor specification work with either of the modifier pair.
Special key names:
Delete | i.e. Backspace |
Return | |
Space | |
Tab | |
Escape | |
LeftArrow | |
RightArrow | |
UpArrow | |
DownArrow | |
Help | |
Del | i.e. Forward delete |
Home | |
End | |
PageUp | |
PageDown |
Alternate special key names (numerical keypad)
Kp0 | numerical keypad 0 |
Kp1 | numerical keypad 1 |
Kp2 | numerical keypad 2 |
Kp3 | numerical keypad 3 |
Kp4 | numerical keypad 4 |
Kp5 | numerical keypad 5 |
Kp6 | numerical keypad 6 |
Kp7 | numerical keypad 7 |
Kp8 | numerical keypad 8 |
Kp9 | numerical keypad 9 |
Enter | |
Kp+ | numerical keypad + |
Kp- | numerical keypad - |
If any of the alternate numerical keypad key names is used in a SetKey command, that command will be independent of the corresponding keyboard shortcut on the main keyboard. For instance mapping
SetKey Option-Enter Beep
will cause a beep when pressing the Enter key with an Option key but not when pressing Return and Option. If unassigned however, pressing a keyboard combination shortcut using Enter will do the same as the equivalent shortcut with Return.
Format:
UnsetKey modifiers-key
Removes a keyboard shortcut previously defined by SetKey. This command is not used often, you may use it for instance when you keep the UserStartup distributed with Eddie as is and add all your private keyboard shortcuts to a personal UserStartup in ~/Library/Preferences/Eddie. (This way you can easily upgrade to a new version of Eddie and keep your old settings, without having to edit the new UserStartup.) You may then remove a specific keyboard shortcut that you do not want defined without modifying the original UserStartup.
More keymap setup shell commands