From df294111549f9e49b3b4fdd7a772b46d9ab6f67b Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 9 Oct 2010 23:09:19 +0100 Subject: [PATCH 01/33] cleaning up EOF --- lib/appearance.zsh | 2 +- lib/directories.zsh | 2 +- lib/grep.zsh | 2 +- lib/rvm.zsh | 2 -- lib/termsupport.zsh | 2 +- tools/check_for_upgrade.sh | 1 - tools/uninstall.sh | 2 +- tools/upgrade.sh | 2 +- 8 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/appearance.zsh b/lib/appearance.zsh index ffee52b5e..e932e87a6 100644 --- a/lib/appearance.zsh +++ b/lib/appearance.zsh @@ -35,4 +35,4 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c setopt prompt_subst # Load the theme -source "$ZSH/themes/$ZSH_THEME.zsh-theme" \ No newline at end of file +source "$ZSH/themes/$ZSH_THEME.zsh-theme" diff --git a/lib/directories.zsh b/lib/directories.zsh index 56d7a2316..4f1f84b9a 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -37,4 +37,4 @@ cd () { alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v' \ No newline at end of file +alias d='dirs -v' diff --git a/lib/grep.zsh b/lib/grep.zsh index 93c4270b6..374279a69 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -3,4 +3,4 @@ # Examples: http://rubyurl.com/ZXv # export GREP_OPTIONS='--color=auto' -export GREP_COLOR='1;32' \ No newline at end of file +export GREP_COLOR='1;32' diff --git a/lib/rvm.zsh b/lib/rvm.zsh index 597be1b33..e1ac9e7bb 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -3,5 +3,3 @@ function rvm_prompt_info() { ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return echo "($ruby_version)" } - - diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index fef978748..be755cf1b 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -18,4 +18,4 @@ case "$TERM" in print -Pn "\e]0;%n@%m: %~\a" # xterm } ;; -esac \ No newline at end of file +esac diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index c59ebaed4..9cdf327a0 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -31,4 +31,3 @@ fi # update the zsh file _update_zsh_update - diff --git a/tools/uninstall.sh b/tools/uninstall.sh index 8ff583322..9da5feff4 100644 --- a/tools/uninstall.sh +++ b/tools/uninstall.sh @@ -17,4 +17,4 @@ else source /etc/profile fi -echo "Thanks for trying out Oh My Zsh. It's been uninstalled." \ No newline at end of file +echo "Thanks for trying out Oh My Zsh. It's been uninstalled." diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 6bdd02e38..ec6d0b286 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -9,4 +9,4 @@ echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' echo ' /____/' echo "Hooray! Oh My Zsh has been updated and/or is at the current version. \nAny new updates will be reflected when you start your next terminal session." echo "To keep up on the latest, be sure to follow Oh My Zsh on twitter: http://twitter.com/ohmyzsh" -cd $current_path \ No newline at end of file +cd $current_path From e5e032fa17cd6c50116c05f7e15f8bf7d506f3ec Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 9 Oct 2010 23:09:42 +0100 Subject: [PATCH 02/33] adding git svn aliases --- plugins/git/git.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d317d179d..fbf010511 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -16,6 +16,8 @@ alias glg='git log --stat --max-count=5' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' +alias gsr='git svn rebase' +alias gsd='git svn dcommit' # # Will return the current branch name @@ -29,4 +31,4 @@ function current_branch() { # these aliases take advangate of the previous function alias ggpull='git pull origin $(current_branch)' alias ggpush='git push origin $(current_branch)' -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' \ No newline at end of file +alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' From 1956510a07f63135cab340e2c65b03a0495c3668 Mon Sep 17 00:00:00 2001 From: Mike Prentice Date: Tue, 16 Feb 2010 22:15:02 +0800 Subject: [PATCH 03/33] added custom/screen.zsh --- custom/screen.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 custom/screen.zsh diff --git a/custom/screen.zsh b/custom/screen.zsh new file mode 100644 index 000000000..67748ba03 --- /dev/null +++ b/custom/screen.zsh @@ -0,0 +1,14 @@ +# don't rename screen window +case "$TERM" in + screen*) + preexec () { + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} + # echo -ne "\ek$CMD\e\\" + print -Pn "\e]0;%n@%m: $1\a" # xterm + } + precmd () { + # echo -ne "\ekzsh\e\\" + print -Pn "\e]0;%n@%m: %~\a" # xterm + } + ;; +esac From bcad29faf4e00ef8bbad75feabb17a6344e0d12b Mon Sep 17 00:00:00 2001 From: Mike Prentice Date: Wed, 8 Sep 2010 01:13:41 +0800 Subject: [PATCH 04/33] changed git symbolic-ref to git rev-parse in lib/git --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 75fdc1f9c..7f2d15135 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,6 +1,6 @@ # get the name of the branch we are on function git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return + ref=$(git rev-parse --abbrev-ref HEAD 2> /dev/null) || return echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" } From e05b8c9cafad04b9369b517516e9bbc47c1a283e Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Mon, 11 Oct 2010 02:43:51 +0100 Subject: [PATCH 05/33] added git log with graph --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index fbf010511..83efeb7af 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -13,6 +13,7 @@ alias gba='git branch -a' alias gcount='git shortlog -sn' alias gcp='git cherry-pick' alias glg='git log --stat --max-count=5' +alias glgg='git log --graph --max-count=5' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From dd43a3effc32f22ee6cf43b882f6e0329ba0facc Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Tue, 12 Oct 2010 20:02:04 +0100 Subject: [PATCH 06/33] added mac keybinding --- lib/key-bindings.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 7196a88ff..07adb7150 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -22,6 +22,12 @@ bindkey ' ' magic-space # also do history expansion on space bindkey '^[[Z' reverse-menu-complete +# Fix Mac OS X's keybinding +bindkey '^?' backward-delete-char +bindkey '^[[3~' delete-char + + + # consider emacs keybindings: #bindkey -e ## emacs key bindings From 2bbb2a6a4fbd5922f240ac3de3c36ae87f917d30 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Tue, 12 Oct 2010 20:11:59 +0100 Subject: [PATCH 07/33] added OS X finder function --- plugins/osx/osx.plugin.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index fce88c796..3eca8e4be 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -8,4 +8,18 @@ function tab() { do script with command "cd \"$PWD\"; $*" in window 1 end tell EOF +} + +# Functions for opening/finding/selecting things in OS X Finder + +function finder() { + if [[ $# -eq 0 ]]; then + open $PWD + elif [[ $# -eq 1 ]]; then + open $1 + else + for dir in $argv; do + open $dir + done + fi } \ No newline at end of file From 49422e3c36d7c011d18f8a1b4bb3146e62fb8d69 Mon Sep 17 00:00:00 2001 From: Wilkes Joiner Date: Fri, 27 Aug 2010 07:21:55 +0800 Subject: [PATCH 08/33] added git-flow --- plugins/git-flow.plugin.zsh | 332 ++++++++++++++++++++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 plugins/git-flow.plugin.zsh diff --git a/plugins/git-flow.plugin.zsh b/plugins/git-flow.plugin.zsh new file mode 100644 index 000000000..07215f9d1 --- /dev/null +++ b/plugins/git-flow.plugin.zsh @@ -0,0 +1,332 @@ +#!zsh +# +# Installation +# ------------ +# +# To achieve git-flow completion nirvana: +# +# 0. Update your zsh's git-completion module to the newest verion. +# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD +# +# 1. Install this file. Either: +# +# a. Place it in your .zshrc: +# +# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in +# your .zshrc: +# +# source ~/.git-flow-completion.zsh +# +# c. Or, use this file as a oh-my-zsh plugin. +# + +_git-flow () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'init:Initialize a new git repo with support for the branching model.' + 'feature:Manage your feature branches.' + 'release:Manage your release branches.' + 'hotfix:Manage your hotfix branches.' + 'support:Manage your support branches.' + 'version:Shows version information.' + ) + _describe -t commands 'git flow' subcommands + ;; + + (options) + case $line[1] in + + (init) + _arguments \ + -f'[Force setting of gitflow branches, even if already configured]' + ;; + + (version) + ;; + + (hotfix) + __git-flow-hotfix + ;; + + (release) + __git-flow-release + ;; + + (feature) + __git-flow-feature + ;; + esac + ;; + esac +} + +__git-flow-release () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new release branch' + 'finish:Finish a release branche.' + 'list:List all your release branches. (Alias to `git flow release`)' + ) + _describe -t commands 'git flow release' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':version:__git_flow_version_list' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':version:__git_flow_version_list' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-hotfix () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch' + 'finish:Finish a hotfix branche.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':hotfix:__git_flow_version_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':hotfix:__git_flow_hotfix_list' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-feature () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch' + 'finish:Finish a hotfix branche.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + 'publish: public' + 'track: track' + 'diff: diff' + 'rebase: rebase' + 'checkout: checkout' + 'pull: pull' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':feature:__git_flow_feature_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__git_flow_feature_list' + ;; + + (publish) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (track) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + (checkout) + _arguments \ + ':branch:__git_flow_feature_list'\ + ;; + + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git_flow_version_list () +{ + local expl + declare -a versions + + versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted versions expl 'version' compadd $versions +} + +__git_flow_feature_list () +{ + local expl + declare -a features + + features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted features expl 'feature' compadd $features +} + +__git_remotes () { + local expl gitdir remotes + + gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) + __git_command_successful || return + + remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) + __git_command_successful || return + + # TODO: Should combine the two instead of either or. + if (( $#remotes > 0 )); then + _wanted remotes expl remote compadd $* - $remotes + else + _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" + fi +} + +__git_flow_hotfix_list () +{ + local expl + declare -a hotfixes + + hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted hotfixes expl 'hotfix' compadd $hotfixes +} + +__git_branch_names () { + local expl + declare -a branch_names + + branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) + __git_command_successful || return + + _wanted branch-names expl branch-name compadd $* - $branch_names +} + +__git_command_successful () { + if (( ${#pipestatus:#0} > 0 )); then + _message 'not a git repository' + return 1 + fi + return 0 +} + +zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' From 490c6d0f59803fe63f34587db20664d6284c5df2 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Wed, 13 Oct 2010 01:12:49 +0800 Subject: [PATCH 09/33] Added lol plugin --- plugins/lol/lol.plugin.zsh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/lol/lol.plugin.zsh diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh new file mode 100644 index 000000000..a7153bb57 --- /dev/null +++ b/plugins/lol/lol.plugin.zsh @@ -0,0 +1,26 @@ +# LOL!!1 +# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh + +alias wtf='dmesg' +alias onoz='cat /var/log/errors.log' +alias rtfm='man' + +alias visible='echo' +alias invisible='cat' +alias moar='more' + +alias icanhas='mkdir' +alias donotwant='rm' +alias dowant='cp' +alias gtfo='mv' + +alias hai='cd' +alias plz='pwd' + +alias inur='locate' + +alias nomz='ps -aux' +alias nomnom='killall' + +alias cya='reboot' +alias kthxbai='halt' From ec5339293bb4446c8c37f2563c58943c30a5a405 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Tue, 12 Oct 2010 20:54:56 +0100 Subject: [PATCH 10/33] moving git-flow plugin into folder for consitency --- plugins/git-flow/git-flow.plugin.zsh | 332 +++++++++++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 plugins/git-flow/git-flow.plugin.zsh diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh new file mode 100644 index 000000000..07215f9d1 --- /dev/null +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -0,0 +1,332 @@ +#!zsh +# +# Installation +# ------------ +# +# To achieve git-flow completion nirvana: +# +# 0. Update your zsh's git-completion module to the newest verion. +# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD +# +# 1. Install this file. Either: +# +# a. Place it in your .zshrc: +# +# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in +# your .zshrc: +# +# source ~/.git-flow-completion.zsh +# +# c. Or, use this file as a oh-my-zsh plugin. +# + +_git-flow () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'init:Initialize a new git repo with support for the branching model.' + 'feature:Manage your feature branches.' + 'release:Manage your release branches.' + 'hotfix:Manage your hotfix branches.' + 'support:Manage your support branches.' + 'version:Shows version information.' + ) + _describe -t commands 'git flow' subcommands + ;; + + (options) + case $line[1] in + + (init) + _arguments \ + -f'[Force setting of gitflow branches, even if already configured]' + ;; + + (version) + ;; + + (hotfix) + __git-flow-hotfix + ;; + + (release) + __git-flow-release + ;; + + (feature) + __git-flow-feature + ;; + esac + ;; + esac +} + +__git-flow-release () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new release branch' + 'finish:Finish a release branche.' + 'list:List all your release branches. (Alias to `git flow release`)' + ) + _describe -t commands 'git flow release' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':version:__git_flow_version_list' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':version:__git_flow_version_list' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-hotfix () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch' + 'finish:Finish a hotfix branche.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':hotfix:__git_flow_version_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':hotfix:__git_flow_hotfix_list' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-feature () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch' + 'finish:Finish a hotfix branche.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + 'publish: public' + 'track: track' + 'diff: diff' + 'rebase: rebase' + 'checkout: checkout' + 'pull: pull' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':feature:__git_flow_feature_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__git_flow_feature_list' + ;; + + (publish) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (track) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; + + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + (checkout) + _arguments \ + ':branch:__git_flow_feature_list'\ + ;; + + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git_flow_version_list () +{ + local expl + declare -a versions + + versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted versions expl 'version' compadd $versions +} + +__git_flow_feature_list () +{ + local expl + declare -a features + + features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted features expl 'feature' compadd $features +} + +__git_remotes () { + local expl gitdir remotes + + gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) + __git_command_successful || return + + remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) + __git_command_successful || return + + # TODO: Should combine the two instead of either or. + if (( $#remotes > 0 )); then + _wanted remotes expl remote compadd $* - $remotes + else + _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" + fi +} + +__git_flow_hotfix_list () +{ + local expl + declare -a hotfixes + + hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted hotfixes expl 'hotfix' compadd $hotfixes +} + +__git_branch_names () { + local expl + declare -a branch_names + + branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) + __git_command_successful || return + + _wanted branch-names expl branch-name compadd $* - $branch_names +} + +__git_command_successful () { + if (( ${#pipestatus:#0} > 0 )); then + _message 'not a git repository' + return 1 + fi + return 0 +} + +zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' From 65ceacd060b523b402d96dc6cdc8e6a14077cb43 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Tue, 12 Oct 2010 21:05:27 +0100 Subject: [PATCH 11/33] adding resty plugin http://github.com/micha/resty/ --- plugins/resty/resty.plugin.zsh | 104 +++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 plugins/resty/resty.plugin.zsh diff --git a/plugins/resty/resty.plugin.zsh b/plugins/resty/resty.plugin.zsh new file mode 100644 index 000000000..61b83260a --- /dev/null +++ b/plugins/resty/resty.plugin.zsh @@ -0,0 +1,104 @@ +# +# resty - A tiny command line REST interface for bash and zsh. +# +# Fork me on github: +# http://github.com/micha/resty +# +# Author: +# Micha Niskin +# Copyright 2009, no rights reserved. +# + +export _resty_host="" +export _resty_path="" + +function resty() { + local confdir host cookies method h2t editor domain _path opt dat res ret out err verbose raw i d tmpf args2 + + confdir="${HOME}/.resty" + host="${confdir}/host" + cookies="$confdir/c" + method="$1"; [[ $# > 0 ]] && shift + h2t=$((which lynx >/dev/null && echo lynx -stdin -dump) \ + || which html2text || which cat) + editor=$(which "$EDITOR" || which vim || echo "vi") + + [ -d "$cookies" ] || (mkdir -p "$cookies"; echo "http://localhost*" > "$host") + [ -n "$1" ] && [ "${1#/}" != "$1" ] \ + && _path=$(echo "$1"|sed 's/%/%25/g;s/\[/%5B/g;s/\]/%5D/g;s/|/%7C/g;s/\$/%24/g;s/&/%26/g;s/+/%2B/g;s/,/%2C/g;s/:/%3A/g;s/;/%3B/g;s/=/%3D/g;s/?/%3F/g;s/@/%40/g;s/ /%20/g;s/#/%23/g;s/{/%7B/g;s/}/%7D/g;s/\\/%5C/g;s/\^/%5E/g;s/~/%7E/g;s/`/%60/g') && shift + + for i in "$@"; do + ([ "$i" = "--verbose" ] || echo "$i" | grep -q '^-[a-zA-Z]*v[a-zA-Z]*$') \ + && verbose="yes" + done + + [ -z "$_resty_host" ] && _resty_host=$(cat "$host" 2>/dev/null) + [ -z "$method" ] && echo "$_resty_host" && return + [ -n "$_path" ] && _resty_path=$_path + domain=$(echo -n "$_resty_host" \ + |perl -ane '/^https?:\/\/([^\/\*]+)/; print $1') + _path="${_resty_host//\*/$_resty_path}" + + case "$method" in + GET|DELETE|POST|PUT) + dat=$( ( [ "${method#P}" != "$method" ] \ + && ( ( [ -n "$1" ] && [ "${1#-}" = "$1" ] && echo "$1") \ + || echo "@-") ) || echo) + if [ "${method#P}" != "$method" ] && [ "$1" = "-V" ]; then + tmpf=$(mktemp /tmp/resty.XXXXXX) + cat > $tmpf + (exec < /dev/tty; "$editor" $tmpf) + dat=$(cat $tmpf) + rm -f $tmpf + fi + [ -n "$dat" ] && [ "$dat" != "@-" ] && shift + [ "$1" = "-Z" ] && raw="yes" && shift + [ -n "$dat" ] && opt="--data-binary" + eval "args2=( $(cat "$confdir/$domain" 2>/dev/null |sed 's/^ *//' |grep ^$method |cut -b $((${#method}+2))-) )" + res=$((((curl -sLv $opt "$dat" -X $method \ + -b "$cookies/$domain" -c "$cookies/$domain" \ + "${args2[@]}" "$@" "$_path" \ + |sed 's/^/OUT /' && echo) 3>&2 2>&1 1>&3) \ + |sed 's/^/ERR /' && echo) 2>&1) + out=$(echo "$res" |sed '/^OUT /s/^....//p; d') + err=$(echo "$res" |sed '/^ERR /s/^....//p; d') + ret=$(echo "$err" |sed \ + '/^.*HTTP\/1\.[01] [0-9][0-9][0-9]/s/.*\([0-9]\)[0-9][0-9].*/\1/p; d' \ + | tail -n1) + [ -n "$err" -a -n "$verbose" ] && echo "$err" 1>&2 + echo "$err" | grep -qi '^< \s*Content-Type: *text/html' \ + && [ -z "$raw" ] && d=$h2t || d=cat + [ -n "$out" ] && out=$(echo "$out" |eval "$d") + [ "$d" != "${d##lynx}" ] && out=$(echo "$out" |perl -e "\$host='$(echo "$_resty_host" |sed 's/^\(https*:\/\/[^\/*]*\).*$/\1/')';" -e '@a=<>; $s=0; foreach (reverse(@a)) { if ($_ =~ /^References$/) { $s++; } unless ($s>0) { s/^\s+[0-9]+\. //; s/^file:\/\/localhost/$host/; } push(@ret,$_); } print(join("",reverse(@ret)))') + if [ "$ret" != "2" ]; then + [ -n "$out" ] && echo "$out" 1>&2 + return $ret + else + [ -n "$out" ] && echo "$out" + fi + ;; + http://*|https://*) + echo "$method" |grep -q '\*' || method="${method}*" + (echo "$method" |tee "$host") |cat 1>&2 && _resty_host="$method" + ;; + *) + resty "http://$method" + ;; + esac +} + +function GET() { + resty GET "$@" +} + +function POST() { + resty POST "$@" +} + +function PUT() { + resty PUT "$@" +} + +function DELETE() { + resty DELETE "$@" +} \ No newline at end of file From fe86d62c0464da20928af0fa57abc78004a6bfe6 Mon Sep 17 00:00:00 2001 From: ramen Date: Sun, 26 Sep 2010 07:59:33 +0800 Subject: [PATCH 12/33] Alt-Enter to run in background --- .gitignore | 2 -- custom/bindings.zsh | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 custom/bindings.zsh diff --git a/.gitignore b/.gitignore index f84db6dc2..e80740950 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ locals.zsh log/.zsh_history projects.zsh -custom/*.zsh -!custom/example.zsh \ No newline at end of file diff --git a/custom/bindings.zsh b/custom/bindings.zsh new file mode 100644 index 000000000..208b9d035 --- /dev/null +++ b/custom/bindings.zsh @@ -0,0 +1,2 @@ +# Alt-Enter to run in background +bindkey -s "^[\r" "^e &\r" From fd71de112d15cd7295ba5c311b2ade2bf6e028f8 Mon Sep 17 00:00:00 2001 From: Aziz Light Date: Sun, 7 Nov 2010 04:21:29 +0800 Subject: [PATCH 13/33] Wrapped git in hub, if hub is available. --- plugins/github/github.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index c23504b85..28ca116b2 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -2,3 +2,14 @@ fpath=($ZSH/plugins/github $fpath) autoload -U compinit compinit -i + +# git + hub = github +# https://github.com/defunkt/hub +function git() +{ + if [ -x $(which hub) ]; then + hub "$@" + else + git "$@" + fi +} \ No newline at end of file From 23e5e832801e3c6910ebad91e5108806486b4440 Mon Sep 17 00:00:00 2001 From: Aziz Light Date: Sun, 7 Nov 2010 05:14:23 +0800 Subject: [PATCH 14/33] automatically remove duplicates from these arrays --- oh-my-zsh.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 848e48eb5..53e696546 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -14,6 +14,9 @@ for config_file ($ZSH/custom/*.zsh) source $config_file plugin=${plugin:=()} for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh +# automatically remove duplicates from these arrays +typeset -U path cdpath fpath manpath + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] then From 4c105b80dce4884ecf80a9523e2d79776446f9ee Mon Sep 17 00:00:00 2001 From: Trabian Developer Date: Wed, 10 Nov 2010 23:24:53 +0800 Subject: [PATCH 15/33] Added Zendesk plugin for opening help desk tickets Modeled after the Lighthouse plugin but without the need for project-specific URLs. --- plugins/zendesk/zendesk.plugin.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/zendesk/zendesk.plugin.zsh diff --git a/plugins/zendesk/zendesk.plugin.zsh b/plugins/zendesk/zendesk.plugin.zsh new file mode 100644 index 000000000..661cf5eac --- /dev/null +++ b/plugins/zendesk/zendesk.plugin.zsh @@ -0,0 +1,16 @@ +# To use: add a .zendesk file into your directory with the URL to the +# individual project. For example: +# https://help.trabian.com/tickets/8994 +open_zendesk_ticket () { + if [ ! -f ~/.zendesk-url ]; then + echo "There is no .zendesk file in the home directory..." + return 0; + else + zendesk_url=$(cat ~/.zendesk-url); + echo "Opening ticket #$1"; + `open $zendesk_url/tickets/$1`; + fi +} + +alias zo='open_zendesk_ticket' +alias ticket='open_zendesk_ticket' From e72b6731ae66388e56b14ebc1eac4c2b1868b105 Mon Sep 17 00:00:00 2001 From: Joseph Jon Booker Date: Tue, 26 Oct 2010 05:02:16 +0800 Subject: [PATCH 16/33] command-not-found package in ubuntu --- plugins/command-not-found/command-not-found.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/command-not-found/command-not-found.plugin.zsh diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh new file mode 100644 index 000000000..5ab03d5a9 --- /dev/null +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -0,0 +1,5 @@ +# Uses the command-not-found package zsh support +# as seen in http://www.porcheron.info/command-not-found-for-zsh/ +# this is installed in Ubuntu + +source /etc/zsh_command_not_found From 8d6bc551e3f8c3dd48621ec7e3d00a7a51d178d7 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Tue, 2 Nov 2010 19:26:49 +0800 Subject: [PATCH 17/33] Fix lighthouse plugin error message --- plugins/lighthouse/lighthouse.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh index 4eb06a997..7661c6add 100644 --- a/plugins/lighthouse/lighthouse.plugin.zsh +++ b/plugins/lighthouse/lighthouse.plugin.zsh @@ -4,7 +4,7 @@ # Example usage: http://screencast.com/t/ZDgwNDUwNT open_lighthouse_ticket () { if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse file in the current directory..." + echo "There is no .lighthouse-url file in the current directory..." return 0; else lighthouse_url=$(cat .lighthouse-url); @@ -13,4 +13,4 @@ open_lighthouse_ticket () { fi } -alias lho='open_lighthouse_ticket' \ No newline at end of file +alias lho='open_lighthouse_ticket' From ae48577d10a1b52385d4d1fdaff100cc173a000e Mon Sep 17 00:00:00 2001 From: gwjo Date: Thu, 4 Nov 2010 04:57:15 +0800 Subject: [PATCH 18/33] Completion fixes Use /etc/hosts in addtion to $HOME/.ssh/known_hosts as the source for hostname completion Turn on completion caching to speed up certain comands When completing usernames, don't include system accounts by default --- lib/completion.zsh | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 52cc5b53c..9c2dfecca 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -34,9 +34,31 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories cdpath=(.) +# use /etc/hosts and known_hosts for hostname completion +[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$( Date: Tue, 9 Nov 2010 21:56:26 +0800 Subject: [PATCH 19/33] Added phing plugin --- plugins/phing/phing.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/phing/phing.plugin.zsh diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh new file mode 100644 index 000000000..80e334629 --- /dev/null +++ b/plugins/phing/phing.plugin.zsh @@ -0,0 +1,20 @@ +_phing_does_target_list_need_generating () { + if [ ! -f .phing_targets ]; then return 0; + else + accurate=$(stat -f%m .phing_targets) + changed=$(stat -f%m build.xml) + return $(expr $accurate '>=' $changed) + fi +} + +_phing () { + if [ -f build.xml ]; then + if _phing_does_target_list_need_generating; then + echo "\nGenerating .phing_targets..." > /dev/stderr + phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets + fi + compadd `cat .phing_targets` + fi +} + +compdef _phing phing From 6c094c25104a2d1c01f5a447d1e19fa904cba3ae Mon Sep 17 00:00:00 2001 From: Ubiratan Pires Alberton Date: Fri, 30 Jul 2010 20:27:32 +0800 Subject: [PATCH 20/33] Added my own theme, based on macovsky-ruby and funky --- themes/bira.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 themes/bira.zsh-theme diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme new file mode 100644 index 000000000..f0ee6a5bd --- /dev/null +++ b/themes/bira.zsh-theme @@ -0,0 +1,14 @@ +# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' +local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' +local rvm_ruby='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v g)›%{$reset_color%}' +local git_branch='$(git_prompt_info)%{$reset_color%}' + +PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +╰─%B$%b " +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" From aaa0daf6141c605d1cf47349c10cd6a9d96665b2 Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Tue, 16 Nov 2010 03:45:04 +0800 Subject: [PATCH 21/33] vagrant plugin autocompletion - initial version --- plugins/vagrant/_vagrant | 139 +++++++++++++++++++++++++++++ plugins/vagrant/vagrant.plugin.zsh | 3 + 2 files changed, 142 insertions(+) create mode 100644 plugins/vagrant/_vagrant create mode 100644 plugins/vagrant/vagrant.plugin.zsh diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant new file mode 100644 index 000000000..4cd6a46d2 --- /dev/null +++ b/plugins/vagrant/_vagrant @@ -0,0 +1,139 @@ +#compdef vagrant +#autoload + +# vagrant zsh completion, based on homebrew completion + +__task_list () +{ + local expl + declare -a tasks + + tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) + + _wanted tasks expl 'help' compadd $tasks +} + +__box_list () +{ + _wanted application expl 'hxlp' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') +} + +__vagrant-box () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + # local -a subcommands + # subcommands=( + # 'start:Start a new release branch' + # 'finish:Finish a release branche.' + # 'list:List all your release branches. (Alias to `git flow release`)' + # ) + # _describe -t commands 'git flow release' subcommands + # _arguments \ + # -v'[Verbose (more) output]' + _describe -t commands "gem subcommand" _box_arguments + return + ;; + + (options) + case $line[1] in + + (repackage) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__box_list' + + + + ;; + esac + ;; + esac + +} + +local -a _1st_arguments +_1st_arguments=( + 'box:Box commands' + 'destroy:Destroys the vagrant environment' + 'halt:Halts the currently running vagrant environment' + 'help:[TASK] Describe available tasks or one specific task' + 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' + 'package:Packages a vagrant environment for distribution' + 'provision:Run the provisioner' + 'reload:Reload the vagrant environment' + 'resume:Resumes a suspend vagrant environment' + 'ssh:SSH into the currently running environment' + 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' + 'status:Shows the status of the current Vagrant environment.' + 'suspend:Suspends the currently running vagrant environment' + 'up:Creates the vagrant environment' + 'version:Prints the Vagrant version information' +) + +local -a _box_arguments +_box_arguments=( + 'add:NAME URI Add a box to the system' + 'help:COMMAND Describe subcommands or one specific subcommand' + 'list:Lists all installed boxes' + 'remove:NAME Remove a box from the system' + 'repackage:NAME Repackage an installed box into a `.box` file.' +) + +local expl +local -a boxes installed_boxes + +#_arguments \ +# '(-v --version)'{-v,--version}'[show version]' \ +# '(-h --help)'{-h,--help}'[show help]' \ +# '*:: :->subcmds' && return 0 + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + + + +#echo $state +#echo -e "\n\n\n\n" +#echo $line[1] + +case $state in + + (command) + + _describe -t commands "gem subcommand" _1st_arguments + return + ;; + + (options) + + case $line[1] in + + (help) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__task_list' + + ;; + + (box) + + __vagrant-box + ;; + esac + ;; +esac diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 000000000..5e9bcf10a --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,3 @@ +fpath=($ZSH/plugins/vagrant $fpath) +autoload -U compinit +compinit -i From b51d43854b2b34761de4ddaf7581c16dddca9c12 Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Tue, 16 Nov 2010 03:56:01 +0800 Subject: [PATCH 22/33] fixed formatting; dead code deleted --- plugins/vagrant/_vagrant | 147 +++++++++++++++------------------------ 1 file changed, 58 insertions(+), 89 deletions(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index 4cd6a46d2..ea7fd5f74 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -5,134 +5,103 @@ __task_list () { - local expl - declare -a tasks + local expl + declare -a tasks - tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) + tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) - _wanted tasks expl 'help' compadd $tasks + _wanted tasks expl 'help' compadd $tasks } __box_list () { - _wanted application expl 'hxlp' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') + _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g') } __vagrant-box () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) - - # local -a subcommands - # subcommands=( - # 'start:Start a new release branch' - # 'finish:Finish a release branche.' - # 'list:List all your release branches. (Alias to `git flow release`)' - # ) - # _describe -t commands 'git flow release' subcommands - # _arguments \ - # -v'[Verbose (more) output]' - _describe -t commands "gem subcommand" _box_arguments - return - ;; - - (options) - case $line[1] in - - (repackage) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__box_list' - - - - ;; - esac - ;; - esac + case $state in + (command) + _describe -t commands "gem subcommand" _box_arguments + return + ;; + (options) + case $line[1] in + (repackage|remove) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__box_list' + ;; + esac + ;; + esac } local -a _1st_arguments _1st_arguments=( - 'box:Box commands' - 'destroy:Destroys the vagrant environment' - 'halt:Halts the currently running vagrant environment' - 'help:[TASK] Describe available tasks or one specific task' - 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' - 'package:Packages a vagrant environment for distribution' - 'provision:Run the provisioner' - 'reload:Reload the vagrant environment' - 'resume:Resumes a suspend vagrant environment' - 'ssh:SSH into the currently running environment' - 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' - 'status:Shows the status of the current Vagrant environment.' - 'suspend:Suspends the currently running vagrant environment' - 'up:Creates the vagrant environment' - 'version:Prints the Vagrant version information' + 'box:Box commands' + 'destroy:Destroys the vagrant environment' + 'halt:Halts the currently running vagrant environment' + 'help:[TASK] Describe available tasks or one specific task' + 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' + 'package:Packages a vagrant environment for distribution' + 'provision:Run the provisioner' + 'reload:Reload the vagrant environment' + 'resume:Resumes a suspend vagrant environment' + 'ssh:SSH into the currently running environment' + 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' + 'status:Shows the status of the current Vagrant environment.' + 'suspend:Suspends the currently running vagrant environment' + 'up:Creates the vagrant environment' + 'version:Prints the Vagrant version information' ) local -a _box_arguments _box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' - 'list:Lists all installed boxes' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' + 'add:NAME URI Add a box to the system' + 'help:COMMAND Describe subcommands or one specific subcommand' + 'list:Lists all installed boxes' + 'remove:NAME Remove a box from the system' + 'repackage:NAME Repackage an installed box into a `.box` file.' ) local expl local -a boxes installed_boxes -#_arguments \ -# '(-v --version)'{-v,--version}'[show version]' \ -# '(-h --help)'{-h,--help}'[show help]' \ -# '*:: :->subcmds' && return 0 - local curcontext="$curcontext" state line - typeset -A opt_args +local curcontext="$curcontext" state line +typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' +_arguments -C \ + ':command:->command' \ + '*::options:->options' - - -#echo $state -#echo -e "\n\n\n\n" -#echo $line[1] - case $state in - (command) - - _describe -t commands "gem subcommand" _1st_arguments - return + _describe -t commands "gem subcommand" _1st_arguments + return ;; (options) - case $line[1] in - (help) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__task_list' - + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__task_list' ;; (box) - - __vagrant-box + __vagrant-box ;; esac ;; From 0d8e8609bbc5c7ad6eb17ccc65367d89881db4bb Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Tue, 16 Nov 2010 04:18:58 +0800 Subject: [PATCH 23/33] improved formatting; redundant attributes deleted --- plugins/vagrant/_vagrant | 68 +++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant index ea7fd5f74..483b29c53 100644 --- a/plugins/vagrant/_vagrant +++ b/plugins/vagrant/_vagrant @@ -1,7 +1,35 @@ #compdef vagrant #autoload -# vagrant zsh completion, based on homebrew completion +# vagrant zsh completion + +local -a _1st_arguments +_1st_arguments=( + 'box:Box commands' + 'destroy:Destroys the vagrant environment' + 'halt:Halts the currently running vagrant environment' + 'help:[TASK] Describe available tasks or one specific task' + 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' + 'package:Packages a vagrant environment for distribution' + 'provision:Run the provisioner' + 'reload:Reload the vagrant environment' + 'resume:Resumes a suspend vagrant environment' + 'ssh:SSH into the currently running environment' + 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' + 'status:Shows the status of the current Vagrant environment.' + 'suspend:Suspends the currently running vagrant environment' + 'up:Creates the vagrant environment' + 'version:Prints the Vagrant version information' +) + +local -a _box_arguments +_box_arguments=( + 'add:NAME URI Add a box to the system' + 'help:COMMAND Describe subcommands or one specific subcommand' + 'list:Lists all installed boxes' + 'remove:NAME Remove a box from the system' + 'repackage:NAME Repackage an installed box into a `.box` file.' +) __task_list () { @@ -36,43 +64,15 @@ __vagrant-box () (options) case $line[1] in (repackage|remove) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__box_list' + _arguments ':feature:__box_list' ;; esac ;; esac } -local -a _1st_arguments -_1st_arguments=( - 'box:Box commands' - 'destroy:Destroys the vagrant environment' - 'halt:Halts the currently running vagrant environment' - 'help:[TASK] Describe available tasks or one specific task' - 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' - 'package:Packages a vagrant environment for distribution' - 'provision:Run the provisioner' - 'reload:Reload the vagrant environment' - 'resume:Resumes a suspend vagrant environment' - 'ssh:SSH into the currently running environment' - 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.' - 'status:Shows the status of the current Vagrant environment.' - 'suspend:Suspends the currently running vagrant environment' - 'up:Creates the vagrant environment' - 'version:Prints the Vagrant version information' -) -local -a _box_arguments -_box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' - 'list:Lists all installed boxes' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' -) + local expl local -a boxes installed_boxes @@ -84,7 +84,6 @@ _arguments -C \ ':command:->command' \ '*::options:->options' - case $state in (command) _describe -t commands "gem subcommand" _1st_arguments @@ -94,10 +93,7 @@ case $state in (options) case $line[1] in (help) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__task_list' + _arguments ':feature:__task_list' ;; (box) From 30c7d3dc2d645e06d0dd9e27f50dcee0de5f430d Mon Sep 17 00:00:00 2001 From: Tobias Ford Date: Sun, 14 Nov 2010 09:47:24 +0800 Subject: [PATCH 24/33] added some good completions for rvm --- completions/_rvm | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 completions/_rvm diff --git a/completions/_rvm b/completions/_rvm new file mode 100644 index 000000000..5be28a358 --- /dev/null +++ b/completions/_rvm @@ -0,0 +1,72 @@ +#compdef rvm + +local curcontext="$curcontext" state line cmds ret=1 + +_arguments -C \ + '(- 1 *)'{-v,--version}'[display version information]' \ + '(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \ + '(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \ + '(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \ + '(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \ + '(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \ + '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \ + '-e[Execute code from the command line]:code' \ + '(-G)-G[root gem path to use]:path:_files' \ + '(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \ + '(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \ + '(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \ + '(-C|--configure)'{-C,--configure}'=[custom configure options]' \ + '(--nice)--nice[process niceness (for slow computers, default 0)]:number' \ + '(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \ + '(--head)--head[with update, updates rvm to git head version]' \ + '(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \ + '(--default)--default[with ruby select, sets a default ruby for new shells]' \ + '(--debug)--debug[Toggle debug mode on for very verbose output]' \ + '(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \ + '(--force)--force[Force install, removes old install & source before install]' \ + '(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \ + '(--latest)--latest[with gemset --dump skips version strings for latest gem]' \ + '(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \ + '(--docs)--docs[with install, attempt to generate ri after installation]' \ + '(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \ + '1: :->cmds' \ + '*: :->args' && ret=0 + +case $state in + cmds) + cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^Action/,/^Implementation/!d; / - /!d; s/^[ *]*\([^ ]*\) *\- *\(.*\)/\1:\2/')"} ) + cmds+=( $(rvm list strings) ) + _describe -t commands 'rvm command' cmds && ret=0 + ;; + args) + case $line[1] in + (use|uninstall|remove|list) + _values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0 + ;; + (install|fetch) + _values -S , 'rubies' $(rvm list known_strings) && ret=0 + ;; + gemset) + if (( CURRENT == 3 )); then + _values 'gemset_commands' $(rvm gemset | sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g') + else + _values -S , 'gemsets' $(rvm gemset list | \grep -v gemset 2>/dev/null) + fi + ret=0 + ;; + package) + if (( CURRENT == 3 )); then + _values 'package_commands' $(rvm package | sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g') + else + _values 'packages' $(rvm package | sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g') + fi + ret=0 + ;; + *) + (( ret )) && _message 'no more arguments' + ;; + esac + ;; +esac + +return ret From 1af973468ddf73bb17c2041c315bf5dfa0f2361c Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:31:25 +0000 Subject: [PATCH 25/33] tabs to spaces --- plugins/git/git.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 83efeb7af..5187611b6 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,6 +1,6 @@ # Aliases alias g='git' -alias gst='git status' +alias gst='git status -s' alias gl='git pull' alias gup='git fetch && git rebase' alias gp='git push' @@ -13,7 +13,7 @@ alias gba='git branch -a' alias gcount='git shortlog -sn' alias gcp='git cherry-pick' alias glg='git log --stat --max-count=5' -alias glgg='git log --graph --max-count=5' +alias glgg='git log --graph --decorate --max-count=5' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 84a6bc92d41c13aaf4973df49d3aa710db9aaf4d Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:31:46 +0000 Subject: [PATCH 26/33] clean up --- .gitignore | 1 + plugins/git-flow.plugin.zsh | 332 ------------------------------------ 2 files changed, 1 insertion(+), 332 deletions(-) delete mode 100644 plugins/git-flow.plugin.zsh diff --git a/.gitignore b/.gitignore index e80740950..dd5f23617 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ locals.zsh log/.zsh_history projects.zsh +custom/personal.zsh \ No newline at end of file diff --git a/plugins/git-flow.plugin.zsh b/plugins/git-flow.plugin.zsh deleted file mode 100644 index 07215f9d1..000000000 --- a/plugins/git-flow.plugin.zsh +++ /dev/null @@ -1,332 +0,0 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - -_git-flow () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - ) - _describe -t commands 'git flow' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; - - (version) - ;; - - (hotfix) - __git-flow-hotfix - ;; - - (release) - __git-flow-release - ;; - - (feature) - __git-flow-feature - ;; - esac - ;; - esac -} - -__git-flow-release () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch' - 'finish:Finish a release branche.' - 'list:List all your release branches. (Alias to `git flow release`)' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':version:__git_flow_version_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-hotfix () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch' - 'finish:Finish a hotfix branche.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':hotfix:__git_flow_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-feature () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch' - 'finish:Finish a hotfix branche.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - 'publish: public' - 'track: track' - 'diff: diff' - 'rebase: rebase' - 'checkout: checkout' - 'pull: pull' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__git_flow_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; - - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git_flow_version_list () -{ - local expl - declare -a versions - - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted versions expl 'version' compadd $versions -} - -__git_flow_feature_list () -{ - local expl - declare -a features - - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted features expl 'feature' compadd $features -} - -__git_remotes () { - local expl gitdir remotes - - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return - - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return - - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi -} - -__git_flow_hotfix_list () -{ - local expl - declare -a hotfixes - - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'hotfix' compadd $hotfixes -} - -__git_branch_names () { - local expl - declare -a branch_names - - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - - _wanted branch-names expl branch-name compadd $* - $branch_names -} - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - -zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' From 4a256a72810b08770b2fd7de10f1283976d91710 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:32:08 +0000 Subject: [PATCH 27/33] more tweaks --- lib/history.zsh | 2 +- lib/key-bindings.zsh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index ca6f57079..6b9b0d5b2 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -4,7 +4,7 @@ HISTSIZE=10000 SAVEHIST=10000 setopt hist_ignore_dups # ignore duplication command history list -setopt share_history # share command history data +#setopt share_history # share command history data setopt hist_verify setopt inc_append_history diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 07adb7150..f633148bf 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -26,8 +26,6 @@ bindkey '^[[Z' reverse-menu-complete bindkey '^?' backward-delete-char bindkey '^[[3~' delete-char - - # consider emacs keybindings: #bindkey -e ## emacs key bindings From e21a9a634368c073318dbf48428afc8aabc888c0 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:32:31 +0000 Subject: [PATCH 28/33] tabs to spaces --- plugins/github/github.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 28ca116b2..856baac3b 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -7,9 +7,9 @@ compinit -i # https://github.com/defunkt/hub function git() { - if [ -x $(which hub) ]; then - hub "$@" - else - git "$@" - fi + if [ -x $(which hub) ]; then + hub "$@" + else + git "$@" + fi } \ No newline at end of file From ce362ff96a7cac3ffefd7cfa64b8fdce2434632c Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:32:44 +0000 Subject: [PATCH 29/33] dunno --- themes/robbyrussell.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-theme index 7b524e82d..fdb49004d 100644 --- a/themes/robbyrussell.zsh-theme +++ b/themes/robbyrussell.zsh-theme @@ -1,6 +1,6 @@ -PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' +PROMPT='%{$fg_bold[grey]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' -ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[grey]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" From 01d79d830800722930b9792e7638d6cffbaf0c5a Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Fri, 19 Nov 2010 19:38:17 +0000 Subject: [PATCH 30/33] github now uses hub http://chriswanstrath.com/hub/ --- plugins/github/github.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 856baac3b..84efe8fa9 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -3,6 +3,7 @@ fpath=($ZSH/plugins/github $fpath) autoload -U compinit compinit -i + # git + hub = github # https://github.com/defunkt/hub function git() @@ -12,4 +13,4 @@ function git() else git "$@" fi -} \ No newline at end of file +} From ba4419ee0ef6bba7a6c56f9a2748fd7999bee7bf Mon Sep 17 00:00:00 2001 From: Claus Witt Date: Fri, 26 Nov 2010 04:48:07 +0800 Subject: [PATCH 31/33] Added ant plugin --- plugins/ant/ant.plugin.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/ant/ant.plugin.zsh diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh new file mode 100644 index 000000000..0544ac92c --- /dev/null +++ b/plugins/ant/ant.plugin.zsh @@ -0,0 +1,19 @@ +_ant_does_target_list_need_generating () { + if [ ! -f .ant_targets ]; then return 0; + else + accurate=$(stat -f%m .ant_targets) + changed=$(stat -f%m build.xml) + return $(expr $accurate '>=' $changed) + fi +} + +_ant () { + if [ -f build.xml ]; then + if _ant_does_target_list_need_generating; then + sed -n '/ .ant_targets + fi + compadd `cat .ant_targets` + fi +} + +compdef _ant ant From 3c7abafdb231b4335c5dd9c4cbc21bfbd3bbe37d Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 16 Apr 2011 13:13:56 +0100 Subject: [PATCH 32/33] delete zsh syntax highlighter --- plugins/zsh-syntax-highlighting | 1 + 1 file changed, 1 insertion(+) create mode 160000 plugins/zsh-syntax-highlighting diff --git a/plugins/zsh-syntax-highlighting b/plugins/zsh-syntax-highlighting new file mode 160000 index 000000000..bc788f3f1 --- /dev/null +++ b/plugins/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit bc788f3f19d3d7e2ce236c62abc3d6bb69f748fc From 046026cd68182ad3810dbf5700959654a4e9f4b1 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 16 Apr 2011 13:17:10 +0100 Subject: [PATCH 33/33] g --- plugins/zsh-syntax-highlighting | 1 - 1 file changed, 1 deletion(-) delete mode 160000 plugins/zsh-syntax-highlighting diff --git a/plugins/zsh-syntax-highlighting b/plugins/zsh-syntax-highlighting deleted file mode 160000 index bc788f3f1..000000000 --- a/plugins/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bc788f3f19d3d7e2ce236c62abc3d6bb69f748fc