From 3bb339ad365db107ce2df45ecf75a7a351b56136 Mon Sep 17 00:00:00 2001 From: bretello Date: Tue, 4 Jun 2024 09:42:47 +0200 Subject: [PATCH] zsh: add support for fzf's --highlight line option (fzf>=0.52.0) --- brethil_dotfile.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/brethil_dotfile.sh b/brethil_dotfile.sh index a1f3be0..016f259 100755 --- a/brethil_dotfile.sh +++ b/brethil_dotfile.sh @@ -66,6 +66,10 @@ else export FZF_CTRL_T_COMMAND='find' fi export FZF_CTRL_T_OPTS=" --preview-window=right,60% --preview \"bash -c 'if [[ -d \"{}\" ]]; then tree -C \"{}\"; else bat --style=plain --color=always \"{}\"; fi'\" --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'" +if [[ $(fzf --version | cut -d. -f 2) -ge 52 ]]; then + # only available for fzf 0.52.0+ https://github.com/junegunn/fzf/releases/tag/0.52.0 + export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --highlight-line" +fi ZSH_HIGHLIGHT_STYLES[comment]='fg=white,bg=gray,bold'