From 56f8f83d58849b31b43819a3b83251bc73f7cb89 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 28 Mar 2012 14:44:50 -0400 Subject: [PATCH] [#23] Convert terminal into a module --- init.zsh | 1 - terminal.zsh => modules/terminal/init.zsh | 4 ++-- templates/zshrc | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) rename terminal.zsh => modules/terminal/init.zsh (95%) diff --git a/init.zsh b/init.zsh index 4e0d1810..028f222a 100644 --- a/init.zsh +++ b/init.zsh @@ -49,7 +49,6 @@ autoload -Uz compinit && compinit -i # Source files (the order matters). source "${0:h}/helper.zsh" source "${0:h}/environment.zsh" -source "${0:h}/terminal.zsh" # Source modules defined in ~/.zshrc. for omodule in "$omodules[@]"; do diff --git a/terminal.zsh b/modules/terminal/init.zsh similarity index 95% rename from terminal.zsh rename to modules/terminal/init.zsh index 6e9d3f23..dcb9a6ea 100644 --- a/terminal.zsh +++ b/modules/terminal/init.zsh @@ -78,7 +78,7 @@ autoload -Uz add-zsh-hook # Sets the tab and window titles before the prompt is displayed. function set-title-precmd { - if zstyle -t ':omz:terminal' auto-title; then + if zstyle -t ':omz:module:terminal' auto-title; then if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]]; then # Set the current working directory in Apple Terminal. printf '\e]7;%s\a' "file://$HOST${PWD// /%20}" @@ -95,7 +95,7 @@ add-zsh-hook precmd set-title-precmd # Sets the tab and window titles before command execution. function set-title-preexec { - if zstyle -t ':omz:terminal' auto-title; then + if zstyle -t ':omz:module:terminal' auto-title; then set-title-by-command "$2" fi } diff --git a/templates/zshrc b/templates/zshrc index ba7f3939..01f95b63 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -18,7 +18,7 @@ zstyle ':omz:*:*' case-sensitive 'no' zstyle ':omz:*:*' color 'yes' # Auto set the tab and window titles. -zstyle ':omz:terminal' auto-title 'yes' +zstyle ':omz:module:terminal' auto-title 'yes' # Set the Zsh modules to load (man zshmodules). # zstyle ':omz:load' zmodule 'attr' 'stat'