In Sublime Text, I often use Cmd+P/Ctrl+P to search and jump between files.
Often, it would pick up temporary or cached files like .scssc or things in the /tmp folder.
Is there a way that I can limit what is shown in the search result?
In Sublime Text, I often use Cmd+P/Ctrl+P to search and jump between files.
Often, it would pick up temporary or cached files like .scssc or things in the /tmp folder.
Is there a way that I can limit what is shown in the search result?
For those few times you need to limit the find (and replace) to the current directory only, do this:
The important bit is
/*/*
in the path exclude pattern. Using Sublime Text 3 build 3083 on Windows 7 64-bit.You can also exclude folders from your search via the Where field:
Where:
<open folders>,-*/node_modules/*.*,-*/build/*.*
So in my example above:
This works for me in Sublime Text 3 and the folders continue to show in the SideBar. This is a search only exclusion via input (does not affect any behind the scenes indexing).
Add and edit this in your
~/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings
file.I think many of these answers span a few different versions of Sublime Text, here's how I do this with Sublime Text 3 on a Mac.
file_exclude_patterns
andfolder_exclude_patterns
values to ignore files and/or folders from the Find toolExample
Screenshot
I think the easiest way to make sure such files and folders are excluded on each project is to just add the following code in Sublime User Settings (Add and edit this in your
~/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings
file.)Gist : https://gist.github.com/ahmadawais/690a816ca158067708ad4dbe17822841
OR you can check my preferences file here https://github.com/ahmadawais/dotFiles/blob/master/SublimeText/User/Preferences.sublime-settings#L80-L81
In sublime text 3 (BLD 3059 Windows) I needed to restrict the "find in folder" function to certain files / folders and maybe a single file,
The following works for me Contents of the where: box
Taking it further without absolute paths, you can combine the above with the following symbolic locations
<open folders>, <open files>, <current file>