RELOAD='reload:rg --column --color=always --smart-case {q} || :'
# shellcheck disable=SC2016
OPENER='if [ "${FZF_SELECT_COUNT}" -eq 0 ]; then
          vim {1} +{2}     # no selection. open the current line in Vim.
        else
          vim +cw -q {+f}  # build quickfix list for the selected items.
        fi'
fzf --disabled --ansi --multi \
   --bind="enter:become:${OPENER}" \
   --bind="ctrl-o:execute:${OPENER}" \
   --delimiter=":" \
   --preview='bat --style=full --color=always --highlight-line {2} {1}'

# vim +cw -q {+f} needs some explanation
#   +cw tells Vim to execute :cw command to open the quickfix window
#   -q {+f} makes Vim start in quickfix mode using the error file {+f}
#
# so what is {+f}?
# it's a placeholder expression for a temporary file containing selected items
# it's a combination of two flags: + and f. see: man fzf(1) for more information
