diff options
| -rw-r--r-- | .config/zsh/themes/ewout.zsh-theme | 36 | ||||
| -rw-r--r-- | .zshrc | 7 |
2 files changed, 37 insertions, 6 deletions
diff --git a/.config/zsh/themes/ewout.zsh-theme b/.config/zsh/themes/ewout.zsh-theme new file mode 100644 index 0000000..78fff90 --- /dev/null +++ b/.config/zsh/themes/ewout.zsh-theme @@ -0,0 +1,36 @@ +autoload colors && colors + +__git() { + command -v git > /dev/null || return + [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == true ]] && echo " $(git branch --show-current)" +} + +__wrap() { + [ -z "$@" ] && return + echo "─[$@]─" +} + +__exitStatus() { + code=$1 + [ $1 != 0 ] && echo $code +} + +__exitFace() { + code=$1 + [ $1 = 0 ] && echo "$fg[green]:3$reset_color" + [ $1 != 0 ] && echo "$fg[red]D:$reset_color" +} + +__prompt() { + echo "%# " +} + +__generate_prompt() { + lastExit="$?" + cat <<ENDPROMPT +╭$(__wrap $(__exitStatus $lastExit))$(__wrap '%~')$(__wrap '%n')$(__wrap $(__git))┄ +╰$(__wrap $(__exitFace $lastExit))┄ $(__prompt) +ENDPROMPT +} + +PROMPT='$(__generate_prompt)' @@ -1,23 +1,19 @@ setopt completealiases alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' -zmodload zsh/zprof ZSH_CUSTOM="$HOME/.config/zsh" -ZSH_THEME="funky" +ZSH_THEME="ewout" zstyle ':omz:update' mode auto plugins=( aliases alias-finder archlinux cp - copyfile - copypath git git-commit git-escape-magic git-extras gitignore - git-prompt kate man node @@ -35,4 +31,3 @@ plugins=( ) . /usr/share/oh-my-zsh/oh-my-zsh.sh -zprof |
