如何在Sublime文本文件夹视图中显示二进制文件

时间:2018-03-07 16:54:14

标签: sublimetext3 sublimetext

我使用Sublime Text 3编写C库。我希望能够引用lib构建目录,并看到实际构建了二进制文件。但是,Sublime将目录显示为空。

empty_lib_dir

如何在Sublime Text Folders视图中显示库二进制文件?

2 个答案:

答案 0 :(得分:4)

侧栏中显示和未显示的内容由以下两个设置控制,另外还有一个设置(请在此处显示默认值):

<httpProtocol>
  <customHeaders configSource="WebConfigShards/CustomHeaders.config" >
  </customHeaders>
</httpProtocol>

configSource会自动阻止文件夹列表显示在侧栏(此处为版本控制系统的控制目录),而// folder_exclude_patterns and file_exclude_patterns control which files // are listed in folders on the side bar. These can also be set on a per- // project basis. "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"], "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.sublime-workspace"], // These files will still show up in the side bar, but won't be included in // Goto Anything or Find in Files "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"], 对文件执行相同操作,并包括编译的目标文件等和几个平台的库文件。

为了让它们显示在侧栏中,您需要修改folder_exclude_patterns默认值,以便列出您想要查看的文件。

如果您这样做,文件将显示在侧栏中,但是当您使用file_exclude_patterns或在项目中搜索时,它们也会显示在要打开的文件列表中。 要解决此问题,您需要将从file_exclude_patterns移除的任何文件添加到Goto Anything,以便Sublime知道它们是二进制的,因此不会感兴趣。

要调整设置,请使用file_exclude_patterns,然后将左侧窗格中的默认值复制到右侧的自定义设置,并修改右侧的版本。

确保您不是在不复制默认设置的情况下创建新设置,或者您有效地关闭了所有默认排除项,这可能会导致您遇到问题。

答案 1 :(得分:2)

ST3的默认首选项包含:

// folder_exclude_patterns and file_exclude_patterns control which files
// are listed in folders on the side bar. These can also be set on a per-
// project basis.
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.sublime-workspace"],
// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],

如果您将其复制到您的用户首选项中,并将要显示的文件类型从file_exclude_patterns移至binary_file_patterns,那么它们将在侧栏中显示,但仍会被忽略转到任何地方。