Use the "External Tools" plugin. For compiling a single C++ file, you can set up gedit so that a single key will compile the program. For example, you can set up a g++ tool with options set up like this:
Code:
Description: g++
Accelerator: F5
Command(s): g++ $GEDIT_CURRENT_DOCUMENT_NAME -o ${GEDIT_CURRENT_DOCUMENT_NAME%.*}
Input: Nothing
Output: Insert in output panel
Applicability: All documents
With this tool set up, hitting the F5 function key opens up a console at the bottom of the window and runs g++ there. And with this:
Code:
Description: Run
Accelerator: F6
Command(s): ./${GEDIT_CURRENT_DOCUMENT_NAME%.*}
Input: Nothing
Output: Insert in output panel
Applicability: All documents
hitting the function key F6 will run the program.
(This idea was taken from this thread.)
For a program with multiple source files, create a Makefile, and use the Build tool to run make.
Bookmarks