Sublime Forum

Fuzzy filesystem find?

#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

#105

Jon,

Please, please, pleasssse expose the index of the selected item in the quickpanel. So many awesome things will come out of it.

0 Likes

#106

[quote=“C0D312”]Jon,

Please, please, pleasssse expose the index of the selected item in the quickpanel. So many awesome things will come out of it.[/quote]

+1

I am so limited by this currently.

0 Likes

#107

Okay, big changes. I decided to listen to COD312 and do the shortcuts as follows (it felt nicer than I thought it would).

delete file: type name of file/folder to delete and press ctrl+d
new file/folder: type name of new file/folder press ctrl+n for file and ctrl+shift+n for folder
copy (target file or folder as source for copying): type name and press ctrl+c
cut (target fie or folder as source for move): type name and press ctrl+x
paste (initiate cut or copy into current folder with optional new name): press ctrl+v to paste the file or type new name and press ctrl+v

For OSX replace ctrl with super

old commands :del, :copy, :cut, :paste, :mkdir, :mkfile have been deprecated.

That is it for now. Let me know if I broke anything or if you hate the new way…but I kind of like the new way…so…

Thanks COD312 for the suggestion!

0 Likes

#108

-Do not show system hidden files by default ("." for Linux\Unix and Hidden attribute for windows)
-Allow setting to show hidden system files by default (not regex excluded files)
-Add Reveal shortcut to show file or folder in OSs file navigator. [ctrl+r] windows/linux [super+r] osx

0 Likes

#109

I must be really thick: I can’t figure out how copying/cutting & pasting works. (Creating & deleting files works fine.)

And a quick note: If possible, I would prefer if the warning about deleting files/folders used Sublime’s interface rather than the OS’s.

Alex

0 Likes

#110

Type file/folder name and use ctrl+c or ctrl+x for copy or cut respectively. Navigate to location you wish to paste it, and hit ctrl+v. If you want to rename it, type a name before pasting.

I don’t think I can get more “Sublime Interface” than by calling sublime’s interface like so:

[pre=#000000] if not sublime.ok_cancel_dialog("%s exists!\n\nOverwrite file?" % file_name):
return[/pre]

0 Likes

#111

I still can’t work out how to cut/copy/paste. I’m either colossally stupid (which might well be the case) or it’s not working in Linux. An example: I am trying to do is to rename MoveTab.py in my User folder to MoveTab.py.foo. I navigate to User/ and then type MoveTab.py and press Ctrl+X, which seems to work (i.e., the input field is erased), but then when I type MoveTab.py.foo and press Ctrl+V, I get the clipboard pasted in the panel’s input.

Yeah. I thought I remembered the File Navigator plugin used the panel for verification but I just checked and I was wrong.

Alex

0 Likes

#112

[quote=“quodlibet”]I still can’t work out how to cut/copy/paste. I’m either colossally stupid (which might well be the case) or it’s not working in Linux. An example: I am trying to do is to rename MoveTab.py in my User folder to MoveTab.py.foo. I navigate to User/ and then type MoveTab.py and press Ctrl+X, which seems to work (i.e., the input field is erased), but then when I type MoveTab.py.foo and press Ctrl+V, I get the clipboard pasted in the panel’s input.
[/quote]

I will take a look at linux. In all honesty, I haven’t tried linux yet. Did you have any errors in the console?

It might have at one time; maybe they changed it. Do you think confirmation in the panel would flow nicer? I can give it a try and we can see how we like it.

0 Likes

#113

No. I can grab a screencast if it helps (although, I tried to be explicit as to what I was doing in my previous description).

I like FuzzyNav because a) the default Linux open/save dialogs are crappy; b) all my computers are slow enough that I find the delay until the dialogs come up annoying (whereas Sublime is supper snappy); c) if you’re in distraction-free mode the OS chrome is quite distracting. In this case, only © might apply to users in general; I think (a) & (b) are my own private peeves. Make what you will of this :smile:

0 Likes

#114

A screencast might help. I know it works on Mac and Windows. The things I am using in linux should work, but I haven’t tested everything there. If it is a simple misunderstanding on your part, a screencast will show me what you are doing wrong. If the plugin has a linux issue, then me playing around in linux might be the only way for me to figure out what is wrong. Make sure to let me know what flavor of Linux you are using etc.

[quote=“quodlibet”]
I like FuzzyNav because a) the default Linux open/save dialogs are crappy; b) all my computers are slow enough that I find the delay until the dialogs come up annoying (whereas Sublime is supper snappy); c) if you’re in distraction-free mode the OS chrome is quite distracting. In this case, only © might apply to users in general; I think (a) & (b) are my own private peeves. Make what you will of this :smile:[/quote]

No problem, I can give it a shot, it might work nicer. If enough people hate it, I can always role it back. Making it configurable might not happen because one method is synchronous and the other asynchronous, but we can see. I never use full screen because I always have other stuff I am referencing or doing etc, but the panel confirmation seems like it would be nice and quick.

0 Likes