mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Removing rvm from prompt and custom svn command, using plugin instead
This commit is contained in:
parent
ef0a4125b5
commit
5f195a1aec
1 changed files with 2 additions and 22 deletions
|
|
@ -1,26 +1,6 @@
|
||||||
svn_prompt_status() {
|
|
||||||
[ -d "./.svn" ] || return
|
|
||||||
|
|
||||||
base_dir="."
|
|
||||||
while [ -d "$base_dir/.svn" ]; do base_dir="$base_dir/.."; done
|
|
||||||
base_dir=$(stat -F "$base_dir")
|
|
||||||
|
|
||||||
rev=$(svn info ${base_dir} | awk '/^URL/ { sub(".*/","",$0); r=$0 } /^Revision/ { sub("[^0-9]*","",$0); print r"/"$0 }')
|
|
||||||
echo "{" ${rev} "}"
|
|
||||||
}
|
|
||||||
|
|
||||||
rvm_prompt_status() {
|
|
||||||
if [ -f "$(which rvm-prompt)" ]; then
|
|
||||||
if [ "" -ne "$(rvm-prompt i v g)" ]; then
|
|
||||||
echo "<"$(rvm-prompt i v g)">"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
|
local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
|
||||||
local pwd='%{$fg[blue]%}%~%{$reset_color%}'
|
local pwd='%{$fg[blue]%}%~%{$reset_color%}'
|
||||||
local rvm='%{$fg[green]%}$(rvm_prompt_status)%{$reset_color%}'
|
local svn='%{$fg[green]%}$(svn_prompt_info)%{$reset_color%}'
|
||||||
local svn='%{$fg[green]%}$(svn_prompt_status)%{$reset_color%}'
|
|
||||||
local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
|
local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
|
||||||
local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
|
local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
|
||||||
|
|
||||||
|
|
@ -37,5 +17,5 @@ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═ "
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭ "
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭ "
|
||||||
|
|
||||||
PROMPT="${user} ${pwd}$ "
|
PROMPT="${user} ${pwd}$ "
|
||||||
RPROMPT="${return_code} ${git_branch} ${svn} ${rvm}"
|
RPROMPT="${return_code} ${git_branch} ${svn}"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue