FZF will change your workflow completely

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys in this video we're going to be going over f CF f ZF is a fuzzy searcher we're going to be going over a few other tools to that kind of augment it if there's one video that I really think you should pay attention to it would be this one this can be integrated in anyone's workflow and it will be useful so let's begin here by installing some tools we're gonna install f ZF we're also going to install a few other tools reinstall rip crap Universal ctags silver searcher and also FD down here so I may not get to Universal ctags and FD I make it to them we'll see but I'm definitely gonna be going over fzf and rip grep and probably silver searcher so this is how you'll install it just choose whatever distro if it's not listed here there's still a way to do it but these are the big three that I list for installing it it use your favorite plug-in manager there's two big ones you know them clog this has been plugin I think there's like DN that people use so if you go into vim plug you'll notice that you'll notice that I also installed airblade vim murder and the murder what it does is it makes sure that fzf is looking at a project directory if I Can Has project directory scope so if you have a dot get in the directory it'll like go all the way up until it finds the doc yet it's like okay this is where I'm supposed to look inside of otherwise when you start seeding in the files this will just look at the directory and just look down from the directory but I'm assuming that when you're in a project you want to be able to search through the entire project another thing that we'll be able to do is ignore like anything in your get ignore so if like you are the biggest node modules folder and you want to ignore all that stuff and it's in your get ignore well rip grep and all that stuff will ignore it as well so we already have that stuff installed the other thing will be - the other thing you'll need to do is add a configuration so we'll go into the plug config that's where I keep all my configurations and it's in FCF dot them right there so that's where I add all of this configuration and this is basically all of these commands are just found directly off of the wiki from from a June gun which he has a lot of great tools you should really look into a lot of them as well as a few other commands that I found just kind of scattered throughout the internet and stuff like that so yep these are the links to this software that's found in this blog so if you want to go check out a PDF rip grab Universal ctags a silver search or FD you can go check those out just by clicking these links and we'll go into some of that stuff later but for now let's check out them so let's open it dot whoops where are we right now yep end them in it dot them alright so let's start searching first one we'll do is just regular fzf and regular grab CF if you're familiar with fzf you know that it kind of just searches for things right so this one will look through like your duck yet it's not configured to to ignore that I guess and then like for instance we ran in at Duffin right now but maybe we'll want to go to like syntax dot them alright and now we're in syntax about them so that's already pretty cool I think that's enough to augment a lot of people's workflow and be super super helpful but we're gonna go a lot of steps further here so files that's the next one so ok files now we get a preview to the right and it's the same files alright so it's all the same files so maybe we'll open COC settings and we can see the file preview over here which is nice alright so now we're in here but now the cool one that I really like is our G this is rip crap right so what rip grip is gonna do for us or at least the way we have rip configured here is going to do for us is we're gonna look inside of files for strings that are already there right so I know that somewhere in this in these directories right I know that Python exists and it just found it but it didn't just find it for like a directory or something like that it found it inside of a file so I know that it's right there and we were already in that file so it's less impressive but let's look for something else with it our G let's look for let's look for syntax again so syntax alright it's finding syntax not only in the directory you can see in blue there that it's fine to get in the directory but as we go down alright now it found it inside of a file so I've found that string inside of a file in one dark alright and that's where I turned syntax on for my theme so it brought me directly to a line here so you can see this being really useful like imagine you have to do Zoar fix mizore whatever scattered throughout a giant project well this thing's super fast and you'll be able to find all of your to do is really fast or like a specific line of code that you can barely remember what it kind of looked like well you can just fuzzy search for it you don't even have to type in all the right characters all right so that's probably my favorite one so I wanted to get it out of the way because I find that one pretty much the most impressive but there's other cool ones here too so let's do B lines and let's see what B lines gets us things like that yep so B lines imagine you had a giant file this one's not very big as 25 lines right but imagine a giant file so it's like a thousand lines long and you want to search for a particular string maybe to do's again who knows right you can start typing it in color alright and so these are all the lines with color on them and you can see them lit up as I'm going through the list so set term give it colors and then there I am I'm at the bottom now you'll notice that I have a bunch of buffers open ok and that one only search through that buffer but what we can do is we can type lines at the bottom and then we can search through all the buffers that I have open so I know that I don't know in a duffman probably has fzf in it and there it is right so I knew that was there and there I go I found FCF so that was lines history so let's do history so all of your command history if you do colon history : all right this is all of your history so I have I guess a hundred and seven things that I've been running and I can look through all of my history for different commands that I've ran let's see what else there's also a silver searcher that's built in here so AG and you'll get a similar thing to similar thing to I guess the ripp grep right so we'll look for like I don't know we'll say Mouse right and this is somewhere I guess somewhere it's found in Mouse but it seems like this may have looked inside of a directory that a directory that isn't is like supposed to be ignored it seems so that's something that I don't really use AG as much as I use RG or at least the way that I have them configured another one is going to be buffers so you can search through all your buffers and here you go like this is every single buffer that I had open so imagine I didn't have this tab line up here at the top imagine you don't want that well here's a cool way to search to your buffers really fast because you can you know you can map these to really useful hotkeys I'm just showing you what the commands are that you would map to hotkeys so I think that's pretty much all I really wanted to go over with them I think that's that really covers most of it but there's other cool things that we can do and I really feel like it would be a shame if I didn't go over them right so i uz show maybe use bash and if you read more you can I put a link to the arch wiki to explain more about this stuff but if you use and that's where I got these it's where I got these lines from right like I didn't pull them out of nowhere right so if you use bash you can set your key bindings and completion and bash and you can also do the same thing with ZCO and then they have something for fish too so what we'll do is go back and this is for your vim art or you not your vim our seat you're like zishe LRC or your bash varsity or whatever right or fish or sea so we'll set those and I'll open my RC really fast jump to the bottom so you'll set those down here at the top you can source them right and so now you'll have completion and you'll have the key bindings so what are key bindings in this sense all right so key bindings are there's basically three of them so there is the first one I'll go over is your history she'll do ctrl R and it'll go through all the history that I've ran recently so I know I've been opening and vim lately on things and here's all the things I've ran with em vim lately so if you have one super long command that you can't remember all the time and you don't feel like mapping it to something and you know you're lazy and you want to just grab it out of your history this is a great way to do that another thing you can do is I have a utility called what I got on my machine and essentially what that does is it runs all the command they've runs like a search command on all the packages that I have installed so I just pipe that into FCF and here we go so here's everything I have installed so let's see do I have discord installed there it goes right do I have docker installed there it goes so you can just see all the stuff you're just wondering like I don't know I have like a hundred and sixty-two packages I don't know if I have something installed what are all the Bluetooth utilities that I have installed start typing blue all right so the next thing that I'll go over is that's that's the that's that one there's two more key commands here so there's ctrl T and ctrl T will essentially just like take us through like it'll just like search for files I think and search for directories and stuff I don't use ctrl T that much but I think it would be useful in other ways and maybe other workflows then there is alt C alt C is really cool and you could see if like you could definitely think of cool ways to replace change directory or CD with this stuff right because it's finding all the directories that I can CD into right now so maybe I want to CD into my blog well there's my blog that fast and I don't need to remember where it is that I don't need to remember where it's a link repose or I have a clone somewhere else or whatever so I could just click on and Here I am here's every single blog topic that I have so I'm in there like faster than I like it's crazy right the last thing I'll go over is from the art wiki if you look at the bottom of the arch wiki here if you're on arch then you can run these like pretty cool commands and I got one to work with the aur as well so there's a small bug in it but all right so the first thing you're gonna want to do is run this and I already ran it so I'm not gonna run it but essentially this will just you know update you so you don't run into an error or you don't you're not going to be missing packages in the next command so we can actually look through all of the packages that are in like in in pac-man right like you can install if your pac-man so if I wanted to look for I don't know Firefox here's everything with Firefox right over fire Yale who knows right who knows what I want to install but I can just start typing it all in and getting it and so this is just with this is just with pac-man so that's going through all the stuff you have a pac-man now if you're really you know adventurous you can search through the entire aur with this command and it takes a little bit longer and I guess there's 74,000 things up there but say we want to start searching for Spotify all right now we can search for Spotify you can press ENTER and it'll start to install it and I think there's definitely more you can do I don't know what I'm doing here but hold up that there's definitely more that you can do with these commands like those are just too like weird utility commands and I just feel like my brain is never gonna be good enough to think up all the cool things that I can do with this tool but if you have any good ideas definitely comment below I'm definitely interested in working this thing this tool way further into my workflow if you're interested here is the f c/f article and the art wiki with the cool package commands they're also on my blog here's a link to I'll probably put the link to well the his links already in my blog so you can just run over to there June gun puts out a lot of awesome software for vim so you should definitely support him get on the star I don't know why I've never started this yes you can check that out and then also you can check out the development for this new ovum config that I'm working on if you have any cool ideas you know feel free to put in a pull request but if you want to start or fork it I'd appreciate it so make sure to LIKE and subscribe and I'll see you in the next video
Info
Channel: ChrisAtMachine
Views: 71,903
Rating: 4.9313107 out of 5
Keywords: fzf, vim, neovim, fzf neovim, neovim fzf, vim fzf, fzf vim, file search vim, fuzzy, fuzzy search
Id: on1AzaZzQ7k
Channel Id: undefined
Length: 13min 28sec (808 seconds)
Published: Mon Apr 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.