Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I need to edit multiple files, it's really a pain to have to open them one by one. Is there a way to open multiple files in VIM from the commandline?

share|improve this question
up vote 7 down vote accepted

You can use vim -o {file-list} to open files horizontally splitted, or vim -O {file-list} to open them vertically splitted. But in your case, I always use vim -p {file-list} to open files in tab pages (because size of each window is nearly size of your terminal in this mode).

share|improve this answer

I use

vim -O file1 file2 file3 file4 #open files side by side
vim -o file1 file2 file3 file4 #open files stacked
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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