From b7d4c84c249789f1de84de9e932e08202de95e35 Mon Sep 17 00:00:00 2001 From: John-Paul Bader Date: Tue, 24 Apr 2012 08:58:49 +0200 Subject: [PATCH] enabled git info promt via vcs_info --- .zsh/lib/appearance.zsh | 11 +---------- .zsh/lib/promt.zsh | 25 +++++++++++++++++++++++++ .zshrc | 3 --- 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 .zsh/lib/promt.zsh diff --git a/.zsh/lib/appearance.zsh b/.zsh/lib/appearance.zsh index 58194c5..320c2c1 100644 --- a/.zsh/lib/appearance.zsh +++ b/.zsh/lib/appearance.zsh @@ -23,13 +23,4 @@ else fi # Apply theming defaults -PS1="%n@%m:%~%# " - -# git theming default: Variables for theming the git info prompt -ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name -ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt -ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty -ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean - -# Setup the prompt with pretty colors -setopt prompt_subst \ No newline at end of file +PS1="%n@%m:%~%# " \ No newline at end of file diff --git a/.zsh/lib/promt.zsh b/.zsh/lib/promt.zsh new file mode 100644 index 0000000..59bd20c --- /dev/null +++ b/.zsh/lib/promt.zsh @@ -0,0 +1,25 @@ +# autoload -U add-zsh-hook +autoload -Uz vcs_info + +# # enable VCS systems you use +zstyle ':vcs_info:*' enable git svn +zstyle ':vcs_info:*:prompt:*' check-for-changes true + +setopt prompt_subst +autoload -U promptinit +promptinit + + +# Look at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information +# for mor options +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' unstagedstr '*' # display this when there are unstaged changes +zstyle ':vcs_info:*' stagedstr '+' # display this when there are staged changes +zstyle ':vcs_info:*' actionformats '[%b%|%a%c%u%]%f' +zstyle ':vcs_info:*' formats ':%b%c%u%f' + + +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' +precmd () { vcs_info } + +PROMPT='[%n@%m %~${vcs_info_msg_0_}] %{$reset_color%}' \ No newline at end of file diff --git a/.zshrc b/.zshrc index 37ce676..f97db73 100644 --- a/.zshrc +++ b/.zshrc @@ -2,9 +2,6 @@ export ZSH=~/.zsh PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting -# add a function path -fpath=($ZSH/functions $ZSH/completions $fpath) - # Load all of the config files in ~/oh-my-zsh that end in .zsh for config_file ($ZSH/lib/*.zsh) source $config_file