diff --git a/lib/directories.zsh b/lib/directories.zsh index e445eb84c..6c743e40e 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -26,9 +26,9 @@ cd () { elif [[ "x$*" == "x...." ]]; then cd ../../.. elif [[ "x$*" == "x....." ]]; then - cd ../../.. - elif [[ "x$*" == "x......" ]]; then cd ../../../.. + elif [[ "x$*" == "x......" ]]; then + cd ../../../../.. else builtin cd "$@" fi diff --git a/lib/git.zsh b/lib/git.zsh index 52477baf6..95dd3dd43 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -58,7 +58,7 @@ function git_prompt_long_sha() { # Get the status of the working tree git_prompt_status() { - INDEX=$(git status --porcelain 2> /dev/null) + INDEX=$(git status --porcelain -b 2> /dev/null) STATUS="" if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" @@ -80,12 +80,23 @@ git_prompt_status() { fi if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" fi if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" fi + if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS" + fi + if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS" + fi + if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS" + fi echo $STATUS } diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index c056989eb..7470110b6 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -8,6 +8,8 @@ function title { fi if [[ "$TERM" == screen* ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars + elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" #set window name print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh new file mode 100644 index 000000000..ff98cbf87 --- /dev/null +++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh @@ -0,0 +1,18 @@ +_git_remote_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) + if [[ -n $ref ]]; then + if (( CURRENT == 2 )); then + # first arg: operation + compadd create publish rename delete track + elif (( CURRENT == 3 )); then + # second arg: remote branch name + compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"` + elif (( CURRENT == 4 )); then + # third arg: remote name + compadd `git remote` + fi + else; + _files + fi +} +compdef _git_remote_branch grb diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 35639096e..f39a73c92 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -9,6 +9,7 @@ alias gup='git pull --rebase' compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push +alias gd='git diff' gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' @@ -24,6 +25,7 @@ alias gba='git branch -a' compdef _git gba=git-branch alias gcount='git shortlog -sn' compdef gcount=git +alias gcl='git config --list' alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5' diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh new file mode 100644 index 000000000..0f4aa4b10 --- /dev/null +++ b/plugins/history/history.plugin.zsh @@ -0,0 +1,8 @@ +alias h='history' + +function hs +{ + history | grep $* +} + +alias hsi='hs -i' diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 682bb2667..f278d4f8d 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -2,10 +2,9 @@ # FILE: osx.plugin.zsh # DESCRIPTION: oh-my-zsh plugin file. # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.1 +# VERSION: 1.1.0 # ------------------------------------------------------------------------------ - function tab() { local command="cd \\\"$PWD\\\"" (( $# > 0 )) && command="${command}; $*" @@ -35,7 +34,7 @@ EOF launch session "Default Session" set current_session to current session tell current_session - write text "${command}" + write text "${command}; clear;" end tell end tell end tell @@ -43,6 +42,64 @@ EOF } } +function vsplit_tab() { + local command="cd \\\"$PWD\\\"" + (( $# > 0 )) && command="${command}; $*" + + the_app=$( + osascript 2>/dev/null </dev/null < 0 )) && command="${command}; $*" + + the_app=$( + osascript 2>/dev/null </dev/null </dev/null <