Tools

Atom on Ubuntu 20.04

ATOM Logo

I am a loy­al soul. But my patience is lim­it­ed. Ubun­tu 20.04 dis­plays the tips from Eclipse in black on black. Hmm. Mark­down edi­tors are cum­ber­some. Oops. And the ‘spell-check’ for Ger­man-Eng­lish texts still does­n’t work. Grrr. So, it is time to con­quer new fron­tiers: every­one is already talk­ing about ‘Atom’. Let us give it a try, even if Atom on Ubun­tu 04/20 enforces us to cir­cum­nav­i­gate some cliffs.

[ en | de ]

First, let’s spec­i­fy what Atom has to offer in order to please us:

  • Spell check­er for Ger­man-Eng­lish texts …
  • with simul­ta­ne­ous syn­tax high­light­ing …
  • and code com­ple­tion for Latex, Mark­down, HTML PHP, C / C ++, Java, bash.
  • Seam­less inte­gra­tion into a mobile lap­top work envi­ron­ment.
  • Good mark­down sup­port.

Then let’s install and con­fig­ure this edi­tor:

The standard Ubuntu method doesn’t work straight ahead!

At least since ver­sion 20.04, the new snap pack­age for­mat becomes a stan­dard that you can hard­ly avoid. Many pro­grams — includ­ing ‘Atom’ — are no longer offered as Debian pack­ages, but have to be installed via the Ubun­tu soft­ware cen­ter as snap pack­ages. Some­times, that works — but some­times it does­n’t:

My first instal­la­tion ran into a trap. After a few days, I did not find it any longer. Nei­ther snap list atom nor snap list --all men­tioned ‘Atom’ although I could still call the edi­tor. This unwished mod­i­fi­ca­tion cuts off the pack­age from all auto­mat­ic updates. My solu­tion was ‘sim­ple’: I suc­cess­ful­ly rein­stalled ‘Atom’ via the Ubun­tu Soft­ware Cen­ter. Then, the edi­tor could be found again, could be removed with­out leav­ing any residue using snap remove atom (and could be rein­stalled)

But — as described on the inter­net — the ver­sion offered by the Ubun­tu Soft­ware Cen­ter behaved ugly: with every call it unavoid­ably opened two com­plete­ly use­less doc­u­ments. So I had to rule out this vari­ant: If I want­ed to be fur­ther annoyed, I could have stayed with Eclipse.

The .deb detour also fails.

The offi­cial Atom doc­u­men­ta­tion describes two ways to install ‘Atom’. The eas­i­er way is to down­load the .deb pack­age and install it with sudo dpkg -i atom-amd64.deb. Unfor­tu­nate­ly, that method fails because of unre­solved depen­den­cies.

But at least a complex methods works …

Accord­ing to the sec­ond method, described by the Atom doc­u­men­ta­tion, you have to down­load the key, to expand the apt sources and to update the sys­tem before you can install the pack­age:

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 suc­cess­ful­ly get an edi­tor inte­grat­ed into the Ubun­tu GNOME 3 desk­top.

… which still requires some additional packages …

Offi­cial­ly, you can expand Atom by pack­ages. The respec­tive inter­face can be accessed via Edit / Preferences / Install (Lin­ux) or via File / Settings / Install (Win­dows): In the upper text field one inserts the name of the desired pack­age. Then, the sys­tem search­es for the appro­pri­ate ‘index card’, which offers an install-but­ton.

But occa­sion­al­ly, the inte­grat­ed search does not work. Every call ends with the error i.filter is not a function [object Object]. It’s not Ubun­tu itself that evokes this error, but — as the com­mu­ni­ty assumes — the Atom serv­er.

In such cas­es, you reach your goal in a round­about way: you search for the respec­tive pack­age via Google. Most­ly, you will be offered a hit point­ing to https://atom.io/packages/. The readme-file of the respec­tive pack­age often also describes how you can install it man­u­al­ly. Usu­al­ly, you only have to type inapm install $packagename at your con­sole. This com­mand installs the pack­age under .atom/packages.

By this method we can get the extra pack­ages we need:

  • First, we want to use ‘Atom’ as a LaTeX edi­tor. To do this, we have to teach it the LaTeX syn­tax: apm install language-latex
  • Sec­ond, we may want to use ‘Atom’ as a LaTeX IDE, so we have to make the LaTeX build com­mands acces­si­ble to it apm install latex
  • Addi­tion­al­ly, ‘Atom’ should check our spelling, in Ger­man and Eng­lish texts. We will con­fig­ure the mul­ti­lin­gual­ism lat­er. But then, ‘Atom’ shall not show us every LaTeX com­mand as an error. But simul­ta­ne­ous­ly, it’s sup­posed to ver­i­fy our (LaTeX) code. Hence, we have to teach him that lan­guage via lin­ter and its respec­tive sub-mod­ules: apm install lin­ter lin­ter-spell lin­ter-ui-default lin­ter-spell-latex. For the oth­er lan­guages, there is a cor­re­spond­ing com­mand, e.g. apt install lin­ter-
  • After all, we also want to use ‘Atom’ while we are work­ing on a sun­ny ter­race. The dark mode makes this extreme­ly dif­fi­cult. For­tu­nate­ly, there is a pack­age with which you can quick­ly switch between light and dark: apm install dark-mode. As usu­al, you find the respec­tive tog­gle com­mand under Packages/dark mode.
  • For­tu­nate­ly, we hard­ly need to do any­thing for our Mark­down activ­i­ties: Syn­tax high­light­ing runs out-of-the-box. And by using the entry Packages/Markdown Pre­view we can direct­ly view the HTML equiv­a­lent. But to con­vert a file into the PDF for­mat with­out switch­ing to the shell, we still need a pack­age: apm install markdown-pdf. After hav­ing restart­ed Atom, we can con­fig­ure the pack­age under File/Settings/Packages#markdown-pdf and can call the con­ver­sion by Packages/Markdown To PDF.

