Atom Text Editor - tdkehoe/blog GitHub Wiki

When someone is looking over your shoulder and you want to impress them with your coding speed, go to http://hackertyper.net/. Start typing furiously and see how fast code appears! Then start chatting without slowing down. Type with one hand while drinking a glass of water!

Alternatively, use the Atom text editor. The editor is rich with keyboard shortcuts, snippets, autocompletes, and other tools to increase your productivity.

Panes

Are you working on index.html and styles.css at the same time? Split your screen into two panes. In the menu, go to

View > Panes > Split Right

You can now open a file in each pane. Note that the menu doesn't show any keyboard shortcuts for opening windows. The documentation says that ⌘-k opens panes but it doesn't work.

To close a window the keyboard shortcut is kill window:

⌘ kw or ⌘ wk (easier to type) command-wk kill window

Preview Panes

Atom can also preview certain file types in a right pane. For example, you can open a readme.md file in a right pane. You can view an image or even preview a website (very small)!

Select the file in the left column of open files and type:

⇪ control M shift-control-m preview file in new pane

Snippets

Snippets are easy. You type a word or a few letters, then the TAB key, and Atom completes your word or phrase. Snippets only work in file types for which you have a language package installed, and your file has been saved with the appropriate suffix. For example, if you open a new file and save it with the name index.html you will get HTML snippets. If you type html TAB, than Atom fills out the html, head, body, etc. tags. (I haven't found an HTML5 snippet with doctype, etc.)

⇪ option S shift-option-s shows available snippets

html populates html, head, body, etc. tags

lorem populates "Lorem ipsum dolor sit amet..."

Autocomplete

control-space autocompletes words, searching your document for words with the same initial letters. Use this to autocomplete your class names, etc.

Folding

To get an overview of your file you can fold elements or blocks of code into single lines. If you move your mouse into the vertical gutter between the line numbers and your code, on the first line of an element you'll see a little v-shaped gray downward arrow. If you click this your code vanishes!

Note that a little icon appears on the right of the line of code. It's a gray oval with three black dots. Click that to make your code reappear.

Screen Shot 2015-04-30 at 2.56.45 PM

Keyboard Shortcuts

There are a zillion keyboard shortcuts. To find them use the Command Palette:

⇪ ⌘ P shift-command-p

The Command Palette show you every command available to you. Look here when you want to learn a new keyboard shortcut or menu item.

Indent and Outdent

⌘ ] command-] indent

⌘ [ command-[ outdent

Comments

⌘ / command-forward_slash comments a line (not a word), toggles off comments too

Select Stuff

⌘ L command-l select a line, repeat to select each line below (double-clicking also selects a line)

⌘ A command-a select all (the entire file line)

⇪ control W shift-control-w select a word (doesn't repeat for following words)

⇪ ← shift-left arrow select character to the left (repeat for preceding characters)

⇪ → shift-right arrow select character to the right (repeat for following characters)

Delete Stuff

??? delete line

option-delete delete to beginning of word

??? delete to end of line

??? delete to end of word

I will post more here as I learn them.

Git Shortcuts

The language-git and status-bar packages should be installed be default. These provide Git support and show Git status in the status bar (the bottom right of the screen).

I will post these here as I learn them.

Uninstalling Atom

If Atom starts crashing, for example, after you install a package, you can do a full uninstall from the terminal. Simply dragging the application to the trash isn't a complete uninstall, there are many more Atom files scattered around your hard drive. Instructions are at the bottom of this discussion: https://discuss.atom.io/t/how-to-completely-uninstall-atom-for-mac/9084. Be sure to use the instructions at the bottom (December 2014), not at the top of the discussion (May 2014).
⚠️ **GitHub.com Fallback** ⚠️