A powerful IDE for Gnome
The Right Stuff
This integrated development environment for Gnome offers several features gedit lacks.
Have you ever tried to knock a nail into a wall with a screwdriver or drill a hole with a saw? Of course not: You know to use the right tool. Then why would you use Gnome's gedit as your integrated development environment (IDE)?
When it comes to global searching, Git integration, and an integrated terminal, Gnome Builder is the right tool for programming in a Gnome environment. Gnome Builder emerged from a crowdfunding campaign [1] in 2015, but many developers still don't have it in their toolbox. Gnome Builder 3.34, released with Gnome 3.34, deserves its turn in the spotlight [2].
You can launch Gnome Builder directly from the application menu (see the "Installation" box); it starts up with a wizard that opens the last project you used or clones known Gnome applications like calendars, files, or photos (Figure 1). Alternatively you can start a new project by clicking on Start New Project… or clone any other project on the computer by selecting Clone Repository…. After importing, the system automatically offers to download the software development kits (SDKs) required to build your project.
Installation
Every distribution maintained by Gnome in its package sources should also contain Gnome Builder. The installation for Debian, Ubuntu, or Linux Mint is handled directly with the graphical package manager or via:
sudo apt install gnome-builder
On Fedora, use:
sudo dnf install gnome-builder
Arch Linux also includes Gnome Builder in its package sources.
However, the major distributions tend to lag behind when it comes to the Gnome Builder version. An update to the current version 3.34 is only available if you update the distribution, too. Ubuntu, for example, delivers Gnome 3.34 with Ubuntu 19.10 "Eoan Ermine." However, at the time of writing this article, Gnome Builder 3.32 is the current version found in Eoan Ermine's package sources.
Optionally, you can install Gnome Builder 3.34 independent of your distribution choice using a Flatpak, which you can pick up from Flathub [3]. On a test system with Ubuntu 19.04, the installation worked in this constellation without any complications. However, you need to prepare the system for installing Flatpaks following the instructions from the Flatpak website [4].
Operation
In the sidebar to the left of the main window under Project Tree, you will find Version Control, Build Targets, Unit Tests, and Files. If you double-click on one of the source code files, Builder opens its contents as a page in the main window to the right (Figure 2). Pages are files opened in parallel by Builder. All of the currently active pages appear above the address tree under Open Pages. By clicking on one of the entries, using the left and right arrows next to the file name in the editor area, or pressing Alt+Ctrl+Page-Up/Page-Down, you can quickly toggle between the pages.
You can use the toolbar buttons top right to switch between Editor and Profiler mode (more on this later) or select Build Preferences, which takes you to a menu where you can create new files or open additional windows and terminals. The next two buttons to the right open and close the sidebar and footer. For example, Builder can output the build log in the lower area of the application window or display an integrated terminal window.
In the middle of the toolbar, Builder displays a field with the name of the current project; clicking on this field displays the project's details. Clicking on the brick wall icon lets you build the current project; clicking on the Play button next to it executes the project. Gnome Builder reports any errors or problems in the build output in the footer. The search field at the right edge of the toolbar not only searches in the currently active source code file, but also automatically returns matches from all of the project files. In the hamburger menu, you can start new projects or open the Preferences.
Gnome Builder covers an IDE's most important functions. Builder becomes really interesting when you start to customize the workspace. Take a look at the bar at the top of the editor area, for example. Next to the arrows for toggling the page, you will find the name of the opened file, a jump function that automatically sends the cursor to a selected function, and the line number currently being edited. Below the icon with the down arrow, you'll find a menu for configuring the workspace.
Flexible User Interface
The Open in New Frame option splits the workspace vertically into two (or more) sections. In the default setting, Builder displays the contents of the currently open page (that is, the file currently being edited) in parallel. Changes in one section automatically appear in the other. In addition, the Split option can be used to split the currently active frame horizontally (Figure 3).
Gnome Builder supports simultaneous editing of code or text at multiple locations in the currently opened file. Simply left-click on the desired positions while holding down Ctrl. Everything you then type will appear at the selected locations.
All the windows always display the same content. This means that you can make changes to several parts of a program file in parallel without having to scroll through the window. If you work with multiple monitors, you can use the Open in New Workspace option to open another code window and move it onto the second screen.
To help optimize your program's performance or find errors, Builder integrates Sysprof, a system-wide profiler for Linux [5]. To do this, instead of starting your program directly via the Play button, use the drop-down menu next to the button and select the Run with Profiler option.
When you do this, Builder requests administrative rights and then logs the system's activities until you either close the application or click Stop Recording in the Builder editor area. The program then automatically opens the recording, from which you can then read the CPU history, the generated network traffic, or stack traces and counters over time (Figure 4).
Editing Text
You don't have to be a Gnome developer to use Builder. For people who want to work on plain old text or Markdown files, the program includes a powerful search function, as well as an integrated spellchecker. You can start searching by pressing Ctrl+F. Pressing the button next to the up and down arrows expands the search dialog and gives you a Replace option. The button on the far right adds options for regular expressions, uppercase and lowercase, and restricting the search to whole words. Pressing the Esc button closes the dialog again.
The spellchecker can be accessed by clicking in the text and selecting the spellchecker option in the context menu. As is usual with other text editors, Builder will immediately highlight misspelled words or expressions that are not in the dictionary with a red underscore. It also displays a sidebar on the right side of the screen, where you can go through the text word by word. You can correct or ignore each unknown word individually, with Builder usually providing helpful suggestions (Figure 5).
Optionally, you can select Highlighting | Spellchecking in the context menu of the editor window to easily highlight spelling mistakes.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.