summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zsh/prompt22
1 files changed, 14 insertions, 8 deletions
diff --git a/.zsh/prompt b/.zsh/prompt
index 17e578d..5ee9c3f 100644
--- a/.zsh/prompt
+++ b/.zsh/prompt
@@ -1,14 +1,20 @@
-# functions
-function git_prompt_info {
- git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
-}
-
# Load colors
autoload -U colors && colors
+precmd() {
+ vcs_info
+}
+
setopt promptsubst
-local CUR_BRANCH='$(git_prompt_info)'
-PROMPT="%{$fg[blue]%}[%{$fg[yellow]%}%n%{$fg[blue]%}@%{$fg[green]%}%m%{$fg[yellow]%}:%~%{$fg[blue]%}]%{$fg[red]%}${CUR_BRANCH}%{$fg[green]%}%# %{$reset_color%}"
+zstyle ':vcs_info:*' enable git svn
+zstyle ':vcs_info:*' check-for-changes true
+zstyle ':vcs_info:*' get-revision true
+zstyle ':vcs_info:*' get-bookmarks true
+zstyle ':vcs_info:git:*' formats "%{$fg[blue]%}(%{$fg[cyan]%}%s%{$fg[blue]%}:%{$fg[yellow]%}%10>>%i%<<%{$fg[blue]%}) %{$fg[red]%}%b$fg[magenta]%}%m%u%c"$'\n'
+zstyle ':vcs_info:git:*' actionformats "%{$fg[blue]%}(%{$fg[cyan]%}%s%{$fg[blue]%}:%{$fg[yellow]%}%10>>%i%<<%{$fg[blue]%}) %{$fg[red]%}%b %{$fg[blue]%}[$fg[green]%}%a%{$fg[blue]%}]"$'\n'
+zstyle ':vcs_info:git:*' branchformat ' GIT BRANCH: %b'
+
+PROMPT='${vcs_info_msg_0_}%{$fg[blue]%}[%{$fg[cyan]%}%n%{$fg[blue]%}@%{$fg[magenta]%}%m%{$fg[yellow]%}:%~%{$fg[blue]%}]%{$fg[green]%}%# %{$reset_color%}'
-RPROMPT='[%?]'
+RPROMPT='[%?%^]'