<commit_before>status is-login; or test $SHLVL -eq 1; or exit

function def -a var val
  set -qUx $var; or set -gx $var $val
end

#
# base
#

# xdg directories
if not set -q XDG_CONFIG_HOME
  set -x XDG_CONFIG_HOME $HOME/.config
end
if not set -q XDG_DATA_HOME
  set -x XDG_DATA_HOME $HOME/.local/share
end
if not set -q XDG_CACHE_HOME
  set -x XDG_CACHE_HOME $HOME/.cache
end
if not set -q XDG_RUNTIME_DIR
  if test -n "$TMPDIR"
    set -x XDG_RUNTIME_DIR $TMPDIR
  else
    set -x XDG_RUNTIME_DIR /tmp
  end
end

# wsl
if is_wsl
  set --path WSLENV $WSLENV
  wslenv -p APPDATA
  wslenv -p LOCALAPPDATA
  set -x BROWSER 'wslview'
  set -x COLORTERM 'truecolor'
end
if is_wsl1
  set umask 0022
  set -x DISPLAY ':0'
end
<commit_msg>fish: set XDG_RUNTIME_DIR to a subdir of TMPDIR<commit_after>status is-login; or test $SHLVL -eq 1; or exit

function def -a var val
  set -qUx $var; or set -gx $var $val
end

#
# base
#

# tmpdir
if not set -q TMPDIR
  set -x TMPDIR /tmp
end

# xdg directories
if not set -q XDG_CONFIG_HOME
  set -x XDG_CONFIG_HOME $HOME/.config
end
if not set -q XDG_DATA_HOME
  set -x XDG_DATA_HOME $HOME/.local/share
end
if not set -q XDG_CACHE_HOME
  set -x XDG_CACHE_HOME $HOME/.cache
end
if not set -q XDG_RUNTIME_DIR
  if mkdir -p "$TMPDIR/runtime" &>/dev/null
    set -x XDG_RUNTIME_DIR "$TMPDIR/runtime"
  else
    set -x XDG_RUNTIME_DIR $TMPDIR
  end
end

# wsl
if is_wsl
  set --path WSLENV $WSLENV
  wslenv -p APPDATA
  wslenv -p LOCALAPPDATA
  set -x BROWSER 'wslview'
  set -x COLORTERM 'truecolor'
end
if is_wsl1
  set umask 0022
  set -x DISPLAY ':0'
end

{'fraction_non_alphanumeric': 0.08375314861460957, 'fraction_numerical': 0.008816120906801008, 'mean_word_length': 3.0126262626262625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7052708', 'n_tokens_mistral': 727, 'n_tokens_neox': 694, 'n_words': 235}