From bb7c309f2f42e17e5841b7f736c7428690424db3 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 13:18:55 +0100 Subject: [PATCH 01/21] + added xterm_color function to lib/termsupport.zsh --- lib/termsupport.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 221989502..893edc9bb 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -28,6 +28,12 @@ function omz_termsupport_preexec { title "$CMD" "%100>...>$2%<<" } +# Prints given 2nd argument with xterm color code of 1st argument +# see http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html for color codes +function xterm_color() { + echo -e "\033[38;5;$1m$2\033[0m" +} + autoload -U add-zsh-hook add-zsh-hook precmd omz_termsupport_precmd add-zsh-hook preexec omz_termsupport_preexec From 251c06f1f041d5d2026700028fe18751c0099368 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 14:38:03 +0100 Subject: [PATCH 02/21] + added initial SCM root detection for OMZ SCM plugin --- lib/scm.zsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/scm.zsh diff --git a/lib/scm.zsh b/lib/scm.zsh new file mode 100644 index 000000000..c14cfb444 --- /dev/null +++ b/lib/scm.zsh @@ -0,0 +1,29 @@ +SCM_DEBUG=yes # comment line to disable debugging +_scm_types=(git hg svn) && export _scm_types + +function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } + +# Checks given 1st path argument if it's root of .git|.hg|.svn +function _scm_get_scm_type { + for type ($_scm_types) { + [ ! -d "$1/.$type" ] && continue + + _scm_debug " -> Is a $type repository" + export SCM_ROOT=$1 + export SCM_TYPE=$type + return 0 + } + + return 1 +} + +# Recursive lookup for possible SCM root from current dir => / +function scm_detect_root { + [[ $# -eq 1 && "$1" = "" ]] && return # touched the root (/) + _DETECT_WD=${1:-$PWD} + + _scm_debug -ne "." + + _scm_get_scm_type "$_DETECT_WD" && return + scm_detect_root "${_DETECT_WD%/*}" +} From a1082573b15cbefe4c428dd3b82e2ad152a24abc Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 14:40:32 +0100 Subject: [PATCH 03/21] + added initial SCM plugin with chpwd_functions hook for SCM root detection --- plugins/scm/scm.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/scm/scm.plugin.zsh diff --git a/plugins/scm/scm.plugin.zsh b/plugins/scm/scm.plugin.zsh new file mode 100644 index 000000000..c236e74a2 --- /dev/null +++ b/plugins/scm/scm.plugin.zsh @@ -0,0 +1,3 @@ +declare -a chpwd_functions +chpwd_functions+='scm_detect_root' + From 24e6264c39d118c7402fb4257626c558fefaf25c Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 23:16:27 +0100 Subject: [PATCH 04/21] + added initialization of _scm_prompt_chars hash --- lib/scm.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/scm.zsh b/lib/scm.zsh index c14cfb444..6a99e9687 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -1,5 +1,11 @@ SCM_DEBUG=yes # comment line to disable debugging + +declare -A _scm_prompt_chars + _scm_types=(git hg svn) && export _scm_types +_scm_prompt_chars[git]=± +_scm_prompt_chars[hg]=ʜɢ +_scm_prompt_chars[svn]=svn function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } From 3668f36fbdf8d78cfa78c5b633b4d37cda06d567 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 23:17:34 +0100 Subject: [PATCH 05/21] + added scm_prompt_char function ~ cleaned up and removed scm_debug output --- lib/scm.zsh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 6a99e9687..966de0ed8 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -14,22 +14,33 @@ function _scm_get_scm_type { for type ($_scm_types) { [ ! -d "$1/.$type" ] && continue - _scm_debug " -> Is a $type repository" - export SCM_ROOT=$1 + export SCM_ROOT="$1" export SCM_TYPE=$type + return 0 } return 1 } -# Recursive lookup for possible SCM root from current dir => / +# Recursive lookup for possible SCM root function scm_detect_root { - [[ $# -eq 1 && "$1" = "" ]] && return # touched the root (/) _DETECT_WD=${1:-$PWD} - - _scm_debug -ne "." - _scm_get_scm_type "$_DETECT_WD" && return - scm_detect_root "${_DETECT_WD%/*}" -} + [ $SCM_ROOT ] && [[ $_DETECT_WD == $SCM_ROOT* ]] && return + + unset SCM_ROOT + unset SCM_TYPE + + until [ "$_DETECT_WD" = "" ]; do + _scm_get_scm_type "$_DETECT_WD" && return + + _DETECT_WD=${_DETECT_WD%/*} + done +} + +function scm_prompt_char() { + [ ! $SCM_TYPE ] && return + + echo $_scm_prompt_chars[$SCM_TYPE] +} From 8e2e64f0b9bdbfe0452e17a7ae0bb31eafb5203a Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 23:28:34 +0100 Subject: [PATCH 06/21] * fixed _scm_get_scm_type for long waiting when checking / (root) for scm type --- lib/scm.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 966de0ed8..f30e86e72 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -11,15 +11,16 @@ function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } # Checks given 1st path argument if it's root of .git|.hg|.svn function _scm_get_scm_type { + [[ "$1" = "/" ]] && return 1 + for type ($_scm_types) { [ ! -d "$1/.$type" ] && continue export SCM_ROOT="$1" export SCM_TYPE=$type - return 0 } - + return 1 } From 94d31d3862e4009b34034d8717e1a4ab4ab45bd9 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 23:37:24 +0100 Subject: [PATCH 07/21] ~ extracted _scm_reset function --- lib/scm.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index f30e86e72..e67e77ea3 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -24,14 +24,17 @@ function _scm_get_scm_type { return 1 } +function _scm_reset { + unset SCM_ROOT + unset SCM_TYPE +} + # Recursive lookup for possible SCM root function scm_detect_root { _DETECT_WD=${1:-$PWD} [ $SCM_ROOT ] && [[ $_DETECT_WD == $SCM_ROOT* ]] && return - - unset SCM_ROOT - unset SCM_TYPE + _scm_reset until [ "$_DETECT_WD" = "" ]; do _scm_get_scm_type "$_DETECT_WD" && return From 0992a4ba5990f0945198019be35fae8bbc6d8d55 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 22 Jan 2012 23:47:39 +0100 Subject: [PATCH 08/21] ~ changed variables names to uppercase --- lib/scm.zsh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index e67e77ea3..45b2e8a8c 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -1,11 +1,11 @@ SCM_DEBUG=yes # comment line to disable debugging -declare -A _scm_prompt_chars +declare -A _SCM_PROMPT_CHARS -_scm_types=(git hg svn) && export _scm_types -_scm_prompt_chars[git]=± -_scm_prompt_chars[hg]=ʜɢ -_scm_prompt_chars[svn]=svn +_SCM_TYPES=(git hg svn) && export _SCM_TYPES +_SCM_PROMPT_CHARS[git]=± +_SCM_PROMPT_CHARS[hg]=ʜɢ +_SCM_PROMPT_CHARS[svn]=svn function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } @@ -13,7 +13,7 @@ function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } function _scm_get_scm_type { [[ "$1" = "/" ]] && return 1 - for type ($_scm_types) { + for type ($_SCM_TYPES) { [ ! -d "$1/.$type" ] && continue export SCM_ROOT="$1" @@ -46,5 +46,6 @@ function scm_detect_root { function scm_prompt_char() { [ ! $SCM_TYPE ] && return - echo $_scm_prompt_chars[$SCM_TYPE] + echo $_SCM_PROMPT_CHARS[$SCM_TYPE] } + From 94ab26139dc74ec207fbeefc954c0ef37bf88361 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Mon, 23 Jan 2012 00:02:59 +0100 Subject: [PATCH 09/21] + added scm_prompt_info and related scm_prompt_info_for_* functions --- lib/scm.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/scm.zsh b/lib/scm.zsh index 45b2e8a8c..908a43452 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -49,3 +49,16 @@ function scm_prompt_char() { echo $_SCM_PROMPT_CHARS[$SCM_TYPE] } + +function scm_prompt_info_for_git() { + git_prompt_info +} + +function scm_prompt_info_for_hg() {} +function scm_prompt_info_for_svn() {} + +function scm_prompt_info() { + [ ! $SCM_TYPE ] && return + + scm_prompt_info_for_$SCM_TYPE # calls scm type specific prompt generator +} From b9170efff3babad931c3dbffcefb7c7b92945213 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 10:30:35 +0200 Subject: [PATCH 10/21] + added caching for scm_prompt_info --- lib/scm.zsh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 908a43452..1480a71bc 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -33,6 +33,7 @@ function _scm_reset { function scm_detect_root { _DETECT_WD=${1:-$PWD} + # skip detection if SCM root already detected and current folder is sub folder of SCM [ $SCM_ROOT ] && [[ $_DETECT_WD == $SCM_ROOT* ]] && return _scm_reset @@ -50,15 +51,31 @@ function scm_prompt_char() { } -function scm_prompt_info_for_git() { - git_prompt_info -} - +function scm_prompt_info_for_git() { git_prompt_info } function scm_prompt_info_for_hg() {} function scm_prompt_info_for_svn() {} function scm_prompt_info() { [ ! $SCM_TYPE ] && return - scm_prompt_info_for_$SCM_TYPE # calls scm type specific prompt generator + SCM_DATA_DIR=$SCM_ROOT/.$SCM_TYPE + SCM_PROMPT_CACHE_FILE=$SCM_DATA_DIR/prompt_cache + + if [ ! -e "$SCM_PROMPT_CACHE_FILE" ]; then + _scm_debug "Creating $SCM_PROMPT_CACHE_FILE" + touch "$SCM_PROMPT_CACHE_FILE" + SCM_PROMPT_INFO=$(scm_prompt_info_for_$SCM_TYPE) # calls scm type specific prompt generator + else + LAST_UPDATE_TIME=`stat -c %Y $SCM_PROMPT_CACHE_FILE` + DIRSTATE_TIME=`stat -c %Y $SCM_DATA_DIR` + + if [[ $DIRSTATE_TIME -gt $LAST_UPDATE_TIME || "$1" == "force" ]]; then + _scm_debug "Updating $SCM_PROMPT_CACHE_FILE" + touch "$SCM_PROMPT_CACHE_FILE" + SCM_PROMPT_INFO=$(scm_prompt_info_for_$SCM_TYPE) # calls scm type specific prompt generator + fi + fi + + SCM_PROMPT_INFO=${SCM_PROMPT_INFO:-$(scm_prompt_info_for_$SCM_TYPE)} + export SCM_PROMPT_INFO } From 7cec393e4ab6044de1b57f15a2960bae3f717d80 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 11:14:16 +0200 Subject: [PATCH 11/21] ~ made _scm_debug understated (less opaque) --- lib/scm.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 1480a71bc..877ce6f17 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -7,7 +7,7 @@ _SCM_PROMPT_CHARS[git]=± _SCM_PROMPT_CHARS[hg]=ʜɢ _SCM_PROMPT_CHARS[svn]=svn -function _scm_debug { [ $SCM_DEBUG ] && echo $* >&2 } +function _scm_debug { [ $SCM_DEBUG ] && echo $(xterm_color 237 "$*") >&2 } # Checks given 1st path argument if it's root of .git|.hg|.svn function _scm_get_scm_type { From e61377ad91a4a08c6d34a434597b5ba97a3d9219 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:13:39 +0200 Subject: [PATCH 12/21] ~ renamed scm_prompt_info to scm_build_prompt_info --- lib/scm.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 877ce6f17..58f8e12df 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -55,7 +55,7 @@ function scm_prompt_info_for_git() { git_prompt_info } function scm_prompt_info_for_hg() {} function scm_prompt_info_for_svn() {} -function scm_prompt_info() { +function scm_build_prompt_info() { [ ! $SCM_TYPE ] && return SCM_DATA_DIR=$SCM_ROOT/.$SCM_TYPE @@ -68,11 +68,11 @@ function scm_prompt_info() { else LAST_UPDATE_TIME=`stat -c %Y $SCM_PROMPT_CACHE_FILE` DIRSTATE_TIME=`stat -c %Y $SCM_DATA_DIR` - + if [[ $DIRSTATE_TIME -gt $LAST_UPDATE_TIME || "$1" == "force" ]]; then _scm_debug "Updating $SCM_PROMPT_CACHE_FILE" - touch "$SCM_PROMPT_CACHE_FILE" SCM_PROMPT_INFO=$(scm_prompt_info_for_$SCM_TYPE) # calls scm type specific prompt generator + touch "$SCM_PROMPT_CACHE_FILE" fi fi From ce4c4354bb5a43d88293b242f9d4c474f479c692 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:14:33 +0200 Subject: [PATCH 13/21] + added scm_build_prompt_info to precmd_functions hook --- lib/scm.zsh | 1 + plugins/scm/scm.plugin.zsh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index 58f8e12df..accea9b53 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -27,6 +27,7 @@ function _scm_get_scm_type { function _scm_reset { unset SCM_ROOT unset SCM_TYPE + unset SCM_PROMPT_INFO } # Recursive lookup for possible SCM root diff --git a/plugins/scm/scm.plugin.zsh b/plugins/scm/scm.plugin.zsh index c236e74a2..d24a8681e 100644 --- a/plugins/scm/scm.plugin.zsh +++ b/plugins/scm/scm.plugin.zsh @@ -1,3 +1,5 @@ declare -a chpwd_functions +declare -a precmd_functions chpwd_functions+='scm_detect_root' - +precmd_functions+='scm_build_prompt_info' + From 127098fc50d0162cea944a7b05a4403b455e9e14 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:15:51 +0200 Subject: [PATCH 14/21] + added separated xterm_color_ functions to be more flexible with color settings --- lib/termsupport.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 893edc9bb..2c7ba13db 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -34,6 +34,14 @@ function xterm_color() { echo -e "\033[38;5;$1m$2\033[0m" } +function xterm_color_open() { + echo -e "\033[38;5;$1m" +} + +function xterm_color_reset() { + echo -e "\033[0m" +} + autoload -U add-zsh-hook add-zsh-hook precmd omz_termsupport_precmd add-zsh-hook preexec omz_termsupport_preexec From e9773574c63fc818624b35f8dcf6752d0d474aa9 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:17:10 +0200 Subject: [PATCH 15/21] + added pixelplastic theme that uses the scm plugin --- lib/scm.zsh | 2 +- themes/pixelplastic.zsh-theme | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 themes/pixelplastic.zsh-theme diff --git a/lib/scm.zsh b/lib/scm.zsh index accea9b53..fbc95118d 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -52,7 +52,7 @@ function scm_prompt_char() { } -function scm_prompt_info_for_git() { git_prompt_info } +function scm_prompt_info_for_git() { echo "$(git_prompt_info)$(git_prompt_status)" } function scm_prompt_info_for_hg() {} function scm_prompt_info_for_svn() {} diff --git a/themes/pixelplastic.zsh-theme b/themes/pixelplastic.zsh-theme new file mode 100644 index 000000000..6c48a280f --- /dev/null +++ b/themes/pixelplastic.zsh-theme @@ -0,0 +1,13 @@ +# see http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html for color codes +PROMPT_PREFIX="$(xterm_color 243 '%n')$(xterm_color 240 '@')$(xterm_color 238 '%m')" + +PROMPT='$PROMPT_PREFIX $(xterm_color 76 "${PWD/#$HOME/~}") $SCM_PROMPT_INFO +$(scm_prompt_char)> ' + +RPROMPT='$RPROMPT_SUFFIX' + +ZSH_THEME_GIT_PROMPT_PREFIX="on $(xterm_color_open 220)" +ZSH_THEME_GIT_PROMPT_SUFFIX="$(xterm_color_reset)" +ZSH_THEME_GIT_PROMPT_DIRTY=" $(xterm_color 196 '(!)')" +ZSH_THEME_GIT_PROMPT_UNTRACKED=" $(xterm_color 33 '(+)')" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 6976962922b9d64875664bfdbe49b072a4da3402 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:18:55 +0200 Subject: [PATCH 16/21] ~ minor debugging changes --- lib/scm.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/scm.zsh b/lib/scm.zsh index fbc95118d..1b1bb4f76 100644 --- a/lib/scm.zsh +++ b/lib/scm.zsh @@ -1,4 +1,4 @@ -SCM_DEBUG=yes # comment line to disable debugging +# SCM_DEBUG=yes # comment line to disable debugging declare -A _SCM_PROMPT_CHARS @@ -25,6 +25,7 @@ function _scm_get_scm_type { } function _scm_reset { + _scm_debug 'scm reset' unset SCM_ROOT unset SCM_TYPE unset SCM_PROMPT_INFO From d777109de7592996ce72e27e769d9d4cfceb022a Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 12:37:17 +0200 Subject: [PATCH 17/21] ~ minor theme improvement --- themes/pixelplastic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/pixelplastic.zsh-theme b/themes/pixelplastic.zsh-theme index 6c48a280f..6a3e7da37 100644 --- a/themes/pixelplastic.zsh-theme +++ b/themes/pixelplastic.zsh-theme @@ -2,7 +2,7 @@ PROMPT_PREFIX="$(xterm_color 243 '%n')$(xterm_color 240 '@')$(xterm_color 238 '%m')" PROMPT='$PROMPT_PREFIX $(xterm_color 76 "${PWD/#$HOME/~}") $SCM_PROMPT_INFO -$(scm_prompt_char)> ' +$(xterm_color 33 $(scm_prompt_char))> ' RPROMPT='$RPROMPT_SUFFIX' From 2164b3a1690829fff91a9151f6e3ace2a192d5d6 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Fri, 6 Apr 2012 14:24:35 +0200 Subject: [PATCH 18/21] * fixed escaping issue with zsh completion system --- lib/termsupport.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 2c7ba13db..6ee4eb596 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -31,15 +31,15 @@ function omz_termsupport_preexec { # Prints given 2nd argument with xterm color code of 1st argument # see http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html for color codes function xterm_color() { - echo -e "\033[38;5;$1m$2\033[0m" + echo -e "%{\033[38;5;$1m%}$2%{\033[0m%}" } function xterm_color_open() { - echo -e "\033[38;5;$1m" + echo -e "%{\033[38;5;$1m%}" } function xterm_color_reset() { - echo -e "\033[0m" + echo -e "%{\033[0m%}" } autoload -U add-zsh-hook From d7cb18eb3d57e96821e8f7d2163463e65b07e6c8 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 8 Apr 2012 13:04:31 +0200 Subject: [PATCH 19/21] + added _show_colors function to debug current 16-color mappings --- lib/termsupport.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 6ee4eb596..7ba5f5fd2 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -42,6 +42,25 @@ function xterm_color_reset() { echo -e "%{\033[0m%}" } +function _show_colors() { + T='■' # The test text + + echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m"; + + for FGs in ' m' ' 1m' ' 30m' '1;30m' \ + ' 31m' '1;31m' ' 32m' '1;32m' \ + ' 33m' '1;33m' ' 34m' '1;34m' \ + ' 35m' '1;35m' ' 36m' '1;36m' \ + ' 37m' '1;37m'; + do FG=${FGs// /} + echo -en " $FGs \033[$FG $T " + for BG in 40m 41m 42m 43m 44m 45m 46m 47m; + do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; + done + echo; + done +} + autoload -U add-zsh-hook add-zsh-hook precmd omz_termsupport_precmd add-zsh-hook preexec omz_termsupport_preexec From 150a0ba1fb7cb744a6b6cffbd588f7687a383c11 Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Sun, 8 Apr 2012 17:45:25 +0200 Subject: [PATCH 20/21] + added color mapping for default 16 term colors to make them more pastelesque --- themes/pixelplastic.zsh-theme | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/themes/pixelplastic.zsh-theme b/themes/pixelplastic.zsh-theme index 6a3e7da37..1d40c355f 100644 --- a/themes/pixelplastic.zsh-theme +++ b/themes/pixelplastic.zsh-theme @@ -11,3 +11,24 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="$(xterm_color_reset)" ZSH_THEME_GIT_PROMPT_DIRTY=" $(xterm_color 196 '(!)')" ZSH_THEME_GIT_PROMPT_UNTRACKED=" $(xterm_color 33 '(+)')" ZSH_THEME_GIT_PROMPT_CLEAN="" + +# Map the default colors to more pasteleqsue colors +# see https://code.google.com/p/mintty/wiki/Tips#Changing_colours +# see http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs#comment12477465_9074343 +echo -ne '\e]4;0;#202020\a' # black +echo -ne '\e]4;1;#5d1a14\a' # red +echo -ne '\e]4;2;#424e24\a' # green +echo -ne '\e]4;3;#6f5028\a' # yellow +echo -ne '\e]4;4;#263e4e\a' # blue +echo -ne '\e]4;5;#3e1f50\a' # magenta +echo -ne '\e]4;6;#234e3f\a' # cyan +echo -ne '\e]4;7;#979797\a' # white (light grey really) +echo -ne '\e]4;8;#555555\a' # bold black (i.e. dark grey) +echo -ne '\e]4;9;#e32424\a' # bold red +echo -ne '\e]4;10;#65c734\a' # bold green +echo -ne '\e]4;11;#dae83a\a' # bold yellow +echo -ne '\e]4;12;#4790c4\a' # bold blue +echo -ne '\e]4;13;#a256c7\a' # bold magenta +echo -ne '\e]4;14;#40c7b0\a' # bold cyan +echo -ne '\e]4;15;#fefefe\a' # bold white + From 73a1184433253abb333a38c323f981b7f742e55e Mon Sep 17 00:00:00 2001 From: Marcel Hoyer Date: Thu, 12 Apr 2012 22:25:09 +0200 Subject: [PATCH 21/21] ~ typo --- themes/pixelplastic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/pixelplastic.zsh-theme b/themes/pixelplastic.zsh-theme index 1d40c355f..89eab803f 100644 --- a/themes/pixelplastic.zsh-theme +++ b/themes/pixelplastic.zsh-theme @@ -12,7 +12,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $(xterm_color 196 '(!)')" ZSH_THEME_GIT_PROMPT_UNTRACKED=" $(xterm_color 33 '(+)')" ZSH_THEME_GIT_PROMPT_CLEAN="" -# Map the default colors to more pasteleqsue colors +# Map the default colors to more pastelesque colors # see https://code.google.com/p/mintty/wiki/Tips#Changing_colours # see http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs#comment12477465_9074343 echo -ne '\e]4;0;#202020\a' # black