From 291e96dcd034750fbe7473482508c08833b168e3 Mon Sep 17 00:00:00 2001 From: Vihang Mehta Date: Wed, 3 May 2017 03:06:07 -0700 Subject: Fix RKJ theme coloring and make it slightly more readable (#5582) --- themes/rkj-repos.zsh-theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'themes/rkj-repos.zsh-theme') diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index a3f1f3dfa..ba2a0dba6 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -23,14 +23,14 @@ function mygit() { 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 " + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$(git_prompt_status)%{$fg_bold[blue]%}$ZSH_THEME_GIT_PROMPT_SUFFIX " fi } function retcode() {} # alternate prompt with git & hg -PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} -%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' +PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg[black]%}@%{$fg[cyan]%}%m%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}] +%{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)$(hg_prompt_info)>%{$reset_color%} ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' -- cgit v1.2.3-70-g09d2 From fa93ea0d75c5079407862c3bbb48d2131577cd5d Mon Sep 17 00:00:00 2001 From: cori schlegel <46317+cori@users.noreply.github.com> Date: Sun, 15 Apr 2018 08:48:31 -0500 Subject: [rkj-repos] Check for 'hg prompt' and exit if not found (#6655) * Check for extension, and exit if not found. Addresses #6036 * Fix styles in rkj-repos.theme --- themes/rkj-repos.zsh-theme | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'themes/rkj-repos.zsh-theme') diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index ba2a0dba6..0d5a166ba 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -1,6 +1,9 @@ -# user, host, full path, and time/date -# on two lines for easier vgrepping -# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +# user, host, full path, and time/date on two lines for easier vgrepping + +if ! grep -q "prompt" ~/.hgrc; then + echo "This theme requires 'hg prompt' (https://bitbucket.org/sjl/hg-prompt/overview)" + return 1 +fi function hg_prompt_info { hg prompt --angle-brackets "\ @@ -33,4 +36,3 @@ function retcode() {} PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg[black]%}@%{$fg[cyan]%}%m%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}] %{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)$(hg_prompt_info)>%{$reset_color%} ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' - -- cgit v1.2.3-70-g09d2 From d7948b39dc662c8072a307869135c8a7cae89cf9 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 19 Apr 2018 23:32:53 +0200 Subject: [rkj-repos] Make `hg prompt` check less strict (#6746) * [rkj-repos] Make `hg prompt` check less strict Move the `hg prompt` check inside the hg_prompt_info function so that it returns an empty string if hg-prompt isn't installed. Fixes #6743. * [rkj-repos] Check for hg in `hg prompt` function --- themes/rkj-repos.zsh-theme | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'themes/rkj-repos.zsh-theme') diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 0d5a166ba..65a075456 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -1,16 +1,13 @@ # user, host, full path, and time/date on two lines for easier vgrepping -if ! grep -q "prompt" ~/.hgrc; then - echo "This theme requires 'hg prompt' (https://bitbucket.org/sjl/hg-prompt/overview)" - return 1 -fi - function hg_prompt_info { + if (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then hg prompt --angle-brackets "\ %{$reset_color%}><:%{$fg[magenta]%}%{$reset_color%}>\ %{$reset_color%}>\ %{$fg[red]%}%{$reset_color%}< patches: >" 2>/dev/null + fi } ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" -- cgit v1.2.3-70-g09d2