Loading ...
Sorry, an error occurred while loading the content.

Automatic indentation

Expand Messages
  • Gus
    Maybe I m the only one who would find this useful, but... I d like to be able to select a bunch of badly formatted code and let SEE auto-indent it. The
    Message 1 of 3 , Apr 17 6:24 AM
    • 0 Attachment
      Maybe I'm the only one who would find this useful, but...
      I'd like to be able to select a bunch of badly formatted code and let
      SEE "auto-indent" it. The function would not have to be perfect.
      Sometimes I have to work with long lines of unreadable Javascript /
      PHP and a function that would automatically indent what's between
      {brackets} would help greatly.

      Thanks for SEE!
    • michael_j_barber
      ... What you re describing is often called a code beautifier or a pretty printer . There are quite a few out there, especially for languages with a C-style
      Message 2 of 3 , Apr 24 2:02 PM
      • 0 Attachment
        --- In SubEthaEdit@yahoogroups.com, "Gus" <jim@...> wrote:
        >
        > Maybe I'm the only one who would find this useful, but...
        > I'd like to be able to select a bunch of badly formatted code and let
        > SEE "auto-indent" it. The function would not have to be perfect.
        > Sometimes I have to work with long lines of unreadable Javascript /
        > PHP and a function that would automatically indent what's between
        > {brackets} would help greatly.
        >

        What you're describing is often called a "code beautifier" or a "pretty printer". There are
        quite a few out there, especially for languages with a C-style syntax. For Javascript and
        PHP, you might find <http://elfz.laacz.lv/beautify/> or <http://www.prettyprinter.de/>
        useful. Google around a bit with the above terms, and I'm sure you'll find many more.

        Getting a code beautifier (in the form of a shell filter ) into SubEthaEdit is actually pretty
        easy. I put together the needed scripts and blogged about them here:
        <http://appliedabstraction.blogspot.com/2008/04/code-indentation-in-
        subethaedit.html>. Short summary is that one script provides a general preferences
        system for the modes, which you use to define the formatters. Another script invokes the
        specified formatter for a document, either reformatting the selection or the entire
        document, if the selection is empty. See the blog post for details and download
        information.

        Hope that helps,
        Michael
      • Gus
        Wow, thank you! Much obliged. I ll be checking the blog and trying to implement this. Gus ... pretty printer . There are ... syntax. For Javascript and ...
        Message 3 of 3 , Jun 7, 2008
        • 0 Attachment
          Wow, thank you!

          Much obliged. I'll be checking the blog and trying to implement this.

          Gus

          --- In SubEthaEdit@yahoogroups.com, "michael_j_barber"
          <michael_j_barber@...> wrote:
          >
          > --- In SubEthaEdit@yahoogroups.com, "Gus" <jim@> wrote:
          > >
          > > Maybe I'm the only one who would find this useful, but...
          > > I'd like to be able to select a bunch of badly formatted code and let
          > > SEE "auto-indent" it. The function would not have to be perfect.
          > > Sometimes I have to work with long lines of unreadable Javascript /
          > > PHP and a function that would automatically indent what's between
          > > {brackets} would help greatly.
          > >
          >
          > What you're describing is often called a "code beautifier" or a
          "pretty printer". There are
          > quite a few out there, especially for languages with a C-style
          syntax. For Javascript and
          > PHP, you might find <http://elfz.laacz.lv/beautify/> or
          <http://www.prettyprinter.de/>
          > useful. Google around a bit with the above terms, and I'm sure
          you'll find many more.
          >
          > Getting a code beautifier (in the form of a shell filter ) into
          SubEthaEdit is actually pretty
          > easy. I put together the needed scripts and blogged about them here:
          > <http://appliedabstraction.blogspot.com/2008/04/code-indentation-in-
          > subethaedit.html>. Short summary is that one script provides a
          general preferences
          > system for the modes, which you use to define the formatters.
          Another script invokes the
          > specified formatter for a document, either reformatting the
          selection or the entire
          > document, if the selection is empty. See the blog post for details
          and download
          > information.
          >
          > Hope that helps,
          > Michael
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.