Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force folder refresh in Sublime, when "Project > refresh" doesn't work?

Especially when using an sftp drive (but this problem is also an issue with local drives, although thankfully not as frequent), the folders in the sidebar just keep spinning and spinning, and the "Open Anything" dialog therefore has no files to choose from.

"Project > Refresh folders" does not work in most cases.

I've resorted to restarting Sublime manually, which works most of the time, but it's getting to be a pain to have to do this every other time I switch projects.

Is there any better way to "force" the folders to refresh?

This problem is the reason I asked this question:

  • How to save project state before exiting in ST3 on Windows?

The SublimeRestart plugin doesn't work on Windows until this project-state-saving problem is solved. However, even if it did work perfectly, it would still only be a workaround for this really annoying non-refreshing-folders issue.


My workaround on Windows, FYI: After loading a project, when the folders don't refresh (don't load even the first time), I have ctrl+f10 bound to "File > Exit", and f10 configured into the shortcut that I launch Sublime Text with. So two reasonably-quick (although additional!) button presses.

like image 618
aliteralmind Avatar asked Jan 20 '15 17:01

aliteralmind


2 Answers

  1. Open Sublime Text.
  2. Select Preferences from the top menu and click Key Bindings – User. Here you will see a JSON file that should contain an array of objects (initially the array is empty). Every object will represent a shortcut.
  3. Add the following (new shortcut object) entry into the array (between the brackets):

    {      "keys"    : ["f5"],      "command" : "refresh_folder_list"  } 

You should be able to refresh the folders with F5.

like image 54
Sandun Chathuranga Avatar answered Sep 28 '22 09:09

Sandun Chathuranga


I have added this myself the other day. I constantly work in an environment where files in the project are changing before I can see them.

Goto 'Preferences' menu -> 'Key Bindings' -> 'User' which will open a JSON file, add below code, save and close that file.

{ "keys": ["ctrl+f5"], "command": "refresh_folder_list" } 

It will work like charm 100%. Thanks for asking this question.

like image 42
Kamlesh Avatar answered Sep 28 '22 10:09

Kamlesh