text substitution for all the files opened in vim

2011-02-23 Thread Peng Yu
:%s only perform substitution with a file. Is there a command that can perform substitution in all the files that are opened by a vim session? -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit

Re: text substitution for all the files opened in vim

2011-02-23 Thread Michael(Xi Zhang)
On Wed, Feb 23, 2011 at 9:50 PM, Peng Yu wrote: > :%s only perform substitution with a file. Is there a command that can > perform substitution in all the files that are opened by a vim session? > > You can try :bufdo %s ... Refer help bufdo for more information. -- You received this message

Re: text substitution for all the files opened in vim

2011-02-23 Thread Ben Schmidt
On 24/02/11 3:50 PM, Peng Yu wrote: :%s only perform substitution with a file. Is there a command that can perform substitution in all the files that are opened by a vim session? Check out :help :argdo :help :bufdo Cheers, Ben. -- You received this message from the "vim_use" maillist. Do

Re: text substitution for all the files opened in vim

2011-02-24 Thread Tim Chase
On 02/23/2011 11:20 PM, Ben Schmidt wrote: On 24/02/11 3:50 PM, Peng Yu wrote: :%s only perform substitution with a file. Is there a command that can perform substitution in all the files that are opened by a vim session? Check out :help :argdo :help :bufdo ...remembering that vim will comp

Re: text substitution for all the files opened in vim

2011-02-24 Thread Christian Brabandt
On Thu, February 24, 2011 1:03 pm, Tim Chase wrote: > On 02/23/2011 11:20 PM, Ben Schmidt wrote: >> :help :argdo >> :help :bufdo > > ...remembering that vim will complain if you try to leave a > modified buffer unless you > > 1) save the buffer as part of your command: > >:bufdo %s/foo/bar/g|w

Re: text substitution for all the files opened in vim

2011-02-24 Thread David Kahn
On Thu, Feb 24, 2011 at 6:33 AM, Christian Brabandt wrote: > On Thu, February 24, 2011 1:03 pm, Tim Chase wrote: > > On 02/23/2011 11:20 PM, Ben Schmidt wrote: > >> :help :argdo > >> :help :bufdo > > > > ...remembering that vim will complain if you try to leave a > > modified buffer unless you > >

Re: text substitution for all the files opened in vim

2011-02-24 Thread Tim Chase
On 02/24/2011 09:07 AM, David Kahn wrote: On Thu, Feb 24, 2011 at 6:33 AM, Christian Brabandtwrote: On Thu, February 24, 2011 1:03 pm, Tim Chase wrote: On 02/23/2011 11:20 PM, Ben Schmidt wrote: :help :argdo :help :bufdo ...remembering that vim will complain if you try to leave a modified b