I need to run this command :perldo s/assigned_to(?!_member|_role)/assigned_to_member/g
in all open buffers. I'm using :perldo
because the builtin vim regex (i.e. %s/foo/bar/g
) isn't working with my negative lookahead for some reason.
Through my research I've found the :bufdo
and :execute "normal <foo>"
commands but I haven't yet figured out how to combine them.
Does anyone know how I would be able to run the perldo command on all my open buffers? Thanks!
Pressing Alt-F12 opens a window listing the buffers, and you can press Enter on a buffer name to go to that buffer. Or, press F12 (next) or Shift-F12 (previous) to cycle through the buffers.
Just put it to your . vim/plugin directory and then use :BufOnly command to close all buffers but the active one.
A buffer is an area of Vim's memory used to hold text read from a file. In addition, an empty buffer with no associated file can be created to allow the entry of text. The :e filename command can edit an existing file or a new file.
What's wrong with:
:bufdo! perldo s/assigned_to(?!_member|_role)/assigned_to_member/g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With