Home Download Buy Blog Forum Support

Highlight currently open file in the project tree.

Highlight currently open file in the project tree.

Postby elishnevsky on Wed Jun 05, 2013 7:35 pm

Hi.
I often work with large projects with many nested folders. I constantly use Goto Anything to open files as opposed to the side bar. I also often need to know where currently open file is located in the project hierarchy, and the only way to do it is by looking at the title bar of the editor, which displays the full path, but it doesn't guarantee to match the project structure. It would be absolutely great if Sublime Text could sync the project tree in the side bar with the currently active document, in other words expand the necessary folders in the side bar, highlight the currently active file and scroll it into view if necessary, regardless of how the file gets activated, either from Goto Anything, Goto Definition, selecting the tab, etc. Doesn't matter.
Does anyone else think it would be a nice addition?
Thanks!
elishnevsky
 
Posts: 5
Joined: Mon Oct 24, 2011 5:03 pm
Location: Canada

Re: Highlight currently open file in the project tree.

Postby qgates on Wed Jun 05, 2013 10:28 pm

1. If the sidebar is expanded to show the file you're editing already, Sublime will hilite the file in the tree when you activate the tab.
2. Better still, if you right-click somewhere in the file content, "Reveal in side bar" will expand the relevant branch and hilite the file.

Think these two have you covered :)
qgates
 
Posts: 205
Joined: Mon Nov 05, 2012 4:33 pm

Re: Highlight currently open file in the project tree.

Postby elishnevsky on Thu Jun 06, 2013 2:09 pm

qgates wrote:1. If the sidebar is expanded to show the file you're editing already, Sublime will hilite the file in the tree when you activate the tab.
2. Better still, if you right-click somewhere in the file content, "Reveal in side bar" will expand the relevant branch and hilite the file.

Think these two have you covered :)


Awesome! I never use right-click menu so I wasn't aware of this feature. Thanks a lot for pointing it out!
elishnevsky
 
Posts: 5
Joined: Mon Oct 24, 2011 5:03 pm
Location: Canada

Re: Highlight currently open file in the project tree.

Postby adzenith on Thu Jun 06, 2013 3:15 pm

If you want to happen every time, by the way, you could write a plugin that calls reveal_in_side_bar in the on_activated callback.
The problem would then be closing all the old file's folders when you switched to a new file.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Highlight currently open file in the project tree.

Postby schlamar on Tue Jun 11, 2013 7:15 am

You can map this command to a shortcut, just add an entry to your key bindings:

Code: Select all
{ "keys": ["ctrl+alt+s"], "command": "reveal_in_side_bar" },
schlamar
 
Posts: 105
Joined: Tue Feb 19, 2013 2:11 pm


Return to General Discussion

Who is online

Users browsing this forum: Anomareh, rusa13, Yahoo [Bot] and 113 guests