Text editor that properly auto-indents JavaScript?

Discussion in 'Web Design and Development' started by nagromme, May 25, 2006.

  1. nagromme macrumors G5

    nagromme

    Joined:
    May 2, 2002
    #1
    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.
     
  2. cait-sith macrumors regular

    Joined:
    Apr 6, 2004
    Location:
    canada
    #2
    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.
     
  3. nagromme thread starter macrumors G5

    nagromme

    Joined:
    May 2, 2002
    #3
    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.
     
  4. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #4
    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.
     
  5. nagromme thread starter macrumors G5

    nagromme

    Joined:
    May 2, 2002
    #5
    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.
     
  6. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #6
    Where did you get needing to know any Unix from my post about Textmate?
     
  7. nagromme thread starter macrumors G5

    nagromme

    Joined:
    May 2, 2002
    #7
    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.
     

Share This Page