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
  • 11 months ago
  • 54 minutes ago
  • 6 years ago

Installs

  • Total 145K
  • Win 80K
  • OS X 44K
  • Linux 21K
Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4
Windows 27 78 72 72 77 79 40 48 53 83 77 75 70 52 43 88 81 64 83 73 49 46 62 74 73 62 63 47 64 67 71 63 83 63 44 48 61 65 53 70 75 49 44 53 42 62
OS X 4 37 26 25 29 27 11 16 26 34 27 37 25 17 21 20 20 34 19 26 19 11 32 26 36 42 31 12 11 40 31 24 30 28 19 26 27 36 20 36 26 8 16 23 35 23
Linux 7 14 7 15 16 15 5 8 9 17 24 16 16 13 15 15 13 11 14 20 13 12 15 15 12 18 21 15 11 16 13 19 14 13 6 10 16 13 15 18 14 10 8 23 11 26

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.