简体   繁体   English

崇高的文字3边栏自动更新不起作用

[英]sublime text 3 sidebar autoupdating not working

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). 我想知道是否有人可以告诉我如何制作它,以便当我在finder(osx)中向当前项目添加新文件夹/文件时,sublime text 3自动更新侧边栏。

Right now, I have to manually go to Project -> Refresh Folders 现在,我必须手动转到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. 如果有人可以帮忙,那么就像我尝试使用Google谷歌搜索一样,寻找答案的答案却还没有找到任何可行的方法。

Thanks in advance. 提前致谢。

I recently began experiencing this issue and it turned out to be DropBox related. 我最近开始遇到此问题,结果与DropBox有关。 Once I removed DropBox and restarted my machine the folder refreshing began working as before. 删除DropBox并重新启动计算机后,文件夹刷新将像以前一样开始工作。 Also, DropBox was affecting several other apps, specifically SourceTree and Transmit as well as Sublime Text 3. 此外,DropBox还影响了其他几个应用程序,特别是SourceTree和Transmit以及Sublime Text 3。

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. 我相信这也是Dreamweaver的工作方式。

I had the same issue with ST3 (OSX 10.9.2). 我在ST3(OSX 10.9.2)中遇到了相同的问题。 It was something wrong with the root folder of my projects. 我的项目的根文件夹有问题。 I created new folder Code1 , moved all of my projects there, removed old Code folder and renamed new Code1 to Code . 我创建了新文件夹Code1 ,将所有项目移到那里,删除了旧的Code文件夹,并将新Code1重命名为Code This bit of magic returned things back to normal. 这种魔法使事情恢复了正常。

Open the console and see if there are any errors. 打开控制台,查看是否有任何错误。 It logs when there are changes to the filesystem. 当文件系统发生更改时,它将记录日志。

I've had this problem when I used disks that where mounted with samba. 当我使用通过samba挂载的磁盘时遇到了这个问题。 My best guess is that this has something to do with the OS or filesystem not triggering the correct events for sublime to realize that there's new stuff in the folders. 我最好的猜测是,这与操作系统或文件系统没有触发升华的正确事件有关,以意识到文件夹中有新内容。

I'm guessing that the disk on which the project you're working on belongs to a mounted disk, that might have a different filesystem. 我猜想您正在处理的项目所在的磁盘属于已安装的磁盘,该磁盘可能具有不同的文件系统。 Try moving the project and see if that helps. 尝试移动项目,看看是否有帮助。 If that is the case maybe you ought to see over which flags and stuff you're using when mounting the disk on which the project was originally stored. 如果是这种情况,那么在装入最初存储项目的磁盘时,您应该查看正在使用的标志和内容。

How you would go about fixing that however I have no clue about since I don't have any experience with OSX. 您将如何解决该问题,但是由于我对OSX没有任何经验,因此我对此一无所知。

This could be the result of an error with the plugin SidebarEnhancements, as was the case for me. 可能是插件SidebarEnhancements错误导致的,就像我这样。 Using package control I removed the plugin. 使用包控制,我删除了插件。 I couldn't package install the plugin back as it would not show up on the list of available plugins. 我无法打包安装该插件,因为它不会显示在可用插件列表中。 So instead I followed this github issue in the repo and got it cloned into the correct directory. 因此,我改为在仓库中关注此github问题 ,并将其克隆到正确的目录中。

Another side note, in sublime I clicked "Sublime Text" -> "Preferences" -> "Browse Packages". 另一边注,在Sublime中,单击“ Sublime Text”->“ Preferences”->“ Browse Packages”。 to open up the correct location to clone the repo in finder. 打开正确的位置以在finder中克隆存储库。 If you click on the folder icon in the top bar of the resulting finder window you can actually drag this into iTerm2 so that you are in the proper location before running the git clone command included below. 如果单击出现的查找程序窗口顶部栏中的文件夹图标,则实际上可以将其拖动到iTerm2中,以便在运行下面包含的git clone命令之前位于正确的位置。

git clone https://github.com/titoBouzout/SideBarEnhancements.git "SideBarEnhancements" cd "SideBarEnhancements"

Finally, quit ST3 and reopen worked for me. 最后,退出ST3并重新打开对我有用。 Hope this helps. 希望这可以帮助。

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. 我使用的是Windows,因此不确定我的解决方案是否与确切的问题相关,但是由于我是在Google上找到的,因此我认为这可能对某些人有所帮助。 My problem was specifically with the SideBarEnhancements plugin. 我的问题特别是与SideBarEnhancements插件有关。

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); 关闭Sublime Text,转到Packages目录(在Windows中,位于%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\Sublime Text 3 (Win + R,粘贴该路径,输入);
  2. Rename SideBarEnhancements to something else and then back to its original name; SideBarEnhancements重命名为其他名称,然后恢复为原始名称;
  3. Reopen Sublime Text. 重新打开Sublime Text。

The nice solution (for Git Bash on Windows): 不错的解决方案(适用于Windows上的Git Bash):

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); 打开%HOMEDRIVE%%HOMEPATH%\\.bashrc或换句话说: User\\.bashrc (如果没有该文件,则创建该文件);
  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); 将路径更改为sublime_text.exe (函数的最后一行);
  2. If Git Bash is opened, execute source ~/.bashrc and go to 6; 如果打开了Git Bash,则执行source ~/.bashrc并转至6; source ~/.bashrc ,执行6。
  3. If Git Bash is not opened, open it and go to 6; 如果未打开Git Bash,请打开它并转到6;否则,请转至6。
  4. Execute touchme without any brackets; touchme没有括号的情况下执行touchme
  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). 如果您将touchme命令用于其他用途,或者根本不喜欢它,请完全随意重命名该功能(我发现它最容易编写和记住:P)。

I guess the code above can be adapted for Unix systems, too, with some small tweaks. 我想上面的代码也可以通过一些小的调整而适用于Unix系统。

I had this problem after reinstalling Sublime Text 2 and symlinking. 重新安装Sublime Text 2和符号链接后,出现了这个问题。

A workaround I found was binding the refresh_folder_list command with cmd+s, since that's usually when we see the sidebar updating. 我发现一种解决方法是将refresh_folder_list命令与cmd + s绑定,因为通常这是在我们看到边栏更新时。

For this to work you'll need to install run_multiple_commands plugin. 为此,您需要安装run_multiple_commands插件。

Then you'll have to update your User Keymap telling it to refresh folder list every time you save. 然后,您必须更新您的用户键盘映射,告诉它每次保存时都要刷新文件夹列表。 The syntax is fairly simple. 语法非常简单。

I also ran across Synced Side Bar after fixing the issue. 解决问题后,我还遇到了Synced Side Bar I am not sure if this is a solution but sounds promising. 我不确定这是否是解决方案,但听起来很有希望。

Hope this helps. 希望这可以帮助。

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. 看来Mavericks正在使用一些强大的睡眠代理,并关闭了幕后不需要的任何功能,这可能还会影响边栏的刷新。

Same issue for me with ST2 on OSX 10.7.5. 对于OSX 10.7.5上的ST2,对我来说也是同样的问题。 I started by opening Finder to the folder where I had the issue and navigated to that folder in terminal as well. 我首先打开Finder到出现问题的文件夹,然后导航到终端中的该文件夹。 Then: 然后:

  1. Create a blank file and observe if Finder refreshed. 创建一个空白文件,并观察Finder是否刷新。

    echo "" > test.txt

  2. If Finder didn't refresh, navigate to the parent folder in both Finder and terminal. 如果Finder没有刷新,请导航到Finder和终端中的父文件夹。 Repeat step 1. 重复步骤1。

  3. If Finder did refresh, rename the child folder you came from to anything and then back to the original name. 如果Finder确实刷新了,则将您来自的子文件夹重命名为任何名称,然后恢复为原始名称。

    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. Finder中的自动刷新以及该文件夹和所有子文件夹的Sublime侧栏再次开始工作。

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. 我从文件夹中删除了.DS_Store文件。

  2. Remove the Finder preferences file and restart Finder. 删除Finder首选项文件,然后重新启动Finder。 As described here . 如上所述这里

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

  3. Exit Dropbox 退出Dropbox

Thanks to @peresleguine for the suggestion of renaming the folder. 感谢@peresleguine提供重命名文件夹的建议。

I had the same issue with folders and files not showing up. 我也遇到了文件夹和文件未显示的相同问题。 No matter what folders I added it wouldn't work, refreshing folders didn't work, if I restarted Sublime, I would then see the folders I added but none of it's contents. 不管我添加的文件夹是什么,刷新文件夹都不起作用,如果我重新启动Sublime,我会看到我添加的文件夹,但没有内容。 I ended up going to File -> Close Window and then File -> New Window , after that when I added folders to the new window, it started working again. 我最终进入File -> Close Window ,然后进入File -> Close Window File -> New Window ,之后,当我将文件夹添加到新窗口时,它又开始工作了。 Seems like it's a corruption in the project file somehow. 似乎它在某种程度上损坏了项目文件。 Anyways hope this helps someone. 无论如何希望这对某人有帮助。

Mac OSX Mavericks Mac OSX小牛
Sublime 3 Build 3059 Sublime 3内部版本3059

If you're using OS X with python version higher than 2.7.1, try downgrading python to 2.7. 如果您使用的OS X的Python版本高于2.7.1,请尝试将python降级到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

One of the sub-folders of my project contained a symlink to the project itself, making a loop. 我项目的子文件夹之一包含一个到项目本身的符号链接,形成一个循环。 As soon as I've removed it and re-opened the project, the problem went away. 我将其删除并重新打开项目后,问题就消失了。 However, that symlink was necessary for my project to function, so I created a simple .sublime-project file: 但是,该符号链接对于我的项目正常运行是必需的,因此我创建了一个简单的.sublime-project文件:

{
  "folders": [{
    "path": "/",
    "folder_exclude_patterns": ["symlink-or-one-of-its-parents"]
  }]
}

The exclusion pattern made Sublime ignore the loop, and the sidebar went back to normal right away. 排除模式使Sublime忽略了循环,并且侧边栏立即恢复正常。 Just note that folder_exclude_patterns accepts folder names, not paths. 请注意, folder_exclude_patterns接受文件夹名称,而不是路径。 That means that it might exclude something you didn't want to exclude (ie if you write lib it'll exclude all lib folders in your project, regardless of where they are). 这意味着它可能会排除您不想排除的内容(即,如果您编写lib它将排除项目中的所有lib文件夹,无论它们在哪里)。 Hope this helps somebody. 希望这对某人有帮助。

I had this issue after symlinking my project files to another partition on the hard disk. 将项目文件符号链接到硬盘上的另一个分区后,出现了这个问题。 I fixed it by editing the path for each project from Project > Edit Project to the new location. 我通过编辑每个项目从Project > Edit Project到新位置的路径来修复它。

A bit late to the conversation, but I resolved this by turning off DropBox's Finder integration. 谈话有点晚了,但是我通过关闭DropBox的Finder集成解决了这个问题。 There is a known issue with Yosemite 10.10.x https://www.dropbox.com/help/7144 Yosemite 10.10.x存在一个已知问题https://www.dropbox.com/help/7144

Click on the dropbox icon in your tool bar, click the gear and then open preferences. 单击工具栏中的保管箱图标,单击齿轮,然后打开首选项。 Un-check Enable Finder integration. 取消选中“启用Finder集成”。 Then restart your computer. 然后重新启动计算机。

Hope that helps. 希望能有所帮助。

I just fixed this issue and I think the reason is because I use dropbox to sync my ST3 settings . 我只是解决了这个问题,我认为原因是因为我使用Dropbox同步了我的ST3设置

Somedays before I restarted with 'reopen windows when logging back in', and found sublime opened earlier than dropbox finished its initialisation, which caused some settings couldn't load properly. 几天前,我使用“重新登录时重新打开窗口”重新启动,发现Sublime在Dropbox完成初始化之前打开,这导致某些设置无法正确加载。

The result was when I used subl . 结果是当我使用subl . to open project, I found the side bar not working properly. 打开项目,我发现侧栏无法正常工作。 At the first beginning, I just closed ST3 windows and re-run subl, but it didn't work. 刚开始时,我只是关闭了ST3窗口并重新运行subl,但是没有用。

Finally I quitted ST3 (cmd+q), and made sure dropbox was properly loaded, then subl again. 最后,我退出了ST3(cmd + q),并确保正确加载了保管箱,然后再次执行subl。 This time it worked. 这次它起作用了。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM