Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to compile and run .c files by using a shortcut key using gedit? I know its possible for java and C++, and I read somewhere that it is possible to do so using scripts in external tools. I'm currently compiling my files by gcc -Wall name name.c then ./name, but i would like to make this process faster

I already tried the below script for my shortcut but it generates an error saying

fatal error: no input files

share|improve this question
Your last line has a typo. Surely "$GEDIT_CURRENT_CODUMENT_NAME" should be "$GEDIT_CURRENT_DOCUMENT_NAME"? – Hugo Buff Mar 13 '14 at 14:17
You might also want to look into learning about makefiles. – Hugo Buff Mar 13 '14 at 14:19

The default build command of the gedit external tools works perfectly for me (run using Ctrl+F8):

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.