# Determine architecture and set brew paths
if [[ "$(uname -m)" == "arm64" ]]; then
  # ARM-based Mac (Apple Silicon)
  HOMEBREW_PREFIX="/opt/homebrew"
else
  # Intel-based Mac
  HOMEBREW_PREFIX="/usr/local"
fi

# Conditionally set the editor based on whether you're using SSH
if [[ -n $SSH_CONNECTION ]]; then
    export EDITOR='vim'
fi

# Read fzf theme options if the file exists
if [[ -f "$HOME/.local/bin/scripts/fzf_theme" ]]; then
  FZF_OPTIONS=$("$HOME/.local/bin/scripts/fzf_theme")
  export FZF_DEFAULT_OPTS="$FZF_OPTIONS"
fi

# Source fzf configuration
if command -v fzf >/dev/null 2>&1; then
  eval "$(fzf --zsh)"
fi

[ -f ~/.fzf.zsh ] && . ~/.fzf.zsh

# Initialize pyenv
if command -v pyenv >/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

if ! command -v nvm >/dev/null 2>&1; then
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh 2>&1 | bash >/dev/null 2>&1
fi

