Use zstyle instead of variables for configuration.

This commit is contained in:
Sorin Ionescu 2011-12-26 13:37:53 -05:00
commit f0499b76c3
13 changed files with 156 additions and 103 deletions

View file

@ -70,7 +70,7 @@ autoload -Uz add-zsh-hook
# Sets the tab and window titles before the prompt is displayed.
function set-title-precmd {
if [[ "$TERM_PROGRAM" != "Apple_Terminal" ]] && check-bool "$AUTO_TITLE"; then
if [[ "$TERM_PROGRAM" != "Apple_Terminal" ]] && zstyle -t ':omz:terminal' auto-title; then
set-window-title "${(%):-%~}"
for kind in tab screen; do
# Left-truncate the current working directory to 15 characters.
@ -85,7 +85,7 @@ add-zsh-hook precmd set-title-precmd
# Sets the tab and window titles before command execution.
function set-title-preexec {
if check-bool "$AUTO_TITLE"; then
if zstyle -t ':omz:terminal' auto-title; then
set-title-by-command "$2"
fi
}