Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux tool/editor that will nicely auto-format my code AFTER it's written

I'm looking for a tool or editor where I can paste in potentially messy code, be it HTML, Javascript, CSS, whatever, and properly take care of all indentation and spacing.

I use Geany but I don't see an option for this, surprisingly. I don't know if it's possible in vim or emacs. Any help would be appreciated.

Example HTML:

<!DOCTYPE html>
<html>
<body>
<ul>
<li>what a mess</li> 
</ul>
</body> 
</html>
like image 475
CaptSaltyJack Avatar asked Apr 02 '26 01:04

CaptSaltyJack


1 Answers

Both vim and emacs will let you do what you ask. I believe in vim you want to use 'gg=G', and emacs is C-x C-M-\

I hope this helps.

like image 124
Ed. Avatar answered Apr 04 '26 13:04

Ed.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!