{"id":2887,"date":"2020-08-09T13:46:48","date_gmt":"2020-08-09T11:46:48","guid":{"rendered":"https:\/\/fodina.de\/?p=2887"},"modified":"2023-01-03T21:47:11","modified_gmt":"2023-01-03T20:47:11","slug":"atom-unter-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/2022.fodina.de\/en\/atom-unter-ubuntu-20-04\/","title":{"rendered":"Atom under Ubuntu 20.04"},"content":{"rendered":"\n<div class=\"wp-block-image\"><a href=\"https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom-1024x1024.png\" data-fancybox=\"\"><figure class=\"alignleft size-large is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom-1024x1024.png\" alt=\"\" class=\"wp-image-2892\" width=\"107\" height=\"107\" srcset=\"https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom.png 1024w, https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom-300x300.png 300w, https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom-150x150.png 150w, https:\/\/2022.fodina.de\/wp-content\/uploads\/2020\/08\/atom-768x768.png 768w\" sizes=\"(max-width: 107px) 100vw, 107px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>I am a loyal soul. But my patience is limited: On <em>Ubuntu 20.04<\/em>, the tips from <em>Eclipse<\/em> are displayed in <em>black on black<\/em>. Hmm. Markdown editors are cumbersome. Oops. And the &#8216;spell-check&#8217; for German-English texts still doesn&#8217;t work. Grrr. So, it is time to conquer new frontiers: everyone is already talking about &#8216;<a href=\"https:\/\/atom.io\">Atom<\/a>&#8216;. Let us give it a try even if &#8211; on <em>Ubuntu 04\/20<\/em> &#8211; we have to circumnavigate some cliffs.<!--more--><\/p>\n\n\n\n<p>First, let&#8217;s specify what Atom has to offer in order to please us:<\/p>\n\n\n<ul>\n<li>Spell checker for German-English texts \u2026<\/li>\n<li>with simultaneous syntax highlighting \u2026<\/li>\n<li>and code completion for Latex, Markdown, HTML PHP, C \/ C ++, Java, bash.<\/li>\n<li>Seamless integration into a mobile laptop work environment.<\/li>\n<li>Good markdown support.<\/li>\n<\/ul>\n<p>Then let&#8217;s install and configure this editor:<\/p>\n\n\n<h2 class=\"wp-block-heading\">The standard Ubuntu method doesn&#8217;t work straight ahead!<\/h2>\n\n\n\n<p>At least since version 20.04, the new snap package format becomes a standard that you can hardly avoid. Many programs &#8211; including &#8216;Atom&#8217; &#8211; are no longer offered as Debian packages but have to be installed via the Ubuntu software center as snap packages. Sometimes, that works &#8211; but sometimes it doesn&#8217;t:<\/p>\n\n\n\n<p>My first installation ran into a trap: After a few days, it was no longer listed. Neither <code>snap list atom<\/code> nor <code>snap list --all<\/code> mentioned &#8216;Atom&#8217; although I could still call the editor. Thus, the package was cut off from all automatic updates. My solution was &#8216;simple&#8217;: I successfully reinstalled &#8216;Atom&#8217; via the Ubuntu Software Center. Then, the editor could be found again, could be removed without leaving any residue using <code>snap remove atom<\/code> (and could be reinstalled)<\/p>\n\n\n\n<p>But &#8211; <a href=\"https:\/\/github.com\/atom\/atom\/issues\/20942\">as described on the internet<\/a> &#8211; 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The .deb detour also fails.<\/h2>\n\n\n\n<p>The official Atom documentation describes <a href=\"https:\/\/flight-manual.atom.io\/getting-started\/sections\/installing-atom\/\">two ways to install &#8216;Atom<\/a>&#8216;. The easier way is to download the .deb package and install it with <code>sudo dpkg -i atom-amd64.deb<\/code>. Unfortunately, that method fails because of unresolved dependencies.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">But at least a complex methods works \u2026<\/h2>\n\n\n\n<p>According to the second method, described by the <a href=\"https:\/\/flight-manual.atom.io\/getting-started\/sections\/installing-atom\/\">Atom documentation<\/a>, you have to download the key, to expand the apt sources and to update the system before you can install the package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1. wget -qO - https:\/\/packagecloud.io\/AtomEditor\/atom\/gpgkey | sudo apt-key add -\n2. sudo sh -c 'echo \"deb &#91;arch=amd64] https:\/\/packagecloud.io\/AtomEditor\/atom\/any\/ any main\" > \/etc\/apt\/sources.list.d\/atom.list'\n3. sudo apt-get update\n4. sudo apt-get install atom<\/code><\/pre>\n\n\n\n<p>By this method you successfully get an editor integrated into the Ubuntu GNOME 3 desktop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u2026 which still requires some additional packages \u2026<\/h2>\n\n\n\n<p>Atom can officially be expanded by packages. The respective interface can be accessed via <code>Edit \/ Preferences \/ Install<\/code> (Linux) or via <code>File \/ Settings \/ Install<\/code> (Windows): In the upper text field one inserts the name of the desired package. Then, the system searches for the appropriate &#8216;index card&#8217;, which offers an <code>install<\/code>-button.<\/p>\n\n\n\n<p>But occasionally, the integrated search does not work. Every call ends with the error <code>i.filter is not a function [object Object]<\/code>. This error is not evoked by Ubuntu, but &#8211; <a href=\"https:\/\/stackoverflow.com\/questions\/63029449\/getting-i-filter-is-not-a-function-in-atom-while-searching-for-a-package\">as the community assumes<\/a> &#8211; by the Atom server.<\/p>\n\n\n\n<p>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 <a href=\"https:\/\/atom.io\/packages\/\">https:\/\/atom.io\/packages\/<\/a>. The readme-file of the respective package often also describes how you can install it manually. Usually, you only have to type in<code>apm install $packagename<\/code> at your console. This command installs the package under <code>.atom\/packages<\/code>. <\/p>\n\n\n\n<p>By this method we can get the extra packages we need:<\/p>\n\n\n\n<ul><li>First, we want to use &#8216;Atom&#8217; as a LaTeX editor. To do this, we have to teach it the LaTeX syntax: <code>apm install language-latex<\/code><\/li><li>Second, we may want to use &#8216;Atom&#8217; as a LaTeX IDE, so we have to make the LaTeX build commands accessible to it <code>apm install latex<\/code><\/li><li>Additionally, &#8216;Atom&#8217; should check our spelling, in German and English texts. We will configure the multilingualism later. But then, &#8216;Atom&#8217; shall not show us every LaTeX command as an error. But simultaneously, it&#8217;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-<\/li><li>After all, we also want to use &#8216;Atom&#8217; 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.<\/li><li>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: <code>apm install markdown-pdf<\/code>. After having restarted Atom, we can configure the package under <code>File\/Settings\/Packages#markdown-pdf<\/code> and can call the conversion by <code>Packages\/Markdown To PDF<\/code>.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u2026 and some adjustments to the configuration:<\/h2>\n\n\n\n<p>&#8216;Atom&#8217; can be configured in two ways: By calling <code>Edit\/Preferences<\/code> (Linux) or <code>File\/Settings\/<\/code> (Windows) you open the configuration dialogues. In the sections <code>#Core<\/code> and <code>#Editor<\/code> you find the general properties you can set. But under <code>Edit\/Preferences\/#Packages<\/code> (Linux) or <code>File\/Settings\/#Packages<\/code> (Windows) you get access to the installed packages and their specific configuration options. <\/p>\n\n\n\n<p>We need both methods:<\/p>\n\n\n\n<ul><li>First, our &#8216;Atom&#8217; 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 &#8230;\/Preferences#Editor.<\/li><li>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.<\/li><li>Furthermore, our &#8216;atom&#8217; should be able to check the spelling in mixed-language texts. For activating such a capacity, we have to configure the package&#8230;\/Preferences\/Package\/spell-check accordingly:<ul><li>We activate Use Locales with a tick.<\/li><li>We insert <code>en-US, de_DE<\/code> in the field <code>Locales<\/code>.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">So, we got what we wanted to get:<\/h2>\n\n\n\n<p>&#8216;Atom&#8217; specifies itself as a <a href=\"https:\/\/atom.io\/\">hackable text editor<\/a>. The network knows <a href=\"https:\/\/www.google.de\/search?q=best&#038;q=atom&#038;q=package\">its best extensions<\/a>. Be inspired by such reviews. The methods to install them are those with which we achieved our goals:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>Feature<\/th><th>Status<\/th><\/tr><\/thead><tbody><tr><td>1.)<\/td><td>Spell checking for multilingual texts<\/td><td>\u2713<\/td><\/tr><tr><td>2.)<\/td><td>Context-sensitive spell checking for programming languages<\/td><td>\u2713<\/td><\/tr><tr><td>3.)<\/td><td>Syntax highlighting for Latex, HTML PHP, C\/C++, Java, bash<\/td><td>\u2713<\/td><\/tr><tr><td>4.)<\/td><td>Code completion for Latex, HTML PHP, C\/C++, Java, bash<\/td><td>\u2713<\/td><\/tr><tr><td>5.)<\/td><td>Integration in a mobile system even for sunny working places<\/td><td>\u2713<\/td><\/tr><tr><td>6.)<\/td><td>Markdown support<\/td><td>\u2713<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">A last confession<\/h2>\n\n\n\n<p>Completely replacing <em>Eclipse<\/em> is impossible and unnecessary. Because no other system supports the development of domain-specific languages in a better way. It&#8217;s a blessing to have <em>XText<\/em> and <em>XTend<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Eigentlich bin ich eine treue Seele. Aber auch meine Geduld ist begrenzt: Die Tipps von Eclipse werden unter Ubuntu 20.04 schwarz auf schwarz angezeigt. Hmm. Markdown-Editoren sind umst\u00e4ndlich. Oopps. Und der &#8216;Spellcheck&#8217; f\u00fcr deutsch-englische Texte geht immer noch nicht. Grrr. Also auf zu neuen Ufern: es reden ja eh alle schon von \u2018Atom\u2019. Geben wir [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[35,40],"translation":{"provider":"WPGlobus","version":"2.12.2","language":"en","enabled_languages":["de","en"],"languages":{"de":{"title":true,"content":true,"excerpt":false},"en":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/posts\/2887"}],"collection":[{"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/comments?post=2887"}],"version-history":[{"count":38,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/posts\/2887\/revisions"}],"predecessor-version":[{"id":4371,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/posts\/2887\/revisions\/4371"}],"wp:attachment":[{"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/media?parent=2887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/categories?post=2887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2022.fodina.de\/en\/wp-json\/wp\/v2\/tags?post=2887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}