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
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.