diff options
author | LangLangBart <92653266+LangLangBart@users.noreply.github.com> | 2024-05-14 18:59:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 01:59:43 +0900 |
commit | 030428ba43671cf951712de41be6d3bfb84117c3 (patch) | |
tree | d74b52189c9fca0cd997dbbbf8dbb4a327becaa2 | |
parent | 8a110e02b9b33e9c0f1c901d61a84d92acb7094d (diff) |
docs: update zsh integration instructions (#3794)
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | install | 6 | ||||
-rw-r--r-- | man/man1/fzf.1 | 2 |
3 files changed, 8 insertions, 4 deletions
@@ -204,7 +204,7 @@ Add the following line to your shell configuration file. * zsh ```sh # Set up fzf key bindings and fuzzy completion - eval "$(fzf --zsh)" + source <(fzf --zsh) ``` * fish ```fish @@ -226,7 +226,7 @@ Add the following line to your shell configuration file. > For example, to disable ALT-C binding: > > * bash: `FZF_ALT_C_COMMAND= eval "$(fzf --bash)"` -> * zsh: `FZF_ALT_C_COMMAND= eval "$(fzf --zsh)"` +> * zsh: `FZF_ALT_C_COMMAND= source <(fzf --zsh)` > * fish: `fzf --fish | FZF_ALT_C_COMMAND= source` > > Setting the variables after sourcing the script will have no effect. @@ -265,7 +265,11 @@ fi EOF if [[ $auto_completion -eq 1 ]] && [[ $key_bindings -eq 1 ]]; then - echo "eval \"\$(fzf --$shell)\"" >> "$src" + if [[ "$shell" = zsh ]]; then + echo "source <(fzf --$shell)" >> "$src" + else + echo "eval \"\$(fzf --$shell)\"" >> "$src" + fi else cat >> "$src" << EOF # Auto-completion diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 513ffc3a..0f99739d 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -911,7 +911,7 @@ e.g. \fBeval "$(fzf --bash)"\fR .B "--zsh" Print script to set up Zsh shell integration -e.g. \fBeval "$(fzf --zsh)"\fR +e.g. \fBsource <(fzf --zsh)\fR .TP .B "--fish" |