diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/functions/prompt_necoro_setup | 13 | ||||
-rw-r--r-- | .zsh/zshrc | 4 |
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" @@ -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 |