修改Sublime Text中"Goto anything"的默认行为

3

当我按下CTRL + P时,我想避免显示一个特定文件夹(doc/是我的情况)中的建议文件。
有没有办法做到这点?


2
谷歌搜索返回了这个论坛帖子。这是你要找的东西还是其他什么? - Jay
1个回答

5
我已经在评论中回答了这个问题,但是为了让它不再被标记为未回答,我在这里提供一个答案。 Sublime论坛上有一个类似的主题讨论这个问题。
简而言之,您需要将以下内容添加到用户设置(首选项 -> 设置 - 用户),以及您希望忽略的任何其他目录或文件类型。
// 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"],
// 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"],

3
这种解决方案的缺点是文件夹也会在侧边栏中消失 :( - Alter Lagos
希望ST3能够解决这个问题。你可以在搜索时始终在文件夹前加上路径,例如src/filename,但随着时间的推移,这可能会变得很烦人。 - Jay

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接