2

How can I run a certain command on only specific buffers (a list of buffer names, or a buffer name pattern etc) ?

1 Answer 1

7

You are looking for :argdo. Populate the arglist via :args. Then do :argdo {cmd} to run {cmd} on each of the files in the arglist.

:args *.c
:argdo %s/FOO/BAR/ge|update

To see all this in action take a look at some of these Vimcasts episodes:

For more help see:

:h :args
:h :argdo
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.