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

the*_*ler 2 sublimetext sublimetext3

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

empty_lib_dir

如何使库二进制文件在Sublime Text Folders视图中可见?

Kei*_*all 5

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"],
Run Code Online (Sandbox Code Playgroud)

如果您将其复制到用户首选项中,并将要在侧边栏中显示的文件类型从 移动到file_exclude_patternsbinary_file_patterns那么它们将在侧边栏中可见,但对于 Goto Anything 仍会被忽略。


Oda*_*urd 5

边栏中显示的内容和未显示的内容受以下两项设置以及需要牢记的其他一项设置(此处显示其默认值)的控制:

// 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"],
Run Code Online (Sandbox Code Playgroud)

folder_exclude_patterns自动阻止出现在侧栏(这里的版本控制系统的控制目录),而文件夹列表file_exclude_patterns做同样的文件和文件之间的编译的对象文件和库文件为多个平台其他东西包括。

为了使它们出现在侧栏中,您需要修改file_exclude_patterns默认值,以便不列出您要查看的文件。

如果这样做,文件将显示在侧栏中,但是它们也将显示在使用Goto Anything或搜索项目时要打开的文件列表中。要解决此问题,您需要添加从中删除的所有文件,file_exclude_patternsbinary_file_patterns使Sublime知道它们是二进制文件,因此并不有趣。

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

确保您不只是在不复制默认设置的情况下创建新设置,否则您实际上是在关闭所有默认排除项,这很可能会导致问题。