如何在 Sublime 中强制刷新文件夹,当“项目"出现时刷新"不起作用? [英] How to force folder refresh in Sublime, when "Project > refresh" doesn't work?

查看:75
本文介绍了如何在 Sublime 中强制刷新文件夹,当“项目"出现时刷新"不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

特别是在使用 sftp 驱动器时(但这个问题也是本地驱动器的一个问题,虽然幸运的是没有那么频繁),侧栏中的文件夹只是不断旋转和旋转,打开任何"对话框因此没有可供选择的文件.

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.

我已经求助于手动重新启动 Sublime,这在大多数情况下都有效,但每次切换项目时都必须这样做,这很痛苦.

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:

SublimeRestart 插件在此项目状态保存问题解决之前无法在 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.

我在 Windows 上的解决方法,仅供参考:加载项目后,当文件夹不刷新(即使第一次也不加载)时,我将 ctrl+f10 绑定到文件 >退出",并将 f10 配置到我启动 Sublime Text 的快捷方式中.所以两次相当快速(虽然是额外的!)按钮按下.

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.

推荐答案

  1. 打开 Sublime Text.
  2. 从顶部菜单中选择首选项,然后点击键绑定 - 用户.在这里,您将看到一个 JSON 文件,该文件应包含一个对象数组(最初该数组为空).每个对象都代表一个快捷方式.
  3. 将以下(新的快捷方式对象)条目添加到数组中(括号之间):

  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" 
}

您应该可以使用 F5 刷新文件夹.

You should be able to refresh the folders with F5.

这篇关于如何在 Sublime 中强制刷新文件夹,当“项目"出现时刷新"不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