sponsor Vim development Vim logo Vim Book Ad

basic Tip #210: compiling the actual file with gcc

 tip karma   Rating 138/81, Viewed by 4067 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   February 3, 2002 6:37      complexity:   basic
author:   elian      as of Vim:   6.0

if you use  set makeprg=gcc\ -o\ %<\ % in your .vimrc, and your actual file is file.c,  then :make will compile file.c with the output file. (gcc file.c -o file).

 rate this tip  Life Changing Helpful Unfulfilling 

<< backtracking your movements in a file | Rotate color themes >>

Additional Notes

Anonymous, April 9, 2005 12:37
You don't even have to make that change.  Just :make %:r and you'll get the same effect.
[email protected], July 16, 2005 7:22
very good. it works!
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo