From faeca828312951ae41d5faa7885d6190f0a537fa Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 23 Sep 2011 20:11:33 -0400 Subject: [PATCH] The functions directory should only hold functions. --- functions/alias.zsh => alias.zsh | 0 functions/completion.zsh => completion.zsh | 0 functions/directory.zsh => directory.zsh | 0 functions/environment.zsh => environment.zsh | 0 functions/init.zsh | 12 -------- functions/helper.zsh => helper.zsh | 0 functions/history.zsh => history.zsh | 0 init.zsh | 30 +++++++++++++++----- functions/keyboard.zsh => keyboard.zsh | 0 functions/spectrum.zsh => spectrum.zsh | 0 functions/terminal.zsh => terminal.zsh | 0 functions/utility.zsh => utility.zsh | 0 12 files changed, 23 insertions(+), 19 deletions(-) rename functions/alias.zsh => alias.zsh (100%) rename functions/completion.zsh => completion.zsh (100%) rename functions/directory.zsh => directory.zsh (100%) rename functions/environment.zsh => environment.zsh (100%) delete mode 100644 functions/init.zsh rename functions/helper.zsh => helper.zsh (100%) rename functions/history.zsh => history.zsh (100%) rename functions/keyboard.zsh => keyboard.zsh (100%) rename functions/spectrum.zsh => spectrum.zsh (100%) rename functions/terminal.zsh => terminal.zsh (100%) rename functions/utility.zsh => utility.zsh (100%) diff --git a/functions/alias.zsh b/alias.zsh similarity index 100% rename from functions/alias.zsh rename to alias.zsh diff --git a/functions/completion.zsh b/completion.zsh similarity index 100% rename from functions/completion.zsh rename to completion.zsh diff --git a/functions/directory.zsh b/directory.zsh similarity index 100% rename from functions/directory.zsh rename to directory.zsh diff --git a/functions/environment.zsh b/environment.zsh similarity index 100% rename from functions/environment.zsh rename to environment.zsh diff --git a/functions/init.zsh b/functions/init.zsh deleted file mode 100644 index 0c7765db..00000000 --- a/functions/init.zsh +++ /dev/null @@ -1,12 +0,0 @@ -# Source function files (the order matters). -source "${0:h}/helper.zsh" -source "${0:h}/environment.zsh" -source "${0:h}/terminal.zsh" -source "${0:h}/keyboard.zsh" -source "${0:h}/completion.zsh" -source "${0:h}/history.zsh" -source "${0:h}/directory.zsh" -source "${0:h}/alias.zsh" -source "${0:h}/spectrum.zsh" -source "${0:h}/utility.zsh" - diff --git a/functions/helper.zsh b/helper.zsh similarity index 100% rename from functions/helper.zsh rename to helper.zsh diff --git a/functions/history.zsh b/history.zsh similarity index 100% rename from functions/history.zsh rename to history.zsh diff --git a/init.zsh b/init.zsh index ab7b6d16..b95f536f 100644 --- a/init.zsh +++ b/init.zsh @@ -6,13 +6,27 @@ if [[ "$TERM" == 'dumb' ]]; then fi # Add functions to fpath. -fpath=($OMZ/themes/*(/) $OMZ/plugins/${^plugins} $OMZ/functions $fpath) - -# Load and initialize the completion system. +fpath=( + $OMZ/themes/*(/N) + ${plugins:+$OMZ/plugins/${^plugins}} + $OMZ/functions + $fpath +) + +# Load and initialize the completion system ignoring insecure directories. autoload -Uz compinit && compinit -i -# Source function files. -source "$OMZ/functions/init.zsh" +# Source files (the order matters). +source "$OMZ/helper.zsh" +source "$OMZ/environment.zsh" +source "$OMZ/terminal.zsh" +source "$OMZ/keyboard.zsh" +source "$OMZ/completion.zsh" +source "$OMZ/history.zsh" +source "$OMZ/directory.zsh" +source "$OMZ/alias.zsh" +source "$OMZ/spectrum.zsh" +source "$OMZ/utility.zsh" # Source plugins defined in ~/.zshrc. for plugin in $plugins; do @@ -20,14 +34,16 @@ for plugin in $plugins; do source "$OMZ/plugins/$plugin/init.zsh" fi done +unset plugin +unset plugins -# Set PATH for Mac OS X GUI applications (requires re-login). +# Set environment variables for launchd processes. if [[ "$OSTYPE" == darwin* ]]; then launchctl setenv PATH "$PATH" &! fi # Load and run the prompt theming system. -autoload -Uz promptinit && promptinit -i +autoload -Uz promptinit && promptinit # Compile zcompdump, if modified, to increase startup speed. if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -f "$HOME/.zcompdump.zwc" ]]; then diff --git a/functions/keyboard.zsh b/keyboard.zsh similarity index 100% rename from functions/keyboard.zsh rename to keyboard.zsh diff --git a/functions/spectrum.zsh b/spectrum.zsh similarity index 100% rename from functions/spectrum.zsh rename to spectrum.zsh diff --git a/functions/terminal.zsh b/terminal.zsh similarity index 100% rename from functions/terminal.zsh rename to terminal.zsh diff --git a/functions/utility.zsh b/utility.zsh similarity index 100% rename from functions/utility.zsh rename to utility.zsh