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

aliteralmind picture aliteralmind · Jan 20, 2015 · Viewed 50k times · Source

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:

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.

Answer

Sandun Chathuranga picture Sandun Chathuranga · Feb 24, 2016
  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.