From 6e8564166fc364baa07e020559ec25ccb26aeb2d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 25 Sep 2015 11:16:30 +0200 Subject: [PATCH] more minimal bash prompt --- bash_prompt | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/bash_prompt b/bash_prompt index a54e0ec..4821441 100644 --- a/bash_prompt +++ b/bash_prompt @@ -53,9 +53,9 @@ prompt_git() { git rev-parse --short HEAD 2> /dev/null || \ echo '(unknown)')"; - [ -n "${s}" ] && s=" [${s}]"; + [ -n "${s}" ] && s=" ${s}"; - echo -e "${1}${branchName}${blue}${s}"; + echo -e "${1}${branchName}${orange}${s}"; else return; fi; @@ -64,16 +64,19 @@ prompt_git() { if tput setaf 1 &> /dev/null; then tput sgr0; # reset colors bold=$(tput bold); + dim=$(tput setaf 7); reset=$(tput sgr0); - # Solarized colors, taken from http://git.io/solarized-colors. - black=$(tput setaf 0); - blue=$(tput setaf 33); - cyan=$(tput setaf 37); - green=$(tput setaf 64); - orange=$(tput setaf 166); + # Tomorrow colors, taken from https://github.com/Slava/vim-colors-tomorrow/blob/master/colors/tomorrow.vim + black=$(tput setaf 236); + gray=$(tput setaf 242); + blue=$(tput setaf 109); + green=$(tput setaf 143); + cyan=$(tput setaf 110); + orange=$(tput setaf 173); purple=$(tput setaf 125); - red=$(tput setaf 124); - violet=$(tput setaf 61); + red=$(tput setaf 167); + magenta=$(tput setaf 139); + violet=$(tput setaf 139); white=$(tput setaf 15); yellow=$(tput setaf 136); else @@ -107,16 +110,12 @@ fi; # Set the terminal title to the current working directory. PS1="\[\033]0;\w\007\]"; -PS1="\[${bold}\]\n"; # newline -PS1+="\[${userStyle}\]\u"; # username -PS1+="\[${white}\] at "; -PS1+="\[${hostStyle}\]\h"; # host -PS1+="\[${white}\] in "; -PS1+="\[${green}\]\w"; # working directory -PS1+="\$(prompt_git \"${white} on ${violet}\")"; # Git repository details PS1+="\n"; -PS1+="\[${white}\]→ \[${reset}\]"; # `→` (and reset color) +PS1+="\[${cyan}\]\w"; # working directory +PS1+="\$(prompt_git \" ${gray}\")"; # Git repository details +PS1+="\n"; +PS1+="\[${dim}\]→ \[${reset}\]"; # `→` (and reset color) export PS1; -PS2="\[${yellow}\]→ \[${reset}\]"; +PS2="\[${dim}\]→ \[${reset}\]"; export PS2;