Sublime Forum

FuzzyFileNav Plugin (on package control...finally)

#1

Here is the official thread for the FuzzyFileNav package. If you are already using it, you know what it is.

FuzzyFileNav is a plugin that allows you you navigate the file system (outside of projects) via the quick panel. There are at least one or two other plugins on Package Control that do similar things. I believe FuzzyFileNav has some unique features.

Anyways, feel free to try it. Post requests, bugs, whatever here.

The official repo is here: github.com/facelessuser/FuzzyFileNav.

0 Likes

#2

Wow. I have been looking for a plugin like this for so long. It’s really amazing. Thank you!

I realize I have a lot of plugins installed that are written by you. You’re like the tim pope of sublime plugins! :laughing:

Is there a way to always have it start at a default location even when I’m in an open buffer?

0 Likes

#3

[quote=“Watabou”]Wow. I have been looking for a plugin like this for so long. It’s really amazing. Thank you!

I realize I have a lot of plugins installed that are written by you. You’re like the tim pope of sublime plugins! :laughing:[/quote]

Thanks! I only write what I actually use, so everything I have out there is because I had a need/desire for them. I have more that I haven’t released or that maybe I posted in a forum but people didn’t show any interest so I kept them to myself.

Yep. Here is my personal config on my work PC. The third entry is what you want. Just replace your default key binding with something like that.

[pre=#2D2D2D] //////////////////////////////////
// Fuzzy File Nav
//////////////////////////////////
{ “keys”: “ctrl+o”], “command”: “fuzzy_start_from_file” },
{ “keys”: “ctrl+shift+o”], “command”: “fuzzy_bookmarks_load” },
{ “keys”: “ctrl+super+alt+o”], “command”: “fuzzy_file_nav”, “args”: {“start”: “C:\workbench” }},[/pre]

0 Likes

#4

Thanks, that works nicely!

0 Likes

#5

Any chance that you will some day you will need a persistent undo (that will also work after sublime is restarted) or branched undo/redo? :mrgreen:

vim.wikia.com/wiki/Using_undo_branches (look for Gundo screenshot)

0 Likes

#6

Who knows, maybe :smile:.

0 Likes

#7

@iamntz Gundo looks really sweet!

@facelessuser Is there any chance that you will need to extend FuzzyNav so that it can be used as a dialog for saving files? :smiley:

Alex

0 Likes

#8

@quodlibet

Doesn’t it already, to an extent via the “Fuzzy Make File” and “Fuzzy Make Folder” commands?

@facelessuser

Great idea implementing (and the original idea from biermeester and matthjes) os/host specific settings. I hope you don’t mind if I apply it to another plugin. One more thing (feel free to ignore this as it isn’t plugin related if you would like). I have written a plugin to help identify key conflicts. Though to me you fall into the category of “If it doesn’t exists and I want it, I’ll build it”, I was wondering if there was anything you could think of as a Sublime Text user or developer, that you feel would be helpful to know with regards to key bindings. Anyways, obviously not related to your plugin, so feel free to ignore.

Thanks for all the hard work. I really do like a number of the plugins you have written.

0 Likes

#9

Yeah, it is still on my list. I have a habit of taking on too much, but I will get to it.

[quote=“skuroda”]@quodlibet

Doesn’t it already, to an extent via the “Fuzzy Make File” and “Fuzzy Make Folder” commands?
[/quote]

Kind of, and you can use the “Fuzzy Copy” and “Fuzzy Paste” command to effectively “Save As”, but I know what he means. He would like to take an unsaved buffer with content and turn it into a file, but pass it through ST2’s save function to save it in a consistent way. Also the same with save as with unsaved content.

[quote=“skuroda”]
@facelessuser

Great idea implementing (and the original idea from biermeester and matthjes) os/host specific settings. I hope you don’t mind if I apply it to another plugin.[/quote]

I don’t mind at all. That is what it is there for. As long as you include the license, it is fine. I plan to integrate it into a couple more of my plugins to abstract some settings that make sense to be abstracted.

Off the top of my head, the only things I can think of that I miss in regards to key bindings I have solved in two scripts:

  1. Shorcut profiles (ShortcutPlus): gist.github.com/4029726
  2. Find and open any keymap file or other package files (PackageFileSearch): gist.github.com/4072884

Neither plugins above are formal Package Control releases. Sometimes I post scripts and see if people actually care about them to see if it is a waste of time creating a formal Package Control repo. Sometimes I don’t release them at all because of laziness, or they just aren’t polished enough, or I don’t think anyone will care.
The ability to fairly quickly pull up a plugins keymap file (without having it in a project) to disable something is nice. I don’t recall releasing PackageFileSearch which can pop up a menu to show a list of all files of X type found in packages on your computer, but I find it very useful, and it applies to key map files as well.

What might be nice from your plugin, is when you show the key maps you create invisible regions with keys (“keyconflict=filepath” or something) around each keymap. When you click or maybe double click (heck even a shortcut), your plugin would look at the region and determine which key map file to open. Just an idea.

0 Likes

#10

Thanks. I saw your post of the shortcut profiles. I book marked the Gist, but haven’t had a chance to use it much (granted I don’t have a ton of plugins installed/keybindings). I had thought about creating “links” to the actual key maps files. Thanks for the ideas!

0 Likes

#11

PERFECT!

0 Likes

#12

Thanks for keeping it mind. You had asked that I don’t pester you about this until an official release. So, here I am!

In other news . . . I have gotten so used to FuzzyNav – and I spend so much time in Sublime – that I am only aware of it when I’m in Excel or something and I hit Ctrl+O, Ctrl+B, db and stare at my screen wondering why I am not looking at the contents of my Dropbox folder. In case it’s not clear, this is a compliment.

