How to use macros in Sublime Text: 1. To record a macro, use the shortcut key [Ctrl Q] to record a macro in Windows; 2. To play a macro, use the shortcut key [Ctrl Shift Q] on Windows; 3. , save macro, use the tool to select the save macro option, and save the recorded macro.
This article mainly introduces what macros in Sublime Text are and how to use them (recording, playback, saving).
Macros are basic automation tools that contain a series of commands. You can use macros whenever you need to perform an action that contains the same steps.
Macro files are JSON files with the extension .sublime-micro and are considered very useful.
Recording Macro
Recording a macro defines the process of saving a given file with a set of commands. You can record macros in two ways - use the shortcut Ctrl Q to record macros in Windows and Cmd Q in Mac.
Use the recording option in Tools → Record Macro.
Once the macro starts recording, you can see the following message in the Sublime Text editor -
Playing MacrosYou can use the shortcut keys Ctrl Shift Q on Windows and Cmd Shift Q on Mac to play macros recorded by users in Sublime Text. Note that this shortcut plays the last recorded macro in Sublime.
Save MacroYou can save a recorded macro using the Tools → Save Macro option. The following screenshot shows how to save a macro using this option.
You can also redefine the macro using the various options in the Tools menu bar as shown below -
This article is a basic introduction to macros in Sublime Text. It has certain reference value. I hope it will be helpful to friends in need!
The above is the detailed content of How to use macros in Sublime Text. For more information, please follow other related articles on the PHP Chinese website!