Sublime Forum

Fuzzy filesystem find?

#116

So. After modifying the keybinding that was hijacking Ctrl+V I’ve had the chance to test FuzzyNav’s cut/copy/paste functionality.

Generally, it works quite well.

I would really like a simpler way to rename a file; i.e., something that keeps the name intact during the process. I generally only change a few characters, and I almost always would like to reuse some part of the original filename.

A corollary to this: I would like the [tab] to be fuzzier; or at least an option to disable case sensitivity.

Sorry if this posting is a little abrupt :smile:

Alex

0 Likes

#117

I can easily store the original name, but if you have an idea for how to preserve and insert that for the user in the UI in an intuitive manner, let me know. I haven’t come up with anything yet.

I can make things fuzzier, but it would not play nice with the built in fuzzy results in the panel, and since I cannot access those results directly, I have know easy way of intuitively melding those together. This is a weakness with the API. Disabling case sensitivity is easy though (windows is not a case sensitive file system, so I disable it by default on Windows). I will add an option for nix systems.

By the way, I wanted to add the full path to always be showing in the status bar like you requested, but the API allows you to add a status to the window bar for only a short while. If you set a persistent one, it only shows on the current view, which means you have to add it to each view if the view changes, and you cannot add it when there is no view. And then you have to sweep all views in the window to clean up all the status bars to make sure you clean up well. A bit annoying. The only good option is to display it in the panel, but I am not sure how I want that to look. It is a bit excessive to add it to every item in the panel. And you don’t want to add it to the main row, because then it will affect the fuzzy results, and then if you add it to a secondary row of one item, ST2 creates an empty secondary row for every item which doesn’t look good. I don’t know still haven’t decided on this one.

I will see about adding in the confirmations for deletes and such in the panel; I have just been busy.

0 Likes

#118

[quote=“facelessuser”]
I can easily store the original name, but if you have an idea for how to preserve and insert that for the user in the UI in an intuitive manner, let me know. I haven’t come up with anything yet.[/quote]

Ctrl+R (or whatever) opens a panel at the bottom with the name of the currently selected file/folder filled-in. ESC to cancel or edit the name and ENTER to rename.

I think I suggested this or something like it in an earlier post. It doesn’t really fit in with the UI as you’ve built it, but it doesn’t break anything either and it’s fairly economical as a design.

What I’m basically looking for in terms of behavior is the FuzzyNav equivalent of pressing F2 in my file manager :smile:

It might be possible to do all of this in the Go To panel, but maybe breaking up the process in two panels would assist the user. Or maybe not.

One note, related to the fuzziness. Can you provide an option to use the currently selected file/folder, even if it’s not the only one? I suspect it might be a really bad idea, but I would like to try it out.

I think the case sensitivity might be sufficient coupled with the note above.

Thanks!

[quote]
By the way, I wanted to add the full path to always be showing in the status bar like you requested, but[/quote]

Thanks for trying :smile:

I’ve got rather used to the ambiguity. Using FuzzyNav is sometimes like taking a deep breath and going underwater.

(You should probably skip this next paragraph.)

I discovered another file-mangerish plugin a few weeks ago. What that plugin did was to add a row at the top of the panel which indicated the current path. Would that be possible for FuzzyNav? Some creative typography will be required to distinguish it from the other rows, but I think that should be okay. It will deduct one row from what you readily see, but I think the improvement in usability would be worth it.

Damn. I hadn’t thought of this.

Don’t worry about it. I am very grateful for the time you’ve already spent on this plugin.

But, in terms of prioritising stuff, the next (and final) step would be to (somehow) hook FuzzyNav into the save process. (I recall you had told me to hold on with this request until your release FuzzyNav; I’m just being impatient. Sorry :smile: )

Alex

0 Likes

#119

Only pressing enter will retrieve currently selected index in the list. If you use a shortcut like Ctrl+R, I can only grab the text you typed in. This is all based on limitations of the ST2 API. I can probably open a rename panel on Ctrl+V before I do the copy/move action. It could then be populated with the name of the file/folder when copied or if you typed anything in the quick panel before pasting, it would grab that as the default.

