I am a loyal soul. But my patience is limited. Ubuntu 20.04 displays the tips from Eclipse in black on black. Hmm. Markdown editors are cumbersome. Oops. And the ‘spell-check’ for German-English texts still doesn’t work. Grrr. So, it is time to conquer new frontiers: everyone is already talking about ‘Atom’. Let us give it a try, even if Atom on Ubuntu 04/20 enforces us to circumnavigate some cliffs.
First, let’s specify what Atom has to offer in order to please us:
- Spell checker for German-English texts …
- with simultaneous syntax highlighting …
- and code completion for Latex, Markdown, HTML PHP, C / C ++, Java, bash.
- Seamless integration into a mobile laptop work environment.
- Good markdown support.
Then let’s install and configure this editor:
The standard Ubuntu method doesn’t work straight ahead!
At least since version 20.04, the new snap package format becomes a standard that you can hardly avoid. Many programs — including ‘Atom’ — are no longer offered as Debian packages, but have to be installed via the Ubuntu software center as snap packages. Sometimes, that works — but sometimes it doesn’t:
My first installation ran into a trap. After a few days, I did not find it any longer. Neither
snap list atom nor
snap list --all mentioned ‘Atom’ although I could still call the editor. This unwished modification cuts off the package from all automatic updates. My solution was ‘simple’: I successfully reinstalled ‘Atom’ via the Ubuntu Software Center. Then, the editor could be found again, could be removed without leaving any residue using
snap remove atom (and could be reinstalled)
But — as described on the internet — the version offered by the Ubuntu Software Center behaved ugly: with every call it unavoidably opened two completely useless documents. So I had to rule out this variant: If I wanted to be further annoyed, I could have stayed with Eclipse.
The .deb detour also fails.
The official Atom documentation describes two ways to install ‘Atom’. The easier way is to download the .deb package and install it with
sudo dpkg -i atom-amd64.deb. Unfortunately, that method fails because of unresolved dependencies.
But at least a complex methods works …
According to the second method, described by the Atom documentation, you have to download the key, to expand the apt sources and to update the system before you can install the package:
1. wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add - 2. sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list' 3. sudo apt-get update 4. sudo apt-get install atom
By this method you successfully get an editor integrated into the Ubuntu GNOME 3 desktop.
… which still requires some additional packages …
Officially, you can expand Atom by packages. The respective interface can be accessed via
Edit / Preferences / Install (Linux) or via
File / Settings / Install (Windows): In the upper text field one inserts the name of the desired package. Then, the system searches for the appropriate ‘index card’, which offers an
But occasionally, the integrated search does not work. Every call ends with the error
i.filter is not a function [object Object]. It’s not Ubuntu itself that evokes this error, but — as the community assumes — the Atom server.
In such cases, you reach your goal in a roundabout way: you search for the respective package via Google. Mostly, you will be offered a hit pointing to https://atom.io/packages/. The readme-file of the respective package often also describes how you can install it manually. Usually, you only have to type in
apm install $packagename at your console. This command installs the package under
By this method we can get the extra packages we need:
- First, we want to use ‘Atom’ as a LaTeX editor. To do this, we have to teach it the LaTeX syntax:
apm install language-latex
- Second, we may want to use ‘Atom’ as a LaTeX IDE, so we have to make the LaTeX build commands accessible to it
apm install latex
- Additionally, ‘Atom’ should check our spelling, in German and English texts. We will configure the multilingualism later. But then, ‘Atom’ shall not show us every LaTeX command as an error. But simultaneously, it’s supposed to verify our (LaTeX) code. Hence, we have to teach him that language via linter and its respective sub-modules: apm install linter linter-spell linter-ui-default linter-spell-latex. For the other languages, there is a corresponding command, e.g. apt install linter-
- After all, we also want to use ‘Atom’ while we are working on a sunny terrace. The dark mode makes this extremely difficult. Fortunately, there is a package with which you can quickly switch between light and dark: apm install dark-mode. As usual, you find the respective toggle command under Packages/dark mode.
- Fortunately, we hardly need to do anything for our Markdown activities: Syntax highlighting runs out-of-the-box. And by using the entry Packages/Markdown Preview we can directly view the HTML equivalent. But to convert a file into the PDF format without switching to the shell, we still need a package:
apm install markdown-pdf. After having restarted Atom, we can configure the package under
File/Settings/Packages#markdown-pdfand can call the conversion by
Packages/Markdown To PDF.
… and some adjustments to the configuration:
‘Atom’ can be configured in two ways: By calling
Edit/Preferences (Linux) or
File/Settings/ (Windows) you open the configuration dialogues. In the sections
#Editor you find the general properties you can set. But under
Edit/Preferences/#Packages (Linux) or
File/Settings/#Packages (Windows) you get access to the installed packages and their specific configuration options.
We need both methods:
- First, our ‘Atom’ should apply a soft line wrap, i.e. automatically wrap long text lines without inserting LFs (Linux) or CRs/LFs (Windows) into the text line itself. To activate such a behavior, we set a respective hook under …/Preferences#Editor.
- Additionally, we also specify that the virtual break should not be at the edge of the window, but at the maximum line width by activating Soft Wrap At Preferred Line Length.
- Furthermore, our ‘atom’ should be able to check the spelling in mixed-language texts. For activating such a capacity, we have to configure the package…/Preferences/Package/spell-check accordingly:
- We activate Use Locales with a tick.
- We insert
en-US, de_DEin the field
So, we got what we wanted to get:
|1.)||Spell checking for multilingual texts||✓|
|2.)||Context-sensitive spell checking for programming languages||✓|
|3.)||Syntax highlighting for Latex, HTML PHP, C/C++, Java, bash||✓|
|4.)||Code completion for Latex, HTML PHP, C/C++, Java, bash||✓|
|5.)||Integration in a mobile system even for sunny working places||✓|
A last confession
Completely replacing Eclipse is impossible and unnecessary. Because no other system supports the development of domain-specific languages in a better way. It’s a blessing to have XText and XTend.
And in what way is this …
… part of the overarching topic FOSS ? Well, my professional life is dominated by free software and open source compliance. But sometimes I find more offbeat tools that are still worth sharing — at least with my forgetful future ‘me’. To whom I like to recommend — for example — suitable, advanced editors. Or ancient preparatory work. Or some free music editors for compositoy work. But with some posts, I just want to remind my later ‘me’ of attitudes, points of view, and attitudes. So that I don’t fall behind myself. That’s what it’s about in here too.