If anyone isn’t using fzf yet, check it out. It works well with other command line tools like fd, ripgrep, and bat.
Here is a video walk through:
Here’s a text version of the tutorial:
If the terminal keybindings don’t work out of the box, you can find the configuration scripts by searching with fzf from the root of your system (Linux or Mac1) like this:
cd /
fzf
Then type the names of the files that you’re searching for.
Copy the config files called key-bindings.zsh and completion.zsh somewhere in your dotfiles/config area and source them in your .zshrc (or similar) file.
They are probably located at a path something like:
The characters ** followed by a tab will trigger the fuzzy finder.
For example, type this and then press tab:
$ vim **
(Select multiple files with the tab key.)
I created some aliases like these that fuzzy search for files in the current directory (multi-select with tab) and opens them in various kinds of splits/tabs in vim:
alias v='vim `fzf`' # opens files
alias vof='vim -o `fzf`' # opens files in horizontal splits
alias vOf='vim -O `fzf`' # opens files in vertical splits
alias vpf='vim -p `fzf`' # opens files in tabs