sublime text 3 sidebar autoupdating not working

2020-02-26 03:27发布

I was wondering if anyone could tell me how to make it so that sublime text 3 automatically updates the sidebar when i add a new folder/file to the current project in finder (osx).

Right now, I have to manually go to Project -> Refresh Folders

My user preferences are probably not the issue as they are very basic:

{
    "color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
    "font_size": 18,
    "tab_size": 2,
    "translate_tabs_to_spaces": true
}

If anyone could help that would be great as I have tried googling, searching for an answer to this but havent found anything that works.

Thanks in advance.

16条回答
可以哭但决不认输i
2楼-- · 2020-02-26 03:41

I had this same issue. You could always bind the folder refresh to a hotkey. While this is not a complete fix for auto-updating, it still saves you from a more lengthy manual refresh. I believe this is how Dreamweaver works as well.

查看更多
冷血范
3楼-- · 2020-02-26 03:44

If you're using OS X with python version higher than 2.7.1, try downgrading python to 2.7. This fixed multiple issues for me:

brew update
brew install pyenv
echo 'if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
source ~/.bashrc
pyenv install 2.7
pyenv global 2.7
# now restart ST3
查看更多
我欲成王,谁敢阻挡
4楼-- · 2020-02-26 03:47

I'm using Windows, so not sure if my solution is relevant to the exact question, but since I found this on Google, I figured it might just help somebody. My problem was specifically with the SideBarEnhancements plugin.

The dumb solution (try this first):

  1. Close Sublime Text, go to the Packages directory (in Windows that's in %HOMEDRIVE%%HOMEPATH%\AppData\Roaming\Sublime Text 3 (Win+R, paste that path, enter);
  2. Rename SideBarEnhancements to something else and then back to its original name;
  3. Reopen Sublime Text.

The nice solution (for Git Bash on Windows):

IF the dumb solution has not worked, there is no point in following on.

However, if it worked, you can automate the process.

  1. Open %HOMEDRIVE%%HOMEPATH%\.bashrc, or in other words: User\.bashrc (create the file if you don't have it);
  2. Paste the following at the end of the file (preferably on a new line):

    touchme() {
        echo 'Killing Sublime Text process..';
        taskkill -IM "sublime_text.exe";
        cd ~/AppData/Roaming/Sublime\ Text\ 3/Packages;
        touch SideBarEnhancements;
        echo 'SideBarEnhancements folder touched;';
        echo 'Returning to original directory..';
        cd -;
        echo 'Reopening Sublime Text..';
        "/L/Program Files/Sublime Text 3/sublime_text.exe"&
    }
    

  1. Change the path to your sublime_text.exe (last line of the function);
  2. If Git Bash is opened, execute source ~/.bashrc and go to 6;
  3. If Git Bash is not opened, open it and go to 6;
  4. Execute touchme without any brackets;
  5. In case you use the touchme command for something else, or simply don't like it, feel completely free to rename the function (I just found it the easiest to write and remember :P).

I guess the code above can be adapted for Unix systems, too, with some small tweaks.

查看更多
放荡不羁爱自由
5楼-- · 2020-02-26 03:47

Same issue for me with ST2 on OSX 10.7.5. I started by opening Finder to the folder where I had the issue and navigated to that folder in terminal as well. Then:

  1. Create a blank file and observe if Finder refreshed.

    echo "" > test.txt

  2. If Finder didn't refresh, navigate to the parent folder in both Finder and terminal. Repeat step 1.

  3. If Finder did refresh, rename the child folder you came from to anything and then back to the original name.

    mv folder_name new_folder_name

    mv new_folder_name folder_name

  4. Auto refresh in Finder started working again as well as the Sublime sidebar for that folder and all child folders.

I don't have an explanation as to why this issue started. Prior to this solution, I attempted the following trying to figure it out. I don't know if these steps were necessary in resolving this issue.

  1. I removed .DS_Store files from the folders with this issue.

  2. Remove the Finder preferences file and restart Finder. As described here.

    rm ~/Library/Preferences/com.apple.finder.plist ; killall Finder

  3. Exit Dropbox

Thanks to @peresleguine for the suggestion of renaming the folder.

查看更多
We Are One
6楼-- · 2020-02-26 03:48

I don't have a solution but a theory on why this is happening. I noticed as well recently that it stopped refreshing. I've also noticed that when I use the finder to open folders or use the 'open' within any program, the OS would just show an empty directory when I know there are files in it. I would then have to select a few different folders to get it to recognize that I'm asking it to show me the contents in the folder. It's almost like that function is asleep and I have to nudge it awake.

It seems Mavericks is using some strong sleep agent and turning off any functions behind the scene that's not needed and perhaps it's also affecting the sidebar refresh.

查看更多
Animai°情兽
7楼-- · 2020-02-26 03:51

I recently began experiencing this issue and it turned out to be DropBox related. Once I removed DropBox and restarted my machine the folder refreshing began working as before. Also, DropBox was affecting several other apps, specifically SourceTree and Transmit as well as Sublime Text 3.

查看更多
登录 后发表回答