Sublime Forum

Fuzzy filesystem find?

#85

[quote=“facelessuser”]Start from file shouldn’t work if no views (buffers) are open. It grabs the current open view. It is a TextCommand that is launched from the view.

Bookmarks should work because it is a Window Command. The basic navigation should work (not from file), but you won’t be able to use it because it is in the context menu, but you can access the root from bookmarks.

Let me know which commands are not working. I honestly haven’t tested with now views open[/quote]

Ok, thats exactly what I get, I was just assuming that FFN defaults to, e.g., the root or home dir when no view is opened and Start from file is requested.

0 Likes

#86

[quote=“matthjes”]

shouldn’t work if no views (buffers) are open. It grabs the current open view. It is a TextCommand that is launched from the view.

Bookmarks should work because it is a Window Command. The basic navigation should work (not from file), but you won’t be able to use it because it is in the context menu, but you can access the root from bookmarks.

Let me know which commands are not working. I honestly haven’t tested with now views open

Ok, thats exactly what I get, I was just assuming that FFN defaults to, e.g., the root or home dir when no view is opened and Start from file is requested.[/quote]

Cool. I fixed it. It now uses a WindowCommand instead and defaults to bookmarks if no view is open.

0 Likes

#87

[quote=“facelessuser”]

shouldn’t work if no views (buffers) are open. It grabs the current open view. It is a TextCommand that is launched from the view.

Bookmarks should work because it is a Window Command. The basic navigation should work (not from file), but you won’t be able to use it because it is in the context menu, but you can access the root from bookmarks.

Let me know which commands are not working. I honestly haven’t tested with now views open

Ok, thats exactly what I get, I was just assuming that FFN defaults to, e.g., the root or home dir when no view is opened and Start from file is requested.

Cool. I fixed it. It now uses a WindowCommand instead and defaults to bookmarks if no view is open.[/quote]

Whoa, that was quick, thanks! One step closer to migrating from vim to sublime text :smile:

Edit:
Just changed it to first check if the home dir ist set in the settings -> if yes, then use “start from file” with home dir, if home is not set then use root instead. I think I will use this more than bookmarks when opening a fresh file.

0 Likes

#88

[quote=“matthjes”]
Whoa, that was quick, thanks! One step closer to migrating from vim to sublime text :smile:

Edit:
Just changed it to first check if the home dir ist set in the settings -> if yes, then use “start from file” with home dir, if home is not set then use root instead. I think I will use this more than bookmarks when opening a fresh file.[/quote]

I will probably make the defaulting behavior configurable via a setting. That way you could choose “home”, “bookmarks”, or “root” as your default. I might throw it in during a break today.

0 Likes

#89

FYI, I just threw together configurable default action for FuzzyStartFromHereCommand via the settings file.

