Our 15 Favourite Atom Tips

Posted on - Last Modified on

Atom has become an extremely well known source code editor that was released by GitHub, back in 2014. It is so useful in its functionality because the framework enables cross-platform application.

The number of users continues to grow and the open source software supports well over a million users every single month and has been downloaded nearly 16 million times! The framework continues to evolve placing it at the forefront of code editing.

This article shows how you can get the best out of Atom. We provide our 15 favourite Atom tips that will help you increase your efficiency and progress your Atom skills at a rate of knots. Also, for those advanced Atom users here is a complete list of popular Atom shortcuts.

 

1. Learn to say no to the mouse

If you can master Atom without the use of the mouse, you can take your competency to a whole new level. Atom is created in such a way that you can utilize the framework exceptionally well with only the use of keyboard shortcuts (many included in this article). Learn to say no to the mouse and watch your Atom skill and efficiency take off!  

This discussion board adds thoughtful insight of different Atom users getting used to working the code editor without using the mouse. To discover available shortcuts use the command palette Cmd + Shift + P (Mac), or Ctrl + Shift + P (Windows/Linux).

 

2. A duplicate line

As described above, there are several keyboard shortcuts that can make your life on Atom remarkably simple. None are more important than the keyboard shortcut for a duplicate line.

A duplicate line lets users to situate their cursor at any point on a line of code and have it duplicated. Furthermore, it is possible to duplicate several lines at one time by highlighting all the lines or using multiple cursors (see tip #9).

To enable a duplicate line on a Mac: Cmd + Shift + D 

For Windows/Linux: Ctrl + Shift + D

 

3. Move the current line above or below

From time to time, you may have to move a line of code above or below where it is currently stationed. This keyboard shortcut is another great asset, particularly when used in association with the duplicate line function. It allows you to manipulate your code without having to re-write it or copy it.

To move the current line on a Mac: Cmd + Ctrl + Up/Down Arrow

For Windows/Linux: Ctrl + Up/Down Arrow

 

4. Choose the next matching characters

This keyboard shortcut is an ingenious way to choose the next matching characters in relation to those highlighted. As with many of the shortcuts, it removes any unnecessary duplication in writing code. It is a great tool if you only need to change a couple of values across multiple lines.

To select the next matching characters on a Mac: Cmd + D

For Windows/Linux: Ctrl + D

 

5. Unselect the next matching characters

If you select too many values you can also unselect the most recent characters that you highlighted without having to start all over again.

To unselect the next matching characters on a Mac: Cmd + U

For Windows/Linux: Ctrl + U

 

6. Choose all matching characters

Occasionally you may find yourself in the situation where you want to edit large chunks of text in the document. Instead of having to select the next matching character for each item, this shortcut allows you to choose everything that matches what you have selected. It is a great tool for limiting the time spent on filling out repeat code.

However, do be careful that you do not select too much at one time as it will compromise Atom’s operating speed.

To select all matching characters on a Mac: Cmd + Ctrl + G

For Windows/Linux: Alt + F3

 

7. Switch on/off Toggle comments

This is a great keyboard shortcut that applicably comments out the line(s) with the right syntax labels for the language you are using. You may find situations where you wish to comment out a particular line or lines and this is a great time saver.

To toggle comments on/off on a Mac: Cmd + /

For Windows/Linux: Ctrl + /

 

8. Locate any File

Atom has awesome locate features, which have the ability to search through multiple layers of files at once.

A quick way to look for a file in your current project is by using Cmd + P (Mac), or Ctrl + P (Windows/Linux). Using this function does away with the cumbersome file tree and you can locate your file using the list or search box available.

 

9. Compound Cursors

The ability to have several cursors operating at once is one of the most admirable features of Atom. Quite simply, several cursors allow you to increase your efficiency by writing several things at once.

If you are operating Windows or Linux hold down Ctrl and click in each place you wish to type. Alternatively, if you are operating in Mac, hold down the Cmd key to achieve the same result.

A great way to align to the same position above or below is using Ctrl+Shift+Up/Down, just be careful that this function is not already utilized in some other capacity, especially for Mac users.

 

10. Allow pending panes

This is one of the more simple Atom hacks that can save you a lot of time. Make sure you turn on Allow Pending Pane Items. Otherwise, if it is not turned on it will create a nuisance by opening a new pane every single time you click on a file. The end result is that you end up with a whole clustered mess of opened tabs on your screen that can be avoided.

To turn on Allow Pending Pane Items you will find it under Settings > Preferences as one of the general settings. The use of italics identifies the pending pane tabs.

 

11. Auto Indent

Indentations are crucial for maintaining a semblance of organisation to your coding. Atom has some neat tools that ensure that your indentation remains consistent.

Check out and download the package here that will allow you to auto indent your current file.

 

12. Show Invisibles

Showing invisibles is another great tool that ensures that your document remains organised and efficient with the appropriate indentation.  You can enable invisibles in your editor.

On a mac this is achievable by: Atom> Preferences > Show Invisibles.

Alternatively, for Windows/Linux: File > Preferences > Show Invisibles.

From the outset, the invisibles may give the appearance of too much happening on the screen. However, if you persevere you will get used to the new characters and they will provide an increased sense of order to your coding:

  • An ellipse ( . . . ) displays space indentation.
  • Double arrows (>>) for tab; and
  • The use of (¨) for new line characters.

 

13. Soft wrap

Using soft wrap in Atom ensures that no text drops off the end of the screen. Disappearing code can be a great hindrance and your structure and adeptness can suffer if it is not always visible. Soft wrap, as the name suggest, wraps around the line to ensure everything is visible.

To permit soft wrap on a mac scroll down to: Atom> Preferences > Soft Wrap.

Otherwise, for Windows/Linux scroll down to: File > Preferences > Soft Wrap.

 

14. Character case conversion

Occasionally you may find that the text you using is incorrectly cased. Upper case text does have its place but it can also often give the impression as though you are being shouted at.

Under the Edit > Text menu you can choose to control how the characters appear by employing either the Upper Case or Lower Case function.

 

15. Adjust your Packages

Packages provide one of the most persuasive arguments as to why you should choose Atom. Atom is constructed on an assembly of packages and they give the user the capability to manipulate just about anything found in the code editor.

The best way to approach packages is to have them all installed and turned on and then systematically turn off the ones that you are categorically not going to use. You can start off by turning off the Welcome, About and Background, and the Wrap-guide package, which is quite unnecessary.

Take a little time to explore which packages you use frequently and investigate them further, as you may find options that are extremely advantageous to you.

These packages are definitely worth exploring, if you haven’t already:

 

This article will help you get the most out of Atom. What shortcuts do you use regularly? And which tips would you recommend to users getting to grips with the Atom Framework? Add to the discussion below.

Posted 3 July, 2017

dunjajanjic

Copywriter, Content Writer, Proofreader, Marketer.

Dunja is the Content & Email Manager at Freelancer HQ (Sydney). She is an Oxford graduate, and is the mother of a pet parrot called DJ Bobo.

Next Article

9 Cool Things You Can Do With CSS Functions