mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
commit
28dfbbf04a
@ -1,123 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 reasons to use the Atom text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/atom)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
5 reasons to use the Atom text editor
|
||||
======
|
||||
Atom is a comprehensive environment that can accomplish tasks from basic
|
||||
to complex, for users from beginners to veterans.
|
||||
![Science lab with beakers][1]
|
||||
|
||||
Beautiful open source text editors are pretty common these days, between Adobe’s [Brackets][2], Microsoft’s [VSCode][3], and GitHub’s [Atom][4]. Each of these seem to offer similar experiences: a modern interface, easily installable plugins, and a big brand-name sponsor. And they’re all actually really good. So what sets Atom apart from any other hyper-modern text editor? Or from a classic old editor like [Vim][5] or [Emacs][6]?
|
||||
|
||||
![Atom terminal with white text on dark grey background][7]
|
||||
|
||||
I’ve used lots of text editors, and upon reflection, I have to admit that once you’ve seen one text editor, you’ve basically seen them all. When judging an editor’s efficacy, 80% of the requirements are satisfied as long as it does one thing: edit text. The other 20% are bonus conveniences, extra gizmos, and fanciful features. They’re nice to have but hardly essential.
|
||||
|
||||
I often come back to Atom, though, because, as a user of open source, I have the luxury of using an application just because I can. Here’s what I like about Atom.
|
||||
|
||||
### Beginner-friendly
|
||||
|
||||
One of my favorite things about Atom is that it feels pretty "normal." I can install Atom on anyone’s computer and they’re off and typing in no time. No new keyboard shortcuts to learn, no serious deviations from user interface conventions. If I take a few minutes to show them a few power features of the application, then they're quickly empowered to install new plugins and discover useful features they enjoy.
|
||||
|
||||
It’s just different enough to feel unique but "safe" enough to trick people into believing (and rightly so) they can use it. That’s a hard line to walk, but Atom manages it, and I appreciate it for that.
|
||||
|
||||
### Great extensions
|
||||
|
||||
When most requirements have been filled as soon as you launch the application, a major factor in "selling" an open source text editor is its extensions. My habitual editor is [GNU Emacs][8], which has a mind-boggling array of extensions so versatile that they can provide everything from an email client to a video game. That’s a hard act to top, and to be honest, I’ve yet to see the editor that can. It shows how important extensions can be, though, and Atom has a nice set of plugins.
|
||||
|
||||
There are extensions to add syntax highlighting for languages and formats, to add dynamic linting, and to integrate debuggers, runtime environments, video and music player controls, and much more.
|
||||
You can practically make Atom the control hub for your desktop, so you rarely have to leave it.
|
||||
|
||||
### Language and syntax support
|
||||
|
||||
I’m a documented fan of [Docbook][9]. By extension, I’m a fan of its simplified front-end, Asciidoc. When I evaluate an editor, Docbook schema and Asciidoc support are two of my primary metrics. While XML support is relatively common, integration with a specific schema can be a tall order, and Asciidoc is still relatively obscure. Atom's community provides great support for my favorite formats.
|
||||
|
||||
Of course, I’ve already mentioned that Atom has great extensions in general, but syntax highlighting is an important feature regardless of what language you're typing. Once again, thanks to a vibrant community, the variety of syntax highlighter options in Atom’s package repository is one of the best.
|
||||
|
||||
### Easy theming
|
||||
|
||||
Atom makes generating your own style as easy as styling a website, so if you’re competent with CSS, you can make your own Atom theme. To create your own theme, navigate to the **Package** menu. If you don’t see a **Package** menu, press the **Alt** key first to reveal the top menu bar. In the **Package** menu, hover over **Package Generator** and then select **Generate Atom Syntax Theme**. This opens a new project called _my-theme-syntax_ by default. You can name it whatever you want, but it should end in `-syntax` according to Atom convention.
|
||||
|
||||
In your new theme project, locate these files: `base.less`, `colors.less`, and `syntax-variables.less`. These define how special keywords, and even background and foreground colors, are themed when your syntax is active. Because they all inherit values from a common template, it’s pretty easy to hack on. For example:
|
||||
|
||||
|
||||
```
|
||||
// Syntax styles
|
||||
|
||||
.syntax--comment {
|
||||
color: @light-gray;
|
||||
}
|
||||
|
||||
.syntax--keyword {
|
||||
color: @purple;
|
||||
|
||||
&.syntax--control {
|
||||
color: @purple;
|
||||
}
|
||||
|
||||
&.syntax--operator {
|
||||
color: @syntax-text-color;
|
||||
}
|
||||
|
||||
&.syntax--other.syntax--special-method {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
&.syntax--other.syntax--unit {
|
||||
color: @orange;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The values ending with two dashes, such as `.syntax--keyword`, are objects recognized by a syntax highlighting engine. If you want to develop your customizations further, of course, you can even create your own syntax definitions (although that’s more work than CSS theming). Read all about the ways to hack Atom at [flight-manual.atom.io][10].
|
||||
|
||||
### Flexible workflow
|
||||
|
||||
Atom has lots of features, and only a subset of them are activated by default. This means you get to decide how you prefer to work, whether you activate new extensions and use them to change Atom on a fundamental level, or you just open up Atom’s preferences and make small adjustments. You can use Atom for writing a fiction book or for writing Python code or technical documentation or anything else.
|
||||
|
||||
Even its Git integration doesn’t insist on what you might imagine would be the obvious repository (Github sponsors Atom). It doesn’t have an agenda, and it’s equally useful to everyone, regardless of audience.
|
||||
|
||||
## Installing
|
||||
|
||||
On Linux, Windows, and macOS, you can [install Atom from its website][11].
|
||||
|
||||
Alternately, on Linux, you can install Atom as a Flatpak from [Flathub][12].
|
||||
|
||||
If you want to build Atom yourself, you can also [compile it from its source code on Github][13].
|
||||
|
||||
## Try Atom
|
||||
|
||||
Atom could be your next text editor, notepad, and IDE. It’s easy to use, easy to configure, easy to extend, and it offers a great user experience. Download Atom today, and give it a try.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/atom
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers)
|
||||
[2]: https://opensource.com/article/20/12/brackets
|
||||
[3]: https://opensource.com/article/20/12/%C2%A0https://opensource.com/article/20/6/open-source-alternatives-vs-code
|
||||
[4]: https://opensource.com/article/17/5/atom-text-editor-packages-writers
|
||||
[5]: https://opensource.com/article/20/12/vi-text-editor
|
||||
[6]: https://opensource.com/article/20/12/emacs
|
||||
[7]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png (Atom terminal with white text on dark grey background)
|
||||
[8]: https://opensource.com/article/20/2/who-cares-about-emacs
|
||||
[9]: https://opensource.com/article/17/9/docbook
|
||||
[10]: https://flight-manual.atom.io/
|
||||
[11]: https://atom.io
|
||||
[12]: https://flathub.org/apps/details/io.atom.Atom
|
||||
[13]: https://github.com/atom
|
@ -0,0 +1,122 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 reasons to use the Atom text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/atom)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用 Atom 文本编辑器的 5 个理由
|
||||
======
|
||||
Atom 是一个全面的环境,可以完成从基本到复杂的任务,适合从初学者到老用户。
|
||||
![Science lab with beakers][1]
|
||||
|
||||
现在漂亮的开源文本编辑器很常见,有 Adobe 的 [Brackets][2]、微软的 [VSCode][3] 和 GitHub 的 [Atom][4]。这些似乎都提供了类似的体验:现代化的界面、易于安装的插件,以及一个大品牌赞助商。而且它们其实都很不错。那么是什么让 Atom 与其他超现代的文本编辑器不同呢?或与经典的老式编辑器如 [Vim][5] 或 [Emacs][6] 有所不同?
|
||||
|
||||
![Atom terminal with white text on dark grey background][7]
|
||||
|
||||
我用过很多文本编辑器,并且经过反思,我不得不承认,只要你见过一个文本编辑器,基本上就见过所有的文本编辑器。在判断一个编辑器的功效时,只要它能做一件事:编辑文字,就能满足 80% 的要求。另外的 20% 则是额外的便利、额外的小玩意和花哨的功能。它们是很好的东西,但几乎不是必不可少的。
|
||||
|
||||
不过我经常回到 Atom,因为作为一个开源的用户,我可以奢侈地使用一个应用,只是因为我可以。以下是我喜欢 Atom 的原因。
|
||||
|
||||
### 新手友好
|
||||
|
||||
我最喜欢 Atom 的一点是,它让人感觉很“普通”。我可以把 Atom 安装在任何人的电脑上,他们很快就可以开始打字。没有新的键盘快捷键需要学习,没有严重偏离用户界面的惯例。如果我花几分钟时间向他们展示一些应用的强大功能,那么他们很快就会有能力安装新的插件,发现他们喜欢的有用功能。
|
||||
|
||||
它只是足够不同,让人觉得独特,但又足够“安全”让人马上相信他们可以使用它。这是一条很难走的路线,但 Atom 做到了,我很欣赏它。
|
||||
|
||||
### 强大的扩展
|
||||
|
||||
当你启动应用就已经满足了大多数需求时,“推销”一个开源文本编辑器的一个主要因素就是它的扩展。我习惯使用的编辑器是 [GNU Emacs][8],它的扩展功能多到令人瞠目结舌,可以提供从电子邮件客户端到视频游戏的所有功能。这是一个很难超越的行为,说实话,我还没有看到能做到的编辑器。不过这说明了扩展是多么重要,Atom 有一套不错的插件。
|
||||
|
||||
有一些扩展可以为语言和格式添加语法高亮、添加动态层叠、以及集成调试器、运行时环境、视频和音乐播放器控件等等。
|
||||
你几乎可以让 Atom 成为你桌面的控制中心,所以你很少需要离开它。
|
||||
|
||||
### 语言和语法支持
|
||||
|
||||
我是 [Docbook][9] 的忠实粉丝。同时也是它的简化前端 Asciidoc 的粉丝。当我评估一个编辑器时,Docbook 模式和 Asciidoc 支持是我的两个主要指标。虽然 XML 支持比较常见,但与特定模式的集成可能是一个高难度的任务,而且 Asciidoc 还比较晦涩。Atom 的社区为我最喜欢的格式提供了很好的支持。
|
||||
|
||||
当然,我已经提到了 Atom 一般来说有很好的扩展,但无论你在输入什么语言,语法高亮都是一个重要的功能。再次感谢充满活力的社区,在 Atom 的软件包仓库中,语法高亮选项的多样性是最好的之一。
|
||||
|
||||
### 简单定制主题
|
||||
|
||||
Atom 让你生成自己的风格就像设计网站的风格一样简单,所以如果你会使用 CSS,你可以制作你自己的 Atom 主题。要创建你自己的主题,找到 **Package** 菜单。如果你没有看到 **Package** 菜单,先按 **Alt** 键,露出顶部菜单栏。在 **Package** 菜单中,将鼠标悬停在 **Package Generator** 上,然后选择 **Generate Atom Syntax Theme**。这将打开一个新的项目,默认名为 _my-theme-syntax_。你可以把它命名为任何你想要的名字,但根据 Atom 惯例,它应该以 `-syntax` 结尾。
|
||||
|
||||
在你的新主题项目中,找到这些文件。 `base.less`、`colors.less` 和 `syntax-variables.less`。这些文件定义了当你的语法激活时,特殊的关键字,甚至是背景和前景的颜色是如何显示的。因为它们都是从一个通用模板中继承的值,所以很容易修改。比如说:
|
||||
|
||||
|
||||
```
|
||||
// Syntax styles
|
||||
|
||||
.syntax--comment {
|
||||
color: @light-gray;
|
||||
}
|
||||
|
||||
.syntax--keyword {
|
||||
color: @purple;
|
||||
|
||||
&.syntax--control {
|
||||
color: @purple;
|
||||
}
|
||||
|
||||
&.syntax--operator {
|
||||
color: @syntax-text-color;
|
||||
}
|
||||
|
||||
&.syntax--other.syntax--special-method {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
&.syntax--other.syntax--unit {
|
||||
color: @orange;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
以两个破折号结尾的值,如 `.syntax--keyword`,是语法高亮引擎识别的对象。当然,如果你想进一步开发你的自定义,你甚至可以创建你自己的语法定义(尽管这比 CSS 主题更费劲)。在 [flight-manual.atom.io][10] 阅读所有关于修改 Atom 的方法。
|
||||
|
||||
### 灵活的工作流
|
||||
|
||||
Atom 有很多功能,只有其中的一个子集是默认激活的。这意味着你可以决定你喜欢的工作方式,是激活新的扩展并使用它们从根本上改变 Atom,还是只打开 Atom 的偏好并进行小的调整。你可以用 Atom 来写一本小说书,也可以用它来写 Python 代码或技术文档或其他任何东西。
|
||||
|
||||
即使是它的 Git 集成也没有坚持你可能会想到的显而易见的仓库(Github 赞助了 Atom)。它没有任何限制,而且它对每个人都同样有用,不管受众是谁。
|
||||
|
||||
## 安装
|
||||
|
||||
在 Linux、Windows 和 macOS 上,你可以[从它的网站安装 Atom][11]。
|
||||
|
||||
另外,在 Linux 上,你可以从 [Flathub][12] 中,以 Flatpak 安装 Atom。
|
||||
|
||||
如果你想自己构建 Atom,你也可以[从 Github 上的源码编译它][13]。
|
||||
|
||||
## 尝试 Atom
|
||||
|
||||
Atom 可以成为你的下一个文本编辑器、记事本和 IDE。它易于使用、易于配置、易于扩展,并提供了良好的用户体验。今天就下载 Atom,试试吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/atom
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers)
|
||||
[2]: https://opensource.com/article/20/12/brackets
|
||||
[3]: https://opensource.com/article/20/12/%C2%A0https://opensource.com/article/20/6/open-source-alternatives-vs-code
|
||||
[4]: https://opensource.com/article/17/5/atom-text-editor-packages-writers
|
||||
[5]: https://opensource.com/article/20/12/vi-text-editor
|
||||
[6]: https://opensource.com/article/20/12/emacs
|
||||
[7]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png (Atom terminal with white text on dark grey background)
|
||||
[8]: https://opensource.com/article/20/2/who-cares-about-emacs
|
||||
[9]: https://opensource.com/article/17/9/docbook
|
||||
[10]: https://flight-manual.atom.io/
|
||||
[11]: https://atom.io
|
||||
[12]: https://flathub.org/apps/details/io.atom.Atom
|
||||
[13]: https://github.com/atom
|
Loading…
Reference in New Issue
Block a user