Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 down vote accepted

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

$ vim - -c 'split file1'
share|improve this answer

Try using vim -o file1 /dev/stdin.

share|improve this answer
1  
Try actually running that command. –  Isaac Rabinovitch Mar 13 '13 at 2:31

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.