## OPTIONS setopt autocd autopushd histverify noclobber correct interactivecomments extendedglob ## COLORS # ls colors! eval "$(dircolors -b)" alias ls='ls --color=auto' # Other color aliases alias gcc='gcc -fdiagnostics-color=auto' ip='ip -color=auto' grep='grep --color=auto' ## COMPLETIONS # Setup zmodload zsh/complist # (Needed here so we can bind to menuselect keymap) autoload -Uz compinit compinit -d "${XDG_CACHE_DIR:-$HOME/.cache}/zcompdump" # Enable completion menu zstyle ':completion:*' menu select true # Use ls colors in completion as well zstyle -e ':completion:*' list-colors 'reply=("${(s.:.)LS_COLORS}")' # Completion groups zstyle ':completion:*' group-name '' zstyle ':completion:*:*:-command-:*' group-order aliases global-aliases functions builtins reserved-words commands zstyle ':completion:*' group-order original corrections expansions all-expansions # Make messages and warnings a bit nicer. zstyle ':completion:*:descriptions' format '➤ %B%d%b (%B%F{cyan}%n%f%b)' zstyle ':completion:*:messages' format "%F{yellow}%d%f" zstyle ':completion:*:warnings' format '%F{red}No %d completions found.%f' # Show and insert `man` sections. zstyle ':completion:*' insert-sections yes zstyle ':completion:*' separate-sections yes ## PROMPTS # Command prompt # user@host ~/current/directory (job count) [exit status] # ❭ PS1=$'%(!.%B%F{red}%m%b.%F{magenta}%n@%m)%f:%F{blue}%~%f%(1j. %F{cyan}(%j%)%f.)%(?..%F{red} [%?]%f)\n❭ ' # Better looking correction and trace prompts SPROMPT='Correct %B%F{red}%U%R%b%f%u to %F{green}%r%f? [%By%bes|%BN%bo|%Be%bdit|%Ba%bbort] ' ## KEY BINDINGS # Cancel menu completion with escape bindkey -M menuselect '^[' send-break