lib module loading is done

This commit is contained in:
Sameer Rahmani 2013-05-06 19:19:28 +04:30
parent 623cb108ff
commit 6333b23dc0
3 changed files with 14 additions and 18 deletions

8
lib/git.zsh Normal file → Executable file
View File

@ -14,14 +14,14 @@ parse_git_dirty() {
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
fi
fi
GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
fi
fi
fi
}
# get the difference between the local and remote branches
@ -131,5 +131,3 @@ function git_compare_version() {
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
#clean up the namespace slightly by removing the checker function
unset -f git_compare_version

18
my.zsh
View File

@ -35,25 +35,23 @@ unsetopt SHARE_HISTORY
# My.Zsh directory path
myzsh=${MYZSH:-$HOME}
fpath=($myzsh/lib/functions/{*.zsh,*.zwc}(N) $fpath)
# Autoload functions that have the executable bit on.
for lib ($myzsh/lib/*.zsh); do
source $lib
done
# Load aliases
. $myzsh/aliases
# Load the theme and coloring
autoload -U colors && colors
tput colors; print $terminfo[colors]; print $termcap[Co]
theme=${THEME:-$myzsh/themes/lxsameer.zsh-theme}
. $theme
fpath=($myzsh/lib/*.zsh(N) $fpath)
# Autoload functions that have the executable bit on.
for dirname in $fpath; do
fns=( $dirname/*~*~(N.x:t) )
(( ${#fns} )) && autoload $fns
done
project_path=${PROJECTS:-~/src}

View File

@ -1,7 +1,7 @@
# lxsameer.zsh-theme
#
# Author: @lxsameer <lxsameer@gnu.org>
# Repo: https://github.com/lxsameer/oh-my-zsh
# Repo: https://github.com/lxsameer/My.Zsh
#
# Created on: Apr 10, 2012
@ -20,9 +20,9 @@ function spaces() {
if [ ${#git} != 0 ]; then
local clean=$(parse_git_dirty)
if [ ${#clean} != 0 ]; then
(( git = ${#git} - 30 - ${#clean} + 1 ))
(( git = ${#git} - 13 - ${#clean} + 1 ))
else
(( git = ${#git} - 30 ))
(( git = ${#git} - 13 ))
fi
else
git=0