Home >Technology peripherals >It Industry >12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

尊渡假赌尊渡假赌尊渡假赌
尊渡假赌尊渡假赌尊渡假赌Original
2025-02-18 10:56:10186browse

Atom Code Editor Tips: A Practical Guide to Improve Efficiency

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Core points:

  • Atom's multi-cursor support, automatic indentation, and display of invisible characters and soft line breaks can significantly improve encoding efficiency and readability.
  • Atom's package system allows extensive customization and enhancement of the code editor, and recommended packages for daily use include Project Manager, Git Plus, Minimap, and Pigments.
  • Keyboard shortcuts can greatly speed up workflows in Atom. Some of the most commonly used shortcut keys include copying lines, moving lines up and down, selecting and deselecting matching characters, and switching comments.
  • Atom's interface is highly customizable, allowing users to adjust themes, layouts, and panels according to their preferences. Atom also has built-in integration with Git and GitHub, and supports multi-line editing and collaboration with other developers.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Atom is a code editor published and maintained by the GitHub team. The 2014 "Sublime Text Killer" has over 1.1 million monthly active users, and it's no surprise: an IDE that is easy to scale, customize and modify has become a favorite among many developers. Despite Atom's widespread use, I often see experienced developers doing tasks in lengthy ways or not realizing the true potential of Atom. This article explores some tips for improving Atom workflow. I hope that after you finish reading this article, you can learn at least a new technique that you cannot give up. Note: Although this article is for Atom users, many tips and shortcuts are also suitable for Sublime Text.

Techniques

First, introduce some general Atom tips. You can enable some options, use the IDE's capabilities, and menu settings that you never knew existed. It's worth browsing all menu options – you may find some features that you never knew existed!

Multi-cursor

One of the most impressive features of Atom is its multi-cursor support. This allows you to type multiple content at once at multiple locations in the document. Simply hold Cmd (Mac) or Ctrl (Windows/Linux) and click each location you want to type. There are other ways to get multiple cursors – but we'll introduce them later via keyboard shortcuts.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Automatic indentation

Indentation confusion is an annoying issue when copying code from elsewhere. Fortunately, Atom can solve this problem. Select the code and go to Edit > Lines > Auto Indent. This should copy the current indent of the file into your code for correction.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

To speed up, I created a custom keyboard shortcut that allows me to use Ctrl Cmd ] (Mac) or Ctrl } (Windows/Linux) at any time. To do this yourself, go to Atom > Keymap (Mac) or File > Settings > Keybindings > Keymap (Windows/Linux) and paste the following (Mac):

<code>'atom-text-editor':
    'ctrl-cmd-]': 'editor:auto-indent'</code>

or the following (Windows/Linux):

<code>'atom-text-editor':
    'ctrl-}': 'editor:auto-indent'</code>

Show invisible characters

To make sure the document and all lines are using the correct indentation, I enabled the invisible characters in the editor. This will show ··· means space indentation, » means tab character, and ¬ means line break character. This helps you view accurate blank lines that mix tabs and spaces. While it will make your screen look "busy" at first, you will get used to it very quickly and I find it invaluable now. To do this, go to Atom (Mac) or File (Windows/Linux) > Preferences > (scroll down) Show Invisibles.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Soft line break

I don't like scrolling left and right and up and down, so to make sure there is only one direction, I enabled soft line wrap in Atom. This ensures that nothing goes beyond the edge of the screen, but instead surrounds the display. If it has a new line, it indents it to the same level as the previous line and replaces the line number in the slot with ·. To enable this option, go down several check boxes in Atom (Mac) or File (Windows/Linux)> Preferences > (scroll down) Soft Wrap.

Case conversion of characters

Sometimes your text is incorrectly case. You may need all capitalizations, or you may need to convert uppercase sentences to lowercase. In the Edit > Text menu, there are some clever text processing tools, including uppercase and lowercase features.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Bag

The package is a compelling reason to choose Atom. The ability to install and change anything is what makes this code editor so good. I won't list the best plugins you have to install - there are already many articles doing this. Instead, I recommend installing every plugin you encounter and uninstalling the plugin you don't like (or adding too much valuable startup time). If you go to Settings > Packages and click on the installed extension, it will tell you how many milliseconds of startup time it has added. Here are a few packages I rely on every day and are not listed in many other blog posts:

Project Manager
  • Git Plus
  • Minimap
  • Pigments
Keyboard shortcuts

I like keyboard shortcuts. I can't help but try to learn all the shortcuts for each program I use. (I do something I use shortcuts in Photoshop, and I don't know how to do it without using it!) Of course, you will forget the shortcuts you don't use, and the shortcuts you use frequently will be remembered in your heart. I use the shortcut keys listed below at least once an hour. They are saviors.

Copy line

<code>'atom-text-editor':
    'ctrl-cmd-]': 'editor:auto-indent'</code>

If the shortcut key has a medal, this will be one of the gold medals. I often use this shortcut key. It allows you to place the cursor on any row and copy it.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

It is very useful for copying CSS selectors, gradients, or table cells. Of course, you can also copy multiple lines at once—by highlighting them or using multiple cursors:

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Move the current line up and down

<code>'atom-text-editor':
    'ctrl-}': 'editor:auto-indent'</code>

This shortcut key works well with the copy line shortcut key above. No matter where your cursor is, this shortcut moves the current row above or below its surrounding rows.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

If you select multiple rows, it moves the entire block (and automatically indents) as you go in and out of the labels and brackets.

Select the next matching character

<code>Cmd + Shift + D (Mac)
Ctrl + Shift + D (Windows/Linux)</code>

This command allows you to select the next word or character that matches the highlighted word or character. Then (using multiple cursors that are automatically generated), you can delete, edit, or update the highlighted values.

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

This is especially useful if you want to update only a few values ​​or properties without using find and replace.

Deselect the next matching character

<code>Cmd + Ctrl + 上 (或下) 箭头 (Mac)
Ctrl + 上 (或下) 箭头 (Windows/Linux)</code>

If you are selecting the next match character, sometimes you will go too far. This shortcut key will deselect the most recently selected characters in the reverse order .

12 Favorite Atom Tips and Shortcuts to Improve Your Workflow

Select all matching characters

Sometimes you want to batch edit all
<code>Cmd + D (Mac)
Ctrl + D (Windows/Linux)</code>
matched characters in the document, instead of pressing Cmd/Ctrl D for each character. This shortcut selects everything that matches the character you selected. (Warning: A large number of choices can severely slow down the speed of Atom!)

Switch comments (on and close)

<code>'atom-text-editor':
    'ctrl-cmd-]': 'editor:auto-indent'</code>

In some cases, you may want to comment out one or more lines of code. This shortcut comments out the current line (or lines) appropriately using the correct comment syntax of the language you are using. You no longer need to remember your...

(The translation cannot be continued here due to the lack of the ending part of the original text.)

The above is the detailed content of 12 Favorite Atom Tips and Shortcuts to Improve Your Workflow. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn