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

RE: Repeat change on range

Expand Messages
  • Ondrejko, David
    ... That actually comes closest to what I want to accomplish, yes. Thanks! I never thought of repeating the last command within the recording of a macro.
    Message 1 of 11 , May 30, 2001
    • 0 Attachment
      RE: Repeat change on range

      > <Trimmed>
      >
      > The other thing to do is make a macro, like qa.j0q
      > and then go to the next line you want to change and
      > execute it with @a.  To do several lines in a row,
      > for example the next 3, just do 3@a

      That actually comes closest to what I want to accomplish, yes.  Thanks!  I never thought of repeating the last command within the recording of a macro.

    • Benji Fisher
      ... Here s another alternative. Make your change, then select the lines you want to change in Visual mode, and do ... The range,
      Message 2 of 11 , May 30, 2001
      • 0 Attachment
        > "Ondrejko, David" wrote:
        >
        > > <Trimmed>
        > >
        > > The other thing to do is make a macro, like qa.j0q
        > > and then go to the next line you want to change and
        > > execute it with @a. To do several lines in a row,
        > > for example the next 3, just do 3@a
        >
        > That actually comes closest to what I want to accomplish, yes. Thanks!
        > I never thought of repeating the last command within the recording of a
        > macro.

        Here's another alternative. Make your change, then select the lines
        you want to change in Visual mode, and do

        :'<,'>normal .

        The range, '<,'> , gets inserted automatically. You might want to put a
        motion before the . if the change is not supposed to be at the start of
        the line.

        Yet another possibility is to start recording before you make the
        first change.

        HTH --Benji Fisher
      • Coen Engelbarts
        ... AHA! So THAT is why that :
        Message 3 of 11 , May 31, 2001
        • 0 Attachment
          > Here's another alternative. Make your change, then
          > select the lines
          > you want to change in Visual mode, and do
          >
          > :'<,'>normal .
          >
          > The range, '<,'> , gets inserted automatically. You might

          AHA! So THAT is why that :'<,'> always pops up its ugly head when I enter
          command mode!
          Probably, when I click the mouse in my GUI VIM window to make it active, I
          sometimes inadvertently select some text.
          If I then enter command mode, the :'<,'> is already there.

          And I thought it was just bad karma. ;-)

          Before I start asking silly questions about this, where can I find the help
          text on this eh... feature?

          Thanks in advance,

          Coen
        • Ondrejko, David
          ... When I do that, all it says is 11 lines yanked (or however many lines I selected). I was getting the same message yesterday when I was trying something
          Message 4 of 11 , May 31, 2001
          • 0 Attachment
            RE: Repeat change on range

            >      Here's another alternative.  Make your change,
            > then select the lines you want to change in Visual
            > mode, and do
            >
            > :'<,'>normal .

            When I do that, all it says is '11 lines yanked' (or however many lines I selected).  I was getting the same message yesterday when I was trying something else along these lines, though I can't remember exactly what I was trying.  Any idea why?

            -- Davyd

          Your message has been successfully submitted and would be delivered to recipients shortly.