- Qt Creator Manual
- Record text editing macros
- Qt Creator Manual 13.0.0

How To

# 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.

## 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, How To: Edit Code, and Navigate with locator.