IDE Window: Editor Macros

From Lazarus wiki
Revision as of 14:14, 27 August 2012 by Martin (talk | contribs)

Deutsch (de) English (en) русский (ru)

  • Lazarus 1.0 supports only macros via keyboard
  • The Editor Macro window is not available in the released Lazarus 1.0. It is only present in SVN and trunk snapshots.
  • See also Editor_Macros_PascalScript

Editor Macros

Editor macros.png

Lazarus allows you to record any amount of macros. Using the Editor Macro window you can select which macro is currently used. You can also save macros by moving them to the project session, or the IDE config.


The macros are displayed in 3 groups:

Shows newly recorded macros. These macros are not saved, and will be lost if the IDE is closed
Shows macros that are saved with the project session. Each project can have it's own set of macros.
If the project is configured not to save a session, then macros in this group are not saved, and will be lost when the project is closed.
Shows macros that are saved with the IDE config. These macros are available to all projects

Macros can be moved between Project and IDE

Macros can have a status icon:

Editor macros current.png
Current macro. This can be set using the "Select" button. This is the macro that is played, if using the keyboard shortcut.
Editor macros rec.png
This macro is currently being recorded.
Editor macros play.png
This macro is currently playing.
Editor macros broken.png
Broken macro. This indicates that the macro could not be loaded from the config. The macro can not be used. (It will be kept (in it's broken form) in the config)


Set current macro which will be used by the keyboard shortcut.
The Play button is not affected by this.
Rename the macro.
Delete the macro.
Play the selected macro. This is the macro selected by clicking the list. Not the "current" macro.
Set how often the macro is played. Only affects the play button. The keyboard shortcut is not affected.
Record a new Macro.
During recording this button will allow to pause/continue the recording.
If anything was recorded, the new macro will be set "current" macro.
Ends the recording. The button also allows to stop repeated play. (in certain circumstances, it is possible to stop in the middle of a playing macro)
Move to
Project/Ide: Moves the selected macro to the indicated group

Using macros by keyboard

By Default the following 2 key shortcuts are set up:

  • Shift+Ctrl+P Play the current macro
  • Shift+Ctrl+R Start/Stop recording a new macro
During recording, the shortcut for play can be used to pause recording


  • A macro can only be recorded from a single editor.
    A macro can be played against any editor afterwards. But only to one editor at a time.
  • Macros only record commands issued by keyboard, and certain menus.
    Changes by mouse (moving caret, selecting text) are not recorded.
  • The macros are limited to the Editor. Actions in the form designer can not be recorded.
  • Recording actions that are not editing text may sometimes be possible, but is not supported, and playback may not render the desired effects. E.g. It is possible to record stepping in the debugger (F7,F8,F9), but if played back some of the commands may be skipped at random