= Linux/zsh = * Alternate to standard [[linux/bash|bash]] shell * Mac: add openssl {{{ export PATH="${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH" }}} * Linux: If not prompted to configure zsh on first use, force with {{{ zsh-newuser-install -f }}} * Mac: to add k8s auto complete, add to end of ~/.zshrc {{{ autoload -Uz compinit compinit echo "load kubectl auto completion for zsh $SHELL" [[ $commands[kubectl] ]] && source <(kubectl completion zsh) alias k=kubectl }}} * git prompt {{{ autoload -U colors && colors ## git prompt built into zsh # Load version control information autoload -Uz vcs_info precmd() { vcs_info } # Format the vcs_info_msg_0_ variable # %s=git %r=gitRoot %S=gitPath $b=branch %m=stash %u=unstagedChanges %c=stagedChanges # zstyle ':vcs_info:git:*' formats 'on branch %b' zstyle ':vcs_info:git*' formats "%{$fg[grey]%}%s %{$reset_color%}%r%{$fg[grey]%} %{$fg[blue]%}[%b]%{$reset_color%}%m%u%c%{$reset_color%} " #zstyle ':vcs_info:git*' actionformats "%s %r/%S %b %m%u%c " # Set up the prompt (with git branch name) setopt PROMPT_SUBST #PROMPT='%n in ${PWD/#$HOME/~} ${vcs_info_msg_0_} > ' PROMPT='${vcs_info_msg_0_} ${PWD/#$HOME/~} > ' }}}