mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
cdcda28bca
11 changed files with 55 additions and 12 deletions
10
lib/git.zsh
10
lib/git.zsh
|
|
@ -63,11 +63,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"
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
alias brews='brew list -1'
|
||||
alias bubu="brew update && brew upgrade"
|
||||
|
|
|
|||
|
|
@ -48,9 +48,17 @@ _within-bundled-project() {
|
|||
false
|
||||
}
|
||||
|
||||
_binstubbed() {
|
||||
[ -f "./bin/${1}" ]
|
||||
}
|
||||
|
||||
_run-with-bundler() {
|
||||
if _bundler-installed && _within-bundled-project; then
|
||||
bundle exec $@
|
||||
if _binstubbed $1; then
|
||||
bundle exec "./bin/$@"
|
||||
else
|
||||
bundle exec $@
|
||||
fi
|
||||
else
|
||||
$@
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ function listMavenCompletions {
|
|||
tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
|
||||
# tomcat7
|
||||
tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
|
||||
# spring-boot
|
||||
spring-boot:run spring-boot:repackage
|
||||
# exec
|
||||
exec:exec exec:java
|
||||
# versions
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
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'
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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]%}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue