Sublime Forum

CTRL + P search only in current folder

#1

Hi
Is it possible when searching by ctrl+p to search only in current_project?
Is there such setting?
Thanks a lot

0 Likes

#2

Is there to way to search in project?

0 Likes

#3

CTRL+p should only be looking for files in the current project or descendants of the currently open folder.

Note that a project file can define included and excluded files and folders that would also impact what is returned when using CTRL+p.

1 Like

#4

Thanks for your reply

Look i am in project b24 file press ctrl+p and its also searching in project docs
I have 2 opened projects at the moment and need to search in that project incide what i am editing file
For example db.php file incide b24 folder

Thanks about project file.
Look i put into project file sublime-project.sublime-project and fill full windows path
When i press ctrl +p and search its find file in directory func, i made some mistakes?
If i put file with project setting into b24/ and from root of b24 i what to exclude folder what path i need to write(not full for example)?

0 Likes

#5

Goto Anything always offers you all files from the file catalog, which includes every file that appears in every open folder (excluding ones you’ve told it via settings that you don’t want to see or should be excluded).

Generally speaking, if you want to pull from only a single folder you need to include the folder (or enough of it to be unique) as a search term in the input, or only have a single folder in your project.

For example, b24/ would constrain the list to only files in that folder, or b24/ bob would show you files that match on bob that are in that folder. You can also shorten these sorts of things, say b2/ bob (if b2 is unique enough in folder names) or even b24/ b to find files whose names have a b, etc).

The matching that’s done is a fuzzy match, so depending on the files and folders that you have open, this isn’t 100% foolproof and might show you some other files that you don’t expect. It should however remove the larger bulk of items you want to ignore.

Note also that the second line of each entry in the panel shows you the relative path including the top level folder that’s open (if you have more than one folder open), so you can more easily verify that you’re picking the right thing.

3 Likes

#6

As i understand your first advice you recommend me to write PROJECT FOLDER NAME as first key. For example b24 searchkKeyword
I understand, but its longer than ST3 understand the folder(PROJECT) where i am working now.

But i dont understan why i tell ST3 from config the path of project why its searching in another project?

Thanks a lot!

0 Likes

#7

If you have a single top level folder open in the side bar (such as in your most recent example), then Ctrl+P will only show you files contained somewhere within that folder, plus any files that you happen to have open at the time.

0 Likes