#!/bin/zsh
# ~/.zshrc — SamiOS root shell configuration
# Loaded by Zsh for interactive shells (SamiOS default shell)

# ============================================================
# History
# ============================================================
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
setopt sharehistory
setopt incappendhistory

# ============================================================
# Shell options
# ============================================================
setopt auto_cd          # cd by typing directory name
setopt interactive_comments

# ============================================================
# Key bindings (vi-style for line editing)
# ============================================================
bindkey -e              # emacs-style bindings (more familiar default)

# ============================================================
# Aliases
# ============================================================
alias ls='ls --color=auto'
alias ll='ls -lah'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias df='df -h'
alias free='free -h'

# SamiOS-specific aliases
alias samios-status='samios status'
alias samios-help='samios help'

# ============================================================
# Prompt — SamiOS branded
# ============================================================
# Blue pyramid color matches brand primary (#1424CE)
autoload -Uz colors && colors
PROMPT='%{$fg_bold[blue]%}▲ SamiOS%{$reset_color%} %{$fg[green]%}%n@%m%{$reset_color%} %~ %# '

# ============================================================
# Completion
# ============================================================
autoload -Uz compinit && compinit
zstyle ':completion:*' menu select

# ============================================================
# Welcome message — printed once per interactive login shell
# ============================================================
if [[ -o login ]]; then
    echo ""
    echo "  \033[1;34m    ▲\033[0m  \033[1;34mSamiOS\033[0m \033[0;37m$(cat /usr/share/samios/version 2>/dev/null | tail -1 || echo '0.1.0')\033[0m"
    echo "  \033[0;37m    |\\\   Arch-based Linux by Sami Ahmed\033[0m"
    echo "  \033[0;37m    | \\  https://sami-ahmed.net\033[0m"
    echo ""
    echo "  \033[0;37mCommands:\033[0m  \033[1;msamios help\033[0m  ·  \033[1;msamios status\033[0m  ·  \033[1;msamios fonts\033[0m"
    echo ""
fi
