How do I run a C program from VIM?

c, vim

Solution

`:!gcc -o somename % && ./somename` When using `:!`, % will be substituted by the name of the currently opened file.

When your project becomes larger, you can also write a makefile and compile the current project with `:make`, if there are any errors, vim will jump to them automatically.

Problem

Is there a way to compile and run a C program from VIM without typing its filename ?

Original source

Related problems