diff --git a/init.zsh b/init.zsh index 73a65976..729ca72c 100644 --- a/init.zsh +++ b/init.zsh @@ -41,21 +41,6 @@ zstyle -a ':omz:load' omodule 'omodules' omodload "$omodules[@]" unset omodules -# Add themes to fpath. -fpath=(${0:h}/themes/*(/FN) $fpath) - -# Load and run the prompt theming system. -autoload -Uz promptinit && promptinit - -# Load the prompt theme. -zstyle -a ':omz:prompt' theme 'prompt_argv' -if (( $#prompt_argv > 0 )); then - prompt "$prompt_argv[@]" -else - prompt 'off' -fi -unset prompt_argv - # Set environment variables for launchd processes. if [[ "$OSTYPE" == darwin* ]]; then for env_var in PATH MANPATH; do diff --git a/themes/minimal/prompt_minimal_setup b/modules/prompt/functions/prompt_minimal_setup similarity index 100% rename from themes/minimal/prompt_minimal_setup rename to modules/prompt/functions/prompt_minimal_setup diff --git a/themes/nicoulaj/prompt_nicoulaj_setup b/modules/prompt/functions/prompt_nicoulaj_setup similarity index 100% rename from themes/nicoulaj/prompt_nicoulaj_setup rename to modules/prompt/functions/prompt_nicoulaj_setup diff --git a/themes/sorin/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup similarity index 100% rename from themes/sorin/prompt_sorin_setup rename to modules/prompt/functions/prompt_sorin_setup diff --git a/themes/steeef/prompt_steeef_setup b/modules/prompt/functions/prompt_steeef_setup similarity index 100% rename from themes/steeef/prompt_steeef_setup rename to modules/prompt/functions/prompt_steeef_setup diff --git a/modules/prompt/init.zsh b/modules/prompt/init.zsh new file mode 100644 index 00000000..973dd711 --- /dev/null +++ b/modules/prompt/init.zsh @@ -0,0 +1,19 @@ +# +# Loads prompt themes. +# +# Authors: +# Sorin Ionescu +# + +# Load and run the prompt theming system. +autoload -Uz promptinit && promptinit + +# Load the prompt theme. +zstyle -a ':omz:module:prompt' theme 'prompt_argv' +if (( $#prompt_argv > 0 )); then + prompt "$prompt_argv[@]" +else + prompt 'off' +fi +unset prompt_argv + diff --git a/templates/zshrc b/templates/zshrc index 46e1db6d..8efd3eb1 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -30,13 +30,13 @@ zstyle ':omz:module:terminal' auto-title 'yes' # zstyle ':omz:load' zfunction 'zargs' 'zmv' # Set the Oh My Zsh modules to load (browse modules). -zstyle ':omz:load' omodule 'environment' 'terminal' 'editor' \ - 'completion' 'history' 'directory' 'spectrum' 'alias' 'utility' +zstyle ':omz:load' omodule 'environment' 'terminal' 'editor' 'completion' \ + 'history' 'directory' 'spectrum' 'alias' 'utility' 'prompt' # Set the prompt theme to load. # Setting it to 'random' loads a random theme. # Auto set to 'off' on dumb terminals. -zstyle ':omz:prompt' theme 'sorin' +zstyle ':omz:module:prompt' theme 'sorin' # This will make you shout: OH MY ZSHELL! source "$OMZ/init.zsh"