How to enable auto-align in Sublime Text 3?
Asked Answered
G

4

5

I want to auto-align my code to make it easier to read, in a click. I am working on Sublime Text 3 and want to know about a method through which I can enable auto-indent of the code in just a click.

Gabi answered 25/5, 2017 at 6:52 Comment(0)
A
5

I'd recommend the AlignTab extension: https://github.com/randy3k/AlignTab (with Demo)

Anthropogeography answered 25/5, 2017 at 15:37 Comment(0)
S
3

By using the https://github.com/randy3k/AlignTab package, you can activate the Table Mode which constantly aligns the code for you, until you run the command Exit Table Mode, for example:

enter image description here

Saccharide answered 13/3, 2018 at 17:22 Comment(0)
C
0
{"keys": ["f12"], "command": "reindent", "args": {"single_line": false}}
Cabstand answered 20/7, 2019 at 4:49 Comment(0)
M
0

In the title bar, go to Preferences > Key Bindings, then add this binding to "Key Bindings - User" file.

{"keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false}}

Now whenever you want to auto-align your code, just highlight the desired code and press alt+shift+f

Source: https://coderwall.com/p/7yxpdw/auto-indenting-on-sublime-text-3


Note: This was the original answer from the OP @Utkarsh (with score 18) that OP deleted and edited into the question.

Microelement answered 3/4, 2022 at 8:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.