• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions

Chapter 1: Getting Started

  • Why Atom?
  • Installing Atom
  • Atom Basics
  • Summary

Chapter 2: Using Atom

  • Atom Packages
  • Moving in Atom
  • Atom Selections
  • Editing and Deleting Text
  • Find and Replace
  • Snippets
  • Autocomplete
  • Folding
  • Panes
  • Pending Pane Items
  • Grammar
  • Version Control in Atom
  • GitHub package
  • Writing in Atom
  • Basic Customization
  • Summary

Chapter 3: Hacking Atom

  • Tools of the Trade
  • The Init File
  • Package: Word Count
  • Package: Modifying Text
  • Package: Active Editor Info
  • Creating a Theme
  • Creating a Grammar
  • Creating a Legacy TextMate Grammar
  • Publishing
  • Iconography
  • Debugging
  • Writing specs
  • Handling URIs
  • Cross-Platform Compatibility
  • Converting from TextMate
  • Hacking on Atom Core
  • Contributing to Official Atom Packages
  • Creating a Fork of a Core Package in atom/atom
  • Maintaining a Fork of a Core Package in atom/atom
  • Summary

Chapter 4: Behind Atom

  • Configuration API
  • Keymaps In-Depth
  • Scoped Settings, Scopes and Scope Descriptors
  • Serialization in Atom
  • Developing Node Modules
  • Interacting With Other Packages Via Services
  • Maintaining Your Packages
  • How Atom Uses Chromium Snapshots
  • Summary

Reference: API

  • AtomEnvironment
  • BufferedNodeProcess
  • BufferedProcess
  • Clipboard
  • Color
  • CommandRegistry
  • CompositeDisposable
  • Config
  • ContextMenuManager
  • Cursor
  • Decoration
  • DeserializerManager
  • Directory
  • DisplayMarker
  • DisplayMarkerLayer
  • Disposable
  • Dock
  • Emitter
  • File
  • GitRepository
  • Grammar
  • GrammarRegistry
  • Gutter
  • HistoryManager
  • KeymapManager
  • LayerDecoration
  • MarkerLayer
  • MenuManager
  • Notification
  • NotificationManager
  • Package
  • PackageManager
  • Pane
  • Panel
  • PathWatcher
  • Point
  • Project
  • Range
  • ScopeDescriptor
  • Selection
  • StyleManager
  • Task
  • TextBuffer
  • TextEditor
  • ThemeManager
  • TooltipManager
  • ViewRegistry
  • Workspace
  • WorkspaceCenter

Appendix A: Resources

  • Glossary

Appendix B: FAQ

  • Is Atom open source?
  • What does Atom cost?
  • What platforms does Atom run on?
  • How can I contribute to Atom?
  • Why does Atom collect usage data?
  • Atom in the cloud?
  • What's the difference between an IDE and an editor?
  • How can I tell if subpixel antialiasing is working?
  • Why is Atom deleting trailing whitespace? Why is there a newline at the end of the file?
  • What does Safe Mode do?
  • I have a question about a specific Atom community package. Where is the best place to ask it?
  • I’m using an international keyboard and keys that use AltGr or Ctrl+Alt aren’t working
  • I’m having a problem with Julia! What do I do?
  • I’m getting an error about a “self-signed certificate”. What do I do?
  • I’m having a problem with PlatformIO! What do I do?
  • How do I make Atom recognize a file with extension X as language Y?
  • How do I make the Welcome screen stop showing up?
  • How do I preview web page changes automatically?
  • How do I accept input from my program or script when using the script package?
  • I am unable to update to the latest version of Atom on macOS. How do I fix this?
  • I’m trying to change my syntax colors from styles.less, but it isn’t working!
  • How do I build or execute code I've written in Atom?
  • How do I uninstall Atom on macOS?
  • macOS Mojave font rendering change
  • Why does macOS say that Atom wants to access my calendar, contacts, photos, etc.?
  • How do I turn on line wrap?
  • The menu bar disappeared, how do I get it back?
  • How do I use a newline in the result of find and replace?
  • What is this line on the right in the editor view?

Appendix C: Shadow DOM

  • Removing Shadow DOM styles

Appendix D: Upgrading to 1.0 APIs

  • Upgrading Your Package
  • Upgrading Your UI Theme Or Package Selectors
  • Upgrading Your Syntax Theme

Appendix E: Atom server-side APIs

  • Atom package server API
  • Atom update server API

  • mac
  • windows
  • linux

AtomEnvironment Essential

Atom global for dealing with packages, themes, menus, and the window.

An instance of this class is always available as the atom global.

Properties

::clipboard

A Clipboard instance

::deserializers

A DeserializerManager instance

::views

A ViewRegistry instance

::notifications

A NotificationManager instance

::config

A Config instance

::keymaps

A KeymapManager instance

::tooltips

A TooltipManager instance

::commands

A CommandRegistry instance

::grammars

A GrammarRegistry instance

::styles

A StyleManager instance

::packages

A PackageManager instance

::themes

A ThemeManager instance

::menu

A MenuManager instance

::contextMenu

A ContextMenuManager instance

::project

A Project instance

::textEditors

A TextEditorRegistry instance

::workspace

A Workspace instance

::history

A HistoryManager instance

Event Subscription

This section only has Extended methods.

Extended Methods

::onDidBeep(callback)

Invoke the given callback whenever ::beep is called.

Argument Description

callback

Function to be called whenever ::beep is called.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

::onWillThrowError(callback)

Invoke the given callback when there is an unhandled error, but before the devtools pop open

Argument Description

callback

Function to be called whenever there is an unhandled error

