Sublime Forum

ST3: FuzzyFileNav

#25

You have to drill down into folders. Deep recursive folder searches would be very slow; imagine starting in your root directory…

The only way to effectively allow FuzzyFileNav (FFN) to do this recursively, I would need to index your entire harddrive. Not really looking to have yet another process indexing my harddrive and slowing down my PC.

FFN allows you to quickly navigate relative files and folders to your current file or folders and files outside your project to view or apply file operations on them directly in FFN. This is not meant to index your entire terabyte harddrive to quickly find any file on your computer by using the fuzzy algorithm.

0 Likes

#26

Tried installing ST3 FFN by cloning the git project (is there a better way?). Some issues:

multiconf.py:44: Single instance of “\U” in C:\Users in docstring. Backslash needs to be doubled.

Two instances of isinstance(key, basestring). Basestring is gone now, should be str(?)

fuzzy_file_nav.py:29: Usage of “FuzzyFileNav: %s” % s. % operator appears to be gone, should be replaced with .format() call.

I’m not conversant with Python 3, so the above suggestions are just guesses from Googling.

And finally, after all that:

File “/Users/jsc/Library/Application Support/Sublime Text 3/Packages/FuzzyFileNav/fuzzy_file_nav.py”, line 13, in
from multiconf import get as qualify_settings
ImportError: No module named ‘multiconf’

It looks like it’s loading fuzzy_file_nav.py, and THEN trying to load multiconf.py as a plugin? Not sure what’s going on.

0 Likes

#27

Okay, figured out the multiconf issue. Need to import from FuzzyFileNav.multiconf instead of multiconf.

Then hit:
NameError: global name ‘unicode’ is not defined

Removing all the calls to unicode(xxx) and replacing with just straight xxx seems to have cleared that up. The panel appears. Actually trying to drill down into any directories immediately returns, however. There is an error:

File “/Users/jsc/Library/Application Support/Sublime Text 3/Packages/FuzzyFileNav/fuzzy_file_nav.py”, line 595, in run
edit = view.begin_edit()
TypeError: begin_edit() missing 2 required positional arguments: ‘edit_token’ and ‘cmd’

And this is where we start getting into API details, so I’m out of options.

0 Likes

#28

@jsc

If you are using ST2, then you can use the main branch github.com/facelessuser/FuzzyFileNav

Don’t install the main branch on ST3 though. Only the ST3 branch works on ST3 github.com/facelessuser/FuzzyFileNav/tree/ST3

Conversely, do not use the ST3 branch on ST2.

You can see they are different.

0 Likes

#29

Oh man. Sorry, I should have figured I was doing something wrong. I just git cloned the URL on that page and didn’t switch branches. Everything works great.

0 Likes

#30

You can use Package Control to manage branches. I have described this here:

There may be more thorough write-ups available.

Hope this helps,
Alex

0 Likes

#31

Alex, that is a great suggestion. It doesn’t seem to work for me, though. I can’t figure out how to add a branch as a repository. When I add the tree/ST3 URL, I still only see the ST2 version. I think the main problem is the one I was experiencing earlier, where using the tree/ST3 URL shows you the branch, but the link to the repository is the main package and you have to switch branches manually. I am not super familiar with github, as I’ve demonstrated.

0 Likes

#32

What is the URL you are using when adding a repository? As far as I know, manually added repositories will override those in the main package repository.

0 Likes

#33

@jsc, the following should work:

  1. Use Remove Package to remove FuzzyFileNav (if installed)
  2. Use Add Repository to add the following URL: github.com/facelessuser/FuzzyFileNav/tree/ST3
    2a. make sure that’s the only “FuzzyFileNav” repository in Packages/User/Package Control.sublime-settings
  3. Use Install Package to add FuzzyFileNav

There’s no obvious indication as to which branch/version you’re installing/have currently installed. Except for the fact that it will work :smile:

Hope this helps,
Alex

0 Likes

#34

[quote=“quodlibet”]@jsc, the following should work:

  1. Use Remove Package to remove FuzzyFileNav (if installed)
  2. Use Add Repository to add the following URL: github.com/facelessuser/FuzzyFileNav/tree/ST3
    2a. make sure that’s the only “FuzzyFileNav” repository in Packages/User/Package Control.sublime-settings
  3. Use Install Package to add FuzzyFileNav

There’s no obvious indication as to which branch/version you’re installing/have currently installed. Except for the fact that it will work :smile:

Hope this helps,
Alex[/quote]

Well there is one thing that can help verify you are using the right version (since I think the ST3 branch has a newer commit than the ST2 branch). If you look at the info given when installing there is a version number (which is the last commit date for FFN). Though that can be more of a pain to look up. Probably better off just trying it. :smiley:

