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

RE: [edit+] Re: Can we write multiple lines at the same time

Expand Messages
  • WBG
    Can I know how did you do your macros for the commenting, as I use a lot of commenting and uncommenting. Thanks WBG ... From: Dean Householder
    Message 1 of 14 , Oct 1, 2004
    • 0 Attachment
      Can I know how did you do your macros for the commenting, as I use a lot of
      commenting and uncommenting.



      Thanks

      WBG



      -----Original Message-----
      From: Dean Householder [mailto:dh@...]
      Sent: Friday, September 17, 2004 4:45 PM
      To: editplus@yahoogroups.com
      Subject: Re: [edit+] Re: Can we write multiple lines at the same time



      I personally have two crucial macros that I use all the time. One is
      ALT+0 which will append whatever I have in my clipboard to the end of
      the current line and then move the cursor to the beginning of the next
      line. The other is ALT+9 which does the same for the beginning of a line.

      So if I have 4 lines like:
      James
      Jack
      Kinny
      Desi

      I copy to my clipboard the text (with a space at the end):
      Hello world and Hello EditPlus users

      And position my cursor in front of James and press ALT+9. The macro
      (consisting of: CTRL+v, Home, Down) pastes the clipboard text in front
      of my line and leaves my cursor at the beginning of the next line. I
      just press ALT+9 4 times and I've got it. I never have to change this
      macro. If I needed to do it 150 times in a row, I can just
      Tools->Record->Playback Multiple and select Macro 9 and enter 150.

      These combined with other permanent macros I have, have become by
      lifeline. I have one which converts a line of HTML code to php printed
      code escaping all double quotes. I also have a macro which converts
      that back. I keep all my permanent macros above 5 and all the ones I
      recreate for each project below. Beautiful system if you ask me. ;o)

      P.S. My other useful tool would be the line comment which I set up a
      keyboard shortcut as CTRL+ALT+C. Then you just highlight the lines,
      press CTRL+ALT+C and enter the text you want to pre pend to each line.

      Dean Householder



      Michael L. Jones wrote:

      >Cool. I learned two things about EditPlus that I didn't know
      >yesterday. My estimate of the percentage of the functionality that I
      >know about keeps goes down <g>. Some of you guys must be really
      >heavy-duty users.
      >
      >--- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
      >
      >
      >>Yes you can... if you select the first character on all the lines
      >>with column select, and then right click, and choose format->fill
      >>column and then type what you want to appear in front there and
      >>
      >>
      >click
      >
      >
      >>ok... that should do what you want it to do.
      >>
      >>
      >>P.S alternatively you could select all lines, right click and
      >>
      >>
      >click
      >
      >
      >>comment lines, and then type the phrase you want to appear at the
      >>beginning of the lines.
      >>
      >>
      >
      >
      >
      >
      >
      >http://www.editplus.com
      >http://groups.yahoo.com/group/editplus
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >


      [Non-text portions of this message have been removed]



      http://www.editplus.com
      http://groups.yahoo.com/group/editplus






      Yahoo! Groups Sponsor



      ADVERTISEMENT

      <http://us.ard.yahoo.com/SIG=129155jui/M=295196.4901138.6071305.3001176/D=gr
      oups/S=1705351788:HM/EXP=1095543936/A=2128215/R=0/SIG=10se96mf6/*http:/compa
      nion.yahoo.com> click here



      <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
      :HM/A=2128215/rand=162377185>



      _____

      Yahoo! Groups Links

      * To visit your group on the web, go to:
      http://groups.yahoo.com/group/editplus/


      * To unsubscribe from this group, send an email to:
      editplus-unsubscribe@yahoogroups.com
      <mailto:editplus-unsubscribe@yahoogroups.com?subject=Unsubscribe>


      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      <http://docs.yahoo.com/info/terms/> Service.



      [Non-text portions of this message have been removed]
    • Dean Householder
      Yes, I d be glad to explain how I do it. My macro to take a line of HTML code and turn it into PHP code is: (assuming the cursor is at the beginning of the
      Message 2 of 14 , Oct 1, 2004
      • 0 Attachment
        Yes, I'd be glad to explain how I do it.

        My macro to take a line of HTML code and turn it into PHP code is:
        (assuming the cursor is at the beginning of the line)
        print "
        Shift+End
        CTRL+h (Replace dialog)
        "(in the Find What box)
        \"(in the Replace With box)
        (select the Selection radio button)
        Replace All (and close the replace box)
        End
        ";

        The reverse macro would delete print ", replace all \" with " and delete
        the "; off of the end. I was very happy to discover that the replace
        menu still works in a macro. This opens a million new possibilities!

        Another of my favorite macros is one that adds quotes to all html tag
        values that are not quoted. For example, if you had:
        <table width=580 height=600>
        It would change it to:
        <table width="580" height="600">
        which is XHTML compliant.

        The Macro to do this is:
        CTRL+h (Replace dialog)
        Replace:
        ( [a-z]+=)([a-z0-9#%]+)
        With:
        \1"\2"

        It's a big time saver!

        Good luck,
        Dean Householder


        WBG wrote:

        >Can I know how did you do your macros for the commenting, as I use a lot of
        >commenting and uncommenting.
        >
        >
        >
        >Thanks
        >
        >WBG
        >
        >
        >
        >-----Original Message-----
        >From: Dean Householder [mailto:dh@...]
        >Sent: Friday, September 17, 2004 4:45 PM
        >To: editplus@yahoogroups.com
        >Subject: Re: [edit+] Re: Can we write multiple lines at the same time
        >
        >
        >
        >I personally have two crucial macros that I use all the time. One is
        >ALT+0 which will append whatever I have in my clipboard to the end of
        >the current line and then move the cursor to the beginning of the next
        >line. The other is ALT+9 which does the same for the beginning of a line.
        >
        >So if I have 4 lines like:
        >James
        >Jack
        >Kinny
        >Desi
        >
        >I copy to my clipboard the text (with a space at the end):
        >Hello world and Hello EditPlus users
        >
        >And position my cursor in front of James and press ALT+9. The macro
        >(consisting of: CTRL+v, Home, Down) pastes the clipboard text in front
        >of my line and leaves my cursor at the beginning of the next line. I
        >just press ALT+9 4 times and I've got it. I never have to change this
        >macro. If I needed to do it 150 times in a row, I can just
        >Tools->Record->Playback Multiple and select Macro 9 and enter 150.
        >
        >These combined with other permanent macros I have, have become by
        >lifeline. I have one which converts a line of HTML code to php printed
        >code escaping all double quotes. I also have a macro which converts
        >that back. I keep all my permanent macros above 5 and all the ones I
        >recreate for each project below. Beautiful system if you ask me. ;o)
        >
        >P.S. My other useful tool would be the line comment which I set up a
        >keyboard shortcut as CTRL+ALT+C. Then you just highlight the lines,
        >press CTRL+ALT+C and enter the text you want to pre pend to each line.
        >
        >Dean Householder
        >
        >
        >
        >Michael L. Jones wrote:
        >
        >
        >
        >>Cool. I learned two things about EditPlus that I didn't know
        >>yesterday. My estimate of the percentage of the functionality that I
        >>know about keeps goes down <g>. Some of you guys must be really
        >>heavy-duty users.
        >>
        >>--- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
        >>
        >>
        >>
        >>
        >>>Yes you can... if you select the first character on all the lines
        >>>with column select, and then right click, and choose format->fill
        >>>column and then type what you want to appear in front there and
        >>>
        >>>
        >>>
        >>>
        >>click
        >>
        >>
        >>
        >>
        >>>ok... that should do what you want it to do.
        >>>
        >>>
        >>>P.S alternatively you could select all lines, right click and
        >>>
        >>>
        >>>
        >>>
        >>click
        >>
        >>
        >>
        >>
        >>>comment lines, and then type the phrase you want to appear at the
        >>>beginning of the lines.
        >>>
        >>>
        >>>
        >>>
        >>
        >>
        >>
        >>http://www.editplus.com
        >>http://groups.yahoo.com/group/editplus
        >>Yahoo! Groups Links
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >
        >
        >[Non-text portions of this message have been removed]
        >
        >
        >
        >http://www.editplus.com
        >http://groups.yahoo.com/group/editplus
        >
        >
        >
        >
        >
        >
        >Yahoo! Groups Sponsor
        >
        >
        >
        >ADVERTISEMENT
        >
        ><http://us.ard.yahoo.com/SIG=129155jui/M=295196.4901138.6071305.3001176/D=gr
        >oups/S=1705351788:HM/EXP=1095543936/A=2128215/R=0/SIG=10se96mf6/*http:/compa
        >nion.yahoo.com> click here
        >
        >
        >
        ><http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
        >:HM/A=2128215/rand=162377185>
        >
        >
        >
        > _____
        >
        >Yahoo! Groups Links
        >
        >* To visit your group on the web, go to:
        >http://groups.yahoo.com/group/editplus/
        >
        >
        >* To unsubscribe from this group, send an email to:
        >editplus-unsubscribe@yahoogroups.com
        ><mailto:editplus-unsubscribe@yahoogroups.com?subject=Unsubscribe>
        >
        >
        >* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        ><http://docs.yahoo.com/info/terms/> Service.
        >
        >
        >
        >[Non-text portions of this message have been removed]
        >
        >
        >
        >
        >http://www.editplus.com
        >http://groups.yahoo.com/group/editplus
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >


        [Non-text portions of this message have been removed]
      • John Morse
        Awesome! Thanks for sharing this with us. Works great for everything that doesn t have a space in-between, how can you change it so that if there is a space it
        Message 3 of 14 , Oct 1, 2004
        • 0 Attachment
          Awesome! Thanks for sharing this with us. Works great for everything
          that doesn't have a space in-between, how can you change it so that if
          there is a space it will account for it as well?
          for example:
          The macro changes this:
          <META NAME=Author CONTENT=John Morse>
          To this:
          <META NAME="Author" CONTENT="John" Morse>
          When it should be this:
          <META NAME="Author" CONTENT="John Morse">
          I'm sure its just needs a slight change to the regular expression
          string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.

          Thanks again!!!
          ~John
          "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"

          Friday, October 1, 2004, 12:15:21 PM, you wrote:
          DH> Another of my favorite macros is one that adds quotes to all html tag
          DH> values that are not quoted. For example, if you had:
          DH> <table width=580 height=600>
          DH> It would change it to:
          DH> <table width="580" height="600">
          DH> which is XHTML compliant.

          DH> The Macro to do this is:
          DH> CTRL+h (Replace dialog)
          DH> Replace:
          DH> ( [a-z]+=)([a-z0-9#%]+)
          DH> With:
          DH> \1"\2"
        • Dean Householder
          There s not an easy way to capture these. The space is really the constant that I m depending on to delimit each attribute. I looked into modifying it to
          Message 4 of 14 , Oct 4, 2004
          • 0 Attachment
            There's not an easy way to capture these. The space is really the
            constant that I'm depending on to delimit each attribute. I looked into
            modifying it to look for either a > or another attribute with a value...
            but then it actually captures the name of the tag itself, which in this
            example is: "META".

            So no this would not work with spaces. You can look at this to be a
            great first stab at cleaning up your code but not an all-in-one
            solution. If EditPlus supported Perl regular expressions instead of
            just POSIX we would have a lot more power. There are some great options
            like look-ahead parameters that could be considered, but this is not
            currently allowed in EditPlus, unfortunately.

            Good luck,
            Dean Householder


            John Morse wrote:

            >Awesome! Thanks for sharing this with us. Works great for everything
            >that doesn't have a space in-between, how can you change it so that if
            >there is a space it will account for it as well?
            >for example:
            >The macro changes this:
            ><META NAME=Author CONTENT=John Morse>
            >To this:
            ><META NAME="Author" CONTENT="John" Morse>
            >When it should be this:
            ><META NAME="Author" CONTENT="John Morse">
            >I'm sure its just needs a slight change to the regular expression
            >string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
            >
            >Thanks again!!!
            >~John
            >"Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
            >
            >Friday, October 1, 2004, 12:15:21 PM, you wrote:
            >DH> Another of my favorite macros is one that adds quotes to all html tag
            >DH> values that are not quoted. For example, if you had:
            >DH> <table width=580 height=600>
            >DH> It would change it to:
            >DH> <table width="580" height="600">
            >DH> which is XHTML compliant.
            >
            >DH> The Macro to do this is:
            >DH> CTRL+h (Replace dialog)
            >DH> Replace:
            >DH> ( [a-z]+=)([a-z0-9#%]+)
            >DH> With:
            >DH> \1"\2"
            >
            >
            >
            >
            >http://www.editplus.com
            >http://groups.yahoo.com/group/editplus
            >Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >


            [Non-text portions of this message have been removed]
          • tailing_loop2003
            ... if ... It s been awhile since I ve done any regular expressions, but that looks like a pretty simple one. ( [a-z]+= ) [a-z] looks for any lower case
            Message 5 of 14 , Oct 4, 2004
            • 0 Attachment
              --- In editplus@yahoogroups.com, John Morse <john_morse@s...> wrote:
              > Awesome! Thanks for sharing this with us. Works great for everything
              > that doesn't have a space in-between, how can you change it so that
              if
              > there is a space it will account for it as well?
              > for example:
              > The macro changes this:
              > <META NAME=Author CONTENT=John Morse>
              > To this:
              > <META NAME="Author" CONTENT="John" Morse>
              > When it should be this:
              > <META NAME="Author" CONTENT="John Morse">
              > I'm sure its just needs a slight change to the regular expression
              > string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
              >

              It's been awhile since I've done any regular expressions, but that
              looks like a pretty simple one.

              ( [a-z]+= )

              [a-z] looks for any lower case character
              [a-z]+ looks for a lower case character 1 or more times
              [a-z]+= looks for a lower case character 1 or more times followed by
              an equals sign.

              The parentheses just delimit that group(which comes into play later
              with the replacement expression).

              For the next part of the regular expression:

              ( [a-z0-9#%]+ )

              [a-z0-9#%] looks for the characters a-z, or 0-9, or #, or %, with the
              plus sign once again meaning one or more times.

              So, putting it all together, the expression looks for:

              the characters a-z one or more times, followed by an equals sign,
              followed by the characters a-z, 0-9, #, or % one or more times.

              Hopefully, that wasn't too confusing. Now it's time to look
              at what
              matches to the regular expression will be replaced by:

              \1"\2"

              If I remember correctly, \1 stands for whatever matches what's in
              the
              first set of parentheses in the regular expression, and \2 stands for
              whatever matches what's in the second set of parentheses in the
              regular expression. Therefore, you can add parentheses to a regular
              expression in order to refer to them later in the replacement
              expression, and the first set of parenthesis will always be \1 and the
              second set will always be \2, and so on. Since the quotes are added
              around \2, whatever matches the second set of parenthesis in the
              regular expression will be enclosed in quotes.

              Now, to answer your question (finally!). All you have to do is add a
              space to the expression in the second set of parenthesis, like this:

              ([a-z0-9#% ]+)

              For image names, like myimage.jpg, in order to put quotes around the
              whole name, for example:

              href="myimage.jpg"

              instead of this(which happens with the current regular expression):

              href="myimage".jpg

              you also need to add a period to the second set of parentheses in the
              regular expression. However, a period has a special meaning in
              regular expressions, so if you literally want to signify a period, you
              have to precede it with a '\':

              ( [a-z0-9#% \.]+ )

              Since, I also use names for my images like:

              my_image.jpg

              I would also add the underscore to the second set of parentheses in
              the regular expression:

              ( [a-z0-9#% \._]+ )




              > Thanks again!!!
              > ~John
              > "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
              >
              > Friday, October 1, 2004, 12:15:21 PM, you wrote:
              > DH> Another of my favorite macros is one that adds quotes to all
              html tag
              > DH> values that are not quoted. For example, if you had:
              > DH> <table width=580 height=600>
              > DH> It would change it to:
              > DH> <table width="580" height="600">
              > DH> which is XHTML compliant.
              >
              > DH> The Macro to do this is:
              > DH> CTRL+h (Replace dialog)
              > DH> Replace:
              > DH> ( [a-z]+=)([a-z0-9#%]+)
              > DH> With:
              > DH> \1"\2"
            • tailing_loop2003
              Well, after I posted, I noticed that I failed to realize that there was a leading space in the regex: ( [a-z]+=)([a-z0-9#%]+) Also, in the interest of making
              Message 6 of 14 , Oct 4, 2004
              • 0 Attachment
                Well, after I posted, I noticed that I failed to realize that there
                was a leading space in the regex:

                ( [a-z]+=)([a-z0-9#%]+)

                Also, in the interest of making the regex more readable, I moved the
                enclosing parenthesis wider in my post, which I now realize adds space
                characters to the regex which affects the search:

                ( [a-z]+= )

                That's wrong!

                Finally, as Dean Householder pointed out, a space is the key to
                discern when an html attribute ends. However, I set up a macro with
                the regex Dean posted modified for spaces, so that it applies only to
                the selection I highlight. So, I can handle something like this:

                <META NAME=Author CONTENT=John Morse>

                by highlighting only:

                CONTENT=John Morse>

                and then the quotes are added like so:

                <META NAME=Author CONTENT="John Morse">

                It's an extra macro you have to run, but it's something to consider.
                I believe if you run that macro first on any parts of your html where
                the attribute has two words, then you can run the original macro
                posted by Dean to handle the rest of your codeĀ—it won't
                affect the
                quotes on the two word attributes. Of course, that means you have to
                know ahead of time that there are some two word attributes and where
                they are located.




                --- In editplus@yahoogroups.com, "tailing_loop2003"
                <tailing_loop2003@y...> wrote:
                >
                >
                > --- In editplus@yahoogroups.com, John Morse <john_morse@s...> wrote:
                > > Awesome! Thanks for sharing this with us. Works great for
                everything
                > > that doesn't have a space in-between, how can you change it so
                that
                > if
                > > there is a space it will account for it as well?
                > > for example:
                > > The macro changes this:
                > > <META NAME=Author CONTENT=John Morse>
                > > To this:
                > > <META NAME="Author" CONTENT="John" Morse>
                > > When it should be this:
                > > <META NAME="Author" CONTENT="John Morse">
                > > I'm sure its just needs a slight change to the regular expression
                > > string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
                > >
                >
                > It's been awhile since I've done any regular expressions, but that
                > looks like a pretty simple one.
                >
                > ( [a-z]+= )
                >
                > [a-z] looks for any lower case character
                > [a-z]+ looks for a lower case character 1 or more times
                > [a-z]+= looks for a lower case character 1 or more times followed
                by
                > an equals sign.
                >
                > The parentheses just delimit that group(which comes into play later
                > with the replacement expression).
                >
                > For the next part of the regular expression:
                >
                > ( [a-z0-9#%]+ )
                >
                > [a-z0-9#%] looks for the characters a-z, or 0-9, or #, or %, with
                the
                > plus sign once again meaning one or more times.
                >
                > So, putting it all together, the expression looks for:
                >
                > the characters a-z one or more times, followed by an equals sign,
                > followed by the characters a-z, 0-9, #, or % one or more times.
                >
                > Hopefully, that wasn't too confusing. Now it's time to look
                > at what
                > matches to the regular expression will be replaced by:
                >
                > \1"\2"
                >
                > If I remember correctly, \1 stands for whatever matches what's in
                > the
                > first set of parentheses in the regular expression, and \2 stands
                for
                > whatever matches what's in the second set of parentheses in the
                > regular expression. Therefore, you can add parentheses to a regular
                > expression in order to refer to them later in the replacement
                > expression, and the first set of parenthesis will always be \1 and
                the
                > second set will always be \2, and so on. Since the quotes are added
                > around \2, whatever matches the second set of parenthesis in the
                > regular expression will be enclosed in quotes.
                >
                > Now, to answer your question (finally!). All you have to do is add
                a
                > space to the expression in the second set of parenthesis, like this:
                >
                > ([a-z0-9#% ]+)
                >
                > For image names, like myimage.jpg, in order to put quotes around the
                > whole name, for example:
                >
                > href="myimage.jpg"
                >
                > instead of this(which happens with the current regular expression):
                >
                > href="myimage".jpg
                >
                > you also need to add a period to the second set of parentheses in
                the
                > regular expression. However, a period has a special meaning in
                > regular expressions, so if you literally want to signify a period,
                you
                > have to precede it with a '\':
                >
                > ( [a-z0-9#% \.]+ )
                >
                > Since, I also use names for my images like:
                >
                > my_image.jpg
                >
                > I would also add the underscore to the second set of parentheses in
                > the regular expression:
                >
                > ( [a-z0-9#% \._]+ )
                >
                >
                >
                >
                > > Thanks again!!!
                > > ~John
                > > "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
                > >
                > > Friday, October 1, 2004, 12:15:21 PM, you wrote:
                > > DH> Another of my favorite macros is one that adds quotes to all
                > html tag
                > > DH> values that are not quoted. For example, if you had:
                > > DH> <table width=580 height=600>
                > > DH> It would change it to:
                > > DH> <table width="580" height="600">
                > > DH> which is XHTML compliant.
                > >
                > > DH> The Macro to do this is:
                > > DH> CTRL+h (Replace dialog)
                > > DH> Replace:
                > > DH> ( [a-z]+=)([a-z0-9#%]+)
                > > DH> With:
                > > DH> \1"\2"
              Your message has been successfully submitted and would be delivered to recipients shortly.