new zshrc, powerline colours for blade

This commit is contained in:
Armin 2015-03-13 19:52:59 +01:00
commit f4f220cedf
3 changed files with 22 additions and 4 deletions

View file

@ -1,4 +1,4 @@
colours=(252 160 152 32) colours=(250 58 152 32)
prompt_context_user_fg="${colours[1]}" prompt_context_user_fg="${colours[1]}"
prompt_context_user_bg="${colours[2]}" prompt_context_user_bg="${colours[2]}"
prompt_context_root_fg="${colours[3]}" prompt_context_root_fg="${colours[3]}"

View file

@ -1,4 +1,5 @@
# vim:ft=zsh ts=2 sw=2 sts=2 # zshrc
# vim: ts=2 sw=2 sts=2 et
# #
# powerline theme - based on agnoster's theme - https://gist.github.com/3712874 # powerline theme - based on agnoster's theme - https://gist.github.com/3712874
# #
@ -189,12 +190,27 @@ build_prompt() {
## right prompt ## right prompt
build_rprompt() { build_rprompt() {
RETVAL=$? RETVAL=$?
FOO="$!"
local symbols local symbols
symbols=() symbols=()
drawrightprompt=0 drawrightprompt=0
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" && drawrightprompt=1 [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" && drawrightprompt=1
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" && drawrightprompt=1 [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" && drawrightprompt=1
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘ $RETVAL" && drawrightprompt=1 if [[ $ZLE_LINE_ABORTED ]]; then
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ " && drawrightprompt=1
else
lastchars=8
last="$(fc -nl -1 | cut -b -${lastchars})..."
if [[ "${#last}" -gt "$lastchars" ]]; then
last="$(fc -nl -1 | cut -b -${lastchars})..."
else
last="$(fc -nl -1 | cut -b -${lastchars})"
fi
# [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘ $RETVAL $(fc -nl -1 | cut -b -8)..." && drawrightprompt=1
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%} ✘" && drawrightprompt=1
fi
if [[ "$drawrightprompt" -eq 1 ]]; then if [[ "$drawrightprompt" -eq 1 ]]; then
prompt_rseperator %k 238 prompt_rseperator %k 238
fi fi

4
zshrc
View file

@ -21,7 +21,7 @@ DISABLE_LS_COLORS="false" # bool
DISABLE_AUTO_TITLE="false" # bool DISABLE_AUTO_TITLE="false" # bool
# Uncomment following line if you want disable red dots displayed while waiting for completion # Uncomment following line if you want disable red dots displayed while waiting for completion
DISABLE_COMPLETION_WAITING_DOTS="true" # bool DISABLE_COMPLETION_WAITING_DOTS="false" # bool
# plugins to load (array) # plugins to load (array)
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
@ -192,4 +192,6 @@ alias less='less -R'
alias diff='colordiff' alias diff='colordiff'
set modeline