0 Likes

#35

Nope, that’s exactly what I tried. Ends up installing the ST2 version. “v2013.02.18.20.42.21; github.com/facelessuser/FuzzyFileNav

	"repositories":
	
		"https://github.com/facelessuser/FuzzyFileNav/tree/ST3"
	]
0 Likes

#36

On another topic, I have a feature request. I have keep_panel_open_after_action set to false, because the vast majority of the time, I’m just looking for a file. But there are some actions after which it would be useful to keep it open, such as creating a new folder. I would like to be able to distinguish the useful cases from the non-useful cases, or have it done for me.

Another idea for a feature I had involves show_system_hidden_files. I have this set to true, but I don’t like looking at the long list of dotfiles in my home directory. But if I set it to false, I can’t actually select any of them. I would like to have a setting where those files are hidden unless you start searching with period.

Thanks, by the way, for such a fantastic plugin. I am a longtime emacs user, and I can’t stand using the file dialog for anything. FFN is the closest thing to emacs’ find-file that I’ve found so far.

0 Likes

#37

That’s the current ST3 version. Maybe you forgot to update your keymap file? FFN only ships with some example files. Do you have any errors in the console?

Alex

0 Likes

#38

I can look into to this. I don’t think it would be too difficult to add.

The setting is for the default behavior. You can toggle between the two with ctrl+h or super+h on mac. Triggering with dot only makes since on systems that use dot to distinguish hidden files; windows does not; therefore, in order to have a consistent interface, I have opted to use the toggle shortcut to quickly hide or show hidden files.

No problem. Glad you like it. I really on create plugins I actually use, but it is always nice to hear that others use them as well :smile:.

0 Likes

#39

@jsc I have added your feature request to have control over which actions to keep the panel open for. You can now exclude actions via the settings key below:

[pre=#2D2D2D] // Actions that can ignore the keep panel open settings
// Available actions: delete, open, saveas, mkfile, mkdir, paste
“keep_panel_open_exceptions”: “open”],[/pre]

I will backport to ST2 later.

0 Likes

#40

The new exceptions preference is perfect.

I couldn’t figure out what was going on with the repository, I think it was an issue with a cache somewhere. I was getting bad unzip errors. I blew away the whole ST3 directory and reinstalled from scratch, and it works fine now.

I can’t get super-h to toggle the hidden files, though.

EDIT: ah, I see what’s wrong. show_system_hidden_files needs to be false. If true, super+h doesn’t toggle. Seems like it should.

0 Likes

#41

I will take a look at this. I don’t think I meant it to work that way…

0 Likes

#42

Obviously, you know your own code better than I do, but just in case it might save you some time digging, I believe the issue is in line 694 of fuzzy_file_nav.py. Togging with super+h toggles ignore_excludes, but it does not impact show_hidden. There seems to be some unintended overlap between the meaning of “excluded” files (by regexp) and “hidden” files.

I’m not sure what the right resolution is. I want to be able to change showing and hiding all files, hidden and excluded, through toggle, but there doesn’t seem to be a clean way of doing it with just one toggle. Maybe keep super+h for toggling hide files and have another command to toggle excluded files? Or if it is easier, just change super+h to toggle show_hidden instead of ignore_excludes, since it is probably much rarer to want to load an excluded file than a hidden one.

0 Likes

#43

@jsc I think you should be happy with the recent change. The behavior for the toggling of hidden files is more consistent now. Not sure what my original reason was for doing it the way I was, but you should have no issues now.

So what this means is when a new FuzzyPanel session is opened, it will use the setting in you setting file, then any time during the session you can toggle back and forth and it will remember the state throughout that session (until quick panel session is officially exited/completed). Regex excluded files and hidden are now treated the same.

I will backport this to ST2 later.

0 Likes

#44

So, a few things. Trying to let Package Control automatically upgrade caused another corrupted mess that wouldn’t load. Whatever, I’ll manually pull updates until that’s fixed, probably a Package Control issue.

Secondly, your latest update, while having the admirable effect of allowing hidden file toggling no matter the initial setting of show_system_hidden_files, also has the side effect of ignoring the setting of show_system_hidden_files. I have tried it set to both true and false, and it always shows me hidden (and excluded) files on initial open.

Actually, now on more testing, that’s not exactly true. 1) I have it set to false, always shows hidden files; 2) I set it to true, still shows me hidden files; 3) I set it back to false, and now it works like I expect. Oh wait, now it’s back to showing me hidden files, although I haven’t changed anything. So it’s a bit hard to make it stick.

I think a sensible behavior might be to treat and excluded files exactly the same. That is, excluded files are just hidden files that were hidden by the user. Then use the hidden files setting to determine whether to open showing all files or just non-hidden ones.

0 Likes