event

Object

originalError

Object the original error object

message

String the original error object

url

String Url to the file where the error originated.

line

Number

column

Number

preventDefault

Function call this to avoid popping up the dev tools.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

::onDidThrowError(callback)

Invoke the given callback whenever there is an unhandled error.

Argument Description

callback

Function to be called whenever there is an unhandled error

event

Object

originalError

Object the original error object

message

String the original error object

url

String Url to the file where the error originated.

line

Number

column

Number

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

::whenShellEnvironmentLoaded(callback)

Invoke the given callback as soon as the shell environment is loaded (or immediately if it was already loaded).

Argument Description

callback

Function to be called whenever there is an unhandled error

Atom Details

::inDevMode()

Return values

Returns a Boolean that is true if the current window is in development mode.

::inSafeMode()

Return values

Returns a Boolean that is true if the current window is in safe mode.

::inSpecMode()

Return values

Returns a Boolean that is true if the current window is running specs.

::getAppName()

Get the full name of this Atom release (e.g. “Atom”, “Atom Beta”)

Return values

Returns the app name String.

::getVersion()

Get the version of the Atom application.

Return values

Returns the version text String.

::getReleaseChannel()

Gets the release channel of the Atom application.

Return values

Returns the release channel as a String. Will return a specific release channel name like ‘beta’ or ‘nightly’ if one is found in the Atom version or ‘stable’ otherwise.

::isReleasedVersion()

Return values

Returns a Boolean that is true if the current version is an official release.

::getWindowLoadTime()

Get the time taken to completely load the current window.

This time include things like loading and activating packages, creating DOM elements for the editor, and reading the config.

Return values

Returns the Number of milliseconds taken to load the window or null if the window hasn’t finished loading yet.

::getStartupMarkers()

Get the all the markers with the information about startup time.

Return values

Returns an array of timing markers. Each timing is an object with two keys:

  • label: string
  • time: Time since the startTime (in milliseconds).

::getLoadSettings()

Get the load settings for the current window.

Return values

Returns an Object containing all the load setting key/value pairs.

Managing The Atom Window

::open(params)

Open a new Atom window using the given options.

Calling this method without an options parameter will open a prompt to pick a file/folder to open in the new window.

Argument Description

params

An Object with the following keys:

pathsToOpen

An Array of String paths to open.

newWindow

A Boolean, true to always open a new window instead of reusing existing windows depending on the paths to open.

devMode

A Boolean, true to open the window in development mode. Development mode loads the Atom source from the locally cloned repository and also loads all the packages in ~/.atom/dev/packages

safeMode

A Boolean, true to open the window in safe mode. Safe mode prevents all packages installed to ~/.atom/packages from loading.

::close()

Close the current window.

::getSize()

Get the size of current window.

Return values

Returns an Object in the format {width: 1000, height: 700}

::setSize(width, height)

Set the size of current window.

Argument Description

width

The Number of pixels.

height

The Number of pixels.

::getPosition()

Get the position of current window.

Return values

Returns an Object in the format {x: 10, y: 20}

::setPosition(x, y)

Set the position of current window.

Argument Description

x

The Number of pixels.

y

The Number of pixels.

Extended Methods

::pickFolder(callback)

Prompt the user to select one or more folders.

Argument Description

callback

A Function to call once the user has confirmed the selection.

paths

An Array of String paths that the user selected, or null if the user dismissed the dialog.

::getCurrentWindow()

Get the current window

::center()

Move current window to the center of the screen.

::focus()

Focus the current window.

::show()

Show the current window.

::hide()

Hide the current window.

::reload()

Reload the current window.

::restartApplication()

Relaunch the entire application.

::isMaximized()

Return values

Returns a Boolean that is true if the current window is maximized.

::isFullScreen()

Return values

Returns a Boolean that is true if the current window is in full screen mode.

::setFullScreen()

Set the full screen state of the current window.

::toggleFullScreen()

Toggle the full screen state of the current window.

Messaging the User

::beep()

Visually and audibly trigger a beep.

::confirm(options, callback)

A flexible way to open a dialog akin to an alert dialog.

While both async and sync versions are provided, it is recommended to use the async version such that the renderer process is not blocked while the dialog box is open.

The async version accepts the same options as Electron’s dialog.showMessageBox. For convenience, it sets type to 'info' and normalizeAccessKeys to true by default.

If the dialog is closed (via Esc key or X in the top corner) without selecting a button the first button will be clicked unless a “Cancel” or “No” button is provided.

Argument Description

options

An options Object. If the callback argument is also supplied, see the documentation at https://electronjs.org/docs/api/dialog#dialogshowmessageboxbrowserwindow-options-callback for the list of available options. Otherwise, only the following keys are accepted:

message

The String message to display.

detailedMessage

optional

The String detailed message to display.

buttons

optional

Either an Array of Strings or an Object where keys are button names and the values are callback Functions to invoke when clicked.

callback

optional

A Function that will be called with the index of the chosen option. If a callback is supplied, the dialog will be non-blocking. This argument is recommended.

Return values

Returns the chosen button index Number if the buttons option is an array or the return value of the callback if the buttons option is an object. If a callback function is supplied, returns undefined.

Managing the Dev Tools

This section only has Extended methods.

Extended Methods

::openDevTools()

Open the dev tools for the current window.

Return values

Returns a Promise that resolves when the DevTools have been opened.

::toggleDevTools()

Toggle the visibility of the dev tools for the current window.

Return values

Returns a Promise that resolves when the DevTools have been opened or closed.

::executeJavaScriptInDevTools()

Execute code in dev tools.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
  • Contribute!
with by