1
0
Fork 0
mirror of synced 2024-11-12 11:08:58 -05:00

fix prompt substitutions/expansions

The 'prompt' function disables any option set with 'setopt'.
To make options persistent we need to use the 'prompt_opts' array
instead
This commit is contained in:
caedus75 2015-12-30 04:23:52 -02:00
parent 7f0dc26de3
commit 9e767dd097
3 changed files with 10 additions and 7 deletions

View file

@ -3,6 +3,9 @@
# https://github.com/shashankmehta/dotfiles/blob/master/thesetup/zsh/.oh-my-zsh/custom/themes/gitster.zsh-theme
#
autoload -Uz colors && colors
prompt_opts=( cr subst percent )
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
function get_pwd(){
@ -20,7 +23,7 @@ function get_pwd(){
print $prompt_short_dir
}
PROMPT="$ret_status %{$fg[white]%}$(get_pwd) $(git_prompt_info)%{$reset_color%}%{$reset_color%} "
PROMPT='$ret_status %{$fg[white]%}$(get_pwd) $(git_prompt_info)%{$reset_color%}%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"

View file

@ -5,7 +5,7 @@
autoload -Uz colors && colors
setopt prompt_subst
prompt_opts=( cr subst percent )
PROMPT_CHAR=""
@ -98,6 +98,6 @@ zle -N zle-line-init
zle -N zle-keymap-select
zle -N zle-line-finish
PROMPT="$(prompt_user)$(prompt_jobs)$(prompt_vimode)$(prompt_status) "
RPROMPT="$(prompt_path)$(prompt_git)"
PROMPT='$(prompt_user)$(prompt_jobs)$(prompt_vimode)$(prompt_status) '
RPROMPT='$(prompt_path)$(prompt_git)'

View file

@ -14,7 +14,7 @@ function virtualenv_info {
}
PR_GIT_UPDATE=1
setopt prompt_subst
prompt_opts=( cr subst percent )
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
@ -96,6 +96,6 @@ function steeef_precmd {
}
add-zsh-hook precmd steeef_precmd
PROMPT="
PROMPT='
%{$purple%}%n${${reset_color}%} at %{$orange%}%m${${reset_color}%} in %{$limegreen%}%~${${reset_color}%} $vcs_info_msg_0_$(virtualenv_info)%{${reset_color}%}
$ "
$ '