<commit_before>export FZF_WIDGETS_ROOT="$0:a:h"
typeset -gA FZF_WIDGETS_OPTS

: "Create cache directory" && () {
  if [[ -n $XDG_CACHE_HOME ]]; then
    [[ ! -d $XDG_CACHE_HOME ]] && mkdir $XDG_CACHE_HOME
    local dir="$XDG_CACHE_HOME/fzf-widgets"
  else
    local dir="/tmp/fzf-widgets"
  fi
  [[ ! -d $dir ]] && mkdir $dir
  export FZF_WIDGETS_CACHE="$dir/data.txt"
}

: "Autoload functions and Create widgets" && () {
  local dir="$FZF_WIDGETS_ROOT/autoload"
  fpath=($dir/**/*(N-/) $fpath)

  autoload -Uz `ls -F $dir/**/* | grep -v /`
<commit_msg>Separate private cache directories for each user<commit_after>export FZF_WIDGETS_ROOT="$0:a:h"
typeset -gA FZF_WIDGETS_OPTS

: "Create cache directory" && () {
  if [[ -n $XDG_CACHE_HOME ]]; then
    [[ ! -d $XDG_CACHE_HOME ]] && mkdir $XDG_CACHE_HOME
    local dir="$XDG_CACHE_HOME/fzf-widgets"
  else
    local dir="/tmp/fzf-widgets-$USER"
  fi
  [[ ! -d $dir ]] && mkdir $dir && chmod 700 $dir
  export FZF_WIDGETS_CACHE="$dir/data.txt"
}

: "Autoload functions and Create widgets" && () {
  local dir="$FZF_WIDGETS_ROOT/autoload"
  fpath=($dir/**/*(N-/) $fpath)

  autoload -Uz `ls -F $dir/**/* | grep -v /`

{'fraction_non_alphanumeric': 0.18283261802575107, 'fraction_numerical': 0.004291845493562232, 'mean_word_length': 3.7016129032258065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2024976', 'n_tokens_mistral': 519, 'n_tokens_neox': 505, 'n_words': 97}