pulsar/docs/getting-started.md
2014-01-21 20:33:53 -07:00

4.2 KiB

Getting Started

Welcome to Atom! This guide provides a quick introduction so you can be productive as quickly as possible. There are also guides which cover configuring, theming, and extending Atom.

The Command Palette

If there's one key-command you remember in Atom, it should be cmd-shift-P. You can always press cmd-shift-P to bring up a list of commands (and key bindings) that are relevant to the currently focused interface element. This is a great way to explore the system and learn key bindings interactively. For information about adding or changing a key binding refer to the customizing key bindings section.

Command Palette

The Basics

Working With Files

Atom windows are scoped to a single directory on disk. If you launch Atom from the command line via the atom command and don't specify a path, Atom opens a window for the current working directory. The current window's directory will be visible as the root of the tree view at the left, and also serve as the context for all file-related operations.

Finding Files

The fastest way to find a file is to use the fuzzy finder. Press cmd-t and begin typing the name of the file you're looking for. If you are looking for a file that is already open press cmd-b to bring up a searchable list of open files.

You can also use the tree view to navigate to a file. To open and focus the the tree view, press ctrl-0. The tree view can be toggled open and closed with cmd-\.

Adding, Moving, Deleting Files

Currently, all file modification is performed via the tree view. Add, move, or delete a file by right-clicking in the tree view and selecting the desired operation from the context menu. You can also perform these operations from the keyboard by selecting a file or directory and using a to add, m to move, and delete to delete.

Searching

Find and Replace

To search within a buffer use cmd-f. To search the entire project use cmd-shift-f.

Navigating By Symbols

To jump to a symbol such as a method definition, press cmd-r. This opens a list of all symbols in the current file, which you can fuzzy filter similarly to cmd-t.

To search for symbols across your project, use cmd-shift-r. First you'll need to make sure you have ctags installed and a tags file generated for your project. Also, if you're editing CoffeeScript, it's a good idea to update your ~/.ctags file to understand the language. Here is a good example.

Split Panes

You can split any editor pane horizontally or vertically by using cmd-k right or cmd-k down. Once you have a split pane, you can move focus between them with cmd-k cmd-right or cmd-k cmd-down. To close a pane, close all its editors with meta-w, then press meta-w one more time to close the pane. You can configure panes to auto-close with empty in the preferences.

Folding

You can fold blocks of code by clicking the arrows that appear when you hover your mouse cursor over the gutter. You can also fold and unfold from the keyboard with alt-cmd-[ and alt-cmd-]. To fold everything, use alt-cmd-shift-{ and to unfold everything use alt-cmd-shift-}. You can also fold at a specific indentation level with cmd-k cmd-N where N is the indentation depth.

Soft-Wrap

If you want to toggle soft wrap, trigger the command from the command palette. Press cmd-shift-P to open the palette, then type "wrap" to find the correct command. By default, lines will wrap based on the size of the editor. If you prefer to wrap at a specific line length, toggle "Wrap at preferred line length" in preferences.

Configuration

Press cmd-, to display the preferences pane. This serves as the primary interface for adjusting config settings, installing packages and changing themes.

For more advanced configuration see the customization guide.