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

Re: search and replace in multiple buffers with a single command

Expand Messages
  • Janakiraman .S
    ... Addiing those quotes is pretty boring. That is easy to fix. Just make a command like command! -nargs=+ -complete=command AllBuf call AllBuffers( )
    Message 1 of 3 , May 30, 2001
    • 0 Attachment
      * Peter Bismuti (bismuti@...) wrote thusly :

      > How to global search and replace in all buffers with one command?
      > You need the AllBuffers command:
      >
      > :call AllBuffers("%s/string1/string2/g")

      Addiing those quotes is pretty boring. That is easy to fix. Just make a
      command like
      command! -nargs=+ -complete=command AllBuf call AllBuffers(<q-args>)

      You could then replace across multiple files with
      :AllBuf %s/foo/bar/ge

      Also this question has come up before. Search the archives for more
      answers. [http://groups.yahoo.com/group/vim/messages%5d
    Your message has been successfully submitted and would be delivered to recipients shortly.