Auto-indent selection
-
EDIT
This post has been erroneously marked as solved.The suggested solution - building custom macro CANNOT be implemented in my current setup. I am in no position to try to find out why I cannot record macros in Qt Creator.
While coding the file text gets pretty messy , so using "auto-indent selection" is not only usable to make things look pretty. It makes the code logic stand up.
The "problem" is - to beautify the entire file requires two steps - "select all" and then "auto-indent selection" either via menu or "Ctrl" codes . It works as advertised, however...
Is there a way to accomplish the task in ONE , single step ?
Maybe even adding "select all" - Ctrl A as an option in file view woudl simplify things.
-
If using a combination of multiple shortcuts is something you do often you can record a macro from Tools -> Text Editing Macros, save it and then assign a single shortcut to it in Tools -> Options -> Environment -> Keyboard.
-
Hi,
Is Ctrl+A followed by Ctrl+i what you are looking for ?
-
If using a combination of multiple shortcuts is something you do often you can record a macro from Tools -> Text Editing Macros, save it and then assign a single shortcut to it in Tools -> Options -> Environment -> Keyboard.
-
@Chris-Kawa
Yes, I was looking for macro but was not sure if such term is used in Qt.
ThanksSorry, I got into Options -> Text Editor ( no Text Editing Macro option ) , there is as tab "Macro" , but there is no visible way to record the macro. I did try Alt+( as described in doc , but it did not work.
I may have a OS / version issue. I could post the "form" but there is nothing about recoding macro in it, sorry. -
Hm, maybe you have the macros plugin disabled. Go to Help -> About Plugins and Look for Macros plugin in Utilities section. If it's off enable it and restart Qt Creator.
-
@Chris-Kawa
Many thanksThis is what I got
PS What is "beautifier" ? Can you give me reference to search for description?
OK , found some description
Here is th "options - test editor " form .
No macro edit. -
PS What is "beautifier" ? Can you give me reference to search for description?
It's an umbrella term for tools that format source code, like clang-tidy for example. Qt Creator supports a couple of them: Beautifying Source Code.
-
@AnneRanch said in Auto-indent selection:
No macro edit.
Go to "Tools/Text Editing Macros/Record Macro" (or press Alt+[) and record your macro.
-
hi
just to add
@jsulm said in Auto-indent selection:Go to "Tools/Text Editing Macros/Record Macro" (or press Alt+[) and record your macro.
then
"tools/options/environment // keyboard // record your shortcut"
https://doc.qt.io/qtcreator/creator-macros.htmledit :my bad.
This was already stated by @Chris-Kawa