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

Focus File on Sidebar

by miguelgraz ST3

Sublime Text plugin to open sidebar and focus on the current opened file

Labels focus, sidebar

Details

  • 2018.06.24.12.56.20
  • github.​com
  • github.​com
  • 6 years ago
  • 1 hour ago
  • 10 years ago

Installs

  • Total 31K
  • Win 15K
  • Mac 10K
  • Linux 5K
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 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
Windows 0 0 1 1 4 1 0 0 0 1 2 1 0 1 0 1 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0
Mac 0 2 3 0 1 4 0 0 0 0 0 1 0 3 0 0 1 0 0 0 1 0 2 1 0 1 0 1 0 0 0 1 2 0 0 1 2 0 0 1 0 1 0 0 0 3
Linux 1 2 1 1 1 1 0 0 0 0 0 2 0 0 0 0 3 0 1 0 0 2 0 2 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

FocusFileOnSidebar

Sublime Text has two options regarding its sidebar: Toggle Side Bar and Reveal in Side Bar, in many (mine :P) workflows people want to browse their files tree right on the opened file's folder, which isn't possible with those two options alone.

This plugin aims to give an easier and simple option that allows the developer to use the new command Focus File On Sidebar to open sidebar and move focus right to the opened file's place on project's tree, this way the user can navigate on files tree with keyboard arrows, and use the same command Focus File On Sidebar to close sidebar and fold the unfolded folders, preparing it to be used in the same way again (this is needed because if the folder is already opened the focus goes to “opened files” section on the top of sidebar).

It's hard to explain how this small changing of focus to the sidebar improved my everyday workflow, I no longer use the Reveal in Side Bar command, I'd suggest you to give it a try.

Using

By default the plugin adds the Focus File On Sidebar command to the command pallete (control+shift+P) and adds the shortcut Ctrl+K, Ctrl+F (Windows/Linux) or Cmd+K, Cmd+F (OSX) to be used faster, obviously you can overwrite this options on your Packages/User/Default (YourOS).sublime-keymap file simply by assigning another shortcut to focus_file_on_sidebar command.

Configuring

If your sidebar is already opened by default the plugin closes it and focus back on your file, some people weren't expecting this behavior, instead they wanted the plugin to focus the current file on sidebar (since you can change the current file while having the sidebar opened). Thinking about this different workflow I've added an option named close_sidebar_if_opened defaulting to true, if you prefer to always have your sidebar opened and that the plugin just reveal and focus different files please add a line with "close_sidebar_if_opened": false to your Packages/User/Preferences.sublime-settings file, like this.

Installing

In the same way you can install all the others Sublime plugins, by running a git clone git@github.com:miguelgraz/FocusFileOnSidebar.git on your Packages folder or, if you use Package Control, just by searching the plugin's name and installing from there.

Errors? Doubts? How this differs from Reveal in Side Bar? Contributing?

You can always send a pull request, send me an email or create an issue with your doubts/feature request/critics =)

I really hope this could be of any use for you!

Maintainers