Tuesday, August 04, 2009

Using VI To Edit Two Files In A Split Screen

So I've looked on and off how to edit multiple files in the same screen, opening them from the command line. This didn't help, but I discovered the -c flag which executes the given command after opening your file, so I did this:
vi file1 -c "split file2"

and it worked wonderfully. You can do more than two files at once, too
vi file1 -c "split file2" -c "split fileN"


Post a Comment

<< Home