Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nagromme

macrumors G5
Original poster
May 2, 2002
12,546
1,196
Former thread title: Text editor that properly auto-indents JavaScript? ...but maybe all I need is a plugin.


I just downloaded SubEthaEdit and I like the code coloring and the functions popup.

But something I miss from Director and Flash: auto-formatting. Indenting intelligently to enforce cleanly laid out scripting. (Anything between { and } gets indented for instance.)

Is there a text editor that will do that to JavaScript while you type?

If not, is there one that will do it when you press Return (like Director)?

If not, is there one that can at least do it on command (like Flash)?

(I know I can tab manually--but with auto-formatting, you have an instant cue if you've made a syntax error and left something unclosed.)

Also, anything with JavaScript syntax-checking to remind me of missing ;s etc. would be great.

TIA. I like SubEthaEdit so far, but maybe I can do better if all I want is JavaScript editing.
 

cait-sith

macrumors regular
Apr 6, 2004
248
1
canada
Eclipse will do it for Java, and there are all kinds of web development plugins. But Eclipse is a rather heavy IDE.

Have you tried TextWrangler? That's my favourite editor for doing PHP/CSS/HTML/JS. It will at least keep your indentation level from the last line. You can also add tools to do auto-formatting on blocks of text, e.g., run it through a code formatter.
 

nagromme

macrumors G5
Original poster
May 2, 2002
12,546
1,196
Thanks--I'll consider those options, and look into add-ons for TextWrangler--which appears to be the "new BBEdit Lite."

BBEDit/BBEdit Lite and SubEthaEdit will also obey your manual indenting when you start a new line.

EDIT: Can anyone direct me to a TextWrangler plugin that will perform JavaScript formatting/indenting? I haven't turned up anything in my searches yet.

TIA.
 

mnkeybsness

macrumors 68030
Jun 25, 2001
2,511
0
Moneyapolis, Minnesota
Try Textmate. It has auto-indenting and loads of fully customizable snippets, tab-completion, and more. I used to be only using BBEdit, but now I've finally found a better, cheaper alternative.

(sorry for sounding like an advertisement, I just really love textmate)

It takes a while to get used to. You've just really got to spend time in it and figure out how to customize and use the snippets.
 

nagromme

macrumors G5
Original poster
May 2, 2002
12,546
1,196
Thanks, I'll check out TextMate too, although I don't have a heavy-duty UNIX background.

Meanwhile I do find TextWrangler better for my needs (and free) compared to SubEthaEdit--although I still haven't found a plug-in to auto-format .js in TextWrangler.
 

nagromme

macrumors G5
Original poster
May 2, 2002
12,546
1,196
mnkeybsness said:
Where did you get needing to know any Unix from my post about Textmate?
Where did you get needing to know Unix from MY post :D

I don't assume Textmate requires UNIX knowlegde. Rather, it seems to have UNIX text-editor features that someone used to UNIX command-line tools might really appreciate. At least, that seems to be the angle they use to set themselves apart. But since that's not where I'm coming from, it may not be worth the price for me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.