Sublime Forum

Project dir matching

#1

I would like to propose a small change to the project popup and the way you can match:

I personally would like to see directories matching as I type. For example, lets say I have this layout in my project:
[ul]
[li]controllers/
[list]
[] login.py[/li]
[li] welcome.py[/li][/ul][/
:m]
[li]model/
[ul]
[] user.py[/li]
[li] forum.py[/li][/ul][/
:m][/list:u]
As it currently stands (in 20090929), if I begin typing ‘cont’, the project popup will display nothing. Only once I finish typing the entire directory “controller”, will the files in that directory be displayed.

However, I think it would be extremely useful if while I have typed “cont”, if I would see an entry labeled “controller” being matched. Perhaps by selecting that entry, it could autofill my search param to the full ‘controller’ string, so that I can then easily see what is in that directory.

I hope this makes sense. Please feel free to respond with any questions or criticisms.

Thanks,
–Mike.

0 Likes

Open file dialog and filtering by directory names
#2

It used to match everything b4 and it was annoying.

To search folders now u gotta type the “” character
so “\cont” should match ur controller\ folder
u can ignore/discard files from being matched with “-” (minus sign)

In ur case lets say I want to filter all py files in model folder but not ones in controllers u can do something like this:

-\controllers \models .py

U can hide all py files -.py, etc…
well u get the idea :smile:

0 Likes

#3

I think something for being able to filter directories without having to type out the whole directory would be nice, but having it match directories and files would be kind of messy and diminish it’s usefulness and efficiency. Perhaps having a designated char at the start of the string would throw it into directory match mode would be an easy implementation. Then maybe another character that would toss it back into file mode to filter files in that directory.

For example, say you have the following directory structure:

v ./
- someFile.file
v someDirectory/
** - ** someFile.file
** - ** someOtherFile.file

.file

Would match all 3 files.

@someD

Would match all files in someDirectory.

@someD#.file

Would match the 2 files in someDirectory.

0 Likes

#4

Did u read my response? and is NOT necessary to type the whole folder name, what you are suggesting is already doable.

\someD .file
0 Likes

#5

I did and was just going to edit my response to reply. Do you have to enable that functionality somewhere? I just tried filtering an includes folder in a project with ‘\inc’ and it didn’t work. Only thing that matched was ‘includes’.

0 Likes

#6

what? isn’t that what you want?
If you don’t want to match “includes” folder like I said before use the “-” (minus sign) in front of your phrase…

-\inc will filter OUT anything that contains inc in folder names

No you don’t have to enable anything, is not an option just a feature thats there :smile:

0 Likes

#7

Starting the string with a slash causes mine to match nothing in the project. The only way I can get it to filter directories is if I type out the entire folder name and follow it with a back slash.

0 Likes

#8

Post ab example of ur folder hierarchy oh and make sure u start it with a Backslash “” not a slash “/”

0 Likes

#9

From what I can tell, doing \someD only works when you are attempting to match a subdirectory.

So, with a folder hierarchy appearing in Sublime as “tests\functional”, I can type “\func”, and it will correctly match. However, if you try “\tes”, it will NOT match anything (i.e. the ‘tests’ directory). If that could work, I think this would solve my problem (i.e. I am too lazy to have to type out the full ‘controllers’ from the original example).

0 Likes

#10

one option i use is to add name:

    <mount name="\src" dir="./src" exclude=".git*"/>
0 Likes

#11

[quote=“mike”]From what I can tell, doing \someD only works when you are attempting to match a subdirectory.

So, with a folder hierarchy appearing in Sublime as “tests\functional”, I can type “\func”, and it will correctly match. However, if you try “\tes”, it will NOT match anything (i.e. the ‘tests’ directory). If that could work, I think this would solve my problem (i.e. I am too lazy to have to type out the full ‘controllers’ from the original example).[/quote]

This is why it wasn’t working for me. ‘\inc’ doesn’t work for me but I can filter the css folder in the includes folder by typing ‘\cs’.

[quote=“vim”]one option i use is to add name:

    <mount name="\src" dir="./src" exclude=".git*"/>

This works but it seems kind of messy. It essentially makes the root of the project one level up and excludes anything else that’s there.

0 Likes

#12

i will join nick’s opinion, i liked it better when the filter applied to all the string including directory names. maybe i’ll get use to it, but i think it should be customizable (on/off).

0 Likes

#13

[quote=“mike”]From what I can tell, doing \someD only works when you are attempting to match a subdirectory.

So, with a folder hierarchy appearing in Sublime as “tests\functional”, I can type “\func”, and it will correctly match. However, if you try “\tes”, it will NOT match anything (i.e. the ‘tests’ directory). If that could work, I think this would solve my problem (i.e. I am too lazy to have to type out the full ‘controllers’ from the original example).[/quote]

Weird I can match parents too not just subfolders… I am testing with a wordpress installation and I can match wp-content just fine…

http://img260.imageshack.us/img260/1958/sublimefolders.png

0 Likes

#14

It’s most likely due to how you have your project mounted. To replicate the situation we are running into make a new project for some directories. Toss the project file in the root and mount it like:

<mount dir="." />

You will not be able to filter any directories in the root the way you showed, only directories in those directories unless you give that one mount a name. Which IMO looks messy.

So for your example if ‘SCA WordPress’ is your root directory create a new project for it with the mount like above and put it in that folder. You will not be able to use ‘\wp’ to filter those directories unless you change the mount like so:

<mount name="SCA WordPress" dir="." />
0 Likes

#15

Ok is confirmed. If your project has no name you can’t match parent folders… if it does then u can. No biggie in my part as my projects always have a name but I see some other people don’t >.<
So we gotta wait for jon to see what he saids on the matter…

and I hate to do the dir="." because if you move ur sublime-project file somewhere else ur screwed. I always use the full path because I don’t keep my sublime-project files in the folder of the project.

Anyways is all in the project name. If you want to match parent folders and don’t want a name just put a period as the name lol… for now

0 Likes

#16

Project dir matching should be pretty ace in 20091002. Let me know if there are any further issues, especially performance wise.

Also let me know if you’d still like a configuration option to disable it. I’d rather not have one, just to avoid unneeded complexity, but if it’s still being annoying I’ve got nothing in particular against it.

0 Likes

#17

[quote=“jps”]Project dir matching should be pretty ace in 20091002. Let me know if there are any further issues, especially performance wise.

Also let me know if you’d still like a configuration option to disable it. I’d rather not have one, just to avoid unneeded complexity, but if it’s still being annoying I’ve got nothing in particular against it.[/quote]

Tested and works, name or no name matching works :smile:

0 Likes

#18

Yep, works perfect now!

0 Likes

#19

This works great now. I personally don’t see the need for a configuration option myself.

Nice work Jon!

–Mike.

0 Likes