In addition to usual bash commands like ls or grep, 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 as well as the version of all installed plugins |
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.
Each of these behaves just like any other shell command and integrates well into the shell. For instance, you may use path wildcards and shell environment variables as arguments, where applicable.
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
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] [ [--tryFirst] [<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 | |
F1 | Function key 1 |
F2 | etc. |
F3 | |
F4 | |
F5 | |
F6 | |
F7 | |
F8 | |
F9 | |
F10 | |
F11 | |
F12 | |
F13 | |
F13 | |
F14 | |
F15 |
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.
The --tryFirst option allows assigning several primitives to a keyboard shortcut. Without the option, executing SetKey with a shortcut that has already been defined will completely overwrite the older shortcut. With --tryFirst the primitive specified in the new shortcut creates a chain of primitives. On pressing the shortcut, the primitives get executed, starting with the last one defined. If the primitive completes successfully, the execution of the shortcut is completed, otherwise it continues with the next primitive. This can be for instance used to overload the DownArrow key to arrow down the Symbol completion popup if showing, otherwise simply arrow down in the text.
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/com.el34.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.
Format:
Primitives [--html]
Lists all the available Eddie keyboard primitives. Unlike SetKey, keyboard primitives that do not have a keyboard shortcut assigned are included.
More keymap setup shell commands