Repetier-Host Documentation

G-Code Editor

Elements of the editor

G-Code editor

The g-code editor has it’s own small toolbar, where you can select the most important functions. The most important is the file selector. Here you can select what you want to edit. After finishing a slice, the “G-Code” is selected. This is the code generated by the slicer. All other selections are smaller codes, which are executed depending on their intention. These codes are saved as part of your current printer configuration, when you press the save button. Only if the g-code is selected, a file selector appears to select the place to store the data. Then you switch the printer configuration the files will change to the one stored in the this configuration!

G-Code, Start code and End code

You surely have already noticed the three button in the toolbar containing the word “job”. Within the host, a job is the assembled data from “Start code”+”G-Code”+”End code”. So if you store or send a job, this always means these three files together.

Run on kill/Run on pause

When sending a job to the printer you may want to kill the print or pause the job. After hitting the button, the matching script will be send to the printer. While the kill job is not so important, you might want some code for the pause case. Typical reasons for a pause are switching filament type or modifications on the printing object like adding nuts bevor enclosing it in filament. In these cases you don’t want the extruder to stay over the object. One thing you could do is move the object back with a G1 command. You can do this, because the host remembers the position, where the pause started. After you hit the continue button, the extruder will go back to the starting position. Things you shouldn’t do during pause are:

  • Home axis.
  • Redefine coordinates with G92.
  • Move the z-axis to a deeper position.

Things you can to during pause:

  • Switch between relative and absolute coordinates, e.g. for lifting extruder.
  • Move extruder.
  • Extrude filament, reset extruder position.
  • Change temperatures (these are not reset by the host).

Script 1-5

If you have some frequent task, that require some commands to be send to the printer, you can put them into these scripts. In the printer menu are five commands to send these scripts to the printer.

New / Save

With the new button you remove all content from the editor.

The save button stores the g-code in a selectable file. All other scripts are saved as part of the current printer configuration.


Not everyone is familiar with the g-codes for 3d printer. To assist you, you can see the meaning of the current code at the bottom, if the help tab is selected. Not all commands will be displayed and some may have a different meaning on your firmware, but the most important are the same on all printers.

Visual screening

G-code editor showing single layer

When a g-code is loaded you see the filament model on the left, if not disabled. Normally higher layers hide the content of the lower layer. If you select the “Visualization” tab at the bottom of the editor you can select, which part you want to see. Default is the complete code, but you can also select a single layer or multiple layers. If you search the matching g-code, look at the status bar of the editor. It shows the layer, the row with cursor belongs to. If the current line will produce a printed line, that line will be highlighted in the preview. You can even mark a larger code range and all contained print moves will be highlighted.


You can add some host specific codes that do not get executed on the board, but inside the host when that position is reached.
This of course only works when you are printing from the host and not from sd card. All host commands start with @ or if you like
to have valid g-code with ;@ followed by command name and eventually some parameter.


The info command writes the text to the log.

@info Hello world


Plays the sound defined in preferences for the sound command.



Waits with sending g-code until the user presses the continue button. Shows the text in the info screen.

@pause My Message


Executes a file. Command should be the absolute path.

@execute command param1 param2


Tells the host the extruder is at it’s origin. You need this if you don’t have endstops to do the normal homing.


Continue with “Manual Control”