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

vim-scripts for beautifying code - where & what?

Expand Messages
  • email.4@gmx.net
    Hallo, I am looking for a vim script that beautifies code. For example: $a = something ; $beta = somewhere ; becomes $a = something ; $beta =
    Message 1 of 5 , Apr 29, 2002
      Hallo,

      I am looking for a vim script that beautifies code.

      For example:



      $a = "something";
      $beta = "somewhere";

      becomes

      $a = "something";
      $beta = "somewhere";


      It should work on windows (NT).

      (Dr.Chips has program - ttalign - but it does not work properly, at
      least on windows).

      Thanks for any hint in advance

      Klaus Horsten
    • Charles E. Campbell
      ... I ve used ttalign quite successfully under Windows 95, 98, NT, and 2000. What problem are you having with it? Regards, Charles Campbell -- Charles E
      Message 2 of 5 , Apr 29, 2002
        Thus saith email.4@...:
        > (Dr.Chips has program - ttalign - but it does not work properly, at
        > least on windows).
        ---------------------------------------------------------------------

        I've used ttalign quite successfully under Windows 95, 98, NT, and 2000.
        What problem are you having with it?

        Regards,
        Charles Campbell

        --
        Charles E Campbell, Jr, PhD _ __ __
        Goddard Space Flight Center / /_/\_\_/ /
        cec@... /_/ \/_//_/
        PGP public key: http://www.erols.com/astronaut/pgp.html
      • Gavin Sinclair
        Look for a script called Lineup.vim on vim.sourceforge.net. Very good. Gavin ... From: To: Sent: Tuesday, April 30, 2002 5:33
        Message 3 of 5 , Apr 29, 2002
          Look for a script called Lineup.vim on vim.sourceforge.net. Very good.

          Gavin

          ----- Original Message -----
          From: <email.4@...>
          To: <vim@...>
          Sent: Tuesday, April 30, 2002 5:33 AM
          Subject: vim-scripts for beautifying code - where & what?


          > Hallo,
          >
          > I am looking for a vim script that beautifies code.
          >
          > For example:
          >
          >
          >
          > $a = "something";
          > $beta = "somewhere";
          >
          > becomes
          >
          > $a = "something";
          > $beta = "somewhere";
          >
          >
          > It should work on windows (NT).
          >
          > (Dr.Chips has program - ttalign - but it does not work properly, at
          > least on windows).
          >
          > Thanks for any hint in advance
          >
          > Klaus Horsten
          >
        • email.4@gmx.net
          I must say that you have one of the best sites and your programming-knowledge must be very broad and great. But lets forget this flattering, here is the
          Message 4 of 5 , Apr 30, 2002
            I must say that you have one of the best sites and your
            programming-knowledge must be very broad and great.

            But lets forget this flattering, here is the problem:


            When I try to format this with \t=:

            $ar_monday[day] = "Mo, ". $date_formatted;
            $ar_monday[] = $time_b.".$time_e."-".$values['AktSComment'][$ii];

            I get the unformatted lines and ttalign adds me this $Z$ at the end:

            $ar_monday[day] = "Mo, ". $date_formatted;
            $ar_monday[] = $time_b."-".$time_e." ".$values['AktSComment'][$ii];$Z$

            Besides, I get 43 substitutions in the whole document (a class) -
            and I do not know what the program does. I do not have an
            overview. So I get anxious that it adds something or removes
            something which it should not do.

            Thanks for your help

            Klaus


            On 29 Apr 2002, at 16:16, Charles E. Campbell wrote:

            > Thus saith email.4@...:
            > > (Dr.Chips has program - ttalign - but it does not work properly, at
            > > least on windows).
            > ---------------------------------------------------------------------
            >
            > I've used ttalign quite successfully under Windows 95, 98, NT, and
            > 2000. What problem are you having with it?
            >
            > Regards,
            > Charles Campbell
            >
            > --
            > Charles E Campbell, Jr, PhD _ __ __
            > Goddard Space Flight Center / /_/\_\_/ /
            > cec@... /_/ \/_//_/
            > PGP public key: http://www.erols.com/astronaut/pgp.html
            >
          • Charles E. Campbell
            ... Thanks -- but I need to learn Java sometime... ... Didn t happen to me when I tried it; perhaps needs updating.
            Message 5 of 5 , Apr 30, 2002
              Thus saith email.4@...:
              > I must say that you have one of the best sites and your
              > programming-knowledge must be very broad and great.

              Thanks -- but I need to learn Java sometime...

              > When I try to format this with \t=:
              >
              > $ar_monday[day] = "Mo, ". $date_formatted;
              > $ar_monday[] = $time_b.".$time_e."-".$values['AktSComment'][$ii];
              >
              > I get the unformatted lines and ttalign adds me this $Z$ at the end:
              >
              > $ar_monday[day] = "Mo, ". $date_formatted;
              > $ar_monday[] = $time_b."-".$time_e." ".$values['AktSComment'][$ii];$Z$

              Didn't happen to me when I tried it; perhaps <ttalign.vim> needs
              updating. (http://www.erols.com/astronaut/vim/vimscript/ttalign.vim)

              This is what I got...

              ---------------------------------------------------------------------
              $ar_monday[day] = "Mo, ". $date_formatted;
              $ar_monday[] = $time_b.".$time_e."-".$values['AktSComment'][$ii];
              ---------------------------------------------------------------------

              > Besides, I get 43 substitutions in the whole document (a class) -
              > and I do not know what the program does.

              One of the things the scripts (not ttalign the program) does is remove
              trailing whitespace. The way the more involved scripts work is to
              insert "@"s at appropriate places, align on them, and then remove them.
              So that might explain the substitution count, too.

              Regards,
              Charles Campbell

              --
              Charles E Campbell, Jr, PhD _ __ __
              Goddard Space Flight Center / /_/\_\_/ /
              cec@... /_/ \/_//_/
              PGP public key: http://www.erols.com/astronaut/pgp.html
            Your message has been successfully submitted and would be delivered to recipients shortly.