A
A
Apostrophe42020-09-24 10:38:46
Sublime Text
Apostrophe4, 2020-09-24 10:38:46

How to auto-tab unformatted code?

You need to auto-tabulate the code. The code is written in a line and is very long, so it is difficult to navigate in it.

The options that I tried:
1) sublime text - Edit -> Line -> Reindent

2) Preferences -> Key Bindings - User

If the file is empty, then paste the code completely.
If not, then add the object to the array, as you would add it to JSON.

[
    { "keys": ["ctrl+alt+l"], "command": "reindent", "args": { "single_line": false } }
]
This code allows you to format the code in the entire file or only within the selected fragment by pressing the CTRL + ALT + L combination.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas V, 2020-09-24
@Apostrophe4

It's not entirely clear what kind of code we are talking about, but try using the CodeFormatter plugin - it supports different languages. In general, there is a formatter for almost any language - packagecontrol search - format

A
Alexander, 2020-09-24
@z80b

Pretty JSON plugin to help you, unless of course we are talking about JSON
https://packagecontrol.io/packages/Pretty%20JSON

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question