Sublime Text - How to ignore the files fetched by the shortcut (Goto Anything) CTRL + P?

1

In the sublime text we have an option called Goto > Goto Anything , which is accessed via the CTRL + P shortcut.

This is very useful because you can open a file in a project simply by pressing CTRL+P and typing the name (or part of the name) of the file you want. So:

However,sometimesitalsoappearsinthelistof"suggestions" of files to open some files that are cache or even the minified , which are not desirable appear there.

How do I delete some files, by extension or by folder, from this search for Goto Anything ?

    
asked by anonymous 22.02.2016 / 13:08

1 answer

2

You will need to add the following to your user settings (Preferences - > Settings - User) with any other directories or file types you wish to ignore.

Example:

"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"],
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],

source: link

There is also an alternative way, where, by creating the project through Sublime Text, you add these settings above in your project file projeto.sublime-project .

For example:

{
    "folders":
    [
        {
            "path": ".",
            "folder_exclude_patterns" : [
                "app/storage"
            ],
            "file_exclude_patterns" : [
                "*.jpg", 
                "*.png",
                ".gif",
                "*.min.css",
                "*.min.js",
                "composer.lock"
            ]
        }
    ],

    "settings" : {
        "tab_size" : 4,
        "translate_tabs_to_spaces" : true
    }
}

This file allows you to define the default settings for your project.

    
22.02.2016 / 13:18