mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-08 04:34:00 +02:00
Merge 70b3820bce into 5667161d49
This commit is contained in:
commit
78148700a9
2 changed files with 37 additions and 0 deletions
16
lib/svn.zsh
Normal file
16
lib/svn.zsh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# utility functions for subversion
|
||||
# based on oh-my-zsh git lib module
|
||||
|
||||
function svn_dirty {
|
||||
if [[ -n $(svn status) ]]; then
|
||||
echo "$ZSH_THEME_SVN_PROMPT_DIRTY"
|
||||
else
|
||||
echo "$ZSH_THEME_SVN_PROMPT_CLEAN"
|
||||
fi
|
||||
}
|
||||
|
||||
function svn_prompt_info {
|
||||
info=$(svn info 2>/dev/null) || return
|
||||
rev=$(echo "$info" | grep Revision | sed 's/Revision: //')
|
||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}r${rev}$(svn_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
}
|
||||
21
themes/xcolour.zsh-theme
Normal file
21
themes/xcolour.zsh-theme
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Matt Singleton's oh-my-zsh theme
|
||||
|
||||
function prompt_char {
|
||||
git branch >/dev/null 2>/dev/null && echo '±' && return
|
||||
svn info >/dev/null 2>/dev/null && echo 'ϟ' && return
|
||||
echo '$'
|
||||
}
|
||||
|
||||
PROMPT='%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}
|
||||
$(git_prompt_info)$(svn_prompt_info)$(prompt_char) %{$reset_color%}'
|
||||
RPROMPT='%D{%r}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✘%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}✔%{$reset_color%}"
|
||||
|
||||
ZSH_THEME_SVN_PROMPT_PREFIX="("
|
||||
ZSH_THEME_SVN_PROMPT_SUFFIX=") "
|
||||
ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%}✘%{$reset_color%}"
|
||||
ZSH_THEME_SVN_PROMPT_CLEAN="%{$fg[green]%}✔%{$reset_color%}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue