ReZeroS / LinuxQA

0 stars 0 forks source link

Vim tips #7

Open ReZeroS opened 5 years ago

ReZeroS commented 5 years ago

How to compile and execute the cpp file directly?

You could try :set makeprg={\ g++\ %\ &&\ ./a.out;\ rm\ -f\ a.out;\ }. Then use :make to compile and run your program. Use :make | copen to run your program and open result in split window. This will print compilation warnings too, you might want to turn errors to warnings or disable all warnings.