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
  • 3 months ago
  • 13 minutes ago
  • 5 years ago

Installs

  • Total 124K
  • Win 66K
  • OS X 39K
  • Linux 19K
Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6
Windows 78 87 83 83 86 68 90 99 99 111 113 88 67 88 100 76 100 88 71 59 107 103 92 68 95 55 65 70 104 99 87 92 62 72 88 85 88 82 92 46 57 89 86 99 107 81
OS X 24 29 37 31 24 26 34 56 48 31 35 24 23 46 31 42 41 38 20 25 44 43 47 43 39 27 14 24 36 33 36 37 17 18 32 39 41 35 40 24 14 23 42 44 47 41
Linux 20 27 29 24 9 17 18 17 25 21 23 19 12 14 34 20 16 16 12 8 24 19 17 17 18 14 13 26 20 25 15 21 19 15 21 21 20 16 16 14 2 15 16 14 17 14

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.