Using Eddie shell commands

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 functions:

Fileopens a file
Lineselects a line
Windowsprints the paths of all the open windows
SetKeydefine keyboard shorcuts for editor commands
UnsetKeyforget keyboard shorcuts for editor commands
EditKeymapactivate a specific keymap for editing
CopyKeymapcreates a new keymap, initially a copy of an existing one
Primitivesprint out all keyboard primitives

File

Format:

	File <filename> [-shell]

Opens a file specified by a full path. If -shell specified document will be opened as a shell.

Line

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 for PPC, 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.

Windows

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.

SetKey

Format:

	SetKey [ [modifier-keys] key [ <primitiveFunction> ] ]

Binds the specified key-modifier combination with an editor primitive function. For instance:

	SetKey Alt-Control-Win-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 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.

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:

MacPC
ShiftShift
CommandAlt
ControlControl
CapsCaps
ScrollLockScrollLock
NumLockNumLock
OptionWin
LeftShiftLeftShift
RightShiftRightShift
LeftCommandLeftAlt
RightCommandRightAlt
LeftControlLeftControl
RightControlRightControl
LeftOptionLeftWin
RightOptionRightWin

The Mac and PC modifier names are interchangeable, you may use the PC names on a Mac and vice-versa. This is to allow sharing the same UserStartup on both platforms.

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:

Backspacedisguised as Delete on some Mac keyboards
Return
Space
Tab
Escape
LeftArrow
RightArrow
UpArrow
DownArrow
InsertIns/Help on Mac keyboards
DeleteDel on Mac keyboards
Home
End
PageUp
PageDown
F1function key 1
F2etc.
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
PrintScreen
ScrollLock
Pause

Alternate special key names (numerical keypad)

Kp0numerical keypad 0
Kp1etc.
Kp2
Kp3
Kp4
Kp5
Kp6
Kp7
Kp8
Kp9
EnterEnter at the very right-bottom corner of the keyboard
KpDelnumerical keypad Del/.
KpDelnumerical keypad Del/.
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 (Windows) 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. (Note that some keyboards have two Enter keys, you will have to make a mental transformation and think of the one to the right of the main keyboard area, above right Shift, as Return).

UnsetKey

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 ~/config/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.

EditKeymap

Format:

	EditKeymap [ <mapName> ]

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.