/status-bar

Status bar for Atom

Primary LanguageCoffeeScriptMIT LicenseMIT

Status Bar package

Display information about the current editor such as cursor position, file path, grammar, current branch, ahead/behind commit counts, and line diff count.

API

The status bar exposes a atom.workspaceView.statusBar global that exposes an API to add views to the status bar.

You can access it from your package by doing the following:

module.exports =
  activate: ->
    atom.packages.once 'activated', ->
      atom.workspaceView.statusBar?.appendLeft('<span>hi!</span>')

It is important to guard against the atom.workspaceView.statusBar property being null since the status bar package could be disabled or not installed.

The status bar API has 4 methods:

  • appendLeft(view) - Append a view to the left side of the status bar
  • prependLeft(view) - Prepend a view to the left side of the status bar
  • appendRight(view) - Append a view to the right side of the status bar
  • prependRight(view) - Prepend a view to the right side of the status bar

The view parameter to all these methods can be a jQuery selector, Space Pen view, string of HTML, or DOM element.