From 7ee73ef37f932f6fa1061ac3242d71e8c06287cc Mon Sep 17 00:00:00 2001 From: René Neumann Date: Tue, 10 Apr 2012 14:05:14 +0200 Subject: fixes for zsh < 4.3.9 --- .zsh/functions/prompt_necoro_setup | 13 +++++++++---- .zsh/zshrc | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to '.zsh') 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 -- cgit v1.2.3-70-g09d2