

My \ binding will open a menu and scan all files recursively from your current working directory. As you can see below, I've selected several different files and now I can go through them one at a time to see or make the changes I needed. One other cool feature from the fzf menu that I mainly use in vim is. If you want to look at all the current buffers, you can use :Lines.

You may be thinking you can do this with vims / or ? - but sometimes it's nice to see all occurrences in one window and look through, instead of spamming n or N. :BLines will simply search the current buffer for a specific string. This is super useful if you've had a long vim session going. I bind b for my buffer menu, opening the standard fzf menu for all files in my buffer. I find this brilliant with no performance change, however if you prefer no preview window, just use :FZF instead of :Files.įrom inside the menu, fzf will automatically detect ctrl-t to open the file in a new tab, ctrl-v for a vertical split or ctrl-x for a horizontal split. To get started, you'll have to get a couple plugins for fzf.Įnter fullscreen mode Exit fullscreen modeįor those of you familiar with vim mappings, you've probably already guessed, but simply press ctrl-t to open up the menu, and get searching!Īs you've probably noticed, this gives you a brilliant preview screen for the file you're planning on opening up. And it comes with some great options -hidden to show hidden files -s for case sensitive searches -l to just show the files that contain the result without showing the context and -g to include or exclude files or filetypes, such as rg 'my_string' -g '*.rb'.īut the real fun comes in when you use it in vim.īoth fzf and rg work extremely well with vim. On the command line you can use ripgrep as simple as rg 'my_search' and it will recursively find your results in a flash. You can plug it in to fzf with the following, or use it for simple greps as per below.Įxport FZF_DEFAULT_COMMAND="rg -files -hidden -follow -glob '!.git'" Another tool that outright shows their speed in their readme, it really lives up to it. You've probably guessed by now that I love fast programs. Ripgrep recursively searches directories for a regex pattern while respecting your gitignore Omit specific searches? !ignored_search_result Want to find a file that specifically ends in. Take it to the next level with ssh support - ssh **. When searching for a file to edit or a directory to move to you can simply ** to use fzf and complete your command. I can't begin to tell you how useful this is. Not no more.įzf has built in ctrl-r functionality which when you find your command and press return will paste it to your command line, allowing you to edit it before sending it off. How many times have you typed part of a command and hit ctrl-r until you reached the right one, only to realise you got part of it wrong and have to history | grep my_command to figure out what you ran. I personally alias this in my bashrc as the following, which makes my branch swaps easy as pie: alias gcob='git branch | fzf | xargs git checkout' Working on several different features at once in a big application, and forget branch names? You may ask, what use is this if it just pastes the file to the command line? Well - take it to the next level and pipe ( |) it into a command. Simply press ctrl-t and your files will be loaded, you can use a fuzzy search and look for whatever you need. In vim, a lot of people use ctrlp.vim.įzf has this built into the command line, and it's super fast if I didn't already mention.
RIPGREP COMMAND NOT FOUND CODE
Whatever code editor you use, you most likely have a file searcher, usually bound to ctrl-t or ctrl-p. But let's look at the use-cases and see exactly how it can speed up your workflow. Just follow along from their github page instructions.Īs I'll keep saying, one of the main benefits of using fzf is the speed - it's just incredibly fast. Whether you use bash, zsh or fish, fzf works great with an easy installation process.