[pre=#000000] // If the “FuzzyStartFromFileCommand” is run outside of a open buffer
// or from a buffer that does not exist on disk, you can specify
// its default action to do instead of starting navigation from
// a file’s location. Options are “bookmarks”, “home”, “root”.
“start_from_here_default_action”: “bookmarks”,[/pre]

Now everyone should be able to have it work as expected with a little tweaking :smile:.

0 Likes

#90

when is this planned to land in package manager?

0 Likes

#91

Good question.

I am still feeling out some things. As soon as I feel the core features I care about are in place, people are happy with general functionality, and it has no outstanding bugs, I will probably make the request for Package Control.

0 Likes

#92

@vitaLee In case you’re not aware of it, you can use Package Control to handle packages that have not been submitted to it.

Just use the Package Control: Add Repository command to add: github.com/facelessuser/FuzzyFileNav

Then you can install FuzzyFileNav using the Package Control: Install Package. Package Control will also do a decent job of keeping everything up-to-date. (Although, if you’re impatient, you can remove and re-install a package to get the latest version.)

When FuzzyFileNav is included in Package Control, all you have to do is remove the repository from your User/Package Control.sublime-settings.

0 Likes

#93

yes, sure i know that. :smile:
somehow it slipped my mind, thanks for reminding me @quodlibet.

0 Likes

#94

-Toggle hidden files/folders via ctrl+h shortcut in quick panel
-Show cwd in status bar via ctrl+/ shortcut or type ?/ in the quick
panel
-Show bookmarks via ctrl+b shortcut in quick panel
-Some internal stuff

So now you can invoke some of the features with shortcuts from within the Fuzzy Nav panel. The shortcuts only take affect in the Fuzzy Nav Panel, so they should not interfere with other shortcuts.

If everyone likes the shortcuts better, I will probably remove the “+/”, “-/”, “*/”, “?/” inputs for showing hidden files, hiding hidden files, bookmarks, and showing cwd respectively in favor of the shortcuts.

I may even add make the mkdir and mkfile commands as shortcuts in the future.

Please let me know if there are any issues; I did tweak some internal stuff too.

0 Likes

#95

Hi @facelessuser,

Some thoughts on the recent updates:

I was less excited by the tab feature than I thought I would be. It doesn’t seem to be as well suited to navigation as to autocompleting the folder/file name for other commands to use. I wrote a mini essay about this, but I’d rather not bore you to death. Two issues: case-sensitivity (seems to contradict the standard behavior of the fuzzy search); auto-complete doesn’t access the folder (changing this would be good for navigation, and a bad idea if you want to use the tab to fill in the folder/file name).

Would it be possible to add a setting to have the current directory always showing?

I prefer the new shortcuts. But then, I never got adjusted to previous ones.

Perhaps because I don’t use them as frequently as, say, the bookmarks, I’m fine with the commands as they are.

Are you considering adding other file management actions? Deleting, renaming, moving (strictly speaking the last two are the same thing in *nix terms but the implementation of the latter seems more complicated)?

I’m still having some trouble in Windows. I’ll post a decent write-up next week. (Sorry, crazy week at work.)

Thanks again for your great work,
Alex

0 Likes

#96

Yeah. There is no case sensitivity on the Windows version, but I did on Unix/Linux because it is case sensitive. I agree it doesn’t feel as natural though. The problem is that I cannot get access to the current selected index in the quick panel. If that info is in the view, I don’t know the key to access it, and I can’t dump the view settings to see all keys. I can’t use any of the built in fuzzy libraries in Python to guess what ST2 would select because I think Jon wrote his own fuzzy algorithm, so I would have to write my own to mimic his (which would be hard). If Jon exposes access to the fuzzy algorithm, or expose access to the current selected index in the quick panel, then I would be able to give a better feel to it. If no one likes it, I may just remove it, but the good thing is that it hurts nothing by being there as well. It is one of those features that you can use if you like it, or not if you don’t, it shouldn’t interrupt work flow.

I think so, I will look into it. As long as I can reliably make it go away when the quick panel is closed. I don’t think quick panel has an on_cancel event.

I like the shortcuts better myself after using both. So I will probably remove old method.

[quote]Perhaps because I don’t use them as frequently as, say, the bookmarks, I’m fine with the commands as they are.

Are you considering adding other file management actions? Deleting, renaming, moving (strictly speaking the last two are the same thing in *nix terms but the implementation of the latter seems more complicated)?
[/quote]

Yeah, maybe not all at first. I think I may add deleting before a first release. I am aware of the renaming/moving being more complicated, that is why it may not happen if first release, but it is doable.

There seems to be something specifically weird about your system because I cannot reproduce such issues. I detailed write up may be very helpful. Until I understand what is failing, my fixes are just guesses.

I might have some pushes this weekend, maybe not if I feel lazy. But I think we are getting closer to final release as we iron out these last details.

0 Likes

#97

The quickpanel sets -1 as the argument to the on_done method when you cancel it.

0 Likes

#98

[quote=“C0D312”]

The quickpanel sets -1 as the argument to the on_done method when you cancel it.[/quote]

Duh…I actually knew this and have used it before…my brain must be not working :smile:; thank for reminding me.

0 Likes

#99

I would vote to keep the tab functionality, because it’s likely to come handy in situations other than navigation (see below). Also, I haven’t used it for long enough to have a strong opinion; maybe I’ll warm up to it.

I imagine your difficulties don’t have to do with the UI. But, on the off chance, here’s a couple of ideas:

  • Deleting would work well with the tab autocompletion so you could easily do: very long filename.md:del. Some verification would be nice, since this would circumvent the OS’s trash functionality.

  • You could treat renaming/moving like one command (move) that behaves like AdvancedNewFile (if I recall the plugin correctly). So you could do Something:mv (tabbing would help here as well), which would open a panel at the bottom with the name filled in. You could then type Something.foobar to rename it or, to move it, ../../Something, Old-Files/Something and so on. This would allow you to do the kind of small scale renaming/moving that results from typos or absent-mindedness. (Like calling a file style.csss and placing it in the javascript folder. That kind of thing.) Larger scale file manipulation should likely be left to the file manager.

(It would be nice to leverage FuzzyNav’s features, but that sounds like an immense headache. Some kind of “ticking” functionality might work, whereby you “tick” files and then navigate to where you want to move them and hit Ctrl+M. But I don’t know how this would work, UI-wise; the closest I can think of is the git plugin which is not tremendously elegant.)

Yeah. :smile: What can I tell you? It’s a work PC. How they’ve set it up is anyone’s guess. At home I use Ubuntu and I haven’t had any problems since you mixed the .. issue.

There’s another issue, which I think is not specific to my weird system, that has to do with relative paths. I’ve done some research and it seems to plague other Sublime users as well, especially those who are running Sublime out of Dropbox or other variable location. This is an issue that’s probably best addressed by @jps; I’m just going to mention the specific problem I’m having with FuzzyNav. Feel free to ignore it. Basically, I would like to be able to define bookmarks relative to Sublime, as I can for example with the $packages variable in build systems. (I don’t know if it’s my Windows system, but %UserProfile% seems to be entirely ignored by Sublime.) I run Sublime out of Dropbox, so I could backpedal out of that path to create bookmarks to other locations in my Dropbox (because its absolute path changes from computer to computer). Does this make sense? Am I missing something obvious?

Alex

0 Likes

#100

-"*/", “?/”, “+/”, and “-/” have been removed; shortcuts replace this functionality.
-":del" command has been added (can delete files or folders); confirmation is required before deletion

Deletion is no big deal. It is now added. I will probably in the future allow the panel to stay open for multiple deletes, but I am lazy today.

Thanks for the suggestions. I am not sure what I am planning to do, but I will take into consideration your suggestions. I am holding off for now though. This will probably come after release.

I can add some kind of relative file handling in relation to ST2. It may come a bit later though. Not on my priority list, but also, I don’t imagine it would be too difficult. I will play with a portable version.

0 Likes

#101

-Keep panel open after action is performed
-Change “multi_file_open” setting name to “keep_panel_open_after_action”
-“keep_panel_open_after_action” true by default

Okay, that is really it for today.

0 Likes

#102

FYI. I know I said I probably wasn’t going to add it yet, but I figured out how I wanted to do it in my head, so I wanted to get it down while it was still floating around in there.

-added :copy, :paste, and :move commands
-couple of internal changes

So basically you would use the features like this:

-file_or_folder_name:copy
-Navigate to where you want the file/folder
-:paste or :move to paste it or move the item
-if you want to rename it, you would simply do this – new_name:paste or new_name:move
-You will be prompted if you want to overwrite if the file already exists (for pasting or moving files only, folders will simply be placed inside existing folders)

You can only copy one file at a time. Maybe in the future I will allow multiple, but not at this point.

I only have a couple more things I want to get done with before I release this.

0 Likes

#103

Hmmm. I’ll try it out but I think I’d prefer command/control + c/x/v for copy/cut/paste. Would be faster and make sense.

0 Likes

#104

I mentioned earlier that I would possibly do shortcuts for file operations, but I haven’t bothered to do that yet. The problem with shortcuts is that it doesn’t give you the opportunity to rename, only copy and move. I don’t think entering a name and then ctrl+v feels very intuitive, so I am still thinking how I would like to implement the shortcuts. It is faster, but doesn’t make as much sense yet. Maybe allowing the shift alternative shortcuts for renaming would be suitable. Ctrl+Shift+v would then prompt for a name before preforming the copy/move.

Again, not sure how I want to approach that yet. This is just the initial addition of the feature.

0 Likes