Any CSS / HTML editor that will auto-indent code (and even Javascript)

I was trying to find a light weight HTML and CSS editor and found Notepad++, Programmer’s Notepad, and Epsilon quite good.

One very good feature of Epsilon is that it can auto-indent (auto-format) all your HTML and Javascript code for you, not like the other editor that will only “indent rigidly” or “un-indent rigidly”. Even the expensive PHPEd editor I use at work won’t do auto-indent either.

However, Epsilon is not free… the trail version will expire in mid November. I wonder if anyone know of any editor that can auto-indent?

I often use PSPad, it can e.g. structure present html and css as one-liners or indented.

If I understand your question right. :slight_smile:

Vim does that and much more, but there’s a bit of a learning curve …

i remember back in the 90s, you can use h, j, k, l, to move the cursor, and ESC to exit edit mode. something like “i” for inserting and entering the edit mode. Do they all apply or can you pretty much use it as a GUI editor now? thanks.

hm… so by the way, i think emacs for windows probably can do it, as emacs is quite powerful too. and it is free.

That still applies, although Vim lets you use the arrow keys and the mouse as well (although I don’t see why you’d want that, since it’s far less efficient). There are about a million other features, though.

Yes, Emacs is on par with Vim when it comes to features. As long as you don’t mind having to press three keys at the same time to do anything, it’s a great editor. If you know Lisp you can write your own plug-ins (Vim has its own scripting language).

Vim and Emacs are both free and available for most platforms.

try E-text editor and dreamweaver cs3/cs4.

Dreamweaver has html auto completion.

E-text has auto indent

both are compatible with each other. Say, you open two program, you design html in dreamweaver then go to E-text to indent. You save the file, both program automatically update it for you.

for E you can download trial

for Dream you can download trial as well.

to my surprise, i downloaded and installed emacs on Win XP. it is about 35MB first of all, and then it didn’t indent PHP correctly. (it keeps on indenting every single line more and more). the command i use is CTRL-space to set mark, and move the cursor to the other end of the region, and use ESC-x and then “indent-region”.

Notepad++ and Programmer’s Notepad both wouldn’t auto-indent the closing braces “}” for javascript or PHP… that’s weird as it wouldn’t take a lot of work to implement it.

yeah i tried E and remembered it was not bad, except it is only a trail for 30 days.

I think you should add phpmode, since I use emacs +phpmode and it works just fine

I use the Aptana IDE - it handles everything (HTML, CSS, JavaScript, PHP, XML, etc.) and does code-completion, validation, indenting, and anything else you could want.