在 Sublime Text Editor 中隐藏具有特定扩展名的文件? [英] Hide files with certain extension in Sublime Text Editor?

查看:35
本文介绍了在 Sublime Text Editor 中隐藏具有特定扩展名的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Sublime Text Editor 3 的侧边栏(横向导航栏)中隐藏具有特定扩展名的所有文件?

is it possible to hide all the files with certain extension from the sidebar (lateral nav bar) in Sublime Text Editor 3?

推荐答案

你说的是侧边栏吗?例如,如果您选择 File →打开并选择一个文件夹,然后该文件夹及其内容将显示在左侧,允许您在其内容和子目录之间导航.如果是这样,那么答案是肯定的,可以排除文件.

Are you talking about the sidebar? For example, if you select File → Open and select a folder, then the folder and its contents are displayed along the left side, allowing you to navigate amongst its contents and sub-directories. If that is the case, then the answer is yes, files can be excluded.

选择 首选项 →Settings – Default 打开一个名为 Preferences.sublime-settings – Default 的选项卡.此文件是只读的,因此您还需要打开 Preferences →设置 - 用户.第一次打开用户首选项时,它将是空白的.它(以及所有 Sublime 配置文件)采用 JSON 格式,因此您需要在文件的开头和结尾处打开和关闭大括号,分别为:

Select Preferences → Settings – Default to open a tab called Preferences.sublime-settings – Default. This file is read-only, so you'll also need to open Preferences → Settings – User. The first time you open your user preferences it will be blank. It (and all Sublime config files) are in the JSON format, so you'll need opening and closing curly braces at the beginning and end of the file, respectively:

{

}

激活默认首选项选项卡并搜索 file_exclude_patterns(位于 ST3 build 3083 中的第 377 行)以及 folder_exclude_patterns(如果需要).将其内容复制到您的用户首选项文件中,如下所示:

Activate the default preferences tab and search for file_exclude_patterns (which is on line 377 in ST3 build 3083) and also folder_exclude_patterns if desired. Copy its contents to your user preferences file, like so:

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

并随意添加您自己的自定义.请注意,方括号后没有逗号 (,),因为在本例中,这是唯一的自定义首选项.如果您有多个(更改字体、窗口选项、主题或其他),除了最后一个(尾随逗号是非法的 JSON),您需要在每个项目后添加一个逗号:

and feel free to add your own customizations. Please note that there is no comma (,) after the closing square bracket, as in this example this is the only customized preference. If you have multiple ones (changing fonts, window options, themes, or whatever) you'll need a comma after each item except the last one (trailing commas are illegal JSON):

{
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    "word_wrap": true,
    "wrap_width": 0
}

这篇关于在 Sublime Text Editor 中隐藏具有特定扩展名的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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