 Alright, what's up everyone? So in this video, I'm going to talk about something that people have seen me using in previous videos But I haven't actually told anyone what it is. It's up for when they ask But I haven't mentioned it in the video and that is you may have seen me when I'm grappling in when I'm searching for some config file or script that I want to modify sometimes I'll run this command S E and you'll see all this stuff Pop up on my screen and I will type something in one of these script names in and I will get to one of my scripts And I can edit that and a lot of people have asked me what exactly this is long story short the Important program that I'm running here is fuzzy finder or fzf, which is pretty much for all the distributions out there You can probably just install it. It's very simple very small By itself, you know, you might think that it comes out of the box as sort of a file searcher It's really closer. If you watch my channel, you probably know about D menu It's really closer to D menu except for on the terminal and I do use it for a couple things including this S E Now what what S E actually is I should probably tell you is You know, I have a scripts folder where I keep all of my scripts But the thing is I have so many of these I have no idea. Let's see how many I have I honestly don't know But I have so many scripts over a hundred that I started sorting them into subfolders So and I just add these I add all the subfolders to scripts to my path And the thing about that is it's very convenient. It makes things less messy, but sometimes I forget where a script is So I have this nice little fuzzy finder command that gives me, you know Really all of them make, you know out in the middle of note or out in front of me so I can access them But anyway, what what exactly is this script now by default if you just run fuzzy finder? Let's actually run it as an example. Let's go to my um, I don't know my documents folder If you just run fuzzy finder by itself It's just going to give you a list of all of the folders or all of the the files that are in the directory You're in and you can select one and what that does it doesn't open it It doesn't do anything fancy to it. It just prints its name to standard output now that of course is the greatest thing You could possibly do because it means you can easily write scripts that make use of this Nice and simple and of course you can also pipe standard input into fuzzy finder and do whatever you want now This is actually what I have in the SE Function that I created this is all it is so let's actually run this manually so we know exactly what it's doing so I du I du a both the scripts and configs folder and by default that's going to print it's going to print all of those files out with you know How big they are we don't want how big they are so we can just say we can just say Ock to To print only the second element because we don't want this first element up here Which is the file directory size so that'll give you all of you know the files in these directories And what we do with that is that we just pipe that into fuzzy finder So pipe those in the fuzzy finder then we can select one of them And if you'll see what this does is once we pipe that in the fuzzy finder that fuzzy finder pipes it into XRs Which allows you to basically read standard input and create a command with it specifically what I do here is I Open the file with an editor. So I let's do let's actually just do this. So we'll say XRs Can't type it the R is for if it receives no input it doesn't run the command That's what just an XR command, but if we say editor, so let's say Q and DL something like that Okay, so now this is open in my editor, which in this case is Vim so everything is working nice And that's all that this that's all that this command is notice I have a couple other ones for doing some other things like for example VF You know if I'm in some folder and I press VF that just takes only the files that are directly in this directory And then I can select one to open in Vim or something like that So they're pretty useful. You can check out fuzzy finders site for some more examples But we might as well. Let's go ahead and write one ourselves So I'm gonna go to I don't know. Let's see where am I gonna go? I'm gonna go to my downloads directory and I have a couple files in here nothing too sensitive So we can play around with it. Um, so let's say we want to create a Well here's what I'm thinking so if you know my setup You know that I keep this nice handy bookmark directories file That I actually generate bash aliases from you know an alias, you know The thing on the left is an alias to the thing on the right And I also pipe these to some scripts if I want to you know If I want to use my important directories for something like for example what I want to do here Let's say I want to use fuzzy finder to take this file And I want to create a function that you can just run a function. Let's call it M Run M on one of these files and it gives me a fuzzy finder menu Where I can select where which one of these directories I want to move it to that's a that's You know, let's say what we want So how can we do that now first off? So this file we of course only want the second element here so we can say awk To to print this the second element which of course is in this case is the um, you know Are the directories here and of course since this is a Christian channel? I don't need you seeing all my meme folders, so I'm gonna grep those out So I'm gonna say grep v and I'm gonna say memes because I actually have a lot of these But you know, I don't need these for the alias, so I'm gonna get rid of those So if I just run that just to be clear it's printing out it's gonna print out all of the directories of course that aren't memes Pretty simple so I can give this the fuzzy finder and that'll give me you know a list that I can select from So now how do I want to you know? Let's say I want to finish my script, you know, let's say I want to copy a file there How what exactly what I do well, I can do I can do it a couple ways I could do it with XRs again, but let's actually just say Well, actually I should probably go ahead and Create the already open. I should probably go ahead and create the alias here. So I'm gonna take this I'm gonna copy it and I'm gonna start. Let's you know, it's called it's called the function just see just for simplicity sake and Basically what we're gonna be doing is we're gonna copy. I'm gonna have it visual and I'm gonna copy whatever Um file we give it Just say the first argument where we'll make it extra simple here and we'll copy it to whatever Directory I select with fuzzy finder. Now. I think that should work We're doing it. We're doing it Real time guys. So let's see. So let's say copy and then I think I had a PDF here So we'll say copy that to home Oh, yeah, there's one more thing. Oh, yeah, one thing about fuzzy finder It's good I ran into this mistake is I don't think that It has some problems with like tilde. So it's good to convert tilde into like what it actually stands for So it doesn't actually know that it's home. So what we want to do here is we want to convert We'll use a said command and we'll convert a tilde Oops, that's not a tilde. We'll convert all tildas into home Okay, so notice a couple things I've done here if you're not a said pro Well, actually, I should probably run this and make sure it works so I can make sure that I'm a said pro Okay, so what was it see so we're running on Fisher and then we'll just have it go to home Okay, that worked and I'll explain that in just one second. Okay, so there it is So what I did here if you don't know what I did here Usually when people are using said they use slashes To you know differentiate the arguments and stuff like that. You can't actually use pretty much any character You might not know this everyone pretty much uses slashes. The reason I use You know the little pipe here is because I know that actually I should probably just remove remove my head I know that this home variable since it is like basically a directory location It's gonna have slashes in it and those slashes are gonna interfere, you know if the said command is looking at slashes So that's why I use these you know pipes here So really it's just replacing the tilde with whatever home is so it moves to the right location even though Fuzzy finder might not be as great. I don't know if it's a fuzzy finder problem or something else But yeah, so anyway, that's what we want. So I can do that again. Let's say let's see what else we have in here we'll copy Another one here. We'll copy that to my LaTeX folder. Okay, and if I go let's say I LS my LaTeX folder Okay, and there it is perfect So that's pretty much how you can do some stuff with fuzzy finder But you know as I said before for those of you who use D met D menu It can pretty much do anything that D menu does Now it just really is an issue of if you want to do them in the terminal or you know Up here or on your window in D menu. I will say there are additional settings I actually deliberately unset my settings for this But you can't change some things around like for example, actually, let me just show you what this does. So if I um You know, let's say I set these settings like the default options for fuzzy finder Which of course you could set by the command line, but you can also set them with you know The environment of environmental variables if I do something like that and run to run a fuzzy finder command Notice that it's much smaller and it's also reversed So you might prefer this kind of interface interface, you know, if I don't know you might like it So check that out. Anyway, as always just check the man for it. This is just bit This is just raising awareness about a program It's your responsibility to actually learn about it But you know fuzzy finders the kind of thing you can get a lot of juice out of so I hope you enjoy it and I will see you guys next time