summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2017-04-18 07:45:10 (GMT)
committerOlliver Schinagl <oliver@schinagl.nl>2017-04-18 08:30:22 (GMT)
commit9ff70c1e848affebae77cf3a275576350e974c23 (patch)
tree649b834a6d54e45cf6ff8c5c304e5e72415027bc
parent2e4552f0f8bb32650b631f868e40a60a7d0901a7 (diff)
downloaddotfiles-9ff70c1e848affebae77cf3a275576350e974c23.zip
dotfiles-9ff70c1e848affebae77cf3a275576350e974c23.tar.gz
dotfiles-9ff70c1e848affebae77cf3a275576350e974c23.tar.bz2
zsh: use vcs_info rather then a manual git_prompt_info
-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='[%?%^]'