diff --git a/init.zsh b/init.zsh index 9b466450..d663b572 100644 --- a/init.zsh +++ b/init.zsh @@ -7,10 +7,9 @@ # # Check for the minimum supported version. -min_zsh_version='4.3.10' +min_zsh_version='4.2.6' if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then print "omz: old shell detected, minimum required: $min_zsh_version" >&2 - return 1 fi unset min_zsh_version diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 0fbd5711..bdeb9bdd 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -40,6 +40,13 @@ # zstyle ':omz:module:editor' completing '...' # +# Check for the minimum supported version. +min_zsh_version='4.3.10' +if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then + return 1 +fi +unset min_zsh_version + # Dumb terminals lack support. if [[ "$TERM" == 'dumb' ]]; then return 1 diff --git a/modules/git/init.zsh b/modules/git/init.zsh index e3c3ac84..cf15851e 100644 --- a/modules/git/init.zsh +++ b/modules/git/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[git] )); then + return 1 +fi + # Source module files. source "${0:h}/alias.zsh" source "${0:h}/hub.zsh" diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index a0ff287f..66fc0349 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -6,6 +6,13 @@ # Sorin Ionescu # +# Check for the minimum supported version. +min_zsh_version='4.3.10' +if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then + return 1 +fi +unset min_zsh_version + source "${0:h}/external/zsh-history-substring-search.zsh" if zstyle -t ':omz:module:history-substring-search' case-sensitive; then diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index e0f866a8..2117e20e 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[rsync] )); then + return 1 +fi + # Aliases _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 8c0f1d57..f1275495 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[screen] )); then + return 1 +fi + # Aliases alias sl="screen -list" alias sn="screen -U -S" diff --git a/modules/syntax-highlighting/init.zsh b/modules/syntax-highlighting/init.zsh index 88ec7b47..297955db 100644 --- a/modules/syntax-highlighting/init.zsh +++ b/modules/syntax-highlighting/init.zsh @@ -5,6 +5,13 @@ # Sorin Ionescu # +# Check for the minimum supported version. +min_zsh_version='4.3.10' +if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then + return 1 +fi +unset min_zsh_version + if zstyle -t ':omz:module:syntax-highlighting' color; then source "${0:h}/external/zsh-syntax-highlighting.zsh" diff --git a/modules/terminal/init.zsh b/modules/terminal/init.zsh index d0bab0b7..b27e9b2b 100644 --- a/modules/terminal/init.zsh +++ b/modules/terminal/init.zsh @@ -6,6 +6,13 @@ # Sorin Ionescu # +# Check for the minimum supported version. +min_zsh_version='4.3.10' +if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then + return 1 +fi +unset min_zsh_version + # Dumb terminals lack support. if [[ "$TERM" == 'dumb' ]]; then return 1 diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index c066ea98..7d3b266e 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -6,6 +6,10 @@ # Colin Hebert # +if (( ! $+commands[tmux] )); then + return 1 +fi + # Aliases alias ta="tmux attach-session" alias tl="tmux list-sessions" diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 53b618d4..2e58c8e0 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -56,7 +56,9 @@ alias type='type -a' # ls if is-callable 'dircolors'; then # GNU Core Utilities - alias ls='ls --group-directories-first' + if [[ `dircolors --version |head -1 |awk '{print $NF}'` > 6 ]]; then + alias ls='ls --group-directories-first' + fi if zstyle -t ':omz:module:utility:ls' color; then if [[ -s "$HOME/.dir_colors" ]]; then