Sublime Forum

Fuzzy filesystem find?

#21

I will look into it.

[quote]If its doable, this seems a more elegant solution than the one SublimeFileNavigator uses, which puts the options in the panel. It also seems unambiguous, since you cannot type past a directory (e.g., /home/foo).

That said, having used FuzzyFileNav for a couple (?) hours now as my open command, I miss being able to type through directories. E.g., /home/foo/docs. (Does this make sense?)
[/quote]

Sorry, I misunderstood. This is not doable. Quick panel only returns the index of the array, not the actual text entered in. So usually you keep the array you sent in so you can index it after the quick panel returns the value. I know, it is unfortunate.

I plan on providing the commands and will probably let the user set up shortcuts. That is my thinking heading forward for new plugins. I donā€™t want to step on a userā€™s current shortcuts.

Yes

The real benefit of this plugin is when you are not in a project, or need to access something outside the project. If you are in a project, Ctrl+P is going to be way more helpful, unless maybe if the file is very close byā€¦like in the same folder.

Being able to type out the path in Ctrl+P is much nicer. Sublime goes ahead and indexes your entire project so you can search all files no matter where they are. This just isnā€™t practical to do the entire computer for the times you want to access a stray file. And then you have to consider, even if you went ahead and indexed it, you have to keep monitoring it for changes.

Yeah, I have been thinking about that. I need to play around with it. It would be nice if you could somehow color entries different or bold them, but that is not possible. A slash at the beginning or end will probably be helpful.

Yeah, that is not a bad idea. The only thing that annoys me is that if you give any entry multiple lines, all entries use multiple lines even if you are not putting info there.

It is a work in progress. It is one of those projects that I was like, that would be pretty easy to throw together, and then when you get into it, all of the little troublesome details make themselves apparent :smile:. I also obsess over the small details, so this might go through a number of changes till I get what I am happy with. I will work out what I can though, and see if I can roll out something better.

Thanks for the input. It makes it a bit more enjoyable to work on when you know there is someone interested in it.

0 Likes

#22

Okay. I started having fun with this. Iā€™ve made the panel dynamic :smile: By default, any files prefixed with . will be hidden. Pressing ā€œ.ā€ will reload the current directory, displaying the hidden files. Pressing ā€œ~ā€ on OSX will bring you to your user directory. One thing Iā€™m having trouble with is getting ā€œ/ā€ to replace ā€œenter.ā€ Iā€™ve scoured the keybindings looking for a command that might do the trick. I tried insert_snippet: ā€œ\nā€ but that didnā€™t work. Iā€™ll post my version soon.

0 Likes

#23

-Removed extra info
-Folders are followed by slashes
-Inaccessible folders/files are now caught when you try and access them

So what are you doing to get dynamic panels? Are you just capturing keystrokes when in the panel view? If so, how do you detect the panel view?

0 Likes

#24

PIKA!

https://files.nyu.edu/ll1208/public/pikachu3.jpg
github.com/BoundInCode/Pikachoose

I use a boolean in the windowcommand that keeps track of whether the panel is up or not. Then I use on_query_context for everything else.

0 Likes

#25

Ahh. I see. Boolean gets confused though if you click another ST2 window that is open. Try opening your nav panel, and then click in another window and enter ā€œ~ā€. You will see a panel pops up in the new window.

It is interesting, and I may play around with the idea. What I find most intriguing is the idea of possibly having the slashes pick the top most selection. The hidden one only works if your exclude regex always filters hidden files. And really that only works for Linux/Unix systems. Windows is a different story. The home shortcut is kind of neat.

I will play with this and see if I can make it useful for my purposes.

The boolean confusion is my main concern with this method.

0 Likes

#26

You could probably fix the confusion by making a separate class so itā€™s not associated with a window. I was just playing around before I keel over and fall asleep. Itā€™s more of a proof of concept.

0 Likes

#27

I think I downplayed my enthusiasm. I think what you did is very cool. The name made me laugh as well. The concept is neat, I just have to think of a real good use for something like this, and figure out how to keep the boolean clean. I think you could store the window ID and use it as verification.

Hmm. I am a little disappointed that you cannot ā€œsendā€ a enter key. It appears you need the ā€œenterā€ keystroke not ā€œ\nā€ to cause the quick panel to accept the selected input. But remapping ā€œ/ā€ to ā€œenterā€ is cosmetic.

I think the home idea is good though. If I can get the boolean issue worked out, I may adopt this.

0 Likes

#28

Maybe Jon or @castles knows an unlisted command to send an enter keyā€¦ Iā€™ll keep playing with it. Iā€™m going to get the create new file sorted out too.

0 Likes

#29

Fixed the boolean issue. Also, figured out how to do onchange event in the quickpanel. Big stuff comming :smile:.

