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
fzf
devotee 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.vim
that adds devicons for file types to thefzf
results!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
fd
GH repo - thanks for the mention!I believe that
fd
andrg
(ripgrep) are very different utilities, Sami.fd
is more of afind
substitute andrg
is a substitute forgrep
orag
(The Silver Searcher). I've had no need to installfd
usingfzf
. 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
.bashrc
or.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!
How do you go by ignoring directories such as
node_modules
or.github
if you use
:GFiles
instead of:Files
it will ignore everything that is in.gitignore
. That should solve the cases you mentioned, although it does not provide a general answer.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!
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 Igor, this was super helpful!
Thanks for making this!