summaryrefslogtreecommitdiff
path: root/.zsh
diff options
context:
space:
mode:
authorRené Neumann <rene.neumann@in.tum.de>2012-04-10 14:05:14 +0200
committerRené Neumann <rene.neumann@in.tum.de>2012-04-10 14:05:15 +0200
commit7ee73ef37f932f6fa1061ac3242d71e8c06287cc (patch)
tree4b580c174ead45da841fd54b2a0c2664a57f17bc /.zsh
parent5d9a677dfdad31568045f00a351c2cbfdcddcd19 (diff)
downloaddotfiles-7ee73ef37f932f6fa1061ac3242d71e8c06287cc.tar.gz
dotfiles-7ee73ef37f932f6fa1061ac3242d71e8c06287cc.tar.bz2
dotfiles-7ee73ef37f932f6fa1061ac3242d71e8c06287cc.zip
fixes for zsh < 4.3.9
Diffstat (limited to '.zsh')
-rw-r--r--.zsh/functions/prompt_necoro_setup13
-rw-r--r--.zsh/zshrc4
2 files changed, 11 insertions, 6 deletions
diff --git a/.zsh/functions/prompt_necoro_setup b/.zsh/functions/prompt_necoro_setup
index 16d3654..8afefe8 100644
--- a/.zsh/functions/prompt_necoro_setup
+++ b/.zsh/functions/prompt_necoro_setup
@@ -10,21 +10,26 @@ EOF
}
prompt_necoro_setup () {
+ emulate -L zsh
+
+ autoload -U colors
+ colors
+
prompt_necoro_prompt=${1:-'blue'}
prompt_necoro_user=${2:-'green'}
prompt_necoro_root=${3:-'red'}
if [ "$USER" = 'root' ]
then
- base_prompt="%B%F{$prompt_necoro_root}%m%k "
+ base_prompt="%B%{$fg[prompt_necoro_root]%}%m%k "
else
- base_prompt="%B%F{$prompt_necoro_user}%n@%m%k "
+ base_prompt="%B%{$fg[$prompt_necoro_user]%}%n@%m%k "
fi
- post_prompt="%b%f%k"
+ post_prompt="%b%{$reset_color%}%k"
#setopt noxtrace localoptions
- path_prompt="%B%F{$prompt_necoro_prompt}%1~"
+ path_prompt="%B%{$fg[$prompt_necoro_prompt]%}%1~"
PS1="$base_prompt$path_prompt %# $post_prompt"
PS2="$base_prompt$path_prompt %_> $post_prompt"
PS3="$base_prompt$path_prompt ?# $post_prompt"
diff --git a/.zsh/zshrc b/.zsh/zshrc
index a08c4eb..4898a4f 100644
--- a/.zsh/zshrc
+++ b/.zsh/zshrc
@@ -136,7 +136,7 @@ RPROMPT="%(?.%S%{$fg[green]%}:).%S%{$fg[red]%}:()%{$reset_color%}%s"
# vcs stuff for prompt
setopt prompt_subst
-if is-at-least 4.3; then
+if is-at-least 4.3.9; then
autoload -Uz vcs_info
zstyle ":vcs_info:*" enable bzr cvs svn git hg
@@ -187,7 +187,7 @@ esac
# Key bindings {{{
#################################################
bindkey -e # use emacs style :)
-if [[ $ZSH_VERSION == 4.3.* ]]; then
+if is-at-least 4.3.9; then
bindkey "^R" history-incremental-pattern-search-backward
bindkey "^S" history-incremental-pattern-search-forward
else