My configuration defines it like so:
evaluate-commands %sh{
[ ! -z "$(command -v rg)" ] && printf "%s\n" "set-option global grepcmd 'rg -L --with-filename --column'"
}
Otherwise I use default value here.
For fzf.kak it’s bit more complicated:
plug "andreyorst/fzf.kak" %{
map -docstring 'fzf mode' global normal '<c-p>' ': fzf-mode<ret>'
set-option global fzf_preview_width '65%'
set-option global fzf_project_use_tilda true
evaluate-commands %sh{
if [ -n "$(command -v fd)" ]; then
echo "set-option global fzf_file_command %{fd . --no-ignore --type f --follow --hidden --exclude .git --exclude .svn}"
else
echo "set-option global fzf_file_command %{find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -follow -print}"
fi
[ -n "$(command -v bat)" ] && echo "set-option global fzf_highlight_cmd bat"
[ -n "${kak_opt_grepcmd}" ] && echo "set-option global fzf_sk_grep_command %{${kak_opt_grepcmd}}"
}
}
But uses the same principle.