代码之家  ›  专栏  ›  技术社区  ›  the_storyteller Latinbooker

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

  •  4
  • the_storyteller Latinbooker  · 技术社区  · 6 年前

    我正在使用Sublime Text 3编写C库。我希望能够引用lib build目录,并查看实际生成的二进制文件。但是,Sublime将目录显示为空。

    empty_lib_dir

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

    2 回复  |  直到 6 年前
        1
  •  8
  •   OdatNurd    6 年前

    侧栏中显示的内容和未显示的内容由以下两个设置以及需要记住的一个附加设置控制(此处显示了它们的默认值):

    // 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\u exclude\u模式 默认设置,以便不列出要查看的文件。

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

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

    确保不要只创建新设置而不复制默认值,或者有效地关闭所有默认排除,这可能会导致后续问题。

        2
  •  4
  •   Keith Hall    6 年前

    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 ,则它们将在侧边栏中可见,但仍然会被忽略,以便转到任何内容。