summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/git.zsh10
-rw-r--r--plugins/brew/brew.plugin.zsh1
-rw-r--r--plugins/docker/_docker2
-rw-r--r--plugins/jira/jira.plugin.zsh12
-rw-r--r--plugins/osx/osx.plugin.zsh5
-rw-r--r--plugins/postgres/postgres.plugin.zsh8
-rw-r--r--plugins/rvm/rvm.plugin.zsh12
-rwxr-xr-xplugins/wd/wd.sh2
-rw-r--r--themes/terminalparty.zsh-theme3
9 files changed, 44 insertions, 11 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index b0e73bf3a..7aa5a0ea2 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -54,11 +54,19 @@ git_remote_status() {
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
- if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
+# Gets the number of commits ahead from remote
+function git_commits_ahead() {
+ if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+ COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
+ echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
+ fi
+}
+
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index c2e95884e..f9497aefb 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -1 +1,2 @@
alias brews='brew list -1'
+alias bubu="brew update && brew upgrade"
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index c291037a3..28568a6e5 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -214,7 +214,7 @@ __save() {
__start() {
_arguments \
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
- '(-i,--interactive=)'{-i, --interactive=}'[Attach container''s stdin]'
+ '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
__docker_containers
}
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index 739ee7142..3d510e430 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -29,15 +29,23 @@ open_jira_issue () {
return 0
fi
+ if [ -f .jira-prefix ]; then
+ jira_prefix=$(cat .jira-prefix)
+ elif [ -f ~/.jira-prefix ]; then
+ jira_prefix=$(cat ~/.jira-prefix)
+ else
+ jira_prefix=""
+ fi
+
if [ -z "$1" ]; then
echo "Opening new issue"
$open_cmd "$jira_url/secure/CreateIssue!default.jspa"
else
echo "Opening issue #$1"
if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
- $open_cmd "$jira_url/issues/$1"
+ $open_cmd "$jira_url/issues/$jira_prefix$1"
else
- $open_cmd "$jira_url/browse/$1"
+ $open_cmd "$jira_url/browse/$jira_prefix$1"
fi
fi
}
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 63760b5ff..a63f0ee05 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -174,12 +174,16 @@ function itunes() {
next|previous)
opt="$opt track"
;;
+ vol)
+ opt="set sound volume to $1" #$1 Due to the shift
+ ;;
""|-h|--help)
echo "Usage: itunes <option>"
echo "option:"
echo "\tlaunch|play|pause|stop|rewind|resume|quit"
echo "\tmute|unmute\tcontrol volume set"
echo "\tnext|previous\tplay next or previous track"
+ echo "\tvol\tSet the volume, takes an argument from 0 to 100"
echo "\thelp\tshow this message and exit"
return 0
;;
@@ -190,4 +194,3 @@ function itunes() {
esac
osascript -e "tell application \"iTunes\" to $opt"
}
-
diff --git a/plugins/postgres/postgres.plugin.zsh b/plugins/postgres/postgres.plugin.zsh
index cdd142e92..c2dbef244 100644
--- a/plugins/postgres/postgres.plugin.zsh
+++ b/plugins/postgres/postgres.plugin.zsh
@@ -1,6 +1,8 @@
-# Aliases to stop, start and restart Postgres
-# Paths noted below are for Postgress installed via Homebrew on OSX
+# Aliases to control Postgres
+# Paths noted below are for Postgres installed via Homebrew on OSX
alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
-alias restartpost='stoppost && sleep 1 && startpost' \ No newline at end of file
+alias restartpost='stoppost && sleep 1 && startpost'
+alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s'
+alias statuspost='pg_ctl status -D /usr/local/var/postgres -s' \ No newline at end of file
diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
index 3bde154df..ad23e18d7 100644
--- a/plugins/rvm/rvm.plugin.zsh
+++ b/plugins/rvm/rvm.plugin.zsh
@@ -6,6 +6,7 @@ alias gemsets='rvm gemset list'
local ruby18='ruby-1.8.7'
local ruby19='ruby-1.9.3'
local ruby20='ruby-2.0.0'
+local ruby21='ruby-2.1.1'
function rb18 {
if [ -z "$1" ]; then
@@ -40,6 +41,17 @@ function rb20 {
_rb20() {compadd `ls -1 $rvm_path/gems | grep "^$ruby20@" | sed -e "s/^$ruby20@//" | awk '{print $1}'`}
compdef _rb20 rb20
+function rb21 {
+ if [ -z "$1" ]; then
+ rvm use "$ruby21"
+ else
+ rvm use "$ruby21@$1"
+ fi
+}
+
+_rb21() {compadd `ls -1 $rvm_path/gems | grep "^$ruby21@" | sed -e "s/^$ruby21@//" | awk '{print $1}'`}
+compdef _rb21 rb21
+
function rvm-update {
rvm get head
}
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index 96a3426fc..9ebad6808 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -58,7 +58,7 @@ wd_warp()
#wd_print_msg $BLUE "Warping..."
cd ${points[$1]}
else
- wd_print_msg $RED "Unkown warp point '$1'"
+ wd_print_msg $RED "Unknown warp point '$1'"
fi
}
diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme
index 216ce37eb..cd7370bba 100644
--- a/themes/terminalparty.zsh-theme
+++ b/themes/terminalparty.zsh-theme
@@ -1,4 +1,4 @@
-PROMPT='%{$fg[green]%} %% '
+PROMPT='%(?,%{$fg[green]%},%{$fg[red]%}) %% '
# RPS1='%{$fg[blue]%}%~%{$reset_color%} '
RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
@@ -6,4 +6,3 @@ ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}"
-