From 980fa0ddb292044334f675044e469e79049ce471 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl <5060861-schtobia@users.noreply.gitlab.com> Date: Mon, 23 May 2022 11:01:49 +0200 Subject: [PATCH] added fzf.zsh --- fzf.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fzf.sh diff --git a/fzf.sh b/fzf.sh new file mode 100644 index 0000000..dc97ead --- /dev/null +++ b/fzf.sh @@ -0,0 +1,17 @@ +export FZF_COMPLETION_OPTS='--border --info=inline' + +# (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function +# - The first argument to the function is the name of the command. +# - You should make sure to pass the rest of the arguments to fzf. +_fzf_comprun() { + local command=$1 + shift + + case "$command" in + vim) fzf "$@" --preview 'batcat --color=always {}' ;; + cd) fzf "$@" --preview 'tree -C {} | head -200' ;; + export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;; + ssh) fzf "$@" --preview 'dig {}' ;; + *) fzf "$@" ;; + esac +}