0 Likes

#30

Publish it already. I donā€™t care if it works. I just want to fix it and make it better :smile:

Iā€™d rather just build off yours.

EDIT: by the way, Iā€™m disappointed in you. I found the line: if valid == True:
Seriously?

0 Likes

#31

[quote=ā€œC0D312ā€]Publish it already. I donā€™t care if it works. I just want to fix it and make it better :smile:

Iā€™d rather just build off yours.

EDIT: by the way, Iā€™m disappointed in you. I found the line: if valid == True:
Seriously?[/quote]

Iā€™m not quality controlling this :smile:. Development stage is ugly. Releases are pretty. At one point I had debug print statements too in there. Look at it this way, it is very explicit :smile:.

I will hopefully publish it soonish. It isnā€™t just my fix, but experiments as well. I am building up to something, so I will pull out the garbage and publish the core stuff when I get a chance, and work on the planned features built on top of it down the road.

0 Likes

#32

Posted on change event for quick panel. Added home shortcut that utilizes it. If the first character is ā€œ~ā€, it will take you to the hard coded HOME variable in the script. Home would become a setting in the future.

Things are subject to change, but this is a proof of concept. This allows me direct access to everything typed into the quick panel. This method has some interesting possibilities. I am thinking about having tab to auto-complete your path like it would in terminal, if the path is valid and a slash is entered, it would reload the panel with the next folder. I am just playing around with ideas is all, nothing is guaranteed until I find something I truly like.

I think there were some other small changesā€¦I donā€™t knowā€¦canā€™t remember, but let me know what you think.

0 Likes

#33

Sweet! :smile:

I had trouble at work getting to the root (hard drives) on Windows XP (with the previous version of the plugin). I got all the way down to C:/ and then hitting .. once or twice did nothing, before giving me a ā€œNo Diskā€ prompt like this:
techimo.com/forum/attachment ā€¦ -error.bmp

(The screenshot is the result of googling, I didnā€™t have time to take an actual screenshot. Sorry!)

Anything I can do in future for debugging?

0 Likes

#34

@quodlibet

I will look into it.

Also, I added two commands you can enter into the quick panel to create folders or files.

Just enter :mkdir or :mkfile

Then you can enter the name of the file or folder you want to create. I will probably change this in the future to be:

folder_name:mkdir to do it in one step. This will allow me to possibly do other commands like delete etc.

Anyways, have fun playing around with it. You wonā€™t see any more updates from me today.

0 Likes

#35

@facelessuser, can you please make this a repo instead of a gist. That way I can just pull request my changes.

Iā€™m making some tweaks and fixing some stuff. Looks good though.

0 Likes

#36

I will tonight or tomorrow. I didnā€™t except this to take off like it has.

0 Likes

#37

@facelessuser

The :mkdir/file commands are really cool.

I forgot to mention in my previous post that the plugin feels a lot snappier now. I was very pleased with this when I ran into the following problem: sometimes, when I press .., it registers two keypresses by the time I pull my finger off the enter key. Iā€™ve only tried the newer versions of the plugin on my netbook and itā€™s possible the key is wonky ā€“ or maybe my finger is :smile:

I was thinking, if itā€™s possible to write a message to the status bar while the panel is open, that that might be a place (as a temporary? fix) to write out the current directory. This the sort of information that I donā€™t need at all, until I do ā€“ and then I really need it.

Thanks again for working on this.

Sureā€¦ :wink:

0 Likes

#38

Because itā€™s not checking the size of every file or getting the contents of every folder.

@Facelessuser: any reason you went with on_modified rather than on_query_context + keybindings? I feel like the latter offers more potentialā€¦ One thing I need to figure out: reloading while keeping the contents of the quickpanel input intact. (i.e. opening the quickpanel with initial text)

0 Likes

#39

[quote=ā€œC0D312ā€]

Because itā€™s not checking the size of every file or getting the contents of every folder.[/quote]

Sorry I was unclear here. I understand why itā€™s faster than the previous few versions, but it feels faster than the very first version, as well. I couldnā€™t figure out how go back into a gistā€™s history to test this, though. And it may just be that Iā€™ve built a bit of muscle memory. At first, it was just weird using enter rather than tab for moving through directories. (I.e., for /home/alex/downloads Iā€™m used to typing cd /h<tab>a<tab>dow<tab>.)

0 Likes

#40

Okay, so Iā€™m close to figuring out the initial_text thing. Iā€™m using on_activated to populate the window. Unfortunately, it crashes sublimeā€¦

EDIT: hmmmā€¦ the on_activated method is being called 3 times whenever the panel is opened.

Anyway, I found my infinite loop. Fixing now.

0 Likes