Top Free Editors for Development and Documentation: Atom

    There are quite a few text editors, as well as development tools, and it is difficult to choose the necessary ones. I propose to get acquainted with the best representatives of this class of programs from among those that are available for Linux OS and are open source.


    Atom seti theme


    The opening of the season, or rather the seasons, is the Atom, due to the completely incredible combination of modern design, flexibility and extensions. However, in the pursuit of features, the developers overlooked a small but important detail due to which there is a lot of inconvenience.


    Installation


    On Habré, they somehow wrote about him in the context of comparing text editors and development tools for Windows, but since then, much water has flowed away and Linux users are not surprised by the fact that a good editor is free.


    Installing the editor is no different than installing any other package from the repositories, but for Gentoo, Atom has not yet stabilized.


    (2:53)$ eix -e atom
    * app-editors/atom
         Доступные версии:      
         (0)    ~1.23.3
         (beta) [M]~1.24.0_beta3
           {test PYTHON_TARGETS="python2_7"}
         Домашняя страница:     https://atom.io
         Описание:              A hackable text editor for the 21st Century

    You can install the unstable option by pre-recording


    app-editors/atom ~amd64

    to file /etc/portage/package.accept_keywords. However, it only allows to install the old version.


    (2:56)$ sudo emerge -av app-editors/atom
    These are the packages that would be merged, in order:
    Calculating dependencies... done!
    ... <зависимые пакеты>
    app-editors/atom-1.23.3::gentoo

    Therefore, I suggest cutting corners a little. Download the last deb file and install it with a command dpkgthat is also available in Gentoo.


    (2:62)$ sudo dpkg --no-force-depends -i atom-amd64.deb

    The command issues a cloud of warnings, but the editor is quietly installed as a result.


    Features of the atomic project


    The short line of the project is the slogan a hackable text editor for the 21st Century . This can be translated as an easily reprogrammable text editor for the 21st century .


    That is what his feature is probably the key. Atom not only has a powerful toolkit for the needs of a technical writer and developer, but also has the ability to change and customize whatever you like.


    You can even change the appearance of the editor, if you know JavaScript, for a large part of Habr's readers it is not a question judging by the tag cloud . In fact, everything is a little different.


    Almost all settings are stored in CSON files and look like this:


    "*":
      core:
        telemetryConsent: "limited"
        themes: [
          "one-dark-ui""base16-tomorrow-light-theme"
        ]
      "exception-reporting":
        userId: "b5dd74b8-b105-47ef-b89b-4e0f21b8d946"

    CSON configs


    If it reminds you JSON, then you are not so far from the truth, this is his cousin, so to speak. Perhaps CSONnot so vigorousmore readable due to the fact that it has fewer parentheses, there is no need to put everything in quotes and escape. For comparison, the same object in two dialects.


    JSON object
    {
      "greatDocumentaries": [
        "earthlings.com",
        "forksoverknives.com",
        "cowspiracy.com"
      ],
      "importantFacts": {
        "emissions": "Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\nGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\nWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\nhttp://www.worldwatch.org/node/6294",
        "milk": "1,000 gallons of water are required to produce 1 gallon of milk.\n“Water trivia facts.” United States Environmental Protection Agency.\nhttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11",
        "more": "http://cowspiracy.com/facts"
      }
    }

    And the same in CSON.


    CSON object
    # Комментарии!!!# Массив без запятых!
    greatDocumentaries: [
        'earthlings.com''forksoverknives.com''cowspiracy.com'
    ]
    # Объект без кавычек!
    importantFacts:
        # Разбивка на несколько строк! Не надо экранировать кавычки!
    emissions: '''
            Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.
            Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”
            WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.
            http://www.worldwatch.org/node/6294
            '''
    milk: '''
            1,000 gallons of water are required to produce 1 gallon of milk.
            “Water trivia facts.” United States Environmental Protection Agency.
            http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11
            '''
    more: 'http://cowspiracy.com/facts'

    Styles are edited through *.lessfile changes . For example, in order to change the type of bar status you need to ~/.atom/styles.lessregister in the file .


    .status-bar {
      color: white;
      background-color: black;
    }

    Atom styles


    By the way, why *.lessinstead *.css? Less is a preprocessor for CSS. However, you can *.lesswrite ordinary CSS styles with peace of mind in the files, the handler perceives both versions equally.


    Key bindings are also edited by editing the CSON file, settings are stored in the file~./atom/keymap.cson


    'atom-text-editor':
      'enter': 'editor:newline'
    'atom-text-editor[mini] input':
      'enter': 'core:confirm'

    This sets the setting for two different key contexts Enter: in the editing mode and in the mode of selecting from several options of the prompt.


    Global settings are set in the file~./atom/config.cson


    Atom global


    In addition, you can set the settings separately for each PL, or a markup language from the same file ~./atom/config.cson. Something can be configured through a graphical interface.


    Atom language-UI


    Unlike global and point settings, the initialization script is ~./atom/init.coffeewritten in CoffeeScript . The screenshot can be seen from 2-4 to cause edit the script: Edit ⇒ Init Script. The code in the initialization script has full access to the Atom API , it can also be written in plain javascript and called ~./atom/init.js.


    Packages and modularity


    No editor is perfect, but if he has a clear API for extensions, then he can be brought closer enough to the ideal. I lacked extensions for editing technical texts:


    • asciidoc-preview
    • wordcount

    and they were installed even without restarting the program.


    packages


    Atom extensions are convenient not only to consume, but also to create. To do this package-generator, in the menu you can call it from Packages ⇒ Package Generator. Calling the extension wizard utility will create a new project's skeletal structure ~/.atom/packages.


    my-package/
    ├─ grammars/
    ├─ keymaps/
    ├─ lib/
    ├─ menus/
    ├─ spec/
    ├─ snippets/
    ├─ styles/
    ├─ index.js
    └─ package.json

    Github


    Another highlight of the editor is that its author sawingNot anybody on GitHub, but GitHub itself. Due to this, Atom is initially integrated with GItHub through the same extension.


    Atom clone


    The list of functions gitavailable through the Git tab :


    • Initialize
    • Clone
    • Branch
    • Stage
    • Discard
    • Commit
    • Amend
    • Push
    • Pull
    • Resolve conflicts
    • View Pull Requests

    The same functions are available through key bindings.


    Actually editor


    Editing code, or technical text in Atom is very convenient, except for one misunderstanding, which I will say in the subtitle of a fly in the ointment. There are all the necessary tools: autocomplete and subdirectory, snippets, syntax checking.


    Auto-complete


    For the necessary habra-authors Markdown there is a preview, syntax highlighting and the creation of tables flying through table+tab.


    | Header One     | Header Two     |
    | :------------- | :------------- |
    | Item One       | Item Two       |

    disadvantages


    The most important of them is the lazy spell-check, alas, it cannot be called otherwise. The spell checker is full of stitches, when it comes to not ordinary language, but ordinary language. For some unknown reason, spelling does not work for the Russian language for Markdown texts, Asciidoc, and other file types. It would seem a small flaw, but because of it it is impossible to use the editor normally.


    There is also a lack of support for R , the same Vim does not have the disadvantages listed, although it is not an “editor of the 21st century”.


    In general, I think Atom is a good and useful editor who will mature to the necessary stage and can become, if not a replacement for Vim, then at least his senior assistant.


    Also popular now: