Sublime Forum

Exclude folder does not work for CTRL+P file search

#1

Hello,

I work with a project where they have a test folder let’s call it “unit_test” that contains file with the same name as those in the rest of project. So whenever I do CTRL+P to find a file some_header.h I get two results (at least) and often open the wrong one, from unit_test folder. This is annoying so I wanted to instruct sublime to skip that folder from search pattern and added “folder_exclude_patterns”: [“unit_test”], into setting. It did not help.

So how can I exclude it?

0 Likes

#2

That setting is working for me, what version of ST are you using and what are your settings?

0 Likes

#3

Build 4126 is the one I use - I think it is the latest.

0 Likes

#4

In the same way I noticed Sublime does not show .o files in my work folders. In the default settings I see:
“file_exclude_patterns”: [".pyc", ".pyo", “.exe", ".dll”, “.obj",".o”, “.a", ".lib”, “.so", ".dylib”, “.ncb", ".sdf”, “.suo", ".pdb”, “.idb", “.DS_Store”, “.directory”, “desktop.ini”, ".class”, “.psd", ".db”, “*.sublime-workspace”],
For test I copied that line from default to user preferences folder and changed it to:
“file_exclude_patterns”: [""],

And sublime still dones’t show files with that extension :frowning:

UPDATE: These settings behave weird - after above file_exclude_patterns I wasn’t able to find my header file so I commented it out and it worked back again. Then I uncommented and still was able to find the header file…

0 Likes

#5

I had the same problem than @mondotek on build 4143.

It seems indeed that this settings needs Sublime Text to restart in order to work properly.

After have defined :

{
  "folder_exclude_patterns": ["node_modules", ".git"]
}

… and restarted Sublime, everything worked properly.

0 Likes

#6

User preferences don’t require a restart to take effect; they should take effect as soon as the settings file is saved. If you didn’t experience that, there may have been something getting in the way of Sublime’s file system notifications, stopping it from noticing that the setting changed.

0 Likes