#!/bin/zsh
#history settings
HISTFILE=$HOME/.cache/zsh/history
SAVEHIST=100000000
HISTSIZE=$SAVEHIST
setopt appendhistory
#completion
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
comp_options+=(globdots)
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
source /usr/share/zsh/site-functions/zsh-autosuggestions.zsh && fpath=(/usr/share/zsh/site-functions $fpath) && source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
#colors & prompt
autoload -U colors && colors && setopt prompt_subst
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=5"
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=12"
PROMPT="%F{9}[%f%F{9}!root%f%F{9}@%f%F{9}%m%f %F{2}%~%f%F{9}]%f: "
#paths and environment
fpath=(~/.zsh/completions $fpath)
export PATH=$HOME/.local/bin:$PATH
export EDITOR="emacs"
export PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH
export MANPATH=/usr/pkg/man:$MANPATH
#aliases for root
alias ..='echo "cd .."; cd ../'
alias ls="ls --color=auto"
grep --color=auto < /dev/null &>/dev/null && alias grep='grep --color=auto'
eval "$(starship init zsh)"
