# .exports dotfile
export EDITOR="${EDITOR:-hx}"
export PAGER="${PAGER:-most}"

# PAI3 Personal AI Infrastructure
export PAI_HOME="/home/e"
export PAI_DIR="$HOME/.claude"  # Added for PAI v0.6.0 compatibility
export PATH=$PATH:"$HOME/.claude"
export PATH=$PATH:"$HOME/.claude/commands"
# export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"\nman 2 select
export BROWSER="${BROWSER:-brave}"
export LANG=en_US.UTF-8                  # avoid locale issues
export LC_ALL=en_US.UTF-8
export GOROOT="/usr/local/go"
export GOPATH="$HOME/go"
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$HOME/.bun/bin
# export STOW_DIR="$HOME/.config"

# --- fzf ---
# Optimized fzf settings
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_DEFAULT_OPTS='--height 60% --layout=reverse --border --inline-info --preview-window=right:60%'

# Better file search with bat preview
export FZF_CTRL_T_OPTS="
  --walker-skip .git,node_modules,target
  --preview 'bat -n --color=always {}'
  --bind 'ctrl-/:change-preview-window(down|hidden|)'"

# CTRL-Y to copy the command into clipboard using pbcopy
export FZF_CTRL_R_OPTS="
  --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
  --color header:italic
  --header 'Press CTRL-Y to copy command to clipboard'"
#  --header 'Press CTRL-Y to copy command into clipboard'"

# Print tree structure in the preview window
# export FZF_ALT_C_OPTS="
#  --walker-skip .git,node_modules,target
#  --preview 'tree -C {}'"


# Path
export PATH="$PATH:$HOME/go/bin"
export PATH="$PATH:$HOME/.scripts:$HOME/scripts"
export PATH="$PATH:$HOME/.cargo/bin"
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
export PATH="$PATH:/usr/local/go/bin"
export PATH="$PATH:/go/bin"
export PATH="$PATH:$HOME/.local/bin"
#export PATH="$PATH:$HOME/miniconda3/bin"

# clean path:
export PATH=$(echo "$PATH" | tr ':' '\n' | awk '!seen[$0]++' | paste -sd:)

# PY3="python3 -c 'import pty;pty.spawn(\"bin/bash\")'"
# SHELLEXPORTS="export TERM=xterm;stty rows $(tput lines) columns $(tput cols)"

if command -v bat &> /dev/null; then
#     export MANPAGER="sh -c 'col -bx | bat -l man -p'"
    export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"
fi
# Removed redundant PATH addition (already on line 50)
