Is there a way/shortcut/built-in feature that can align code for operands, like '=' signs?
For example, there is a XAlign for Xcode (https://github.com/qfish/XAlign), allowing the user to select code that needs to be aligned and use a shortcut to align it automatically.
There is a Fields Group feature in Android Studio which can "Align in columns", but it does not work for code that is already written.
To center align text in TextView in Kotlin Android, set android:textAlignment attribute with the value “center” in layout file, or programmatically set the textAlignment property of the TextView object with View. TEXT_ALIGNMENT_CENTER in activity file.
Open any file in the editor. From the main menu, select Edit | Macros | Start Macro Recording. Press ⌥⌘L to reformat code (Code | Reformat Code ). Then press ⌘S to save all changes (File | Save All ).
File-> Settings-> IDE Settings-> Keymap So if you are have the same problem just go to the Settings - Keyboard - Shortcuts - System and change the default shortcut for the "Lock screen". Show activity on this post. Shift + Tab to decrease the indent.
Windows
Ctrl + Alt + L
Mac:
Option + Command + L
The alignment for variable declarations works for only those that are outside of functions. The alignment feature in menu Preference → Code Style → Wrapping and Braces → Fields Groups → "Align in Columns" does not work for those inside the brackets/braces.
Here is an issue ticket on the JetBrains website: https://youtrack.jetbrains.com/issue/IDEA-56947#
This feature is available, but not in the stable release yet. It is available from build: 140.1761
At the time of writing this answer my current build is "135.1653844, built on December 18, 2014" on Stable Release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With