From 27065816c78f1678ab2295ecc1e4eaf5ebd9bd83 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 28 Nov 2012 10:18:43 +0100 Subject: .zshrc --- .zshrc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '.zshrc') diff --git a/.zshrc b/.zshrc index 1a166e5..307ebc7 100644 --- a/.zshrc +++ b/.zshrc @@ -1,4 +1,6 @@ # -*- Mode: shell-script; -*- +autoload -Uz add-zsh-hook + # Setup variables HISTFILE=$ZDOTDIR/histfile HISTSIZE=1000 @@ -48,10 +50,11 @@ typeset -ga precmd_functions typeset -ga chpwd_functions # Append git functions needed for prompt. -preexec_functions+='preexec_update_vars' -precmd_functions+='precmd_update_git_vars' -precmd_functions+='precmd_update_updates' -chpwd_functions+='chpwd_update_git_vars' +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 chpwd chpwd_update_git_vars # Set the prompt. PROMPT='$(prompt)' -- cgit v1.2.3-54-g00ecf From 0fc7500375e85374ae91f69cf96363d6e8840f52 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 4 Dec 2012 17:46:11 +0100 Subject: .zshrc --- .zshrc | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to '.zshrc') 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. -- cgit v1.2.3-54-g00ecf