mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge branch 'master' of github.com:ashleydev/oh-my-zsh
This commit is contained in:
commit
3bb66a6ef7
4 changed files with 16 additions and 18 deletions
|
|
@ -503,41 +503,41 @@ _git_prompt__dirty_state ()
|
||||||
_big_repo='yes'
|
_big_repo='yes'
|
||||||
local line
|
local line
|
||||||
while IFS=$'\n' read line; do
|
while IFS=$'\n' read line; do
|
||||||
if [[ "$line" =~ '^M' ]]; then
|
if [[ "$line" = M* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^A' ]]; then
|
if [[ "$line" = A* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^R' ]]; then
|
if [[ "$line" = R* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^C' ]]; then
|
if [[ "$line" = C* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^D' ]]; then
|
if [[ "$line" = D* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$line" =~ '^\?\? ' ]]; then
|
if [[ "$line" = \?\?* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^ M' ]]; then
|
if [[ "$line" = \ M* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
if [[ "$line" =~ '^ D' ]]; then
|
if [[ "$line" = \ D* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$line" =~ '^UU' ]]; then
|
if [[ "$line" = UU* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes'
|
||||||
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ alias ghhhh="git log --graph --stat -p --full-diff $pretty_format_medium"; compd
|
||||||
|
|
||||||
# Git and svn mix
|
# Git and svn mix
|
||||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||||
compdef git-svn-dcommit-push=git
|
compdef _git git-svn-dcommit-push=git
|
||||||
|
|
||||||
#
|
#
|
||||||
# Will return the current branch name
|
# Will return the current branch name
|
||||||
|
|
@ -53,8 +53,8 @@ function current_branch() {
|
||||||
|
|
||||||
# these aliases take advantage of the previous function
|
# these aliases take advantage of the previous function
|
||||||
alias ggpull='git pull origin $(current_branch)'
|
alias ggpull='git pull origin $(current_branch)'
|
||||||
compdef ggpull=git
|
compdef _git ggpull=git
|
||||||
alias ggpush='git push origin $(current_branch)'
|
alias ggpush='git push origin $(current_branch)'
|
||||||
compdef ggpush=git
|
compdef _git ggpush=git
|
||||||
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
|
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
|
||||||
compdef ggpnp=git
|
compdef _git ggpnp=git
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@ if [[ "$MODE_INDICATOR" == "" ]]; then
|
||||||
MODE_INDICATOR="%{$fg_bold[red]%}<%{$reset_color%}%{$fg[red]%}<<%{$reset_color%}"
|
MODE_INDICATOR="%{$fg_bold[red]%}<%{$reset_color%}%{$fg[red]%}<<%{$reset_color%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function zle-line-init zle-keymap-select {
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
|
|
||||||
# If I am using vi keys, I want to know what mode I'm currently using.
|
# If I am using vi keys, I want to know what mode I'm currently using.
|
||||||
# zle-keymap-select is executed every time KEYMAP changes.
|
# zle-keymap-select is executed every time KEYMAP changes.
|
||||||
# From http://zshwiki.org/home/examples/zlewidgets
|
# From http://zshwiki.org/home/examples/zlewidgets
|
||||||
|
|
@ -67,9 +63,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bindkey "^P" up-line-or-search
|
bindkey "^P" up-line-or-search
|
||||||
|
bindkey -M vicmd "k" up-line-or-search
|
||||||
bindkey -M vicmd "^k" up-line-or-search
|
bindkey -M vicmd "^k" up-line-or-search
|
||||||
bindkey -M viins "^k" up-line-or-search
|
bindkey -M viins "^k" up-line-or-search
|
||||||
bindkey "^N" down-line-or-search
|
bindkey "^N" down-line-or-search
|
||||||
|
bindkey -M vicmd "j" down-line-or-search
|
||||||
bindkey -M vicmd "^j" down-line-or-search
|
bindkey -M vicmd "^j" down-line-or-search
|
||||||
bindkey -M viins "^j" down-line-or-search
|
bindkey -M viins "^j" down-line-or-search
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ update__GIT_PROMPT_INFO ()
|
||||||
|
|
||||||
local _prompt="$b$r$s$i$p"
|
local _prompt="$b$r$s$i$p"
|
||||||
# add ( ) around _prompt:
|
# add ( ) around _prompt:
|
||||||
if [ $f = 'yes' ]; then
|
if [ "$f" = 'yes' ]; then
|
||||||
_prompt="($_prompt)"
|
_prompt="($_prompt)"
|
||||||
elif [ "$u" = "yes" ]; then
|
elif [ "$u" = "yes" ]; then
|
||||||
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue