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

Re: execute macro in bufdo command

Expand Messages
  • Tim Chase
    ... Without the contents of the macro, this may be a bit difficult to troubleshoot. ... You likely want ... However, norm doesn t allow extra stuff after it
    Message 1 of 4 , May 31, 2006
      > I recorded a macro (search for line and paste 3 lines out of the
      > clipboard "*p )

      Without the contents of the macro, this may be a bit difficult to
      troubleshoot.

      > :bufdo @a | update

      You likely want

      :bufdo norm @a

      However, "norm" doesn't allow extra stuff after it (such as your
      update). My preferred way to make such batch changes is to
      enable the 'hidden' setting, allowing me to review all the
      changes before updating them all with ":wall"

      From the description of what you want to do, you can also do it
      in ex mode:

      :set hidden
      :bufdo g/regexp/put *
      [review changes]
      :wall

      This will put the clipboard's contents after *every* line
      containing regexp. If you only want the first, you can use

      :set hidden wrapscan
      :bufdo $/regexp/put *

      Hope this gives you some stuff to work with.

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