Free IDE / Editor for Arduino / Genuino and its clones

# EDRUINO - Editor

Each project opens its own editor window.

The editor uses the windows standards:

- Insert / overwrite mode switched by Insert key
- Line numbering
- Syntax highlighting
- Parenthes / curly brackets pair matches highlighting
- Cut / Copy / Paste function
- Search / replace function including regular expression search
- Indent / Inindent block with Ctrl-shift-I / Ctrl-shift-U hotkeys

Some lines are marked by different colors:

- setup() and loop() functions
- other functions first line with function name
- includes and defines

For users used to Microsoft products, there are two differences:

- Editor does not support code folding
- Bookmarks are implemented the same way as in the Delphi

## Editor hotkeys

The editor uses the standard hotkeys used in another Windows editors + some enhancements.

Here is the the complete list of editor hotkeys.

## Bookmarks

Bookmarks are placed / removed by clicking in the left gutter next to line number or by Ctrl-Shift0-9. They are marked by numbers 0-9 and in the same time highlighted in the toolbar above the editor. For defined bookmarks, when the mouse is over the toolbar bookmark, hint shows the text of the bookmarked line. In some of new versions there wil be a bookmark list window and hint wil show more lines.

In order to jump to a bookmarked line, either click on the icon in the toolbar or press Ctrl-0..Crtl-9.

The bookmarks can be added in arbitrary order - e.g. BM0,BM4,BM9,BM2,..

In order to make work with bookmarks even easier, the bookmark list can be opened by clicking on the button with a question mark icon:

In the top of the Bookmark list window there is a list of assigned bookmarks while the lower part shows a few lines before and after the line with a bookmark.

Double-clicking on a bookmark in the bookmatk list closes the window and a line with selected bookmark is found.

## Bracket pairs matching

Bracket pairs are automatically highlighted by yellow color. For moving a cursor between the pair, put the cursor left to a parenthes and press Ctrl-Shift-B hotkey.

All three types of parenthes are highlighted: (), [], {}

## Code navigation

Next to the standard navigation techniques, there are extended possibilities for code navigating:

In the toolbar there are four buttons (available also from Goto menu) for jumping to often visited parts of every code:

- Setup() function
- Loop() function
- #defines
- #includes

### Function and variables list

Inside the left pane, there is a tab marked "Functions". After opening this tab, a list of source code functions, variables and constants is displayed.

Different pieces of code are marked with different colors and icons:

- Red "f" icons marks functions
- Red "stp" is the setup () function
- Red "loop" is for the loop () function
- Green ball - constants definition
- Blue ball - variables

By clicking on the line, the position in the source code is found and the line is marked by a small blue arrow in the gutter.

The function list is automatically updated when edit window lost focus. To update it manually click on the Update function list button above the function list;

## Code templates and Code completion

Entering source code can be easier by utilizing code templates, invoked by double-clicking on the template name in the Templates tab in the left panel.

Templates can be used for entering an arbitrary piece of code at the editor cursor position, e.g. C-loops, often used declarations, shield initialization, functions for accessing LCD etc.

The templates reside in the Edruino.templates file in the program folder. By modifying / extending this file, each user can create its own templates.

There are buttons above the template list. First two are for sorting templates by the name or by the order from Erduino.templates file.

For the fast code entering there is a new feature - code completion. The definition file for code completion is the same as for the Code templates.

Look at the complete description of the Code templates / code completion

## Result panel

Result window is below the editor window and displays results for sketch compilation(verification) and upload. The output of the Arduino is a bit modified to be more readable and allows to navigate directly to lines with errors. Size of this window is trimmed automatically according to the size of result output.

After compiling (verifying) sketch, the color of the Result panel is either white if compilation passed without error or it is light red signalizing a problem.

If the sketch compiles without errors, the Result panel shows information about Arduino memory used / free.

If an experienced user wants to look at the complete compilation protocol, right click inside result window opens a popup menu allowing to open standard log and error log.

## Sketch Autosave

Edruino uses standard Arduino software for sketch verification / upload. As Arduino (which should be configured to "Use external editor") reads the source code from a file on the disk, Edruino automatically saves the sketch content before calling Compile (verify) or upload functions.

## Editor line spacing

The editor line spacing can be increased or decreased by changing a value of "Line space" control

Positive values increase spacing:

Negative values decrease spacing:

## Printing

Editor allows to preview and print the active sketch on a printer using syntax highlighting: