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 press Alt+[.
  2. Press keyboard keys.
  3. To stop recording, go to Tools > Text Editing Macros > Stop Recording Macro or press 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.
  • Press 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.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.