From b163bfe049a3ce12c9a183d669aabd1aa6de0e06 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 22 Sep 2008 15:57:53 +0200 Subject: Added parameter to disable unicode --- etc/completion | 8 +++++--- etc/prompt | 2 +- etc/rc | 1 + etc/unicode | 20 ++++++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 etc/unicode (limited to 'etc') diff --git a/etc/completion b/etc/completion index 5eaae9b..4fed4d6 100644 --- a/etc/completion +++ b/etc/completion @@ -13,17 +13,19 @@ zstyle ':completion:*' menu select=1 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z} m:_=\\\ ' '' # Be verbose +char=${ps_yellow}$(zchar compdelim)${ps_reset} zstyle ':completion:*' verbose true zstyle ':completion:*:descriptions' format \ - "${ps_yellow}·${ps_reset} %d ${ps_yellow}·${ps_reset}" + "$char %d $char" zstyle ':completion:*:messages' format \ - "${ps_yellow}·${ps_reset} %d ${ps_yellow}·${ps_reset}" + "$char %d $char" zstyle ':completion:*:corrections' format \ - "${ps_yellow}·${ps_reset} %d ${ps_yellow}·${ps_reset}" + "$char %d $char" zstyle ':completion:*:warnings' format \ "${ps_red}no match:${ps_reset} %d" zstyle ':completion:*' group-name '' +unset char # program-specific settings zstyle ':completion:*:*:kill:*' menu yes diff --git a/etc/prompt b/etc/prompt index c948f5d..241ee42 100644 --- a/etc/prompt +++ b/etc/prompt @@ -10,7 +10,7 @@ user="${ps_yellow}%n" at="@" host="%m" dir="${ps_reset}%25>…>%2v%>>" -sign="%(!.${ps_red}#.${ps_green}>)${ps_reset}" +sign="%(!.${ps_red}$(zchar prompt-root-ok).${ps_green}$(zchar prompt-user-ok))${ps_reset}" screen=$'%{\ek\e\\%}' PS1="${user}${at}${host} ${dir} ${sign} ${screen}" diff --git a/etc/rc b/etc/rc index 75c7411..41a8d26 100644 --- a/etc/rc +++ b/etc/rc @@ -14,6 +14,7 @@ alias 'openbsd:'='[[ $uname = OpenBSD ]] &&' ## include the actual config source $ZDIR/options source $ZDIR/parameters +source $ZDIR/unicode source $ZDIR/function source $ZDIR/colors source $ZDIR/prompt diff --git a/etc/unicode b/etc/unicode new file mode 100644 index 0000000..fd3b382 --- /dev/null +++ b/etc/unicode @@ -0,0 +1,20 @@ +## vim:ft=zsh + +typeset -A chars +typeset unicode=${unicode-1} +chars=( + compdelim '-·' + prompt-user-ok '>>' # ▶? + prompt-user-nz '>>' # ▷? + prompt-root-ok '##' + prompt-root-nz '##' +) + +function zchar () { + typeset char=$1 + if (( unicode == 1 )) { + echo -n - ${chars[$char][2]} + } else { + echo -n - ${chars[$char][1]} + } +} -- cgit v1.2.3