在Sublime Text中,我经常使用Cmd+P/Ctrl+P在文件之间搜索和跳转。
通常,它会选择临时或缓存的文件,如.scssc或/tmp文件夹中的东西。
是否有一种方法可以限制搜索结果中显示的内容?
在Sublime Text中,我经常使用Cmd+P/Ctrl+P在文件之间搜索和跳转。
通常,它会选择临时或缓存的文件,如.scssc或/tmp文件夹中的东西。
是否有一种方法可以限制搜索结果中显示的内容?
当前回答
你可以通过修改项目设置来排除某些文件模式和文件夹,如下所示:
{
"folders":
[
{
"path": "src",
"folder_exclude_patterns": ["backup"]
},
{
"path": "docs",
"file_exclude_patterns": ["*.css"]
}
]
}
这在项目文档中有描述。
其他回答
这个解决方案非常适合我:https://superuser.com/a/601270
Find: "something" Where: "<open folders>" // <open folders>" not include hidden folder in sidebar
你也可以通过在Where字段中使用-*/foldername/*语法来排除Find All窗格中的文件夹-例如:
-*/node_modules/*
http://www.sublimetext.com/forum/viewtopic.php?f=2&t=3847&start=10
我认为这些答案中有许多跨越了几个不同版本的Sublime Text,以下是我如何在Mac上使用Sublime Text 3做到这一点。
打开Sublime Text > Preferences > Settings - User菜单 编辑file_exclude_patterns和folder_exclude_patterns值以忽略查找工具中的文件和/或文件夹
例子
"file_exclude_patterns":
[
".svn",
".git",
".hg",
".md",
".txt",
".DS_Store"
],
"folder_exclude_patterns":
[
"node_modules",
"bower_components",
".svn",
".git",
".hg",
"CVS",
"deprecated",
"cache"
],
截图
在sublime text 3 (BLD 3059 Windows)中,我需要限制“在文件夹中查找”功能到某些文件/文件夹,也许是单个文件,
下面的方法对我有用 “where:”框的内容
/C/path/2/project/folder,*.c,*.h,-*/path/not/to/look/in,/C/path/2/specific/file/file.h
如果不使用绝对路径,可以将上述方法与以下符号位置结合使用
<打开文件夹>,<打开文件>,<当前文件>
<open folders>,*.c,*.h,-*/never_this_in_folder/*,<open files>
对于那些几次你需要限制查找(和替换)到当前目录,这样做:
c/Path/2/Project,-c/Path/2/Project/*/*
重要的位是路径排除模式中的/*/*。在Windows 7 64位上使用Sublime Text 3 build 3083。