diff options
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 49 |
1 files changed, 29 insertions, 20 deletions
@@ -1,4 +1,13 @@ # -*- 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 HISTSIZE=1000 @@ -25,37 +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. -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 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 @@ -97,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. |