GitHub's configurable editor
Hacker Kitchen
The Atom code editor from GitHub is a highly configurable free application. Just one year old, even at this early stage, the mix looks very promising.
When GitHub announced Atom [1] in June 2014, many observers sighed: Does the world really need yet another text editor? Well, the makers of GitHub are convinced it does. Sublime Text [2] might be convenient, but it is not genuinely configurable. On the other hand, Emacs and Vi are highly configurable, but not exactly convenient for the uninitiated.
The makers of GitHub know pretty well how the open source world ticks, and they have gotten very few things wrong thus far. Atom is no exception. Vi and Emacs only work as sustainably and well as they do because they are both open and have a large community. Consequently, GitHub plans to be involved long-term with the editor. Atom 1.0 was released on June 25, 2015, under an MIT license, but that does not rule out GitHub offering an enterprise variant of the editor at some time.
Atom Model
Atom is intended to help developers program desktop and web applications across multiple platforms. The software comes with syntax highlighting for various programming languages – from JavaScript, through Perl and Python, up to C, C++, or Java. At the end of the day, Atom is a variant of the Chromium browser, and the windows are no more than locally rendered web pages, from which the content can access the Node.js API.
Atom consists of an easily manageable core (Atom Core), with most other components available as Atom packages managed by the Atom Package Manager (APM). The core and the packages run on the Electron framework [3], which was previously known as the Atom Shell. The Atom Shell takes care of automatic updates, includes a Windows installer, creates crash reports, and delivers notifications. The functions are accessible through JavaScript APIs.
For simplicity's sake, the developers use and recommend CoffeeScript instead of JavaScript for working with Atom and Less as a replacement for CSS. That said, the editor can also be extended to include JavaScript and CSS.
Control Panel
After the installation – which could be somewhat less complex (see the box "Installing Atom") – developers are taken to a graphical interface (Figure 1). It comprises various panes that can be zoomed and rearranged as needed. The individual files in which a developer works are known as "buffers" in Atom-speak.
Installing Atom
Installation on Ubuntu 14.04 with an LXDE desktop involved some overhead, mainly attributable to the Node.js environment that Atom needs. Prebuilt packages exist, but if you want to compile the software yourself, you first need to install the matching files:
sudo apt-get install build-essential git libgnome-keyring-dev fakeroot gconf-service libnss3
The next step is to download the latest version of Node.js, which is available on NodeSource.com [4]:
curl -sL https://deb.nodesource.com/setup | sudo bash -
The command sequence basically fetches a setup script for the current node version and runs it with root privileges. More cautious users will probably want to insert more
after the pipe to watch the script run. The command
sudo apt-get install -y nodejs
installs the latest variant of the framework – if it runs without any complaints.
If the which node
command does not show any results, the binary below /usr/bin/
that Atom is looking for might be named nodejs
instead of node
. The command
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
provides a remedy. The next set of commands clones the Atom repository on GitHub and then checks out the latest Atom release from the atom
directory:
git clone https://github.com/atom/atom cd atom git fetch -p git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
Finally, you need to run the build script and then launch the JavaScript Task Runner Grunt [5] to install the executable atom
file and the apm
package manager in /usr/local/bin
. Incidentally, you can also use Grunt to create a Debian package via script/grunt mkdeb
.
After starting Atom, you find the directory tree for the current project in the left-hand pane. The code belongs in the large field in the middle. Pressing F11 takes you to full-screen mode; Atom opens the settings as additional tabs when you press Ctrl+, (Ctrl+<comma>), or when you select Edit | Preferences.
If you are uncertain how to proceed, you can tell the editor to show all available commands with Ctrl+Shift+P. A useful Flight Manual is also available online [6].
In the Reactor
Although the editor is still a fairly young project, it already comes with a number of useful features. To indent one or multiple lines of code, you select the text and pressing Tab. Shift+Tab moves the block of code to the left.
Auto-completion is also implemented, and the developers promise to expand this in the future. Right now, you can press Ctrl+Space to enable the feature and display alternatives to the element underneath the cursor.
When you access the settings (Ctrl+,) and mark the Soft Wrap checkbox below the Editor Settings section, the editor wraps the line at the end of the screen. Checking Soft Wrap At Preferred Line Length wraps the code after n characters. The line break border is marked by an invisible line; by default the length is 80 characters, but you can change this in the Preferred Line Length text box in the same section.
If you enable the Soft Tabs option, the editor automatically converts tabs to space characters; you can even define the number of space characters in the settings (Tab Length drop-down box).
Folding means hiding blocks of code (e.g., functions, loops) to simplify your view of the code. Folding is accomplished either with the small triangles that appear when mousing over the gutter or with Alt+Ctrl+[(fold) or Alt+Ctrl+] (unfold). The triangles are sometimes difficult to hit, causing the editor to jump suddenly to other snippets of code.
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
-
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.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.