Geany is a small development-oriented text editor that is available on all platforms (Windows, MacOS, Linux) and ARM microprocessors that equip mini-PCs (Raspberry Pi, Orange Pi, Cubieboard …). There are others (Leafpad, IDLE, VIM …), but I find that Geany replaces pretty well Sublime text unfortunately absent from ARM distributions. Geany has a graphical interface, which is much more friendly to use than VIM or nano on projects.
Install Geany for ARM processor
The installation is very simple because Geany is present in the depots. Simply run
sudo apt-get install geany
Once installed, a new shortcut is added to the Programming menu.
Besides the ability to edit text (configuration file, python scripts …) more easily than with nano in the Terminal, Geany is programming oriented.
It first brings syntax highlighting, which makes it easier to focus and check for errors. Several languages are supported (html, php, python, ruby, java, c ++ …).
If you are used to using Sublime Text 2, you will find several useful functions in programming: moving the line (s) up or down, duplicating the selection, commenting / uncommenting lines Does not work with all languages), increase / decrease indentation, search the current file or in files.
The display can be adapted by adding the line numbers, an indentation guide. The automatic indentation is activated in the Document menu. It is possible to choose the type of indentation (tabulation, space, mixed) and choose the indentation width. This option is very handy for languages that are based on indentation for code compilation. If you retrieve code from the internet, you should often clean it, change the indentation, replace the tabs by spaces (or vice versa), choose the encoding (if the file comes from Windows for example), type end of line (LF, CR, CR / LF). Everything is available in the Document menu.
Function very practical in programming, the column selection of several lines. It is available but works much less well than on Sublime Text. You must position yourself just before the character and hold down the CTRL key. Convenient to increase the indentation of a block.
Geany features like many other software are system plugins. It is stored in Tools -> Plugin Manager. Plugins are very numerous (the complete list here) … except for ARM platforms or there are only 6 available at the moment:
- Registration Actions
- HTML Characters
- Class Creator
- Divide the window
- File Browser
Some plugin functions can be accessed from the Edit -> Plugins Preferences menu. This is the case, for example, with the Registration Actions plugin, which allows you to set up an automatic backup policy. Who has never lost hours of work due to a backup oversight or power outage. This plugin allows to define an automatic backup interval and to make a backup copy on a USB key or a network disk.
Build: run code directly from Geany
Finally last very practical function, direct compilation from the text editor. You do not have to leave Geany to run your code. Let’s take the example of a small python program that displays a simple Hello World text.
print "Hello World from Geany!";
Save the script. Pressing the F8 key calls the compiler. The result of the compilation is directly available at the bottom of the screen in the Compiler tab. We thus directly recover the compilation errors without leaving Geany!
Finally, the F5 key starts the script. After compilation, a Terminal is automatically opened and starts the script.
In the next article, we will use Geany to create HTML interfaces using the language pug (former Jade) for ESP8266 projects with Web Server.
- Install Home Assistant (HASS) on an Orange Pi running under Armbian
- IoT development based on Orange Pi, Arduino (Firmata), Nodejs, Blynk and Johnny-Five
- Blynk + Node.js + Johnny-Five: drive a Pan-Tilt PTZ SG90 kit on Orange Pi with an Arduino / Firmata
- Start programming with Node Js and Johnny-Five: IoT and robotics based on Arduino, Raspberry Pi, Orange Pi
- Orange Pi: test of the OPI.GPIO package for Node-Red (node-red-contrib-opi-gpio)
- Orange Pi (Armbian): replace the GPIO by an Arduino/Firmata, Node-RED and Johnny-Five