mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-25 22:00:15 +08:00
refactor(themes): use ruby_prompt_info
everywhere
This commit is contained in:
parent
aa99472c8a
commit
e3bb6e685d
@ -1,5 +1,5 @@
|
||||
|
||||
PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color
|
||||
PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(ruby_prompt_info)$fg_bold[blue] ]$reset_color
|
||||
$ '
|
||||
# git theming
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green]("
|
||||
|
@ -10,7 +10,7 @@ function josh_prompt {
|
||||
prompt=" "
|
||||
|
||||
branch=$(git_current_branch)
|
||||
ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
|
||||
ruby_version=$(ruby_prompt_info)
|
||||
path_size=${#PWD}
|
||||
branch_size=${#branch}
|
||||
ruby_size=${#ruby_version}
|
||||
@ -31,7 +31,7 @@ function josh_prompt {
|
||||
prompt=" $prompt"
|
||||
done
|
||||
|
||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_current_branch)"
|
||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} $(git_current_branch)"
|
||||
|
||||
echo $prompt
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
||||
local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
|
||||
local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}'
|
||||
local rvm_ruby='%{$fg[red]%}$(ruby_prompt_info)%{$reset_color%}'
|
||||
local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
|
||||
|
||||
PROMPT="${user_host}:${current_dir} ${rvm_ruby}
|
||||
|
@ -68,7 +68,7 @@ ZSH_THEME_RUBY_PROMPT_SUFFIX="]"
|
||||
# Decide if we need to set titlebar text.
|
||||
case $TERM in
|
||||
xterm*|*rxvt*)
|
||||
PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%M:%~ $(git_prompt_info) $(rvm_prompt_info) | ${COLUMNS}x${LINES} | %y\a%}'
|
||||
PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%M:%~ $(git_prompt_info) $(ruby_prompt_info) | ${COLUMNS}x${LINES} | %y\a%}'
|
||||
;;
|
||||
screen)
|
||||
PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
|
||||
@ -88,7 +88,7 @@ fi
|
||||
# Finally, the prompt.
|
||||
PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
|
||||
$PR_RED$PR_HBAR<\
|
||||
$PR_BLUE%(!.$PR_RED%SROOT%s.%n)$PR_GREEN@$PR_BLUE%M:$PR_GREEN%$PR_PWDLEN<...<%~$PR_CYAN$(git_prompt_info)$(rvm_prompt_info)\
|
||||
$PR_BLUE%(!.$PR_RED%SROOT%s.%n)$PR_GREEN@$PR_BLUE%M:$PR_GREEN%$PR_PWDLEN<...<%~$PR_CYAN$(git_prompt_info)$(ruby_prompt_info)\
|
||||
$PR_RED>$PR_HBAR${(e)PR_FILLBAR}\
|
||||
$PR_RED$PR_HBAR<\
|
||||
$PR_GREEN%l$PR_RED>$PR_HBAR\
|
||||
|
Loading…
Reference in New Issue
Block a user