I\'d like to compile cpp file w/o turning off vi. I know the :!g++ file.cpp but I prefer :make so I added this line in .vimrc file
I think it's much easier if you write a Makefile and put it where vi can find it. I'm not sure if you actually use vi (I've only used Vim), but when there is a Makefile compiling should be as easy as writing :make (no set makeprg needed).