
if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then
  eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/catppuccin_macchiato.omp.json)"
fi

source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.bash_aliases
source ~/.environment

source <(fzf --zsh)
HISTFILE=~/.zsh_history
HISTSIZE=10000
HISTFILESIZE=20000
HISTCONTROL=Ignoreboth

fpath=(/Users/sudacode/.docker/completions $fpath)

[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)"
eval "$(fnm env --use-on-cd --shell zsh)"
export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

bindkey -v
# zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# zstyle ':completion:*' menu select

# Substring search
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh

# Bind arrow keys for vi insert mode
bindkey -M viins '^[[A' history-substring-search-up
bindkey -M viins '^[[B' history-substring-search-down
# Also bind arrow keys for vi command mode
bindkey -M vicmd '^[[A' history-substring-search-up
bindkey -M vicmd '^[[B' history-substring-search-down
bindkey '^ ' autosuggest-accept

# The following lines were added by compinstall

zstyle ':completion:*' completer _complete _ignored _match _approximate
zstyle ':completion:*' completions 1
zstyle ':completion:*' insert-unambiguous false
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' max-errors 2
zstyle ':completion:*' menu select=long
zstyle ':completion:*' original true
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' substitute 1
zstyle :compinstall filename '/Users/sudacode/.zshrc'

autoload -Uz compinit
compinit

# load both the URL‐quoting and paste‐magic widgets
autoload -Uz url-quote-magic bracketed-paste-magic

# tell url-quote-magic which chars to escape
zstyle ':url-quote-magic:*' url-quotes ''

# bind it to both typing and pasting
zle   -N self-insert       url-quote-magic
zle   -N bracketed-paste   bracketed-paste-magic

# bun completions
[ -s "/Users/sudacode/.bun/_bun" ] && source "/Users/sudacode/.bun/_bun"

# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

alias claude-mem='/Users/sudacode/.bun/bin/bun "/Users/sudacode/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"'
