To open multiple files at a time I use this command (here using the vi tab feature):

vim -p file1 file2 ... fileN

If I want to open a file at the end or at the first occurrence of a text:

vim + file1 or vim +/searchPattern file1

How to combine these 2 operations?

With vim + file1 file2 it works only for the first file.

1 Answer 1


One workaround would be to use :argdo (which runs an ex command in each file in the argument list):

vim +"argdo norm G" file1 file2
vim +"argdo /searchPattern" file1 file2

You will be left in the final file, so you'll need to manually invoke :first to return to the beginning of the arglist, or add this as another command-line argument:

vim +"argdo norm G" +first file1 file2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.