ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Synced​Side​Bar

by TheSpyder ST2/ST3 Top 100

Sublime Text plugin to sync project sidebar (folder view) with currently active file.

Details

  • 2017.01.03.02.30.28
  • github.​com
  • github.​com
  • 5 months ago
  • 1 hour ago
  • 5 years ago

Installs

  • Total 130K
  • Win 70K
  • OS X 41K
  • Linux 19K
May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10
Windows 59 60 80 73 54 54 88 71 71 85 78 51 32 78 80 72 85 70 52 41 62 70 78 94 50 58 41 76 72 74 82 68 69 56 49 80 75 87 62 47 39 59 89 88 98 75
OS X 20 20 35 20 17 23 38 28 28 36 34 12 14 25 39 29 39 37 11 11 39 18 26 29 24 15 16 37 33 31 32 35 18 17 33 28 31 28 32 15 20 30 29 57 40 32
Linux 8 23 11 18 11 12 8 16 15 13 23 14 14 18 13 17 15 14 7 11 20 9 14 13 16 11 8 18 17 14 20 15 7 17 20 10 20 17 20 8 12 12 11 18 18 11

Readme

Source
raw.​githubusercontent.​com

SyncedSideBar

Sublime Text plugin to sync project sidebar (folder view) with the currently active file.

As you switch tabs Sublime highlights only files in folders that are already expanded. This plugin makes that work for all files. It accomplishes this through use of the “reveal in side bar” command from the default context menu.

Installation

This plugin is available through Package Control which is the best way to install it. Manual installation using a git clone will work if you prefer that.

Usage

As you move between tabs in a sublime window, the plugin will automatically trigger Sublime to reveal it in the sidebar. If the sidebar is hidden, the plugin will attempt to detect this and disable automatic syncing (see sublime versions note below).

Reveal all tabs

When re-opening a project Sublime collapses the sidebar folders regardless of which tabs are open. To fix this, when a window opens the plugin will cycle through all open tabs causing each one to be revealed in the sidebar.

You can turn this behaviour off through the reveal-all-tabs configuration setting.

Command palette features

This plugin adds some useful features to the Command Palette (Command+Shift+P on Mac, Ctrl+Shift+P on Linux/Windows).

Enable/Disable

Helper commands for enabling/disabling automatic syncing are available as Side Bar: Enable Sync and Side Bar: Disable Sync. This modifies the global reveal-on-activate configuration.

Reveal File

If automatic syncing is disabled, files can be manually revealed via the command Side Bar: Reveal File. This is literally equivalent to using the context menu.

Configuration

Settings can be overridden on a per-project basis by adding them to the settings block in the project file rather than the global Sublime configuration.

  • reveal-on-activate controls the automatic reveal as the active tab changes (true by default).
  • reveal-all-tabs controls whether or not the plugin will cycle through all tabs when a window opens (true by default).

Sublime versions and sidebar visibility

This plugin works on both Sublime Text 2 and Sublime Text 3 beta. The new capabilities enabled by ST3 are designed to gracefully degrade to the old behaviour on ST2.

With ST3 build 3098 or above the plugin makes use of the new sidebar visibility API to disable automatic syncing when the sidebar is hidden.

With ST3 builds 3025-3097 the plugin monitors sidebar visibility. It forces the sidebar to become visible the first time a window is opened in each Sublime session, and after that watches for the sidebar hide command to disable automatic syncing until it is shown again.

With ST2 and older ST3 builds the plugin has no means to track the sidebar visibility and will always reveal the active file as it changes. This will show the sidebar if you try to hide it, so use the command palette features to disable sync manually.

Credits

Original technique figured out by Mylith at sublimetext.com forum: http://www.sublimetext.com/forum/viewtopic.php?f=2&t=4080

Created by @sobstel in 2012, I took over development about a year later. Project migrated here in 2016.