enabled git info promt via vcs_info

This commit is contained in:
John-Paul Bader 2012-04-24 08:58:49 +02:00
parent 90ca29af4a
commit b7d4c84c24
3 changed files with 26 additions and 13 deletions

View file

@ -23,13 +23,4 @@ else
fi fi
# Apply theming defaults # Apply theming defaults
PS1="%n@%m:%~%# " 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

25
.zsh/lib/promt.zsh Normal file
View file

@ -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%}'

3
.zshrc
View file

@ -2,9 +2,6 @@ export ZSH=~/.zsh
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting 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 # Load all of the config files in ~/oh-my-zsh that end in .zsh
for config_file ($ZSH/lib/*.zsh) source $config_file for config_file ($ZSH/lib/*.zsh) source $config_file