:smile: . No biggie. I plan on adding the case sensitivity option. Then I plan on releasing it.

After that, I will probably take a look at the renaming functionality and the save process (not sure how I want to approach it, haven’t put much thought into it).

0 Likes

#120

Case sensitivity option is now in the settings file.

0 Likes

#121

Works like a charm.

[quote]
Only pressing enter will retrieve currently selected index in the list. If you use a shortcut like Ctrl+R, I can only grab the text you typed in. This is all based on limitations of the ST2 API.[/quote]

I have a feeling you’ve explained this before :blush:

Just to clarify: is it possible to use TAB to fill-in “HTML.tmLanguage” in the following situation?

My feeling here is that it would be best to assign it its own shortcut. Otherwise you would be adding an extra step when copying/moving and wrapping the renaming functionality inside a redundant process. Do you see what I mean? Another way of saying this is that although you can rename & move in one step using the CLI, you can’t using most GUI file managers.

There’s a semi-related issue with the plugin as it is. You’ve provided an option to keep the panel open after action, which is completely useless – except when it isn’t it :smile: I had suggested at some point that a way to have it both ways (i.e., keeping the panel open only when required) would be to use Ctrl+ENTER to trigger opening the file and keeping the file open. Does this idea hit on the limitation you mention above?

Thanks again,
Alex

0 Likes

#122

Currently it uses a linux/unix like autocomplete that you would find in the terminal. What you are requesting is more like windows autocomplete in terminal. I would have to track the last autocomplete and cycle through the options on each tab discarding the last autocomplete on character key press…so maybe in the future, but not right now. I also cannot grab the visually selected item because there is no access to that in the API. But give it some time, and I may get something like the windows autocomplete after release.

I can possibly add a rename specific shortcut that does what you request, and allow move/copy to continue functioning as is. I may do this after release.

I might, be able to do something. I have an idea that I might try today. I cannot simulate an enter press, so it can’t capture Ctrl+ENTER because ENTER would fail and I cannot simulate it. I might be able to watch for CTRL+ENTER and set a flag, but let it pass through without capturing it. I will let you know. Now this would not work after things like CTRL+V. So if you are doing a bit of copying and pasting, the keeping of the dialog open would only work for opening files where enter is used. I will see what I can cobble together.

0 Likes

#123

HOW!?!?!

0 Likes

#124

[quote=“C0D312”]
HOW!?!?![/quote]

It is nearly impossible to catch an “enter” or even a “modifier+enter” in the quick panel. But recently I discovered, you can capture enter if it is in a sequence like:

"keys": "ctrl+k","enter"]

Here you can use the on_query_context make sure the panel is active, and then just set a flag.

I am not saying it is super intuitive or ideal, but if you use a sequence, ST2 starts looking for the next key press after “ctrl+k” allowing “enter” to actually be captured.

Ugly hack…yes. Successful way to essentially modify a enter key stroke in the quick panel…yes.

0 Likes

#125

I’ve heard you make the distinction before and I’m not sure what you mean by it. In Linux, if you navigate to the Packages/HTML directory (which is what I was using as an example in the screenshot) and type HTML.t followed by TAB, it will autocomplete “HTML.tmLanguage”. My question was whether your plugin + Sublime’s built-in fuzzy stuff can handle something like this. (Although you’d need to write HTML.tm to counter the fuzzy search’s broader search.) Is this making any sense?

I generally use FuzzyNav to open files and, for me, that’s the likeliest candidate for multiple actions. I use the other functions for housekeeping (er, filesystemkeeping?). If I want to do a lot of operations, I would open a terminal or a file manager, which I think is acceptable. Actually, the more I think about it, I would be inclined to ignore everything I’ve said about this: I’ll change the keep_panel_open_after_action setting to false and that should solve most of my problems :smile:

0 Likes

#126

Maybe some distro’s terminals handle things differently, but my experience is that if there are names that start the same and you haven’t entered enough to differentiate one from another, Linux/Unix will not show anything, then if you hit tab again, it will show all the files that match, and you just type more until your result can only match one. I have used Linux for very long time, so I am certain that this convention exists. Some terminals may be more advanced. But anyways, the gist of what I am saying is right now you have “dumb” auto-completing. In the future, I plan on adding more “smart” auto-completing.

[quote=“quodlibet”]
I generally use FuzzyNav to open files and, for me, that’s the likeliest candidate for multiple actions. I use the other functions for housekeeping (er, filesystemkeeping?). If I want to do a lot of operations, I would open a terminal or a file manager, which I think is acceptable. Actually, the more I think about it, I would be inclined to ignore everything I’ve said about this: I’ll change the keep_panel_open_after_action setting to false and that should solve most of my problems :smile:[/quote]

I might just add something where by default, the panel does not remain open, and if you press some shortcut, you will enable keeping the panel open. So if you want to keep the panel open to open multiple files, you would just press “ctrl+k” once and then all open, delete, etc. operations will allow the panel to stay open without any further interaction. But by default the panel will just close after an open, delete, etc. I think this is a healthy compromise.

0 Likes

#127

Incidentally, I was messing about with the sidebar earlier, and I noticed that the “Delete File” menu option provided by SideBarEnhancements uses the panel for confirmation. This must have been what I had in mind when we were talking about it awhile back (and had mistakenly confused it with the FileNavigator plugin). The SideBar plugin also provides a rename command (accessible via the palette > File: Rename) which functions more or less like what we were talking about, although obviously it requires the file to be open. I don’t know if any of this is interesting or useful.

0 Likes

#128

Okay, I lied and went ahead and added smarter auto-complete and turned off case sensitivity in Linux/Unix by default. Let me know if you see any issues with this change, but overall, autocomplete should feel much nicer. I think that should take care of all major complaints.

Currently copy/cut and paste takes care of rename for now (but I will look into a more efficient same directory rename for the future after release).
Panel staying open option will probably get tweaked after release.
UI changes for prompts etc might get tweaked after release sometime.
Save option might be added sometime after release.
Code is getting a little sloppy, so I might try and clean that up after release as well.

Basically I want to play around with some different ideas before I do anything else, but I am hoping the better auto-complete is the last thing to make this feel really usable for now. I will continue to see how I can make this better, but I think it is about time for an official release.

0 Likes

#129

Cool. Hopefully this will make the interface faster and improve its “feel”.

Incidentally, it’s considered a bad idea in typography to both make something bold and underline it :smiley: But, yeah, I’ll shut up now :laughing:

0 Likes

#130

I forgot to mention, tab cycles through all like matches in auto-complete. Shift+tab cycles backwards through them.

[quote=“quodlibet”]
Incidentally, it’s considered a bad idea in typography to both make something bold and underline it :smiley: But, yeah, I’ll shut up now :laughing:[/quote]

What! *** I don’t*** understand what you are talking about. :confused:

0 Likes

#131

Added the ability to specify home setting and bookmark path setting in the preference file. Take a look at the default preference file for an example; also, check out the readme. Sorry if this breaks some things with personal settings.

0 Likes

#132

Hi all

can anyone explain me why i getting parse error “invalid escape” when i try to add such string

{"name": "downloads", "path": {"#multiconf#": {"host:SPC": "e:\downloads"}]}}
0 Likes

#133

Instead of e:\downloads try e:\\downloads (you need to escape the backslash with a backslash).

0 Likes

#134

Thanks, it help.
Probably README file needs to be changed, there we can see unescaped backslashes.

0 Likes

#135

[quote=“Sinled”]
Thanks, it help.
Probably README file needs to be changed, there we can see unescaped backslashes.[/quote]

Done. Thanks for the heads up.

0 Likes