atom 流程图
Atom is the code editor released and maintained by the GitHub team. Released in 2014, the “Sublime Text killer” has over 1.1 million monthly users, and it’s no surprise: easily expandable, customizable and hackable, the IDE has become the favorite of many developers.
Atom是由GitHub团队发布和维护的代码编辑器。 “ Sublime Text Killer”于2014年发布, 每月有110万以上的用户 ,这并不奇怪:IDE易于扩展,可定制和可入侵,已成为许多开发人员的最爱。
Despite its wide use, I often see competent developers taking the long way around to do things, or not knowing about its true potential. This post explores some tricks for improving your Atom workflow. I’m hoping that, by the time you’ve finished, you’ll have learned at least one new trick you can’t live without.
尽管用途广泛,但我经常看到有能力的开发人员花很长的时间做事情,或者不知道其真正的潜力。 这篇文章探讨了一些改善Atom工作流程的技巧。 我希望,当您完成学习时,您将学到至少一种新的技巧,您不能没有这种技巧。
Note: Although this post is for Atom users, a lot of these tips and shortcuts also work in Sublime Text.
注意:尽管这篇文章是针对Atom用户的,但是其中许多技巧和捷径也可以在Sublime Text中使用。
提示 (Tips)
The first stop is some general Atom tips. There are options you can enable, features the IDE has, and menu settings you never knew existed. It’s worth having a look through all the menu options — as you might spot something you never knew was there!
第一站是一些一般性的Atom技巧。 您可以启用一些选项,IDE具有的功能以及您从未知道过的菜单设置。 值得一看所有菜单选项-因为您可能会发现自己不知道的东西!
多个游标 (Multiple Cursors)
One of the most impressive features of Atom is its multiple cursor support. This enables to you type many things at once, on multiple lines, anywhere in the document. Just hold cmd (Mac) or ctrl (Windows/Linux) and click in every place you want to type. There are also other ways to get multiple cursors — but we’ll cover them later with keyboard shortcuts.
Atom最令人印象深刻的功能之一就是其对多光标的支持。 这使您可以一次多行地在文档中的任何位置键入许多内容。 只需按住cmd (Mac)或ctrl (Windows / Linux),然后在要键入的每个位置单击即可。 还有其他获取多个光标的方法-但我们稍后将通过键盘快捷键进行介绍。
自动缩进 (Auto Indent)
One annoyance I have is when I copy code from somewhere and the indentation is all over the place. Luckily, Atom has you covered. Select the code and head to Edit > Lines > Auto Indent. This should copy the current indentation on the file to correct your code.
我的烦恼是当我从某个地方复制代码时,缩进到处都是。 幸运的是,Atom已覆盖您。 选择代码,然后转到编辑>行>自动缩进 。 这应该将当前缩进复制到文件上以更正您的代码。
To speed this up, I created a custom keyboard shortcut, enabling me to use Ctrl + Cmd + ] at any point. (On Windows, I would opt for Ctrl + } — which is Ctrl + Shift + ] — as Ctrl + Alt + ] is already taken.)
为了加快速度,我创建了一个自定义键盘快捷键,使我可以随时使用Ctrl + Cmd +] 。 (在Windows上,我会选择Ctrl +} (即Ctrl + Shift +] -因为已经使用了Ctrl + Alt +] 。)
To do the same yourself, go to Atom > Keymap (Mac) or File > Settings > Keybindings > Keymap (Windows/Linux) and paste the following for Mac:
要自己执行相同的操作,请转到Atom>键盘映射 (Mac)或文件>设置>键盘绑定>键盘映射 (Windows / Linux),然后将以下内容粘贴到Mac:
'atom-text-editor':
'ctrl-cmd-]': 'editor:auto-indent'
or this for Windows/Linux:
或对于Windows / Linux:
'atom-text-editor':
'ctrl-}': 'editor:auto-indent'
显示不可见 (Show invisibles)
To make sure the document and all lines are using the correct indentation, I’ve enabled invisibles in my editor. This shows ···
for space indentation, »
for tab and ¬
for new line characters. This helps you see exactly where you have mixed tabs and empty news filled with spaces.
为了确保文档和所有行都使用正确的缩进,我在编辑器中启用了invisibles 。 这说明···
空间缩进, »
用于标签和¬
新行字符。 这可以帮助您准确查看混合标签和空白新闻填充位置。
Although it makes your screen feel “busy” to begin with, you soon get used to it, and I now find it invaluable.
尽管一开始它会让您的屏幕感觉“很忙”,但是您很快就会习惯它,我现在发现它非常宝贵。
To do this, go to Atom (Mac) or File (Windows/Linux) > Preferences > (Scroll Down) Show Invisibles.
为此,请转到Atom (Mac)或“ 文件” (Windows / Linux) >“首选项”>(向下滚动)“显示不可见” 。
软包装 (Soft wrap)
I despise having to scroll left and right and up and down, so to make sure there’s only one direction, I’ve enabled soft wrap in Atom. This makes sure nothing goes off the edge of the screen but wraps around. If it has wrapped the line, it indents it to the same level as the previous line and replaces the line number in the gutter with a ·
.
我鄙视必须向左和向右以及上下滚动,因此为了确保只有一个方向,我在Atom中启用了自动换行 。 这样可以确保没有东西掉落在屏幕边缘,而是环绕起来。 如果已将行换行,则将其缩进到与前一行相同的级别,并将装订线中的行号替换为·
。
To enable this option, it’s a few checkboxes down from the Show invisibles option in Atom (Mac) or File (Windows/Linux) > Preferences > (Scroll Down) Soft Wrap.
要启用此选项,需要在Atom (Mac)或“ 文件” (Windows / Linux) >“首选项”>“(向下滚动)”“软包装”中的“ 显示不可见项”选项下选中几个复选框。
字符大小写转换 (Character case convert)
Sometimes you have text that’s in the wrong case. You might want all uppercase, or you may need to convert a SHOUTY SENTENCE to all lowercase. Located in the Edit > Text menu are some clever text manipulation tools, including Upper Case and Lower Case functions.
有时您输入的文字不正确。 您可能需要全部大写,或者可能需要将SHOUTY SENTENCE转换为所有小写。 一些巧妙的文本处理工具位于“ 编辑”>“文本”菜单中,包括大写和小写功能。
配套 (Packages)
Packages are a compelling reason for choosing Atom. The ability to install and change anything and everything is what makes this code editor so great. I’m not about to reel off the best plugins that you must have installed — there are plenty of posts that do that already.
软件包是选择Atom的一个令人信服的理由。 安装和更改所有内容的能力使此代码编辑器变得如此出色。 我不会放弃您必须安装的最好的插件-已经有很多文章做了 。
Instead, I’m going to tell you to install every one that you come across, then uninstall the ones you don’t like (or add too many precious seconds to your start-up time). If you go to Settings > Packages and click on an installed extension, it tells you how many milliseconds it adds to boot-up time.
相反,我将告诉您安装遇到的每个组件,然后卸载不喜欢的组件(或为启动时间增加太多宝贵的时间)。 如果转到“设置”>“软件包” ,然后单击已安装的扩展,它会告诉您它增加了多少毫秒的启动时间。
These are a few packages that I rely on daily and that I haven’t seen listed in many other blog posts:
这些是我每天都依赖的一些软件包,在许多其他博客文章中都没有列出:
键盘快捷键 (Keyboard Shortcuts)
I love keyboard shortcuts. I can’t help but try and learn them all for every program I use. (There are things I do via shortcuts in Photoshop that I wouldn’t have a clue how to do any other way!)
我喜欢键盘快捷键。 对于我使用的每个程序,我禁不住尝试学习它们。 (有些事情我是通过Photoshop中的快捷方式完成的,我根本不知道该怎么做!)
Naturally, you forget the ones you don’t use, whereas the ones you use constantly get engraved in your mind. The ones I’ve listed below I tend to use at least once an hour. They’re lifesavers.
自然,您会忘记不使用的内容,而不断使用的内容会被您铭记在心。 我在下面列出的那些我倾向于每小时至少使用一次。 他们是救生员。
重复行 (Duplicate line)
Cmd + Shift + D (Mac)
Ctrl + Shift + D (Windows/Linux)
If shortcuts got medals, this would be the one to win gold. I use this one constantly. It allows you to place your cursor anywhere on the line and duplicate it.
如果捷径获得了奖牌,那将是赢得金牌的人。 我经常使用这个。 它允许您将光标放在行上的任何位置并复制它。
It’s hugely helpful for duplicating CSS selectors, gradients or table cells. Of course, you can duplicate multiple lines at once, too — either by highlighting them or by using multiple cursors:
对于复制CSS选择器,渐变或表格单元格非常有用。 当然,您也可以一次突出显示多行或使用多个光标来复制多行:
上下移动当前行 (Move the current line Up or Down)
Cmd + Ctrl + Up (or Down) Arrow (Mac)
Ctrl + Up (or Down) Arrow (Windows/Linux)
This keyboard shortcut is great in conjunction with the duplicate line one above. Wherever your cursor is, this shortcut will move the current line above or below the lines around it.
与上面重复的第一行结合使用时,此键盘快捷键非常有用。 无论您的光标在哪里,此快捷方式都会将当前行移动到其周围的行的上方或下方。
If you have selected multiple lines, it will move the whole block (and auto indent) as you move in and out of tags and brackets.
如果选择了多行,则在移入和移出标签和括号时,它将移动整个块(并自动缩进)。
选择下一个匹配的字符 (Select the next matching characters)
Cmd + D (Mac)
Ctrl + D (Windows/Linux)
This command allows you to select the next matching word or characters to that which is highlighted. You can then (using the auto generated multiple cursors) delete, edit or update the highlighted values.
此命令允许您选择与突出显示的单词或字符匹配的下一个单词。 然后,您可以(使用自动生成的多个光标)删除,编辑或更新突出显示的值。
This is particularly helpful if you want to update only a couple of values or properties, without resorting to find and replace.
如果您只想更新几个值或属性,而又不求助于查找和替换,则这特别有用。
取消选择下一个匹配字符 (Unselect the next matching characters)
Cmd + U (Mac)
Ctrl + U (Windows/Linux)
If you’re selecting the next matching characters, sometimes you go too far. This shortcut will unselect the most recently selected characters in reverse order.
如果要选择下一个匹配的字符,有时您会走得太远。 此快捷方式将以相反的顺序取消选择最近选择的字符。
选择所有匹配的字符 (Select all matching characters)
Cmd + Ctrl + G (Mac)
Alt + F3 (Windows/Linux)
Sometimes you want to bulk edit all the matching characters in the document, rather than pressing Cmd/Ctrl + D for every one. This shortcut selects everything that matches what you’ve selected. (Warning: a large selection can seriously slow down Atom!)
有时您想批量编辑文档中所有匹配的字符,而不是对每个字符都按Cmd / Ctrl +D 。 此快捷方式将选择与所选内容匹配的所有内容。 (警告:选择过多会严重降低Atom的速度!)
切换评论(打开和关闭) (Toggle comments (on and off))
Cmd + / (Mac)
Ctrl + / (Windows/Linux)
There may be cases where you want to comment out a line or collections of lines. This shortcut appropriately comments out the current line (or selection of lines) with the correct commenting syntax for whatever language you are in. No longer do you need to remember your <!--
or /*
ever again.
在某些情况下,您可能要注释掉一行或几行。 此快捷方式会根据您所使用的语言使用正确的注释语法适当地注释掉当前行(或行的选择)。您不再需要再次记住您的<!--
或/*
。
结论 (Conclusion)
Atom is amazing, and I’m finding out new things about it every day. However, these are the shortcuts and plugins I use consistently. Do you have any favorites I haven’t covered? Let us know!
Atom很棒,我每天都在寻找有关它的新事物。 但是,这些是我一直使用的快捷方式和插件。 你有我没有提到的最爱吗? 让我们知道!
翻译自: https://www.sitepoint.com/12-favorite-atom-tips-and-shortcuts-to-improve-your-workflow/
atom 流程图