Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Is it possible to open vim with stdin in one window, and a file in another?

vim - starts vim with text from stdin in the buffer

vim -o file1 file2 starts vim with files in multiple split windows

Can they be combined? vim -o file1 - doesn't work; it dies with a Too many edit arguments error. I know I can use vim - and then :split file1, but I'd like to do it with command-line flags if possible.

share|improve this question
up vote 2 down vote accepted

Though you cannot use -o, you can execute any commands passed with -c:

$ vim - -c 'split file1'
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.