summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-09-22 15:57:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-09-22 15:57:53 +0200
commitb163bfe049a3ce12c9a183d669aabd1aa6de0e06 (patch)
treef6997b7ec2009b02a9447774263338b5651bd0a6
parentbd9e2a82f69d314291f78d7a4ecb358e3367ec2e (diff)
Added parameter to disable unicode
-rw-r--r--etc/completion8
-rw-r--r--etc/prompt2
-rw-r--r--etc/rc1
-rw-r--r--etc/unicode20
4 files changed, 27 insertions, 4 deletions
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]}
+ }
+}