Alex

0 Likes

#13

Another question for you (well about your plugin this time :smiley: ). I was curious to why you chose to implement the more MS-DOS style auto completes (where you cycle though the options) rather than the more Unix (or at least what I have experienced) auto completes (where tab fills in the longest prefix). Again, if you don’t feel like answering, that’s fine, I was just curious.

Thanks.

0 Likes

#14

[quote=“quodlibet”]
Thanks for keeping it mind. You had asked that I don’t pester you about this until an official release. So, here I am!

In other news . . . I have gotten so used to FuzzyNav – and I spend so much time in Sublime – that I am only aware of it when I’m in Excel or something and I hit Ctrl+O, Ctrl+B, db and stare at my screen wondering why I am not looking at the contents of my Dropbox folder. In case it’s not clear, this is a compliment.

Alex[/quote]

I appreciate the kind words.

Oh, and “save as” functionality is in :smile:. Just open the Fuzzy File Nav Panel as usual and type in a file name and press ctrl+s or super+s for Mac, and it will save your file as the name you entered. You will be prompted to approve overwrites. I am not responsible if you file explodes into a million tiny pieces…but it should work based on the little testing I did :wink:.

[quote=“skuroda”]Another question for you (well about your plugin this time :smiley: ). I was curious to why you chose to implement the more MS-DOS style auto completes (where you cycle though the options) rather than the more Unix (or at least what I have experienced) auto completes (where tab fills in the longest prefix). Again, if you don’t feel like answering, that’s fine, I was just curious.

Thanks.[/quote]

Honestly, some times I feel like MS-DOS, sometimes I don’t. I guess I was feeling MS-DOS. I can do either way…I want to say I started with UNIX style (or close to), but people didn’t quite like it. I use MS-DOS at work, and UNIX at home, so they all bleed together for me.

0 Likes

#15

That was my guess, but thought, hmm maybe there’s some deep philosophical reason that I don’t yet understand. Also, the windows key binding for save is set to “super+s” (which works too) rather than “ctrl+s” like I think you meant.

0 Likes

#16

Thanks, I was working on a Mac at home…like I said it all blurs together sometimes. I fixed the windows and linux keybinding for saving.

I go back and forth sometimes on which path completion style I like better. Maybe I will add back UNIX style and make it an option if enough people care. I can go either way with path completions.

0 Likes

#17

No problem. I agree I have to switch back and forth between the two systems, so it’s not a huge deal. That being said, I’ve added the Unix style auto complete for me. I think I prefer because I can actually see the files that match the pattern. Where as, for example, the AdvancedNewFile plugin you can’t so the Windows style works fine.

So this isn’t quite worth making a pull request either, but I found another bug for you. I believe you WIN_DRIVE regex should be
[pre=#272822]WIN_DRIVE =* r*"(^A-Za-z]{1}:\)"[/pre]

The missing “\” from the group causes the issue. Granted I only tested it when “back_to_root” is called, so you may want to double check it doesn’t break anything else. The problem is the group returns something like “C:” which isn’t resolved as a path on windows. So, when I type “/” in the quick panel, and it took me to the sublime packages directory rather than the root.

0 Likes

#18

[quote=“skuroda”]No problem. I agree I have to switch back and forth between the two systems, so it’s not a huge deal. That being said, I’ve added the Unix style auto complete for me. I think I prefer because I can actually see the files that match the pattern. Where as, for example, the AdvancedNewFile plugin you can’t so the Windows style works fine.

So this isn’t quite worth making a pull request either, but I found another bug for you. I believe you WIN_DRIVE regex should be
[pre=#272822]WIN_DRIVE =* r*"(^A-Za-z]{1}:\)"[/pre]

The missing “\” from the group causes the issue. Granted I only tested it when “back_to_root” is called, so you may want to double check it doesn’t break anything else. The problem is the group returns something like “C:” which isn’t resolved as a path on windows. So, when I type “/” in the quick panel, and it took me to the sublime packages directory rather than the root.[/quote]

I am not sure I understand. You have an issue going back to root after you made changes to the code or before? I use the slash to go back to root of drive on windows quite often, so I am not sure if you are describing an issue that is brought on by changes you made or that are inherent in the code. I will check again tomorrow on windows, but as far as I know, no issues exists with going to root of drive on windows.

0 Likes

#19

So I just did a clean install of the plugin and I still have the issue. Out of curiousity, when you go to the root at work, do you type something like “C:/” or “/”? I’m seeing the incorrect behavior when I do “/”. This machine only has 1 drive, so I have no reason to explicitly choose the drive (also kind of the back and forth between linux and windows). Hopefully you can reproduce it…or there’s just something really odd on my machine (which I suppose is possible too).

So all I’ve added to the code are those two print statements that I boxed in the image (did a clone and diffed to make sure).
(http://i.imgur.com/ogcA2.png)

0 Likes

#20

I will check tomorrow. I am not saying there isn’t a bug, just that I would be surprised. FuzzyFileNav has actually been used by people for months now (it just recently went on Package Control though), so I imagine I would have gotten a bug filed by now for something like this, but you never know.I will double check my system on windows tomorrow and let you know what I find.

I just want to illustrate that the missing slash was intentional and gets added back later. You can see here the get_drive function returns them without slash on purpose. The algorithm expects drives to not have the slash. Hopefully we can get to the bottom of this though.
[pre=#2D2D2D]def get_drives():
# Search through valid drive names and see if they exist.
return unicode(d + “:”) for d in “ABCDEFGHIJKLMNOPQRSTUVWXYZ” if path.exists(d + “:”)][/pre]

0 Likes