Sublime Forum

What can I use in addition to <Project>?

#1

Hello!

One of my favourite small features in Sublime is how in the “Find” panel you can type “Where: <Project>” to search through all files in all project folders. I’m not sure if this is a very well-advertised feature, because lots of people don’t seem to know how to do it, but I’ve always found this useful ever since first using Sublime.

But I’ve never known what else you can write here—if there are any other kind of aliases other than <Project>.

More to the point, this is extremely hard to find out because Google ignores all angle brackets!

What I’d like to do is create my own aliases which can be used for searches within my project, for example <Engine> to search through all engine source files in my game project, <Talents> to search through all talent files, etc.* Would anyone know whether this is possible, or would I have to knock together my own little package to make it work?

Thanks in advance for any help!

*I know you can just enter a directory path, but I would really have some fun with this feature, and it would be much quicker to do it this way too.

0 Likes

#2

You can use filters to achieve your objectives. When you open the Find in Files panel, you can see a ... just to the right of the Where field. Clicking that will show you all available <...> in Sublime.
For your case, all you need to do is use an Add Include Filter, which populates the Where with *. and if your engine files have, for example, an extension of .engine, then it would be *.engine (||| ly *.talents if that’s the extension for those talent files).
This should search for the specific word in the entire project only on those files.

1 Like

#3

Thanks UltraInstinct05, that’s amazing!

The whole time, I thought that “…” would just lead to a “Select Folder” dialog.

So I’ve found <open folders>, <open files>, and <current file>… I wonder if I can make some new aliases to make these searches super quick and easy for me.

If anyone knows, that’s great, but I’m also quite interested to look into the Sublime API and think about how to expand search possibilities within a package! In the meantime, what I’ll do is take a keyboard sequence like and have AutoHotKey transform that into the correct filter string that searches in all the necessary files for me.

0 Likes

#4

I’m not sure what you mean by “make new aliases”, but there’s no way via the API to add additional template searches like this. You can augment the menu that appears to have it automatically add search terms you commonly use, but you can’t say add a new <mynewthing> and have Sublime know what that means.

1 Like

#5

That’s exactly what I mean! Yes, that might be a better way to describe it. Thanks a lot, OdatNurd.

It’s a shame. If I try and enter a full filepath / filter string, either I mistype it, or waste a lot of time by navigating the sidebar. I’m coding right now and finding that every couple of minutes, this is something that I need!

Has nobody else felt a need for something like this?

0 Likes

#6

This is mega frustrating, because I can’t select both replies as the solution to the problem, when really this is what I feel is correct and should be.

0 Likes

#7

There might be a solution depending on your requirements. If the filepath or filter string is something that is same, then you can automate it to an extent.

0 Likes