From 896b5e31f1f6e3253b38ddde16be70b4f54b11af Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 8 Aug 2014 20:51:18 +0200 Subject: zshrc: Redid PS1 again, two lines now --- zsh/.zshrc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'zsh/.zshrc') diff --git a/zsh/.zshrc b/zsh/.zshrc index d6a21e2..2cac9e2 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -49,21 +49,20 @@ function yellow { printf "%s%s%s" "%{${fg[yellow]}%}" "$1" "$DEFAULT_COLOR" } function black { printf "%s%s%s" "%{${fg[black]}%}" "$1" "$DEFAULT_COLOR" } function white { printf "%s%s%s" "%{${fg[white]}%}" "$1" "$DEFAULT_COLOR" } function prompt_user_color { - (( UID )) && printf green || print red + (( UID )) && print -n red || print -n magenta } -PS1='$(yellow "$(bold %m)") \ +PROMPT="$(yellow "┌─[") $(yellow "$(bold %m)") \ $($(prompt_user_color) "$(bold %n)") \ -$(blue "$(bold %~)") \ -$(blue "$(bold %#)") ' -RPS1=$'$(yellow $branch)' +$(blue "$(bold %~)") $(magenta $(bold '$branch'))$(yellow "]") +$(yellow "└─╼") " function get_git_branch { - if [[ -d .git ]]; then - branch=" $(git rev-parse --abbrev-ref HEAD) " - else - branch=" " - fi + if [[ -d .git ]]; then + branch="$(git rev-parse --abbrev-ref HEAD) " + else + branch="" + fi } # Print basic prompt to the window title -- cgit v1.2.3-54-g00ecf