… and some adjustments to the configuration:

‘Atom’ can be con­fig­ured in two ways: By call­ing Edit/Preferences (Lin­ux) or File/Settings/ (Win­dows) you open the con­fig­u­ra­tion dia­logues. In the sec­tions #Core and #Editor you find the gen­er­al prop­er­ties you can set. But under Edit/Preferences/#Packages (Lin­ux) or File/Settings/#Packages (Win­dows) you get access to the installed pack­ages and their spe­cif­ic con­fig­u­ra­tion options.

We need both meth­ods:

  • First, our ‘Atom’ should apply a soft line wrap, i.e. auto­mat­i­cal­ly wrap long text lines with­out insert­ing LFs (Lin­ux) or CRs/LFs (Win­dows) into the text line itself. To acti­vate such a behav­ior, we set a respec­tive hook under …/Preferences#Editor.
  • Addi­tion­al­ly, we also spec­i­fy that the vir­tu­al break should not be at the edge of the win­dow, but at the max­i­mum line width by acti­vat­ing Soft Wrap At Pre­ferred Line Length.
  • Fur­ther­more, our ‘atom’ should be able to check the spelling in mixed-lan­guage texts. For acti­vat­ing such a capac­i­ty, we have to con­fig­ure the package…/Preferences/Package/spell-check accord­ing­ly:
    • We acti­vate Use Locales with a tick.
    • We insert en-US, de_DE in the field Locales.

So, we got what we wanted to get:

‘Atom’ spec­i­fies itself as a hack­able text edi­tor. The net­work knows its best exten­sions. Such reviews can inspire us. The meth­ods to install them are those with which we achieved our goals:

Fea­tureSta­tus
1.)Spell check­ing for mul­ti­lin­gual texts
2.)Con­text-sen­si­tive spell check­ing for pro­gram­ming lan­guages
3.)Syn­tax high­light­ing for Latex, HTML PHP, C/C++, Java, bash
4.)Code com­ple­tion for Latex, HTML PHP, C/C++, Java, bash
5.)Inte­gra­tion in a mobile sys­tem even for sun­ny work­ing places
6.)Mark­down sup­port

A last confession

Com­plete­ly replac­ing Eclipse is impos­si­ble and unnec­es­sary. Because no oth­er sys­tem sup­ports the devel­op­ment of domain-spe­cif­ic lan­guages in a bet­ter way. It’s a bless­ing to have XText and XTend.


And in what way is this …

… part of the over­ar­ch­ing top­ic FOSS ? Well, my pro­fes­sion­al life is dom­i­nat­ed by free soft­ware and open source com­pli­ance. But some­times I find more off­beat tools that are still worth shar­ing — at least with my for­get­ful future ‘me’. To whom I like to rec­om­mend — for exam­ple — suit­able, advanced edi­tors. Or ancient prepara­to­ry work. Or some free music edi­tors for com­pos­i­toy work. But with some posts, I just want to remind my lat­er ‘me’ of atti­tudes, points of view, and atti­tudes. So that I don’t fall behind myself. That’s what it’s about in here too.


2 Comments on “Atom on Ubuntu 20.04”

  • Peter Mueller

    says:

    Any idea of how to get babel-com­mands-depen­dent spellcheck­ing? That is, the Ger­man doc­u­ment

    Das ist ein langer Satz (engl. \foreignlanguage{USenglish}{sentence}).

    should invoke no spellcheck­er warn­ings, where­as

    Das ist ein langer sen­tence (engl. \foreignlanguage{USenglish}{Satz}).

    should invoke two spellcheck­er warn­ings.

    Reply

  • Karsten Reincke

    says:

    Ok. I see, what you want to get: a con­text sen­si­tive fault mes­sage in between a sen­tence. Does ‘Babel’ offer such a fea­ture in gen­er­al? I have not used ‘Babel’ active­ly. So, unfor­tu­nate­ly, I can’t help you.

    And my solu­tion is indeed much weak­er than that you want to get:

    A) ‘Das ist ein langer Satz (engl. sen­tence)’ only marks the abbre­vi­a­tion ‘engl.’

    B) And in ‘Das ist ein langer sen­tence …’ my solu­tion does not see that
    a)‘sentence’ nor­mal­ly is not a word in a Ger­man sen­tence as well as
    b) it does not see that ‘Satz’ isn’t an Eng­lish word.

    So, if you find a way, to get what your need, please let us know your solu­tion.

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

To top