<commit_before>__fsel() {
  command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
    -o -type f -print \
    -o -type d -print \
    -o -type l -print 2> /dev/null | sed 1d | cut -b3- | pick | while read item; do
    printf '%q ' "$item"
  done
  echo
}

fuzzy-git-branch-widget() {
  trap "" INT

  result="$(git branch | cut -c 3- | pick)"
  if [[ "$result" != "" ]]; then
    LBUFFER="${LBUFFER}\"$result\""
    zle redisplay
  fi

  trap INT
}

fuzzy-file-widget() {
  LBUFFER="${LBUFFER}$(__fsel)"
  zle redisplay
}

zle     -N   fuzzy-git-branch-widget
bindkey '^B' fuzzy-git-branch-widget

zle     -N   fuzzy-file-widget
bindkey '^F' fuzzy-file-widget
<commit_msg>Automatically execute after fuzzy searches<commit_after>__fsel() {
  command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
    -o -type f -print \
    -o -type d -print \
    -o -type l -print 2> /dev/null | sed 1d | cut -b3- | pick | while read item; do
    printf '%q ' "$item"
  done
  echo
}

fuzzy-git-branch-widget() {
  trap "" INT

  result="$(git branch | cut -c 3- | pick)"
  if [[ "$result" != "" ]]; then
    LBUFFER="${LBUFFER}\"$result\""
    zle redisplay
    zle accept-line
  fi

  trap INT
}

fuzzy-file-widget() {
  LBUFFER="${LBUFFER}$(__fsel)"
  zle redisplay
  zle accept-line
}

zle     -N   fuzzy-git-branch-widget
bindkey '^B' fuzzy-git-branch-widget

zle     -N   fuzzy-file-widget
bindkey '^F' fuzzy-file-widget

{'fraction_non_alphanumeric': 0.18268575323790048, 'fraction_numerical': 0.0054533060668029995, 'mean_word_length': 2.343963553530752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4574353', 'n_tokens_mistral': 613, 'n_tokens_neox': 587, 'n_words': 156}