diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/correction.zsh | 12 | ||||
-rw-r--r-- | lib/git.zsh | 15 | ||||
-rw-r--r-- | lib/history.zsh | 4 |
3 files changed, 14 insertions, 17 deletions
diff --git a/lib/correction.zsh b/lib/correction.zsh index fc60dcdbd..176ec16d5 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -1,10 +1,2 @@ -setopt correct_all - -alias man='nocorrect man' -alias mv='nocorrect mv' -alias mysql='nocorrect mysql' -alias mkdir='nocorrect mkdir' -alias gist='nocorrect gist' -alias heroku='nocorrect heroku' -alias ebuild='nocorrect ebuild' -alias hpodder='nocorrect hpodder' +# correct commands, but not any arguments (correct_all would do that) +setopt correct diff --git a/lib/git.zsh b/lib/git.zsh index 3e14695bd..76fe9b142 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -9,16 +9,19 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' + local GIT_STATUS='' + local CLEAN_MESSAGE='nothing to commit (working directory clean)' 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 - if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then + 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 @@ -62,7 +65,7 @@ function git_prompt_long_sha() { git_prompt_status() { INDEX=$(git status --porcelain -b 2> /dev/null) STATUS="" - if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then + if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" fi if $(echo "$INDEX" | grep '^A ' &> /dev/null); then @@ -112,7 +115,7 @@ function git_compare_version() { local INPUT_GIT_VERSION=$1; local INSTALLED_GIT_VERSION INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION}); - INSTALLED_GIT_VERSION=($(git --version)); + INSTALLED_GIT_VERSION=($(git --version 2>/dev/null)); INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}); for i in {1..3}; do diff --git a/lib/history.zsh b/lib/history.zsh index 876936b87..655945166 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,5 +1,7 @@ ## Command history configuration -HISTFILE=$HOME/.zsh_history +if [ -z $HISTFILE ]; then + HISTFILE=$HOME/.zsh_history +fi HISTSIZE=10000 SAVEHIST=10000 |