summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-12-04 17:46:11 +0100
committerGravatar Tom Willemsen2012-12-04 17:46:11 +0100
commit0fc7500375e85374ae91f69cf96363d6e8840f52 (patch)
tree82543f10f98c31e14895505ad6b3e81c56606f63
parent8123b403f4d7468d5a4c8a4a724b6ce2fe793471 (diff)
downloaddotfiles-0fc7500375e85374ae91f69cf96363d6e8840f52.tar.gz
dotfiles-0fc7500375e85374ae91f69cf96363d6e8840f52.zip
.zshrc
-rw-r--r--.zshrc38
1 files changed, 22 insertions, 16 deletions
diff --git a/.zshrc b/.zshrc
index 307ebc7..bc94c2e 100644
--- a/.zshrc
+++ b/.zshrc
@@ -1,5 +1,12 @@
# -*- Mode: shell-script; -*-
autoload -Uz add-zsh-hook
+autoload -Uz compinit
+autoload -U colors
+autoload -Uz vcs_info
+
+# Autoload zsh functions.
+fpath=($HOME/.zsh/functions $fpath)
+autoload -U $HOME/.zsh/functions/*(:t)
# Setup variables
HISTFILE=$ZDOTDIR/histfile
@@ -27,38 +34,34 @@ alias reboot="systemctl reboot"
alias poweroff="systemctl poweroff"
setopt notify
-# Allow for functions in the prompt
-setopt PROMPT_SUBST
+setopt PROMPT_SUBST # Allow for functions in the prompt
setopt EXTENDED_GLOB
zstyle :compinstall filename '$HOME/.zshrc'
-autoload -Uz compinit
-compinit
-
-# Initialize colors.
-autoload -U colors
-colors
-
-# Autoload zsh functions.
-fpath=($HOME/.zsh/functions $fpath)
-autoload -U $HOME/.zsh/functions/*(:t)
-
# Enable auto-execution of functions
typeset -ga preexec_functions
typeset -ga precmd_functions
typeset -ga chpwd_functions
-# Append git functions needed for prompt.
add-zsh-hook preexec preexec_update_vars
add-zsh-hook precmd precmd_update_git_vars
add-zsh-hook precmd precmd_update_updates
add-zsh-hook precmd precmd_maybe_festival
+add-zsh-hook precmd vcs_info
add-zsh-hook chpwd chpwd_update_git_vars
+zstyle ':vcs_info:*' actionformats '%F{2}(%f%s %r %b%F{2})%f %a
+ %S'
+zstyle ':vcs_info:*' enable bzr git hg svn
+zstyle ':vcs_info:*' formats '%F{2}(%f%s %r %b%F{2})%f
+ %S'
+zstyle ':vcs_info:*' nvcsformats '
+ %~'
+zstyle ':vcs_info:bzr:*' branchformat '%b'
+
# Set the prompt.
-PROMPT='$(prompt)'
-RPROMPT='$(rprompt)'
+PROMPT='%F{1}(%F{2}(%f%m %l%F{2})%f ${vcs_info_msg_0_}%F{1})%f %# '
# Set terminal name to current running application
case $TERM in
@@ -100,3 +103,6 @@ if [ -z $EMACS ]; then
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
fi
+
+compinit
+colors # Initialize colors.