From 61fb4567f0bf09e4d77cb78b957060d0b25987b7 Mon Sep 17 00:00:00 2001 From: Hanashiko Date: Sat, 24 May 2025 13:53:50 +0300 Subject: [PATCH] docs(fzf): improved documentation --- plugins/fzf/README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md index 15a9b503d..ceae66c91 100644 --- a/plugins/fzf/README.md +++ b/plugins/fzf/README.md @@ -12,42 +12,55 @@ plugins=(... fzf) ## Settings -All these settings should go in your zshrc file, before Oh My Zsh is sourced. +All variables should be defined before Oh My Zsh is sourced in your `.zshrc` file. ### `FZF_BASE` -Set to fzf installation directory path: +If `fzf` is installed in a non-standard location, you can manually specift the base installation directory by setting: ```zsh -export FZF_BASE=/path/to/fzf/install/dir +export FZF_BASE=/path/to/fzf ``` +The plugin will look for shell integration files under `$FZF_BASE/shell`, or `$FZF_BASE` directly. + ### `FZF_DEFAULT_COMMAND` -Set default command to use when input is tty: +This variable defines the default command used by `fzf` when there is no piped input (e.g., when used with `CTRL-T`). + +You can cutomize it: ```zsh -export FZF_DEFAULT_COMMAND='' +export FZF_DEFAULT_COMMAND='fd --type f --hidden --exlude .git' ``` -If not set, the plugin will try to set it to these, in the order in which they're found: +If not defined, the plugin will automatically set it to the first available tool in the following priority: - [`fd`](https://github.com/sharkdp/fd) - [`rg`](https://github.com/BurntSushi/ripgrep) - [`ag`](https://github.com/ggreer/the_silver_searcher) +These tools allow for fast, filesystem-aware searches and greatly improve `fzf` performance. + ### `DISABLE_FZF_AUTO_COMPLETION` -Set whether to load fzf auto-completion: +If you do not want `fzf` to override or enchance Zsh's auto-completion, disable it by setting: ```zsh DISABLE_FZF_AUTO_COMPLETION="true" ``` +Auto-completion provides fuzzy matches for commands, files, and directories. + ### `DISABLE_FZF_KEY_BINDINGS` -Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C): +To disable the key bindings provided by `fzf`, set: ```zsh DISABLE_FZF_KEY_BINDINGS="true" ``` + +Key bindings enabled by default: + - `CTRL-T`: Paste selected file path(s) + - `CTRL-R`: Search command history + - `ALT-C`: Change to selected directory