mirror of https://github.com/akelge/vim
Repo aware prompt
This commit is contained in:
parent
02063b266b
commit
a1e61b9720
|
@ -19,5 +19,8 @@ autoload -U bak
|
|||
# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false
|
||||
autoload -U fancyTerm
|
||||
|
||||
# repo_char - returns a character based on the type of repo we are in
|
||||
autoload -U repo_char
|
||||
|
||||
|
||||
# vim: set ts=4 sw=4 tw=0 ft=zsh :
|
||||
|
|
|
@ -4,14 +4,14 @@ if `fancyTerm`; then
|
|||
I="%m::%."
|
||||
# L="$FX[bold]$FX[italic]$BG[111]$FG[239]@%m::%2~ $BG[000]
|
||||
# $FG[228]%#$FX[reset] "
|
||||
L="$FX[bold]$FX[italic]$BG[062]@%m::%2~ $BG[000]
|
||||
$FG[220]%#$FX[reset] "
|
||||
L='$FX[bold]$FX[italic]$BG[062]@%m::%2~$(repo_char)$BG[000]
|
||||
$FG[220]%#$FX[reset] '
|
||||
PS1="%{]2;$W%}%{]1;$I%}$L"
|
||||
unset W I L
|
||||
|
||||
else
|
||||
# We are not on xterminal
|
||||
PS1="%B%K{blue}%F{white}[%l] %n@%m:%~ %f%k%F{yellow}%#%f%b "
|
||||
PS1="%B%K{blue}%F{white}[%l] %n@%m:%~ %f%k%F{yellow}%# $(repo_char)%f%b "
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
function repo_char {
|
||||
# git branch > /dev/null 2> /dev/null && echo '±' && return
|
||||
# svn info > /dev/null 2> /dev/null && echo '\u03a3' && return
|
||||
# echo '\u25cb'
|
||||
git branch > /dev/null 2> /dev/null && echo ' «git' && return
|
||||
svn info > /dev/null 2> /dev/null && echo ' «svn' && return
|
||||
}
|
Loading…
Reference in New Issue