Follow @learnvim for more Vim tips and tricks!
One thing that modern text editors/ IDEs got right that Vim didn't is how easy it is to find files ...
For further actions, you may consider blocking this person and/or reporting abuse
Great article! I've been a
fzfdevotee for a while, but I really like how you laid out the syntax for it in a easy reference way! Will likely refer back to it for that in the future!Shameless Plug:
Check out my fork of
fzf.vimthat adds devicons for file types to thefzfresults!fzf.devicon.vim
I have used FZF and l’m loving it. Instead of ripgrep I use fd
I have just started my Vim journey few months ago, so I’m really liking your articles 🙂
Interesting. I actually never heard of fd before. Just checked
fdGH repo - thanks for the mention!I believe that
fdandrg(ripgrep) are very different utilities, Sami.fdis more of afindsubstitute andrgis a substitute forgreporag(The Silver Searcher). I've had no need to installfdusingfzf. Check out videos from The Primeagen and Thoughtbot on Vim. Cheers and enjoy the journey!Yes, that is true. I just use it with the FZF for finding files as it is faster than find (or at least it feels so).
But I might add ripgrep to get faster grep, haven’t yet used used it so much.
And the ripgrep author suggests to use fd instead when finding files.
Source
Nice write-up, Igor. I'd been using fzf for a couple years in Vim, but it was only recently (beginning of the year) that I discovered its powers as a CLI utility. If you're using bash along with fzf's bash/zsh-completion, it provides globbed search that you can prefix with many Unix utilities including ripgrep:
$ vim **(followed by tab)$ vim foo/bar/**(followed by tab)$ rg --files | fzf$ cd **(followed by tab)You're probably familiar with these as one of your links discusses fzf and ripgrep.
I just learned how to better to search/find-and-replace in multiple files from you. Thanks for that! I was just about to adopt more sed into my workflow to do this sort of thing, but the situation hasn't come up yet
when I use add this to my .vimrc
if type rg &> /dev/null; then
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='-m --height 50% --border'
fi
I get errors when reloading vimrc. Anything I'm missing?
This needs to be added to your
.bashrcor.zshrc, not your .vimrc!Hi Wesley Cheek, how about fish shell? i got the error also
Lol good suggestion. Edited the post.
This gave me a chuckle when I read it at first lol Love that it came from the comment thread!
Awesome intro to fzf. Thanks for the help getting everything setup. Haven't familiarized myself with these tools before, but I can definitely see the use-value!
How do you go by ignoring directories such as
node_modulesor.githubif you use
:GFilesinstead of:Filesit will ignore everything that is in.gitignore. That should solve the cases you mentioned, although it does not provide a general answer.I just recently discovered FZF. This article however exposed a lot I'm not using. Thanks for upping my vim game a notch
You are very welcome. I am glad you found it helpful. Best of luck!
Thanks for making this!
Thanks Igor, this was super helpful!