summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2015-08-30 20:15:13 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2015-08-30 22:03:05 +0200
commit7ddbea632e2681fba1d430e366ca31bf048568cb (patch)
tree53cfc1b07c573d1aa112182495fe32523bb738ba
parenta06e98948faedbbe2aef7bec94ef34d53cb906dd (diff)
downloaddotfiles-7ddbea632e2681fba1d430e366ca31bf048568cb.tar.gz
dotfiles-7ddbea632e2681fba1d430e366ca31bf048568cb.tar.bz2
dotfiles-7ddbea632e2681fba1d430e366ca31bf048568cb.zip
[zsh] Use add-zsh-hook wherever possible.
-rw-r--r--.zsh/zshrc24
1 files changed, 15 insertions, 9 deletions
diff --git a/.zsh/zshrc b/.zsh/zshrc
index a8024e8..8f4f567 100644
--- a/.zsh/zshrc
+++ b/.zsh/zshrc
@@ -102,6 +102,13 @@ if [[ $- != *i* ]] ; then
fi
# }}}
+# General ZSH Functionality {{{
+#################################################
+
+autoload -Uz add-zsh-hook
+
+# }}}
+
# Completion {{{
#################################################
autoload -U compinit
@@ -133,6 +140,8 @@ zstyle ':completion:*:cd:*' ignore-parents parent pwd
# Prompt {{{
#################################################
+add-zsh-hook -Uz precmd promptnl # always guarantee a newline
+
autoload -U promptinit
promptinit
@@ -166,7 +175,7 @@ if is-at-least 4.3.9; then
zstyle ":vcs_info:*" get-revision true
zstyle ":vcs_info:*" check-for-changes true
zstyle ":vcs_info:*" max-exports 1
-
+
# hg stuff
zstyle ":vcs_info:hg:*" unstagedstr '*'
zstyle ":vcs_info:hg:*" hgrevformat '%r'
@@ -176,12 +185,10 @@ if is-at-least 4.3.9; then
zstyle ":vcs_info:bzr:*" use-simple true
RPROMPT='${vcs_info_msg_0_:+"${vcs_info_msg_0_} "}'"${RPROMPT}"
-else
- vcs_info () {} # dummy
+
+ add-zsh-hook precmd vcs_info
fi
-autoload promptnl
-precmd_functions=( ${precmd_functions} promptnl vcs_info )
# }}}
@@ -202,6 +209,7 @@ _set_title () {
esac
echo -ne "${pre}${USER}@${HOST}:${PWD/$HOME/~}${post}"
}
+add-zsh-hook precmd _set_title
_set_cwd () {
local update="\0033]777;cwd-spawn;path;$PWD\0007"
@@ -215,9 +223,7 @@ _set_cwd () {
echo -ne "$update"
}
-
-precmd_functions=( ${precmd_functions} _set_title )
-chpwd_functions=( ${chpwd_functions} _set_cwd )
+add-zsh-hook chpwd _set_cwd
case $TERM in
xterm*)
@@ -321,7 +327,7 @@ autoload -U zmv
# }}}
-# Cleanuo {{{
+# Cleanup {{{
#################################################
unset _IS_GENTOO