diff options
Diffstat (limited to 'themes')
-rw-r--r-- | themes/adben.zsh-theme | 17 | ||||
-rw-r--r-- | themes/agnoster.zsh-theme | 12 | ||||
-rw-r--r-- | themes/apple.zsh-theme | 1 | ||||
-rw-r--r-- | themes/avit.zsh-theme | 53 | ||||
-rw-r--r-- | themes/awesomepanda.zsh-theme | 8 | ||||
-rw-r--r-- | themes/bureau.zsh-theme | 2 | ||||
-rw-r--r-- | themes/candy-kingdom.zsh-theme | 2 | ||||
-rw-r--r-- | themes/fino-time.zsh-theme | 2 | ||||
-rw-r--r-- | themes/fino.zsh-theme | 2 | ||||
-rw-r--r-- | themes/gnzh.zsh-theme | 3 | ||||
-rw-r--r-- | themes/half-life.zsh-theme | 2 | ||||
-rw-r--r-- | themes/jispwoso.zsh-theme | 10 | ||||
-rw-r--r-- | themes/jonathan.zsh-theme | 5 | ||||
-rw-r--r-- | themes/kolo.zsh-theme | 2 | ||||
-rw-r--r-- | themes/linuxonly.zsh-theme | 1 | ||||
-rw-r--r-- | themes/michelebologna.zsh-theme | 114 | ||||
-rw-r--r-- | themes/mikeh.zsh-theme | 2 | ||||
-rw-r--r-- | themes/minimal.zsh-theme | 12 | ||||
-rw-r--r-- | themes/mira.zsh-theme | 29 | ||||
-rw-r--r-- | themes/mortalscumbag.zsh-theme | 6 | ||||
-rw-r--r-- | themes/rkj-repos.zsh-theme | 16 | ||||
-rw-r--r-- | themes/simonoff.zsh-theme | 5 | ||||
-rw-r--r-- | themes/steeef.zsh-theme | 2 | ||||
-rw-r--r-- | themes/strug.zsh-theme | 25 | ||||
-rw-r--r-- | themes/trapd00r.zsh-theme | 2 | ||||
-rw-r--r-- | themes/ys.zsh-theme | 33 | ||||
-rw-r--r-- | themes/zhann.zsh-theme | 2 |
27 files changed, 236 insertions, 134 deletions
diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index 6869c8a20..e4774cf0e 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -42,7 +42,7 @@ GREEN_BASE_START="${PR_RESET}${PR_GREY}>${PR_RESET}${PR_GREEN}>${PR_BRIGHT_GREEN GREEN_START_P1="${PR_RESET}${GREEN_BASE_START}${PR_RESET} " DIVISION="${PR_RESET}${PR_RED} < ${PR_RESET}" VCS_DIRTY_COLOR="${PR_RESET}${PR_YELLOW}" -Vcs_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" +VCS_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" VCS_SUFIX_COLOR="${PR_RESET}${PR_RED}› ${PR_RESET}" # ########## COLOR ########### # ########## SVN ########### @@ -69,17 +69,17 @@ function precmd { #Choose from all databases, regardless of whether they are considered "offensive" fortune -a } - #obtains the tip + #obtains the tip ps1_command_tip () { wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' - } + } prompt_header () { if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then ps1_command_tip else ps1_fortune - fi - } + fi + } PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}" # set a simple variable to show when in screen if [[ -n "${WINDOW}" ]]; then @@ -99,11 +99,8 @@ prompt_context () { set_prompt () { # required for the prompt setopt prompt_subst - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -gt 8 ]]; then - colors - fi - + autoload zsh/terminfo + # ######### PROMPT ######### PROMPT='${PROMPT_HEAD} ${RED_START}$(prompt_context) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 7a62bd860..3a0c58b89 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -26,7 +26,13 @@ # A few utility functions to make it easy and re-usable to draw segmented prompts CURRENT_BG='NONE' -SEGMENT_SEPARATOR='' + +# Fix odd char on mac +if [[ `uname` == 'Darwin' ]]; then + SEGMENT_SEPARATOR='\ue0b0' +else + SEGMENT_SEPARATOR='' +fi # Begin a segment # Takes two arguments, background and foreground. Both can be omitted, @@ -123,10 +129,10 @@ prompt_hg() { st="" rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g') branch=$(hg id -b 2>/dev/null) - if `hg st | grep -Eq "^\?"`; then + if `hg st | grep -q "^\?"`; then prompt_segment red black st='±' - elif `hg st | grep -Eq "^(M|A)"`; then + elif `hg st | grep -q "^[MA]"`; then prompt_segment yellow black st='±' else diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme index 275341dc6..95e6249fa 100644 --- a/themes/apple.zsh-theme +++ b/themes/apple.zsh-theme @@ -7,7 +7,6 @@ get_git_dirty() { } autoload -Uz vcs_info -autoload -U colors && colors zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index a21a9c8c4..65466b82f 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -38,34 +38,32 @@ function _ruby_version() { # Determine the time since last commit. If branch is clean, # use a neutral color, otherwise colors will vary according to time. function _git_time_since_commit() { - if git rev-parse --git-dir > /dev/null 2>&1; then - # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # Get the last commit. - last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) - now=$(date +%s) - seconds_since_last_commit=$((now-last_commit)) - - # Totals - minutes=$((seconds_since_last_commit / 60)) - hours=$((seconds_since_last_commit/3600)) - - # Sub-hours and sub-minutes - days=$((seconds_since_last_commit / 86400)) - sub_hours=$((hours % 24)) - sub_minutes=$((minutes % 60)) - - if [ $hours -gt 24 ]; then - commit_age="${days}d" - elif [ $minutes -gt 60 ]; then - commit_age="${sub_hours}h${sub_minutes}m" - else - commit_age="${minutes}m" - fi - - color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL - echo "$color$commit_age%{$reset_color%}" +# Only proceed if there is actually a commit. + if git log -1 > /dev/null 2>&1; then + # Get the last commit. + last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) + now=$(date +%s) + seconds_since_last_commit=$((now-last_commit)) + + # Totals + minutes=$((seconds_since_last_commit / 60)) + hours=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + days=$((seconds_since_last_commit / 86400)) + sub_hours=$((hours % 24)) + sub_minutes=$((minutes % 60)) + + if [ $hours -gt 24 ]; then + commit_age="${days}d" + elif [ $minutes -gt 60 ]; then + commit_age="${sub_hours}h${sub_minutes}m" + else + commit_age="${minutes}m" fi + + color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL + echo "$color$commit_age%{$reset_color%}" fi } @@ -99,4 +97,3 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}" export LSCOLORS="exfxcxdxbxegedabagacad" export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' export GREP_COLOR='1;33' - diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme index 411b89837..1c5d06b2d 100644 --- a/themes/awesomepanda.zsh-theme +++ b/themes/awesomepanda.zsh-theme @@ -1,18 +1,16 @@ # the svn plugin has to be activated for this to work. - -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" +PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " - - ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" ZSH_THEME_SVN_PROMPT_SUFFIX=")" ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" -ZSH_THEME_SVN_PROMPT_CLEAN=" "
\ No newline at end of file +ZSH_THEME_SVN_PROMPT_CLEAN=" " diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 443d1d5ee..148abec10 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -31,7 +31,7 @@ bureau_git_status () { if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" fi - if $(echo "$_INDEX" | grep -E '^\?\? ' &> /dev/null); then + if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" fi if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme index 889128758..9d2103926 100644 --- a/themes/candy-kingdom.zsh-theme +++ b/themes/candy-kingdom.zsh-theme @@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST + [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} } PROMPT=' diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 67b6b6e08..9b1db3a08 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -21,7 +21,7 @@ function prompt_char { } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST + [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} } diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 50d41e899..6eec097f5 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -17,7 +17,7 @@ function prompt_char { } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST + [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} } local ruby_env='' diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 0519fbefb..ab154c1e5 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -2,8 +2,7 @@ # Based on bira theme # load some modules -autoload -U colors zsh/terminfo # Used in the colour alias below -colors +autoload -U zsh/terminfo # Used in the colour alias below setopt prompt_subst # make some aliases for the colours: (could use normal escape sequences too) diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme index 942affa94..a3c505706 100644 --- a/themes/half-life.zsh-theme +++ b/themes/half-life.zsh-theme @@ -13,8 +13,6 @@ function virtualenv_info { PR_GIT_UPDATE=1 setopt prompt_subst -autoload colors -colors autoload -U add-zsh-hook autoload -Uz vcs_info diff --git a/themes/jispwoso.zsh-theme b/themes/jispwoso.zsh-theme index cdfef3871..748430573 100644 --- a/themes/jispwoso.zsh-theme +++ b/themes/jispwoso.zsh-theme @@ -1,4 +1,10 @@ -PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} -%{$fg_bold[red]%}➜ %{$reset_color%} ' +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" +PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/ %{$reset_color%}%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%} +${ret_status} %{$reset_color%} ' PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index bca92970c..2f0e77431 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -44,10 +44,7 @@ setprompt () { ### # See if we can use colors. - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi + autoload zsh/terminfo for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme index e743289c3..51b0af724 100644 --- a/themes/kolo.zsh-theme +++ b/themes/kolo.zsh-theme @@ -1,5 +1,3 @@ -autoload -U colors && colors - autoload -Uz vcs_info zstyle ':vcs_info:*' stagedstr '%F{green}●' diff --git a/themes/linuxonly.zsh-theme b/themes/linuxonly.zsh-theme index a11b80d7f..f9e0aa07d 100644 --- a/themes/linuxonly.zsh-theme +++ b/themes/linuxonly.zsh-theme @@ -13,7 +13,6 @@ local c7=$(printf "\033[38;5;149m") local c8=$(printf "\033[38;5;126m") local c9=$(printf "\033[38;5;162m") -local foopath=$(perl /home/scp1/bin/foopath) if [ "$TERM" = "linux" ]; then c1=$(printf "\033[34;1m") diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme index a7599c8f5..fec243873 100644 --- a/themes/michelebologna.zsh-theme +++ b/themes/michelebologna.zsh-theme @@ -1,44 +1,74 @@ -# reference colors -GREEN="%{$fg_bold[green]%}" -RED="%{$fg_bold[red]%}" -CYAN="%{$fg_bold[cyan]%}" -YELLOW="%{$fg_bold[yellow]%}" -BLUE="%{$fg_bold[blue]%}" -MAGENTA="%{$fg_bold[magenta]%}" -WHITE="%{$fg_bold[white]%}" - -COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) - -# color reset -RESET_COLOR="%{$reset_color%}" - -# which color should be applied? -USERNAME_NORMAL_COLOR=$WHITE -USERNAME_ROOT_COLOR=$RED -HOSTNAME_NORMAL_COLOR=$BLUE -# uncomment next line if you want auto-generated hostname color -#for i in $HOST; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] -HOSTNAME_ROOT_COLOR=$RED -HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) -CURRENT_DIR_COLOR=$CYAN - -# zsh commands -USERNAME_COMMAND="%n" -HOSTNAME_COMMAND="%m" -CURRENT_DIR="%~" - -# output: colors + commands -USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" -HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" -CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" -LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" - -# git theming -ZSH_THEME_GIT_PROMPT_PREFIX="(" +# Michele Bologna's theme +# http://michelebologna.net +# +# This a theme for oh-my-zsh. Features a colored prompt with: +# * username@host: [jobs] [git] workdir % +# * hostname color is based on hostname characters. When using as root, the +# prompt shows only the hostname in red color. +# * [jobs], if applicable, counts the number of suspended jobs tty +# * [git], if applicable, represents the status of your git repo (more on that +# later) +# * '%' prompt will be green if last command return value is 0, yellow otherwise. +# +# git prompt is inspired by official git contrib prompt: +# https://github.com/git/git/tree/master/contrib/completion/git-prompt.sh +# and it adds: +# * the current branch +# * '%' if there are untracked files +# * '$' if there are stashed changes +# * '*' if there are modified files +# * '+' if there are added files +# * '<' if local repo is behind remote repo +# * '>' if local repo is ahead remote repo +# * '=' if local repo is equal to remote repo (in sync) +# * '<>' if local repo is diverged + +local green="%{$fg_bold[green]%}" +local red="%{$fg_bold[red]%}" +local cyan="%{$fg_bold[cyan]%}" +local yellow="%{$fg_bold[yellow]%}" +local blue="%{$fg_bold[blue]%}" +local magenta="%{$fg_bold[magenta]%}" +local white="%{$fg_bold[white]%}" +local reset="%{$reset_color%}" + +local -a color_array +color_array=($green $red $cyan $yellow $blue $magenta $white) + +local username_normal_color=$white +local username_root_color=$red +local hostname_root_color=$red + +# calculating hostname color with hostname characters +for i in `hostname`; local hostname_normal_color=$color_array[$[((#i))%7+1]] +local -a hostname_color +hostname_color=%(!.$hostname_root_color.$hostname_normal_color) + +local current_dir_color=$blue +local username_command="%n" +local hostname_command="%m" +local current_dir="%~" + +local username_output="%(!..$username_normal_color$username_command$reset@)" +local hostname_output="$hostname_color$hostname_command$reset" +local current_dir_output="$current_dir_color$current_dir$reset" +local jobs_bg="${red}fg: %j$reset" +local last_command_output="%(?.%(!.$red.$green).$yellow)" + +ZSH_THEME_GIT_PROMPT_PREFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" -ZSH_THEME_GIT_PROMPT_CLEAN=")" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" +ZSH_THEME_GIT_PROMPT_MODIFIED="*" +ZSH_THEME_GIT_PROMPT_ADDED="+" +ZSH_THEME_GIT_PROMPT_STASHED="$" +ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="=" +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">" +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<" +ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>" -# wrap all together -PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' -RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' +PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)' +PROMPT+='$(__git_ps1)' +PROMPT+=" $last_command_output%#$reset " +RPROMPT='' diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme index 943f04d38..a95383ba5 100644 --- a/themes/mikeh.zsh-theme +++ b/themes/mikeh.zsh-theme @@ -1,6 +1,4 @@ setopt prompt_subst -autoload colors -colors autoload -U add-zsh-hook autoload -Uz vcs_info diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme index a2a16031f..e05df9c9b 100644 --- a/themes/minimal.zsh-theme +++ b/themes/minimal.zsh-theme @@ -1,18 +1,24 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$fg[white]%}]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN +ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX +ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX +ZSH_THEME_HG_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY +ZSH_THEME_HG_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN vcs_status() { - if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then + if [[ $(whence in_svn) != "" ]] && in_svn; then svn_prompt_info + elif [[ $(whence in_hg) != "" ]] && in_hg; then + hg_prompt_info else git_prompt_info fi } -PROMPT='%2~ $(vcs_status)»%b '
\ No newline at end of file +PROMPT='%2~ $(vcs_status)»%b ' diff --git a/themes/mira.zsh-theme b/themes/mira.zsh-theme new file mode 100644 index 000000000..e6c952998 --- /dev/null +++ b/themes/mira.zsh-theme @@ -0,0 +1,29 @@ +# Based on bira zsh theme with nvm, rvm and jenv support +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' +local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' + +local rvm_ruby='' +if which rvm-prompt &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi + +local nvm_node='' +nvm_node='%{$fg[green]%}‹node-$(nvm_prompt_info)›%{$reset_color%}' + +local jenv_java='' +jenv_java='%{$fg[blue]%}‹$(jenv_prompt_info)›%{$reset_color%}' + +local git_branch='$(git_prompt_info)%{$reset_color%}' + +PROMPT="╭─${user_host} ${current_dir} ${nvm_node} ${rvm_ruby} ${jenv_java} ${git_branch} +╰─%B$%b " +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme index 5dbf2e4f6..ccce4197a 100644 --- a/themes/mortalscumbag.zsh-theme +++ b/themes/mortalscumbag.zsh-theme @@ -10,12 +10,12 @@ function my_git_prompt() { fi # is anything staged? - if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then + if $(echo "$INDEX" | command grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" fi # is anything unstaged? - if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then + if $(echo "$INDEX" | command grep -E -e '^[ MARC][MD] ' &> /dev/null); then STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" fi @@ -25,7 +25,7 @@ function my_git_prompt() { fi # is anything unmerged? - if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then + if $(echo "$INDEX" | command grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" fi diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 6289427c2..a3f1f3dfa 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -4,7 +4,7 @@ function hg_prompt_info { hg prompt --angle-brackets "\ -<hg:%{$fg[magenta]%}<branch>%{$reset_color%}>\ +<hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ </%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ %{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null @@ -15,14 +15,16 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}✈" +ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg[blue]%}" +ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" function mygit() { - ref1=$(git symbolic-ref HEAD 2> /dev/null) || return - ref2=$(git rev-parse HEAD | head -c 6) || return - ref="$ref1 %{$fg[grey]%}$ref2" - #ref=$(git symbolic-ref HEAD 2> /dev/null) $(git rev-parse HEAD | head -c 6) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX " + if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then + ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ + ref=$(command git rev-parse --short HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX " + fi } function retcode() {} diff --git a/themes/simonoff.zsh-theme b/themes/simonoff.zsh-theme index fb4d32e24..63ce4261b 100644 --- a/themes/simonoff.zsh-theme +++ b/themes/simonoff.zsh-theme @@ -63,10 +63,7 @@ setprompt () { ### # See if we can use colors. - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi + autoload zsh/terminfo for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index e38188d35..13728ca9a 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -15,8 +15,6 @@ function virtualenv_info { PR_GIT_UPDATE=1 setopt prompt_subst -autoload colors -colors autoload -U add-zsh-hook autoload -Uz vcs_info diff --git a/themes/strug.zsh-theme b/themes/strug.zsh-theme new file mode 100644 index 000000000..89b56b008 --- /dev/null +++ b/themes/strug.zsh-theme @@ -0,0 +1,25 @@ +# terminal coloring +export CLICOLOR=1 +export LSCOLORS=dxFxCxDxBxegedabagacad + +local git_branch='$(git_prompt_info)%{$reset_color%}$(git_remote_status)' + +PROMPT="%{$fg[green]%}╭─%n@%m %{$reset_color%}%{$fg[yellow]%}in %~ %{$reset_color%}${git_branch} +%{$fg[green]%}╰\$ %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}on " +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}%{$fg[red]%} ✘ %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔ %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED=true +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX="%{$fg[yellow]%}(" +ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=" +" +ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR=%{$fg[green]%} + +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" -" +ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR=%{$fg[red]%} + diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index cb1c43c56..ca1676fb5 100644 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -86,7 +86,7 @@ prompt_jnrowe_precmd () { else dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" PROMPT='${vcs_info_msg_0_} -%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} > ' fi } diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme index 017139100..fd8adc41e 100644 --- a/themes/ys.zsh-theme +++ b/themes/ys.zsh-theme @@ -14,12 +14,35 @@ function box_name { # Directory info. local current_dir='${PWD/#$HOME/~}' +# VCS +YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} " +YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}" +YS_VCS_PROMPT_SUFFIX="%{$reset_color%}" +YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x" +YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o" + # Git info. local git_info='$(git_prompt_info)' -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}on%{$reset_color%} git:%{$fg[cyan]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}x" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}o" +ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}" +ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX" +ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY" +ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN" + +# HG info +local hg_info='$(ys_hg_prompt_info)' +ys_hg_prompt_info() { + # make sure this is a hg dir + if [ -d '.hg' ]; then + echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}" + echo -n $(hg branch 2>/dev/null) + if [ -n "$(hg status 2>/dev/null)" ]; then + echo -n "$YS_VCS_PROMPT_DIRTY" + else + echo -n "$YS_VCS_PROMPT_CLEAN" + fi + echo -n "$YS_VCS_PROMPT_SUFFIX" + fi +} # Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $ PROMPT=" @@ -29,6 +52,7 @@ PROMPT=" %{$fg[green]%}$(box_name) \ %{$fg[white]%}in \ %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ +${hg_info}\ ${git_info} \ %{$fg[white]%}[%*] %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" @@ -41,6 +65,7 @@ PROMPT=" %{$fg[green]%}$(box_name) \ %{$fg[white]%}in \ %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ +${hg_info}\ ${git_info} \ %{$fg[white]%}[%*] %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme index 5c0854730..27597ec6c 100644 --- a/themes/zhann.zsh-theme +++ b/themes/zhann.zsh-theme @@ -1,5 +1,3 @@ -autoload -U colors && colors - autoload -Uz vcs_info zstyle ':vcs_info:*' stagedstr '%F{green}●' |