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

Asked

Viewed 114 times

1

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

This is very useful as we can open a project file by simply pressing CTRL+P and typing the name (or part of the name) of the desired file. So:

inserir a descrição da imagem aqui

However, sometimes it also appears in the list of "cues" to open some files that are part of the cache or even the minified, who are not desirable to appear there in this option.

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

1 answer

2


You will need to add the following to your user settings (Preferences -> Settings - User) with any other directories or file types that you want 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: https://forum.sublimetext.com/t/exclude-directory-from-go-to-anything/5767/3

There is still 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 is for you to set your project’s default settings.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.