Initial Commit - moved out of ubuntu_config.

This commit is contained in:
Nathan Broadbent
2011-10-18 00:18:17 +08:00
commit e634d0c4b5
24 changed files with 2592 additions and 0 deletions

8
lib/_shared.sh Normal file
View File

@@ -0,0 +1,8 @@
# Detect shell
if [ -n "${ZSH_VERSION:-}" ]; then shell="zsh"; else shell="bash"; fi
# Detect whether zsh 'shwordsplit' option is on by default.
if [[ $shell == "zsh" ]]; then zsh_shwordsplit=$((setopt | grep -q shwordsplit) && echo "true"); fi
# Switch on/off shwordsplit for functions that require it.
zsh_compat(){ if [[ $shell == "zsh" && -z $zsh_shwordsplit ]]; then setopt shwordsplit; fi; }
zsh_reset(){ if [[ $shell == "zsh" && -z $zsh_shwordsplit ]]; then unsetopt shwordsplit; fi; }