I am using Mac OS X version 10.6.8. Is there any helpful script to compile and run my c++ file from inside vim using single command?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes there is:
This will run
makewith the C++ file (less its extension) as the target and run the file in the same directory with that target’s name.See the following
:helpfor more information…nnoremap: Create a normal-mode mapping<F5>: for F5 (other function keys are available)<C-U>: clear the command-linemake: call'makeprg', which ismakeby default%:r: root of the current filename (extension removed)<CR>: execute all thisIf you want this for all Vim sessions, place this into your
.vimrc:Update:
You may also find the SingleCompile Vim script to be handy for C++ and many other languages besides.