8/8/2023 0 Comments Fzf vs ripgrep![]() ![]() ![]() So if I type in cnext, by the way c is for quick, I know, mnemonics, right? Cnext it will move to the next one, notice that my highlighted line has moved forward, and I've changed files, if I do it again it will go to the next one, if I do it again it's gonna say hey, there's no more items in here. What do we do here? How do we get those other three results? I don't know, well, they're in a quickfix list, you can do copen, so if you type the command copen, I keep playing this way, if you type the command copen, and press Enter, it will open it back up, and it'll even highlight what command or what quickfix item you're currently looking at. c, right? So every single folder all that, it's gonna return to us three results, awesome, when I hit Enter, it navigates us to a result, if you didn't wanna navigate to that result, you could use bang and it would silence it, but right now we've now navigated to a result. Then what do we want to find? Let's do the same thing SOCKET, right? We're inside of the vim nap playground, and we wanna search every single file, and everything that starts with say. So this will work on any system by the way, so if you remote into a system, and it doesn't have any plugins installed, this just works, we're gonna type in grep. So let's use grep instead, so vim does come with grep, it's gonna use grep underneath the hood, and we're gonna find it, so let's go into a command. We'll go over more of this soon, it's available in FZF, but let's do it without FZF, sounds good? And if I hit Enter, I now have what is referred to as a quickfix list, you can tell it's a quickfix list, by this light text down here, that says the word quickfix. I can go tab, prev tab, prev, and I can go through and do them all, you can actually select them all at once, but I forgot I don't use this utility anymore, but I forgot what it is. ![]() So I want to say, send all four results, to a quicktfix list, one thing you can do with say FZF, is you can press tab, notice that I get that little extra item. So I can search up the word SOCK, right? And it will actually show you, now we have a ripgrep result, piped into an FZF result, so now I can start doing things, I can start typing and get a single solution out, awesome. And it's kind like the cycle that I have for three months as I can, this feels funny, like it never really clicked in my head like, why is this happening? What is this list that keeps popping up? And when I close it, it goes away, this just doesn't feel right, and so let me show you, if you have ripgrep installed, and you have FZF, you can also use Rg, so this is ripgrep, right? So I'ld always search it, and then i'd close the quickfix list, and then I couldn't go back to it, I didn't understand what it was, I never really read into it. So just remember that it's available, you can use it, so ripgrep is awesome, but here's the problem, when i was using rip grep, I didn't realize that FZF would pipe ripgrep's results into a quickfix list. It's fantastic, it's written rust by the way, so you can tell people it's rust, really easy to brag on people in plus, you get to have the three circles like so if you're using vim with ripgrep on Arch Linux, you are the actual coolest person that has ever existed. Quickfix is something that I never really tried to learn about, honestly, I'd use like, say ripgrep,if you're familiar with ripgrep, it is an incredible utility to be able to search like a bajillion files, and just what feels like instantaneous. So I feel like we're making them pretty good at this point, yes, FZF is pretty awesome, because it works in both in the Neovim, so I use telescope like I said, that's a Neovim only one, but FZF is pretty darn awesome. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |