compile directly from vim
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 au FileType C set makeprg=gcc\ % au FileType Cpp set makeprg=g++\ % but I keep getting "make: ***** No targets specified and no makefile found. Stop.** "message. can anyone tell me what is wrong with my setting? I use to compile successfully with the option above. You need the substitution there, try something like: set makeprg=gmake\ %:r.o Oh, this assumes that you've got: a (M|m)akefile in the directory, or default SUFFIX rules are available for your environment