From bf9365e30ceadec078f96df939fea184b6dfbc2c Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 23 Aug 2018 12:01:56 -0500 Subject: [PATCH] zshrc: Add prompt --- shrc/zshrc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/shrc/zshrc b/shrc/zshrc index 27b00b2..42ad1f0 100755 --- a/shrc/zshrc +++ b/shrc/zshrc @@ -9,15 +9,33 @@ HISTFILE=~/.histfile HISTSIZE=1000 SAVEHIST=1000 -setopt appendhistory autocd extendedglob nomatch prompt_subst +setopt appendhistory autocd extendedglob nomatch unsetopt beep notify -bindkey -v +bindkey -e + +# Partial history matching bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward + +# Set up styling zstyle :compinstall filename '/home/salt/.zshrc' + +# Completion autoload -Uz compinit compinit +# The prompt +autoload -Uz promptinit +setopt prompt_percent +if [ "$SSH_CLIENT" = "" ]; then + PROMPT="[%F{blue}%~" +else + PROMPT="[%F{red}%B%m%b:%~" +fi +PROMPT="$PROMPT%f]%(0?..%F{red}?%f)%(!.%F{red}#%f.%F{green}$%f) " +promptinit + +# Source .profile if [[ -f "$HOME/.profile" ]]; then source "$HOME/.profile" 2>& /dev/null fi