A macro consists of a series of commonly used keystroke combinations, which are invoked by a simpler keystroke combination. You can define a macro by recording a series of keystrokes. The recorded macros is available for all other files of the same type.
To record a Source Editor macro:
You should not use the mouse while recording a macro. If any of the steps of your macro cannot be done with a keyboard shortcut, create a shortcut for that step as described in Setting Keyboard Shortcuts.
"Recording" appears in the Source Editor status line.
The Recorded Macro dialog box is displayed.
The Add Keybinding dialog box is displayed.Press the key sequence you want to use to run this macro in the Shortcut Sequence field, and click OK.
As you press the key sequence, the correct syntax for that sequence automatically appears in the text field. For example, if you simultaneously hold down the Alt key, the Control key, and the J key, "Ctrl+Alt+J" appears.