Suggestions

At this point you should examine the macros defined in the file /usr/lib/ed.macros to gain further insight into the writing of new macros. You may examine them by reading the file, or by displaying each key's translation one at a time via the "t ? \hh" command and then using the F4 key to show it as a nice multi-line sequence. If you do not know the hexadecimal value of a key, then you may enter it's literal value by preceding it with the macro disable key (- key on the keypad). For example, you could type either

t ? \81

or

t ? <MINUS key><F1 key>

The possibilities for macros are endless, but you are warned that creating them is very much a black art...