/pinned-tabs-for-atom

A package for the Atom text editor that allows you to pin tabs

Primary LanguageJavaScriptMIT LicenseMIT

Pinned tabs for Atom

Build Status Maintainability

A simple package for the Atom text editor from GitHub that allows you to pin tabs. Inspired by the pin tab feature from Browsers, also supports Visual Studio style pinning.

For the best experience of this package, I recommend using it with the file-icons package.

preview gif


Usage

There are three ways to pin/unpin a tab using this package.

  • Via the context menu of a tab.
  • Via the keyboard shortcut ctrl + alt + p.
  • Via the command-palette, by typing Pin Active.

Installation

Via the Atom Package Manager (APM)

$ apm install pinned-tabs

Or via Git clone

$ cd ~/.atom/packages
$ git clone https://github.com/ericcornelissen/pinned-tabs-for-atom --depth=1

Customization

You can add custom styles for pinned tabs. Use your Stylesheet and target .tab.pinned-tab to tweak a pinned tab. You can consult the package stylesheet to see what classes are used.

Below are a few examples of ways to customize the styling of pinned tabs.

Style the active pinned tab

.tab.pinned-tab.active {
  background-color: salmon;
}

/* Or all non active pinned tabs */
.tab.pinned-tab:not(.active) {
  background-color: olive;
}

Choose your own icon for pinned tabs

.tab.pinned-tab > .title::before {
  content: '\f135';
  font-family: FontAwesome;
  font-size: 18px;
}

If you're using file-icons, you can check out its customization documentation as well.

Change the pin button on tabs

.tab > .pin-icon::before {
  content: '\f015' !important;
}

Change the 'pinned' icon for Visual Studio mode

.tab.pinned-tab > .close-icon::before {
  content: '\f276';
  font-family: FontAwesome;
  font-size: 12px;
}

Style tabs that are not pinned

.tab:not(.pinned-tab):not([data-type="TreeView"]):not([data-type="PanelDock"]):not([data-type="Object"]) {
  opacity: 0.5;
}

Where the different :not([data-type]) exclude tabs elsewhere in Atom.


Copyright © Eric Cornelissen | MIT license