Record text editing macros

When you have a file open in the code editor, you can record a keyboard sequence as a macro. You can then play the macro to repeat the sequence. You can save the latest macro and assign a keyboard shortcut for running it or run it from the locator.

Record macros

To record a text editing macro:

  1. Go to Tools > Text Editing Macros > Record Macro or select Alt+[.
  2. Select keyboard keys.
  3. To stop recording, go to Tools > Text Editing Macros > Stop Recording Macro or select Alt+].

Note: The macro recorder does not support code completion.

Play macros

To play the last macro:

  • Go to Tools > Text Editing Macros > Play Last Macro.
  • Select Alt+R.
  • Enter rm in the locator.

Save macros

To save the last macro, go to Tools > Text Editing Macros > Save Last Macro.

To view and remove saved macros, go to Preferences > Text Editor > Macros.

{Macros tab in Text Editor Preferences}

Assign keyboard shortcuts to macros

To assign a keyboard shortcut to a text editing macro, go to Preferences > Environment > Keyboard.

See also Assign keyboard shortcuts, Create Lua scripts, How To: Edit Code, and Navigate with locator.