Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.