Must-Read Tips For Getting The Most Out Of Atom

Alexander Paterson
|
Posted about 1 year ago
|
7 minutes
Must-Read Tips For Getting The Most Out Of Atom
Essential packages and keyboard shortcuts

Atom is a powerful text-editor with a rich ecosystem of extensions, and a lot of handy in-built features you may not be aware of. This article includes my top tips for getting the most out of Atom.

Snippets

If you're not using snippets: start using snippets -- they will save you hours (cumulatively).

Atom Snippets

React components and unit tests are two examples of often repetitive code; you can save hundreds of lines by taking advantage of snippets. If you get good enough you'll even start using snippets for things like import and require statements.

Don't go and install a package of pre-configured snippets; make your own or you won't use them. Atom makes it inexcusably convenient.

Keyboard Shortcuts

I've wanted to write about this for a while. Atom has a lot of really neat keyboard shortcuts, but it took me a bad amount of time to figure them out and start using them. There's a trick to this however: there's basically a cheatsheet under the menu item Edit > Lines.

Atom Keyboard Shortcuts

If, when you're writing code, you're still reaching for your mouse/touchpad to navigate: you're doing it wrong, and potentially not working as efficiently as you could be.

Using the Duplicate/Delete Line and Move Line Up/Down shortcuts will make you look very much like somebody who's been doing this for a while. Practise these.

If you need to go to the start or end of a file use ⌘↑ or ⌘↓. If you want to select one half of a file delineated by your cursor use ⌘↑ to get everything up to your cursor, or ⌘↓ to get everything after. These shortcuts appear under Selection:

Atom Selection Shortcuts

Select Line is a useful one. You should be familiar with moving your cursor around with combinations of alt/command and arrow keys, and a lot of the effects listed above can actually just be achieved by doing that. For example "Select to Beginning of Word" can be done with ⇧←.

Fuzzy Finder

One reason to reach for your mouse might be to open up a file, but stop! Hit T instead to open up the fuzzy finder, and scroll through that menu with your arrow keys.

Atom Fuzzy Finder

This really is a good habit to get into.

Packages

Seemingly taking queues from node package manager, installing Atom packages is easy with the simple command apm install <name> or with the in-app package browser.

remember-folds

This one really saved me a lot of time while writing unit tests. Hundreds of lines of repetitive and highly indented code can become pretty difficult to navigate, and code-folding is one way to mitigate this. However, Atom doesn't remember code folds when you close and re-open a file, so this package was created to fix that.

git-time-machine

With git-time-machine installed, simply hitting ⎇T splits your workspace down the middle, and launches an unobtrusive timeline for opening up past versions of your file. It's super-neat, and actually works well while looking good.

Git Time Machine Usage

wakatime

Wakatime is more than an Atom package, it's a web application that keeps track of your coding habits, with plugins for basically any text editor you can think of. Here's a screenshot from my wakatime web dashboard:

Wakatime Dashboard

Just to be clear: that gross underestimation of the amount of screentime I've had this week is due to the fact that I don't have the Wakatime Xcode plugin installed and I had it disabled in Atom for some reason. 

It even keeps track of which particular project you're working on, and for how long. I can imagine people having reservations about using this though (maybe it's too soon after Snowden).

minimap

Long file? No problem. minimap does what its says on the box by giving you a pretty overview of the file in the top right of your window.

Atom Minimap

color-picker

Another simple yet essential package: just think of the possiblities with this one. color-picker is a gorgeous-looking package that just works. 

Atom Color Picker Package

git-plus

I most frequently open terminal sessions to deal with git; that was my preferred method before I discovered this package. git-plus means you're only a keyboard shortcut (H) away from doing whatever source-control stuff.

git-plus Atom Package



ALEXANDER
PATERSON