# fzf - Fuzzy Finder Command-line fuzzy finder for interactive filtering of command history, files, and directories. Written in Go. ## Installation ```bash brew install fzf $(brew --prefix)/opt/fzf/install --all ``` The install script creates `~/.fzf.zsh` with the setup and adds a source line to `~/.zshrc`. ## Key Bindings These replace default shell behaviors after installation: | macOS | Windows/Linux | Action | |-------|---------------|--------| | `Ctrl+R` | `Ctrl+R` | Fuzzy search through command history (replaces default reverse search) | | `Ctrl+T` | `Ctrl+T` | Fuzzy file/directory picker — pastes selected path to the command line | | `Opt+C` | `Alt+C` | Fuzzy cd — change directory interactively | ## Speed Fix: Use `fd` Instead of `find` By default, fzf uses `find` which can be very slow on macOS (especially in `~`). Replacing it with [fd](https://github.com/sharkdp/fd) makes all three key bindings near-instant by skipping `.git`, caches, and other noise. ([source](https://github.com/junegunn/fzf/issues/1419)) Add to `~/.zshrc`: **macOS:** ```bash export FZF_DEFAULT_COMMAND='fd --hidden --type f --type l --exclude .git --exclude .cache --exclude node_modules --exclude Library' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND='fd --hidden --type d --exclude .git --exclude .cache --exclude node_modules --exclude Library' ``` **Linux:** ```bash export FZF_DEFAULT_COMMAND='fd --hidden --type f --type l --exclude .git --exclude .cache --exclude node_modules' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND='fd --hidden --type d --exclude .git --exclude .cache --exclude node_modules' ``` ## Uninstallation ```bash $(brew --prefix)/opt/fzf/uninstall ``` This deletes `~/.fzf.zsh`, removes the source line from `~/.zshrc`, and restores default shell key bindings. To disable without uninstalling (keeps `fzf` available for manual use), comment out the source line in `~/.zshrc` and reload with `source ~/.zshrc`.