450

I just switched to Sublime Text as my new editor. If I open the sidebar it shows the opening file, but what I want is a file navigation sidebar, is it possible to change that without downloading plugins?

2

10 Answers 10

745

You have to add a folder to the Sublime Text window in order to navigate via the sidebar. Go to File -> Open Folder... and select the highest directory you want to be able to navigate.

Also, 'View -> Sidebar -> Show Sidebar' if it still doesn't show. In the new version, there is only an 'open' menu and no separate option for opening a folder.

13
  • 71
    On OS X just normally use File -> Open and then click Open in any folder in the new file dialog.
    – Timm
    Jan 9, 2013 at 8:58
  • 15
    Ive been trying to find a plugin for that for like 6 months lol +1 Mar 17, 2013 at 21:53
  • 6
    Is there a keyboard shortcut to navigate the folder panel without using the mouse?
    – lv10
    May 4, 2013 at 0:44
  • 39
    just figured out Ctrl + 0
    – lv10
    May 4, 2013 at 0:47
  • 3
    can't you just somehow see list of files in current folder, where the currently opened file sits? I can't believe no one yet written such a plugin. Yes you can see them in "Open File" dialog, but wouldn't it be great to be able to see current folder structure, and navigate out and into inner folders right in the side bar, and maybe preview files without really opening them like in Visual Studio 2012
    – iLemming
    May 18, 2013 at 0:00
106

You may drag'n'drop your folder to Side bar. To enable Side bar you should do View -> Side bar -> show opened files. You'll got opened files (tabs) tree and folder structure at Side bar.

2
  • 36
    ctrl+k ctrl+b or cmd+k cmd+b (MAC) to enable side bar
    – snowbound
    Sep 26, 2014 at 9:16
  • 3
    My sidebar was just gone for no apparent reason! This fixed it. Thanks! :)
    – Domi
    Dec 22, 2016 at 13:57
54

Use Ctrl+0 to change focus to the sidebar.

6
  • 8
    THANK YOU. Once sidebar is focused, up/down go prev/next file, left/right collapse/expand!
    – Amy
    Mar 31, 2015 at 23:33
  • It's not the answer to the asked question, but it helped me.
    – mmohaveri
    Jul 21, 2015 at 6:59
  • @mmohaveri That's debatable. It was a poorly-worded question to begin with. Jul 21, 2015 at 15:37
  • 1
    In Windows '''Ctrl-K Ctrl-B" opens and closes the sidebar. Of course you first need to View->ShowOpenFiles, or have a project set in order to have access to the sidebar. Mar 17, 2017 at 20:16
  • THANK YOU, that's the answer I was looking for :) Ctrl-0 (zero) and the file is highlighted in the sidebar. Feb 25, 2021 at 22:06
25

Instead of opening a folder, try adding a folder by going to "Project" -> "Add Folder to Project..." which opens a Folder choosing dialog. This way the folder won't open in a new window and will be added to your current workspace.

If you then go to "Project" -> "Save Project As..." you can even save your current setup (cells setup, opened files, unsaved changes, etc...), this makes it easy to hotswitch between multiple projects without loosing control and unsaved changes which could be unsafe to be saved right now, but would be a loss if you just ditched them. (Just be sure to have the "hot_exit" setting set to true.)

And Ctrl + Alt + P (Linux and Windows) / Super + Ctrl + P (Mac) lets you switch between the saved projects.

This way you don't have to setup your editor every time you want to work on one of your projects.

Hint: Try http://sublime-text-unofficial-documentation.readthedocs.org/en/sublime-text-2/ which is a wonderful resource for beginners, it teaches you the ropes and shows you the power of your "new" editor, just start with the "Editing" chapter.

2
  • Agreed, File > Open... opens the folder in a new project. Feb 19, 2014 at 21:12
  • This is what I was looking for without knowing it -- new to Sublime and didn't grok projects...
    – Dave
    Jun 21, 2016 at 18:42
17
  1. open ST ( Sublime Text )

  2. add your project root folder into ST : link : https://stackoverflow.com/a/18798528/1241980

  3. show sidebar : Menu bar View > Side Bar > Show Side Bar

  4. Try Ctrl + P to open a file someFileName.py

Does a navigation panel for openned files and project folders appear in the left of ST ?

Extra : Want view the other files that are in the same directory with someFileName.py ?
While I found ST side bar seems doesn't support this, but you can try Ctrl + O (Open) keyshort in ST to open your system file browser, in which the ST will help you to locate into the folder that contains someFileName.py and it's sibling files.

12

Both of the previous answers from Matt York and Cyberbolt are right.

Basic idea is here that you want to get some kind of File explorer in Sublime.

Approach:

1) With File -> New Folder -> Click on Desired folder and Hit Open you will get new popup window in sublime which for me is very annoying

2) I use second option which is drag'n'drop from nautilus (a.k.a. Files) window. Simply drag'n'drop your file you want to explore from nautilus to sublime sidebar. That way you stay in the same window and everything is cool.

Don't forget to enable View -> Sidebar -> Show Sidebar and drag'n'drop there from nautilus and of course run it with root privleges. It works like charm

5

Just do: Ctrl+K+B

Have a nice day! :D

3
  • this shortcut is supported in any particular version or all ? Jan 14, 2020 at 21:21
  • @AkberIqbal This work in SublimeText2 since 2012(I don't know which version), but this shortcut only work in some cases, if it don't worked to you this one should do the trick: Ctrl+k AND THEN Ctrl+b. You can see it working in 2012 Sublime2 here: forum.sublimetext.com/t/ctrl-b-ctrl-k-doesnt-toggle-sidebar/… Jan 15, 2020 at 22:39
  • I'm not sure if it works for all versions, but justo go to the latest and you should be Fine. Also, Ctrl+k and then Ctrl+b works as well Apr 1, 2020 at 16:36
3

See this plugin

https://github.com/stvkoch/sublime-text-go-to-file

This version, while not merge with fork branch, has more power to find files basead on class name.

Try:

select namespace and click alt+d click on word of class name and click alt+d click on path of template file and click alt+d

2

This is not exactly a solution, but for opening new files this works great:

AdvancedNewFile

https://github.com/skuroda/Sublime-AdvancedNewFile

Command + Option + n to save a file in a new or existing directory.

enter image description here

So this would place your_file.html.erb in the existing views directory in a Rails app. If you needed a new directory -you would just type that as the path and then hit enter.

You can also Tab like in terminal to autocomplete for existing directories.

This does not give the sidebar navigation I am looking for, but at least helps with one significant need that is repeated often.

1
  • and if you prefix the name with : you can create the file in a location relative to the currently open file, eg: :../myfile.js
    – ptim
    Jun 29, 2016 at 5:23
0

I added the Context Menu item for Folders to open in Sublime Text. In windows, you can right click on any Folder and open the structure in Sublime. You could also create a service (?) for Mac OS - I'm just not familiar with the process.

The following could be saved to a File (OpenFolderWithSublime.reg) to merge to the registry. Be Sure to modify the directory structure to appropriately point to your Sublime installation. Alternatively, you can use REGEDIT and browse to HKCR\Folder\shell and create the values manually.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text]

[HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text\command]
@="C:\\Program Files\\Sublime Text 2\\sublime_text \"%1\""

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.