Environment: MacOS, gcc, Vim7.2
I know I can do it in Emacs. Compile code and run it. I am wondering how can I do it in vi? I don't want to switch from vi to terminal a lot. thanks! :)
vim does have a inbuilt :make command, but it has to be associated with the compiler. Some examples are:
GNU gcc compiler:
set makeprg=gcc\ -o\ %<\ %
Intel Fortran compiler:
set makeprg=ifort\ %\ -o\ %<
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With