Open .cpp and .h files in vim with split screens

Alec Jacobson

April 15, 2010

weblog/

Here's a little bash script I save in cvim.sh (apologies to chinese vim):
#!/bin/bash
base_name=`echo $1 | sed "s/\.$//g"`
vim -O2 $base_name.h $base_name.cpp
So the if I type:
./cvim.sh foo
vim opens foo.cpp and foo.h in split screen.