# Code beautify / code cleanup / auto indent?

**URL:** <https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659>\
**Category:** Corona Editor\
**Created:** [May 13, 2015, 1:41am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659 "2015-05-13T01:41:51Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 1:41am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/1 "2015-05-13T01:41:51Z")

</div>

Hey Team!

I’m finally getting around to try out Corona Editor and I’m wondering where (If?!) the auto indent / code clean up is? Something that, after I paste a chunk of code from the web into my editor, it’s all funked up and not indented. I know intellij/netbeans has the feature called “Auto Format”.

Is there anything like that for Sublime Text 3??? The OCD portion of me is DYIN over here since I have to constantly clean it up. It’s no problem for code I’m coding from scratch with since it auto indents as I’m typing.

Appreciate any help!

-Mario

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [May 13, 2015, 3:21am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/2 "2015-05-13T03:21:52Z")

</div>

Have you tried using Google and searching for “sublime text autoformat” or “beautify” or some other key words?&nbsp;&nbsp; ST is a popular editor and there are plenty of people building add-ins for it.

Rob

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 1:50pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/3 "2015-05-13T13:50:18Z")

</div>

"Have you tried using Google and searching for “sublime text autoformat” or “beautify” or some other key words? "

Oh yes indeedy I certainly have! All plugins to cleanup/ auto indent LUA were either only supported for OS X or Linux, or had strange requirements such as pointing to an install directory of LUA, which I steered clear of since I didn’t want to mess with CoronaEditor’s syntax highlighting (wasn’t sure that it would screw up anything with that…)

**So everyone using CoronaEditor just naturally types in everything perfectly indented, and manually corrects any paste-ins ’ indentation screwiness to the editor??**

Dang, I guess I **AM** OCD…🙂

On that note, where’s the feature request board for CoronaEditor? Or should I Google that? 😉

-Mario

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 1:52pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/4 "2015-05-13T13:52:33Z")

</div>

Ah ha! “Edit-\>Line-\>Reindent”! It was built in already! And here I was looking for fancy packages!!!

-Mario

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [May 13, 2015, 3:49pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/5 "2015-05-13T15:49:27Z")

</div>

[http://feedback.coronalabs.com](http://feedback.coronalabs.com)

But it sounds like you found it built in.

Rob

---

<div class="post-metadata">

**Author:** ![Perry\_Clarke](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@Perry\_Clarke](https://forums.solar2d.com/u/Perry_Clarke)\
**Post date:** [May 13, 2015, 8:53pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/6 "2015-05-13T20:53:14Z")

</div>

Any time you think something is missing remember that Sublime Text supports 1000s of plugins. &nbsp;If the built in indentation isn’t to your liking, you might want to look at&nbsp;[FormatLua](https://packagecontrol.io/packages/FormatLua). &nbsp;It’s a little fiddly to get set up (it requires command line lua) but it might suit.

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 9:34pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/7 "2015-05-13T21:34:43Z")

</div>

That’s exactly the one I was looking at, and yeah it was pretty fiddly requiring the Lua binaries or whatever so I steered clear of it.

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 14, 2015, 5:30am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/8 "2015-05-14T05:30:11Z")

</div>

The “fix” I quoted above&nbsp;“Edit-\>Line-\>Reindent” doesn’t work, it chokes on the elseif and NOW I remember this is why I never switched over to any of the Sublime editors.&nbsp;Guess I’m not the only one who bemoans the issue, The Google brought up a ton of various “fixes” for it, all of which I can’t seem to get working on Windows.

Matter of fact, Rob, you commented on how frustrating my very issue was here for Sublime Editor 2:

[https://forums.coronalabs.com/topic/49721-ifelseif-formatting-question-sublime-2-related/](https://forums.coronalabs.com/topic/49721-ifelseif-formatting-question-sublime-2-related/)

And the issue still persists into Sublime Editor 3…!!!

Shame. Back to LUA Glider for now.

-Mario

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [May 13, 2015, 3:21am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/9 "2015-05-13T03:21:52Z")

</div>

Have you tried using Google and searching for “sublime text autoformat” or “beautify” or some other key words?&nbsp;&nbsp; ST is a popular editor and there are plenty of people building add-ins for it.

Rob

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 1:50pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/10 "2015-05-13T13:50:18Z")

</div>

"Have you tried using Google and searching for “sublime text autoformat” or “beautify” or some other key words? "

Oh yes indeedy I certainly have! All plugins to cleanup/ auto indent LUA were either only supported for OS X or Linux, or had strange requirements such as pointing to an install directory of LUA, which I steered clear of since I didn’t want to mess with CoronaEditor’s syntax highlighting (wasn’t sure that it would screw up anything with that…)

**So everyone using CoronaEditor just naturally types in everything perfectly indented, and manually corrects any paste-ins ’ indentation screwiness to the editor??**

Dang, I guess I **AM** OCD…🙂

On that note, where’s the feature request board for CoronaEditor? Or should I Google that? 😉

-Mario

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 1:52pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/11 "2015-05-13T13:52:33Z")

</div>

Ah ha! “Edit-\>Line-\>Reindent”! It was built in already! And here I was looking for fancy packages!!!

-Mario

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [May 13, 2015, 3:49pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/12 "2015-05-13T15:49:27Z")

</div>

[http://feedback.coronalabs.com](http://feedback.coronalabs.com)

But it sounds like you found it built in.

Rob

---

<div class="post-metadata">

**Author:** ![Perry\_Clarke](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@Perry\_Clarke](https://forums.solar2d.com/u/Perry_Clarke)\
**Post date:** [May 13, 2015, 8:53pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/13 "2015-05-13T20:53:14Z")

</div>

Any time you think something is missing remember that Sublime Text supports 1000s of plugins. &nbsp;If the built in indentation isn’t to your liking, you might want to look at&nbsp;[FormatLua](https://packagecontrol.io/packages/FormatLua). &nbsp;It’s a little fiddly to get set up (it requires command line lua) but it might suit.

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 13, 2015, 9:34pm UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/14 "2015-05-13T21:34:43Z")

</div>

That’s exactly the one I was looking at, and yeah it was pretty fiddly requiring the Lua binaries or whatever so I steered clear of it.

---

<div class="post-metadata">

**Author:** ![mroberti](https://forums.solar2d.com/user_avatar/forums.solar2d.com/mroberti/32/47_2.png) [@mroberti](https://forums.solar2d.com/u/mroberti)\
**Post date:** [May 14, 2015, 5:30am UTC](https://forums.solar2d.com/t/code-beautify-code-cleanup-auto-indent/333659/15 "2015-05-14T05:30:11Z")

</div>

The “fix” I quoted above&nbsp;“Edit-\>Line-\>Reindent” doesn’t work, it chokes on the elseif and NOW I remember this is why I never switched over to any of the Sublime editors.&nbsp;Guess I’m not the only one who bemoans the issue, The Google brought up a ton of various “fixes” for it, all of which I can’t seem to get working on Windows.

Matter of fact, Rob, you commented on how frustrating my very issue was here for Sublime Editor 2:

[https://forums.coronalabs.com/topic/49721-ifelseif-formatting-question-sublime-2-related/](https://forums.coronalabs.com/topic/49721-ifelseif-formatting-question-sublime-2-related/)

And the issue still persists into Sublime Editor 3…!!!

Shame. Back to LUA Glider for now.

-Mario
