forked from qt-creator/qt-creator
Doc: Turn "Using Text Editing Macros" into a how-to topic
Task-number: QTCREATORBUG-29361 Change-Id: I0d62d48036e08528c025eac8653e58ff0039e5a2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
@@ -49,11 +49,6 @@
|
|||||||
\li Add, modify, and remove \l{Snippets}{code snippets} in
|
\li Add, modify, and remove \l{Snippets}{code snippets} in
|
||||||
\uicontrol Snippets.
|
\uicontrol Snippets.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
|
||||||
\li View and remove \l{Using Text Editing Macros}{text editing macros}
|
|
||||||
in \uicontrol Macros.
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\li Configure \l{Completion}{code completion} in \uicontrol Completion.
|
\li Configure \l{Completion}{code completion} in \uicontrol Completion.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
@@ -65,12 +65,6 @@
|
|||||||
colleagues to review a change that you plan to submit to a
|
colleagues to review a change that you plan to submit to a
|
||||||
version control system.
|
version control system.
|
||||||
|
|
||||||
\li \l{Using 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.
|
|
||||||
\endif
|
\endif
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
@@ -1,35 +1,61 @@
|
|||||||
// Copyright (C) 2023 The Qt Company Ltd.
|
// Copyright (C) 2024 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\previouspage creator-editor-codepasting.html
|
\previouspage creator-editor-codepasting.html
|
||||||
\page creator-macros.html
|
\page creator-macros.html
|
||||||
\nextpage creator-diff-editor.html
|
\previouspage creator-how-tos.html
|
||||||
|
|
||||||
\title Using Text Editing Macros
|
\ingroup creator-how-to-edit
|
||||||
|
|
||||||
To record a text editing macro, select \uicontrol Tools >
|
\title Record text editing macros
|
||||||
\uicontrol {Text Editing Macros} > \uicontrol {Record Macro}
|
|
||||||
or press \key {Alt+[}. To stop recording, select \uicontrol Tools >
|
When you have a file open in the code editor, you can record a
|
||||||
\uicontrol {Text Editing Macros} > \uicontrol {Stop Recording Macro} or
|
keyboard sequence as a macro. You can then play the macro to
|
||||||
press \key {Alt+]}.
|
repeat the sequence. You can save the latest macro and assign a
|
||||||
|
keyboard shortcut for running it or run it from the locator.
|
||||||
|
|
||||||
|
\section1 Record macros
|
||||||
|
|
||||||
|
To record a text editing macro:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
\li Go to \uicontrol Tools > \uicontrol {Text Editing Macros} >
|
||||||
|
\uicontrol {Record Macro} or press \key {Alt+[}.
|
||||||
|
\li Press keyboard keys.
|
||||||
|
\li To stop recording, go to \uicontrol Tools >
|
||||||
|
\uicontrol {Text Editing Macros} > \uicontrol {Stop Recording Macro}
|
||||||
|
or press \key {Alt+]}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
\note The macro recorder does not support code completion.
|
\note The macro recorder does not support code completion.
|
||||||
|
|
||||||
To play the last macro, select \uicontrol Tools >
|
\section1 Play macros
|
||||||
\uicontrol {Text Editing Macros} > \uicontrol {Play Last Macro} or
|
|
||||||
press \key {Alt+R}.
|
|
||||||
|
|
||||||
To save the last macro, select \uicontrol Tools >
|
To play the last macro:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Go to \uicontrol Tools > \uicontrol {Text Editing Macros} >
|
||||||
|
\uicontrol {Play Last Macro}.
|
||||||
|
\li Press \key {Alt+R}.
|
||||||
|
\li Enter \c rm in the locator.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Save macros
|
||||||
|
|
||||||
|
To save the last macro, go to \uicontrol Tools >
|
||||||
\uicontrol {Text Editing Macros} > \uicontrol {Save Last Macro}.
|
\uicontrol {Text Editing Macros} > \uicontrol {Save Last Macro}.
|
||||||
|
|
||||||
To assign a keyboard shortcut to a text editing macro, select
|
To view and remove saved macros, go to \preferences >
|
||||||
\preferences > \uicontrol Environment >
|
|
||||||
\uicontrol Keyboard. For more information, see \l{Assign keyboard shortcuts}.
|
|
||||||
|
|
||||||
You can also use the \c rm locator filter to run a macro. For more
|
|
||||||
information, see \l{Navigate with locator}.
|
|
||||||
|
|
||||||
To view and remove saved macros, select \preferences >
|
|
||||||
\uicontrol {Text Editor} > \uicontrol Macros.
|
\uicontrol {Text Editor} > \uicontrol Macros.
|
||||||
|
|
||||||
|
\image qtcreator-preferences-texteditor-macros.webp {Macros tab in Text Editor Preferences}
|
||||||
|
|
||||||
|
\section1 Assign keyboard shortcuts to macros
|
||||||
|
|
||||||
|
To assign a keyboard shortcut to a text editing macro, go to
|
||||||
|
\preferences > \uicontrol Environment > \uicontrol Keyboard.
|
||||||
|
|
||||||
|
\sa {Assign keyboard shortcuts}, {Edit Code}{How To: Edit Code},
|
||||||
|
{Navigate with locator}
|
||||||
*/
|
*/
|
||||||
|
@@ -33,7 +33,6 @@
|
|||||||
\li \l{Checking Code Syntax}
|
\li \l{Checking Code Syntax}
|
||||||
\li \l{Using Qt Quick Toolbars}
|
\li \l{Using Qt Quick Toolbars}
|
||||||
\li \l{Pasting and Fetching Code Snippets}
|
\li \l{Pasting and Fetching Code Snippets}
|
||||||
\li \l{Using Text Editing Macros}
|
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{Configuring the Editor}
|
\li \l{Configuring the Editor}
|
||||||
\li \l{Using GitHub Copilot}
|
\li \l{Using GitHub Copilot}
|
||||||
|
Reference in New Issue
Block a user