在Sublime Text中,我经常使用Cmd+P/Ctrl+P在文件之间搜索和跳转。

通常,它会选择临时或缓存的文件,如.scssc或/tmp文件夹中的东西。

是否有一种方法可以限制搜索结果中显示的内容?


当前回答

这个解决方案非常适合我: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

在你的~/Library/Application Support/Sublime Text 2/Packages/User/Preferences中添加并编辑它。sublime-settings文件。

// 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": [".svn", ".git", ".hg", "CVS"],

这个解决方案非常适合我:https://superuser.com/a/601270

Find: "something" Where: "<open folders>" // <open folders>" not include hidden folder in sidebar

对于那些几次你需要限制查找(和替换)到当前目录,这样做:

c/Path/2/Project,-c/Path/2/Project/*/*

重要的位是路径排除模式中的/*/*。在Windows 7 64位上使用Sublime Text 3 build 3083。

你可以通过修改项目设置来排除某些文件模式和文件夹,如下所示:

{
    "folders":
    [
        {
            "path": "src",
            "folder_exclude_patterns": ["backup"]
        },
        {
            "path": "docs",
            "file_exclude_patterns": ["*.css"]
        }
    ]
}

这在项目文档中有描述。