From c24936ece51940536f3e62fc9e458b74c2affe68 Mon Sep 17 00:00:00 2001 From: steeef Date: Thu, 30 Sep 2010 19:56:56 -0700 Subject: [PATCH 01/39] added steeef theme --- themes/steeef.zsh-theme | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 themes/steeef.zsh-theme diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme new file mode 100644 index 00000000..a54cdce1 --- /dev/null +++ b/themes/steeef.zsh-theme @@ -0,0 +1,68 @@ +# prompt style and colors based on Steve Losh's Prose theme: +# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# +# vcs_info modifications from Bart Trojanowski's zsh prompt: +# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} +PR_GIT_UPDATE=1 + +setopt prompt_subst +autoload colors +colors + +autoload -U add-zsh-hook +autoload -Uz vcs_info + + +# check-for-changes can be really slow. +# you should disable it, if you work with large repositories +zstyle ':vcs_info:*:prompt:*' check-for-changes true + +# set formats +# %b - branchname +# %u - unstagedstr (see below) +# %c - stagedstr (see below) +# %a - action (e.g. rebase-i) +# %R - repository path +# %S - path in the repository +PR_RST="%{${reset_color}%}" +FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})" +FMT_ACTION="(%{$fg[green]%}%a${PR_RST})" +FMT_UNSTAGED="%{$fg[yellow]%}!" +FMT_STAGED="%{$fg[yellow]%}?" + +zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" +zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" +zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" +zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" +zstyle ':vcs_info:*:prompt:*' nvcsformats "" + + +function steeef_preexec { + case "$(history $HISTCMD)" in + *git*) + PR_GIT_UPDATE=1 + ;; + esac +} +add-zsh-hook preexec steeef_preexec + +function steeef_chpwd { + PR_GIT_UPDATE=1 +} +add-zsh-hook chpwd steeef_chpwd + +function steeef_precmd { + if [[ -n "$PR_GIT_UPDATE" ]] ; then + vcs_info 'prompt' + PR_GIT_UPDATE= + fi +} +add-zsh-hook precmd steeef_precmd + +PROMPT=$' +%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%} $vcs_info_msg_0_ +$(virtualenv_info)$ ' From 7fb0b210e88bcbdb71d2cb0022c35b2cc3810327 Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 1 Oct 2010 14:11:53 -0700 Subject: [PATCH 02/39] merge steeef.zsh-theme from master --- themes/steeef.zsh-theme | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index a54cdce1..abb8f299 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -3,6 +3,9 @@ # # vcs_info modifications from Bart Trojanowski's zsh prompt: # http://www.jukie.net/bart/blog/pimping-out-zsh-prompt +# +# git untracked files modification from Brian Carper: +# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' @@ -17,6 +20,9 @@ autoload -U add-zsh-hook autoload -Uz vcs_info +# enable VCS systems you use +zstyle ':vcs_info:*' enable git svn + # check-for-changes can be really slow. # you should disable it, if you work with large repositories zstyle ':vcs_info:*:prompt:*' check-for-changes true @@ -31,8 +37,8 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true PR_RST="%{${reset_color}%}" FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})" FMT_ACTION="(%{$fg[green]%}%a${PR_RST})" -FMT_UNSTAGED="%{$fg[yellow]%}!" -FMT_STAGED="%{$fg[yellow]%}?" +FMT_UNSTAGED="%{$fg[yellow]%}●" +FMT_STAGED="%{$fg[green]%}●" zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" @@ -46,6 +52,9 @@ function steeef_preexec { *git*) PR_GIT_UPDATE=1 ;; + *svn*) + PR_GIT_UPDATE=1 + ;; esac } add-zsh-hook preexec steeef_preexec @@ -56,6 +65,15 @@ function steeef_chpwd { add-zsh-hook chpwd steeef_chpwd function steeef_precmd { + # check for untracked files or updated submodules, since vcs_info doesn't + if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) || -n $(git ls-files -m --exclude-standard 2> /dev/null) ]]; then + PR_GIT_UPDATE=1 + FMT_BRANCH="(%{$fg[magenta]%}%b%u%c%{$fg[red]%}●${PR_RST})" + else + FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})" + fi + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" + if [[ -n "$PR_GIT_UPDATE" ]] ; then vcs_info 'prompt' PR_GIT_UPDATE= From 6fcf9393c31a51cef688b591de73817c5988c405 Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 1 Oct 2010 14:17:13 -0700 Subject: [PATCH 03/39] merge steeef.zsh-theme from master (removed submodule check) --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index abb8f299..a4319274 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -66,7 +66,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { # check for untracked files or updated submodules, since vcs_info doesn't - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) || -n $(git ls-files -m --exclude-standard 2> /dev/null) ]]; then + if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$fg[magenta]%}%b%u%c%{$fg[red]%}●${PR_RST})" else From 7405f5d9ff29f42e934fa5f3c87401437c16aedd Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 1 Oct 2010 14:40:06 -0700 Subject: [PATCH 04/39] fix untracked files checking --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index a4319274..8c4c8026 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -66,7 +66,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { # check for untracked files or updated submodules, since vcs_info doesn't - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$fg[magenta]%}%b%u%c%{$fg[red]%}●${PR_RST})" else From f2f49f9571cf56b2fa672f16260c000050f9349b Mon Sep 17 00:00:00 2001 From: atom smith Date: Sun, 3 Oct 2010 17:41:45 -0400 Subject: [PATCH 05/39] adding my zsh-theme --- themes/re5et.zsh-theme | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 themes/re5et.zsh-theme diff --git a/themes/re5et.zsh-theme b/themes/re5et.zsh-theme new file mode 100644 index 00000000..fadb1fef --- /dev/null +++ b/themes/re5et.zsh-theme @@ -0,0 +1,15 @@ +if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi + +local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})" + +PROMPT=' +%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info) +%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}' + +RPS1='${return_code} %D - %*' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" \ No newline at end of file From ba9ae6a1e5fe1b45a58e655ab3413bb95a82573e Mon Sep 17 00:00:00 2001 From: atom smith Date: Sun, 3 Oct 2010 17:42:57 -0400 Subject: [PATCH 06/39] should have newline at end of file. --- themes/re5et.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/re5et.zsh-theme b/themes/re5et.zsh-theme index fadb1fef..5bded76a 100644 --- a/themes/re5et.zsh-theme +++ b/themes/re5et.zsh-theme @@ -12,4 +12,4 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[ye ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ±" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" \ No newline at end of file +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[red]%} ♥" From 6d5e4eaebcde1c48413f89b4554983f489e4b017 Mon Sep 17 00:00:00 2001 From: steeef Date: Mon, 4 Oct 2010 18:05:01 -0700 Subject: [PATCH 07/39] use 256 colors, if available --- themes/steeef.zsh-theme | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 8c4c8026..d8f9306c 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -19,6 +19,20 @@ colors autoload -U add-zsh-hook autoload -Uz vcs_info +#use extended color pallete if available +if [ $TERM = "xterm-256color" ]; then + turquoise="%F{81}" + orange="%F{166}" + purple="%F{135}" + hotpink="%F{161}" + limegreen="%F{118}" +else + turquoise="$fg[cyan]" + orange="$fg[yellow]" + purple="$fg[magenta]" + hotpink="$fg[red]" + limegreen="$fg[green]" +fi # enable VCS systems you use zstyle ':vcs_info:*' enable git svn @@ -35,10 +49,10 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true # %R - repository path # %S - path in the repository PR_RST="%{${reset_color}%}" -FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})" -FMT_ACTION="(%{$fg[green]%}%a${PR_RST})" -FMT_UNSTAGED="%{$fg[yellow]%}●" -FMT_STAGED="%{$fg[green]%}●" +FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" +FMT_ACTION="(%{$limegreen%}%a${PR_RST})" +FMT_UNSTAGED="%{$orange%}●" +FMT_STAGED="%{$limegreen%}●" zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" @@ -68,9 +82,9 @@ function steeef_precmd { # check for untracked files or updated submodules, since vcs_info doesn't if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then PR_GIT_UPDATE=1 - FMT_BRANCH="(%{$fg[magenta]%}%b%u%c%{$fg[red]%}●${PR_RST})" + FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" else - FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})" + FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" fi zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" @@ -82,5 +96,5 @@ function steeef_precmd { add-zsh-hook precmd steeef_precmd PROMPT=$' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%} $vcs_info_msg_0_ +%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_ $(virtualenv_info)$ ' From c6b339f532b05e907b0c554000643db5e896a75f Mon Sep 17 00:00:00 2001 From: steeef Date: Mon, 4 Oct 2010 22:08:38 -0700 Subject: [PATCH 08/39] merge master --- themes/steeef.zsh-theme | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index d8f9306c..a5cf0f9a 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -79,16 +79,16 @@ function steeef_chpwd { add-zsh-hook chpwd steeef_chpwd function steeef_precmd { - # check for untracked files or updated submodules, since vcs_info doesn't - if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - PR_GIT_UPDATE=1 - FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" - else - FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" - fi - zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" - if [[ -n "$PR_GIT_UPDATE" ]] ; then + # check for untracked files or updated submodules, since vcs_info doesn't + if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + PR_GIT_UPDATE=1 + FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" + else + FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" + fi + zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" + vcs_info 'prompt' PR_GIT_UPDATE= fi From 4e433eb6bb578c864116cbcf0aa201227f80e4aa Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Fri, 15 Oct 2010 11:05:47 +0200 Subject: [PATCH 09/39] Added own theme (based on robbyrussell) --- themes/fwalch.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/fwalch.zsh-theme diff --git a/themes/fwalch.zsh-theme b/themes/fwalch.zsh-theme new file mode 100644 index 00000000..24edf55c --- /dev/null +++ b/themes/fwalch.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}" +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 60b560fc9ace116cde7e56954f386b1098751648 Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Fri, 15 Oct 2010 16:50:39 +0200 Subject: [PATCH 10/39] Added gpg-agent plugin Based on ssh-agent plugin. --- plugins/gpg-agent/gpg-agent.plugin.zsh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/gpg-agent/gpg-agent.plugin.zsh diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh new file mode 100644 index 00000000..8cc71fd5 --- /dev/null +++ b/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -0,0 +1,26 @@ +# Based on ssh-agent code + +local GPG_ENV=$HOME/.gnupg/gpg-agent.env + +function start_agent { + /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null + chmod 600 ${GPG_ENV} + . ${GPG_ENV} > /dev/null +} + +# Source GPG agent settings, if applicable +if [ -f "${GPG_ENV}" ]; then + . ${GPG_ENV} > /dev/null + ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || { + start_agent; + } +else + start_agent; +fi + +export GPG_AGENT_INFO +export SSH_AUTH_SOCK +export SSH_AGENT_PID + +GPG_TTY=$(tty) +export GPG_TTY From 9b6dd1cd48a549d2868cfe16073bbd04357e27e5 Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 22 Oct 2010 10:39:33 -0700 Subject: [PATCH 11/39] merge with master --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index a5cf0f9a..07c1d3de 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -20,7 +20,7 @@ autoload -U add-zsh-hook autoload -Uz vcs_info #use extended color pallete if available -if [ $TERM = "xterm-256color" ]; then +if [ $TERM = "xterm-256color" || $TERM = "linux" || $TERM = "rxvt-256color" || $TERM = "rxvt-unicode-256color" ]; then turquoise="%F{81}" orange="%F{166}" purple="%F{135}" From 810b8f5ce8a58b03afba4e6ec5937e2cd0bcab5c Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 22 Oct 2010 10:42:49 -0700 Subject: [PATCH 12/39] merge with master --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 07c1d3de..6bca57ee 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -20,7 +20,7 @@ autoload -U add-zsh-hook autoload -Uz vcs_info #use extended color pallete if available -if [ $TERM = "xterm-256color" || $TERM = "linux" || $TERM = "rxvt-256color" || $TERM = "rxvt-unicode-256color" ]; then +if [ [ $TERM = "xterm-256color" ] || [ $TERM = "linux"] || [ $TERM = "rxvt-256color" ] || [ $TERM = "rxvt-unicode-256color" ] ]; then turquoise="%F{81}" orange="%F{166}" purple="%F{135}" From d2bfdc2d89cb08a870169af4f394f27d2b9c0aed Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 22 Oct 2010 10:51:58 -0700 Subject: [PATCH 13/39] merge theme fixes from master --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index 6bca57ee..f8130024 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -20,7 +20,7 @@ autoload -U add-zsh-hook autoload -Uz vcs_info #use extended color pallete if available -if [ [ $TERM = "xterm-256color" ] || [ $TERM = "linux"] || [ $TERM = "rxvt-256color" ] || [ $TERM = "rxvt-unicode-256color" ] ]; then +if [[ $TERM = *256color* || $TERM = "linux" ]]; then turquoise="%F{81}" orange="%F{166}" purple="%F{135}" From 4ff0136079b8ffe29e0990d0a0ce8876554aa0d5 Mon Sep 17 00:00:00 2001 From: steeef Date: Fri, 22 Oct 2010 11:34:52 -0700 Subject: [PATCH 14/39] merge from master --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index f8130024..a2583b02 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -20,7 +20,7 @@ autoload -U add-zsh-hook autoload -Uz vcs_info #use extended color pallete if available -if [[ $TERM = *256color* || $TERM = "linux" ]]; then +if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then turquoise="%F{81}" orange="%F{166}" purple="%F{135}" From bdaf872ce6e411f881e5e6138fc61a9c1645e67a Mon Sep 17 00:00:00 2001 From: Claus Witt Date: Wed, 17 Nov 2010 11:17:03 +0100 Subject: [PATCH 15/39] Removed the echo statement - no need for that. --- plugins/phing/phing.plugin.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh index 80e33462..8f4adca0 100644 --- a/plugins/phing/phing.plugin.zsh +++ b/plugins/phing/phing.plugin.zsh @@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () { _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` From fa7036b4eef177f25478091e660fca52b9ac725d Mon Sep 17 00:00:00 2001 From: Claus Witt Date: Thu, 25 Nov 2010 21:48:07 +0100 Subject: [PATCH 16/39] 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 00000000..0544ac92 --- /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 fcc7801435fd2c5c6defcfbfc736e22341500a9d Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Mon, 24 Jan 2011 15:49:49 +0100 Subject: [PATCH 17/39] add missing unrar flag --- lib/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index 914f2ef2..86545c7b 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -52,7 +52,7 @@ function extract() { *.tar.xz) tar xvJf $1;; *.tar.lzma) tar --lzma -xvf $1;; *.bz2) bunzip $1;; - *.rar) unrar $1;; + *.rar) unrar x $1;; *.gz) gunzip $1;; *.tar) tar xvf $1;; *.tbz2) tar xvjf $1;; From 7f69551498a78a6b30d706c89808fcd2ba000045 Mon Sep 17 00:00:00 2001 From: Christopher Chow Date: Wed, 23 Feb 2011 02:56:25 +1100 Subject: [PATCH 18/39] Add tab completion for rvm. --- plugins/rvm/_rvm | 147 +++++++++++++++++++++++++++++++++++++ plugins/rvm/rvm.plugin.zsh | 3 + 2 files changed, 150 insertions(+) create mode 100644 plugins/rvm/_rvm create mode 100644 plugins/rvm/rvm.plugin.zsh diff --git a/plugins/rvm/_rvm b/plugins/rvm/_rvm new file mode 100644 index 00000000..bba5304a --- /dev/null +++ b/plugins/rvm/_rvm @@ -0,0 +1,147 @@ +#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=( + "version:show the rvm version installed in rvm_path" + "use:setup current shell to use a specific ruby version" + "reload:reload rvm source itself (useful after changing rvm source)" + "implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)." + "update:upgrades rvm to the latest version." + "reset:remove current and stored default & system settings." + "info :show the *current* environment information for current ruby" + "current:print the *current* ruby version and the name of any gemset being used." + "debug:show info plus additional information for common issues" + "install:install one or many ruby versions" + "uninstall:uninstall one or many ruby versions, leaves their sources" + "remove:uninstall one or many ruby versions and remove their sources" + "migrate:Lets you migrate all gemsets from one ruby to another." + "upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically." + "wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like." + "cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm." + "repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)." + "snapshot:Lets your backup / restore an rvm installation in a lightweight manner." + "disk-usage:Tells you how much disk space rvm install is using." + "tools:Provides general information about the ruby environment, primarily useful when scripting rvm." + "docs:Tools to make installing ri and rdoc documentation easier." + "rvmrc:Tools related to managing rvmrc trust and loading." + "exec:runs an arbitrary command as a set operation." + "ruby:runs a named ruby file against specified and/or all rubies" + "gem:runs a gem command using selected ruby's 'gem'" + "rake:runs a rake task against specified and/or all rubies" + "tests:runs 'rake test' across selected ruby versions" + "specs:runs 'rake spec' across selected ruby versions" + "monitor:Monitor cwd for testing, run rake {spec,test} on changes." + "gemset:gemsets: http://rvm.beginrescueend.com/gemsets/" + "rubygems:Switches the installed version of rubygems for the current ruby." + "gemdir:display the path to the current gem directory (GEM_HOME)." + "srcdir:display the path to rvm source directory (may be yanked)" + "fetch:Performs an archive / src fetch only of the selected ruby." + "list:show currently installed rubies, interactive output." + "package:Install a dependency package {readline,iconv,zlib,openssl}" + "notes:Display notes, with operating system specifics." + "export:Temporarily set an environment variable in the current shell." + "unexport:Undo changes made to the environment by 'rvm export'." + ) + _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' \ + 'import' \ + 'export' \ + 'create' \ + 'copy' \ + 'rename' \ + 'empty' \ + 'delete' \ + 'name' \ + 'dir' \ + 'list' \ + 'list_all' \ + 'gemdir' \ + 'install' \ + 'pristine' \ + 'clear' \ + 'use' \ + 'update' \ + 'unpack' \ + 'globalcache' + else + _values -S , 'gemsets' $(rvm gemset list | grep -v gemset 2>/dev/null) + fi + ret=0 + ;; + package) + if (( CURRENT == 3 )); then + _values 'package_commands' \ + 'install' \ + 'uninstall' + else + _values 'packages' \ + 'readline' \ + 'iconv' \ + 'curl' \ + 'openssl' \ + 'zlib' \ + 'autoconf' \ + 'ncurses' \ + 'pkgconfig' \ + 'gettext' \ + 'glib' \ + 'mono' \ + 'llvm' \ + 'libxml2' \ + 'libxslt' \ + 'libyaml' + fi + ret=0 + ;; + *) + (( ret )) && _message 'no more arguments' + ;; + esac + ;; +esac + +return ret diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh new file mode 100644 index 00000000..ef934d54 --- /dev/null +++ b/plugins/rvm/rvm.plugin.zsh @@ -0,0 +1,3 @@ +fpath=($ZSH/plugins/rvm $fpath) +autoload -U compinit +compinit -i From 31ef6199675be846e473c20681da339b6ea864cd Mon Sep 17 00:00:00 2001 From: Jacob Atzen Date: Thu, 19 May 2011 16:20:30 +0200 Subject: [PATCH 19/39] Add autojump plugin --- plugins/autojump/autojump.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/autojump/autojump.plugin.zsh diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh new file mode 100644 index 00000000..da0a1276 --- /dev/null +++ b/plugins/autojump/autojump.plugin.zsh @@ -0,0 +1,3 @@ +if [ -f `brew --prefix`/etc/autojump ]; then + . `brew --prefix`/etc/autojump +fi From bde77af40d28ed7a308a843d8bcad556d8115f84 Mon Sep 17 00:00:00 2001 From: Jacob Atzen Date: Thu, 19 May 2011 16:33:29 +0200 Subject: [PATCH 20/39] TextMate automatically forks into the background --- plugins/textmate/textmate.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh index 7b73e275..7c4c14a5 100644 --- a/plugins/textmate/textmate.plugin.zsh +++ b/plugins/textmate/textmate.plugin.zsh @@ -1,9 +1,9 @@ # TextMate -alias et='mate . &' -alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' +alias et='mate .' +alias ett='mate app config lib db public spec test Rakefile Capfile Todo' +alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' +alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' # Editor Ruby file in TextMate alias mr='mate CHANGELOG app config db lib public script spec test' From 210c1ef86deed805b3c5b25833d4b128f758b610 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Jahner Date: Fri, 20 May 2011 15:14:10 +0200 Subject: [PATCH 21/39] Added 'simple' theme. --- themes/simple.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/simple.zsh-theme diff --git a/themes/simple.zsh-theme b/themes/simple.zsh-theme new file mode 100644 index 00000000..a88d9d72 --- /dev/null +++ b/themes/simple.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} ' + +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_DIRTY=" ✗" +ZSH_THEME_GIT_PROMPT_CLEAN=" ✔" From 093f9077f5b358803a810d65fb0d4729477905cf Mon Sep 17 00:00:00 2001 From: Oliver Braun Date: Fri, 20 May 2011 22:26:45 +0200 Subject: [PATCH 22/39] Added obraun theme which is a slightly modified version of an already existing theme. --- themes/obraun.zsh-theme | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 themes/obraun.zsh-theme diff --git a/themes/obraun.zsh-theme b/themes/obraun.zsh-theme new file mode 100644 index 00000000..08d13766 --- /dev/null +++ b/themes/obraun.zsh-theme @@ -0,0 +1,11 @@ +if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi + +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%{$fg[green]%}[%*]%{$reset_color%} %{$fg_no_bold[cyan]%}%n %{${fg_bold[blue]}%}::%{$reset_color%} %{$fg[yellow]%}%m%{$reset_color%} %{$fg_no_bold[magenta]%} ➜ %{$reset_color%} %{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' + +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" + From 1aacb74caf6800fe895ab3a40584c08bfded451e Mon Sep 17 00:00:00 2001 From: Guten Date: Sun, 22 May 2011 21:27:30 +0800 Subject: [PATCH 23/39] add custom completion support --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 3ea88e92..a3d276df 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,7 +1,7 @@ # Initializes Oh My Zsh # add a function path -fpath=($ZSH/functions $fpath) +fpath=($ZSH/functions $ZSH/completions $fpath) # Load all of the config files in ~/oh-my-zsh that end in .zsh # TIP: Add files you don't want in git to .gitignore From 5c1b341132119f08047a506e2c2b06fa0c0db52e Mon Sep 17 00:00:00 2001 From: Casey Watson Date: Tue, 24 May 2011 12:15:58 -0600 Subject: [PATCH 24/39] Fix to random theme selection - themes array is 1-based - theme files names are located in indicies 1 through N inclusive - this resolves an issue where you would occasionally see: "no such file or directory. Random theme '' loaded..." --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 3ea88e92..2a206798 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -31,7 +31,7 @@ if [ "$ZSH_THEME" = "random" ] then themes=($ZSH/themes/*zsh-theme) N=${#themes[@]} - ((N=RANDOM%N)) + ((N=(RANDOM%N)+1)) RANDOM_THEME=${themes[$N]} source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." From 21276546e9614576ce6e1a6be1393abce393d04f Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Wed, 23 Feb 2011 00:38:15 -0800 Subject: [PATCH 25/39] fishy theme: text indicators for $? and git status The git status indicators were taken from sorin.zsh-theme and changed to use ASCII symbols instead of Unicode ones because my preferred terminal font, DejaVu Sans Mono, renders Unicode symbols poorly and also because Unicode rendering is not available in standard Linux virtual terminals. --- themes/fishy.zsh-theme | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index f22eda86..f9e506ca 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -3,7 +3,18 @@ local user_color='green'; [ $UID -eq 0 ] && user_color='red' PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) ' PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)' -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" +RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX=" " +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" From f8aae64e478066be7d05f5eb6970c356cafcfd36 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Thu, 26 May 2011 12:34:37 -0500 Subject: [PATCH 26/39] Adding ability to override plugins from the custom directory. --- .gitignore | 1 + README.textile | 6 ++++-- custom/example/example.plugin.zsh | 2 ++ oh-my-zsh.sh | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 custom/example/example.plugin.zsh diff --git a/.gitignore b/.gitignore index 4b555067..8fdfae28 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ locals.zsh log/.zsh_history projects.zsh custom/* +!custom/example !custom/example.zsh cache diff --git a/README.textile b/README.textile index d01c3310..2dbfbe5a 100644 --- a/README.textile +++ b/README.textile @@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo h3. Customization If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. -If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin. +If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. +If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. + h3. Uninstalling @@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors. * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors -Thank you so much! \ No newline at end of file +Thank you so much! diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh new file mode 100644 index 00000000..406f2744 --- /dev/null +++ b/custom/example/example.plugin.zsh @@ -0,0 +1,2 @@ +# Add your own custom plugins in the custom/plugins directory. Plugins placed +# here will override ones with the same name in the main plugins directory. diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c8f1a33b..dbff1ced 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -17,7 +17,9 @@ compinit -i # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do - if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then + if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then + source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh + elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi done From 04573324d52aaadf947f3a80190e4f54d8580932 Mon Sep 17 00:00:00 2001 From: Martin Thurau Date: Fri, 27 May 2011 16:58:14 +0200 Subject: [PATCH 27/39] Added compatibility for the linux 'stat' command for the ant plugin --- plugins/ant/ant.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh index 0544ac92..23bc7756 100644 --- a/plugins/ant/ant.plugin.zsh +++ b/plugins/ant/ant.plugin.zsh @@ -1,8 +1,15 @@ +stat -f%m . > /dev/null 2>&1 +if [ "$?" = 0 ]; then + stat_cmd=(stat -f%m) +else + stat_cmd=(stat -L --format=%y) +fi + _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) + accurate=$($stat_cmd -f%m .ant_targets) + changed=$($stat_cmd -f%m build.xml) return $(expr $accurate '>=' $changed) fi } From 3e433165502a01028fcd0368161a2193eaeb386c Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 10:16:06 -0400 Subject: [PATCH 28/39] Ruby Switching Helpers Add helper functions to switch gemsets on ruby-1.8.7-p334 and ruby-1.9.2-p180. Add completion definitions for helper functions. --- plugins/rvm/rvm.plugin.zsh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index ef934d54..27412383 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -1,3 +1,28 @@ fpath=($ZSH/plugins/rvm $fpath) autoload -U compinit compinit -i + +local ruby18='ruby-1.8.7-p334' +local ruby19='ruby-1.9.2-p180' + +function rb18 { + if [ -z "$1" ]; then + rvm use "$ruby18" + else + rvm use "$ruby18@$1" + fi +} + +_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`} +compdef _rb18 rb18 + +function rb19 { + if [ -z "$1" ]; then + rvm use "$ruby19" + else + rvm use "$ruby19@$1" + fi +} + +_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} +compdef _rb19 rb19 From e703c9591c64cd23bb0f0e1a892fbed0efe74fa7 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 10:23:06 -0400 Subject: [PATCH 29/39] Helpful Listing Aliases Add alias to list installed rubies. Add alias to list gemsets in active ruby. --- plugins/rvm/rvm.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 27412383..ba780c97 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -2,6 +2,9 @@ fpath=($ZSH/plugins/rvm $fpath) autoload -U compinit compinit -i +alias rubies='rvm list rubies' +alias gemsets='rvm gemset list' + local ruby18='ruby-1.8.7-p334' local ruby19='ruby-1.9.2-p180' From 9f34bbedc8d4843b0ed50f76d38b63e5aa48cc8b Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 10:35:54 -0400 Subject: [PATCH 30/39] RVM Update Helpers Add helper function to get rvm head. Add helper function to link zsh completion that comes with rvm into om-my-zsh plugin directory, but don't overwrite the completion that comes with oh-my-zsh (oh-my-zsh's completion is better, but I want to be able to compare). --- plugins/rvm/rvm.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index ba780c97..509dcbd9 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -29,3 +29,12 @@ function rb19 { _rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`} compdef _rb19 rb19 + +function rvm-update { + rvm get head + rvm reload # TODO: Reload rvm completion? +} + +function rvm-link-completion { + ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official" +} From 572b27b75724d00fbc99ef64de3dbd21a28c8194 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 10:50:06 -0400 Subject: [PATCH 31/39] Gem List Helper Add helper function to list gems in a pretty way (only with rvm, for now). Add missng EOF newline and a todo to the ruby plugin. --- plugins/ruby/ruby.plugin.zsh | 4 +++- plugins/rvm/rvm.plugin.zsh | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh index 82bf5d49..08ca9c60 100644 --- a/plugins/ruby/ruby.plugin.zsh +++ b/plugins/ruby/ruby.plugin.zsh @@ -1,4 +1,6 @@ +# TODO: Make this compatible with rvm. +# Run sudo gem on the system ruby, not the active ruby. alias sgem='sudo gem' # Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' \ No newline at end of file +alias rfind='find . -name *.rb | xargs grep -n' diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 509dcbd9..8a3ec788 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -38,3 +38,15 @@ function rvm-update { function rvm-link-completion { ln -s "$rvm_path/scripts/zsh/Completion/_rvm" "$ZSH/plugins/rvm/_rvm.official" } + +# TODO: Make this usable w/o rvm. +function gems { + local current_ruby=`rvm-prompt i v p` + local current_gemset=`rvm-prompt g` + + gem list $@ | sed \ + -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \ + -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ + -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" +} From e263f1f0057f6cac15ef588c681e6f49713c3975 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 10:57:48 -0400 Subject: [PATCH 32/39] Brew Plugin Merge completion with official brew completion. Add a helper to link official completion into oh-my-zsh plugin (without overwriting). Add an alias to list installed brews. Add brews to the path (in a somewhat strange way). --- plugins/brew/_brew | 24 +++++++++++++++++------- plugins/brew/brew.plugin.zsh | 13 +++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 plugins/brew/brew.plugin.zsh diff --git a/plugins/brew/_brew b/plugins/brew/_brew index cee1e25f..1dcf0a4b 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -25,10 +25,12 @@ _1st_arguments=( 'link:link a formula' 'list:list files in a formula or not-installed formulae' 'log:git commit log for a formula' + 'missing:check all installed formuale for missing dependencies.' 'outdated:list formulas for which a newer version is available' 'prune:remove dead links' 'remove:remove a formula' 'search:search for a formula (/regex/ or string)' + 'server:start a local web app that lets you browse formulae (requires Sinatra)' 'unlink:unlink a formula' 'update:freshen up links' 'upgrade:upgrade outdated formulae' @@ -36,10 +38,14 @@ _1st_arguments=( ) local expl -local -a formula installed_formulae +local -a formulae installed_formulae _arguments \ - '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '(-v)-v[verbose]' \ + '(--cellar)--cellar[brew cellar]' \ + '(--config)--config[brew configuration]' \ + '(--env)--env[brew environment]' \ + '(--repository)--repository[brew repository]' \ '(--version)--version[version information]' \ '(--prefix)--prefix[where brew lives on this system]' \ '(--cache)--cache[brew cache]' \ @@ -51,20 +57,24 @@ if (( CURRENT == 1 )); then fi case "$words[1]" in - list) + search|-S) + _arguments \ + '(--macports)--macports[search the macports repository]' \ + '(--fink)--fink[search the fink repository]' ;; + list|ls) _arguments \ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ + '(--versions)--versions[list all installed versions of a formula]' \ '1: :->forms' && return 0 if [[ "$state" == forms ]]; then _brew_installed_formulae - _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae + _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae fi ;; - install|home|log|info|uses|cat|deps) + install|home|homepage|log|info|abv|uses|cat|deps|edit|options) _brew_all_formulae _wanted formulae expl 'all formulae' compadd -a formulae ;; - remove|edit|xo) + remove|rm|uninstall|unlink|cleanup|link|ln) _brew_installed_formulae _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;; esac - diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh new file mode 100644 index 00000000..f584a468 --- /dev/null +++ b/plugins/brew/brew.plugin.zsh @@ -0,0 +1,13 @@ +# Move /usr/local/bin (path where brews are linked) to the front of the path +# This will allow us to override system binaries like ruby with our brews +# TODO: Do this in a more compatible way. +# What if someone doesn't have /usr/bin in their path? +export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'` # Add it in front of /usr/bin +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'` # Add /usr/local/sbin + +alias brews='brew list -1' + +function brew-link-completion { + ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official" +} From befb02e3da0573fa788114e1c18c70b75f787f1f Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 11:09:37 -0400 Subject: [PATCH 33/39] Pow! Restart Helper Add helper function to restart an app running on Pow! --- plugins/pow/pow.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/pow/pow.plugin.zsh diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh new file mode 100644 index 00000000..6b2a6f2b --- /dev/null +++ b/plugins/pow/pow.plugin.zsh @@ -0,0 +1,10 @@ +# Thanks to Christopher Sexton +# https://gist.github.com/965032 +function kapow { + touch ~/.pow/$1/tmp/restart.txt + if [ $? -eq 0 ]; then + echo "$fg[yellow]Pow restarting $1...$reset_color" + fi +} + +compctl -W ~/.pow -/ kapow From d72b9c5ec5d55765998bb301b3425fbe84012c1f Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 11:20:48 -0400 Subject: [PATCH 34/39] Node.js Helpers Add helper function to open node api in browser. Add binaries installed via npm to path. Tell node where to find things (what things?). --- plugins/node/node.plugin.zsh | 8 ++++++++ plugins/npm/npm.plugin.zsh | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 plugins/node/node.plugin.zsh create mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh new file mode 100644 index 00000000..18f35333 --- /dev/null +++ b/plugins/node/node.plugin.zsh @@ -0,0 +1,8 @@ +# This works if you installed node via homebrew. +export NODE_PATH="/usr/local/lib/node" + +# Open the node api for your current version to the optional section. +# TODO: Make the section part easier to use. +function node-api { + open "http://nodejs.org/docs/$(node --version)/api/all.html#$1" +} diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh new file mode 100644 index 00000000..0b0a30e1 --- /dev/null +++ b/plugins/npm/npm.plugin.zsh @@ -0,0 +1,2 @@ +# TODO: Don't do this in such a weird way. +export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'` From 18293cd724224282d6ca473fcbe6e7439d3eac0c Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 11:27:50 -0400 Subject: [PATCH 35/39] OS X Helpers Add helper aliases for show/hide files. Add helper alias to recursively delete .DS_Store files. --- plugins/osx/osx.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 81eed5e9..a65ca642 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -1,3 +1,9 @@ +alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder' +alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder' + +# Recursively delete .DS_Store files +alias rm-dsstore="find . -name '*.DS_Store' -type f -delete" + function savepath() { pwd > ~/.current_path~ } From 18ab94bccd3cfe64f81ab2ea0e09ce4a630a21bc Mon Sep 17 00:00:00 2001 From: brian tse Date: Sat, 28 May 2011 23:57:32 +0800 Subject: [PATCH 36/39] Add new 'minimal' theme --- themes/minimal.zsh-theme | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 themes/minimal.zsh-theme diff --git a/themes/minimal.zsh-theme b/themes/minimal.zsh-theme new file mode 100644 index 00000000..ee3ab6b2 --- /dev/null +++ b/themes/minimal.zsh-theme @@ -0,0 +1,15 @@ +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +#Customized git status, oh-my-zsh currently does not allow render dirty status before branch +git_custom_status() { + local cb=$(current_branch) + if [ -n "$cb" ]; then + echo "- $ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} + + +PROMPT='%2~ $(git_custom_status) »%b ' \ No newline at end of file From ace84c8b7eb8b50842798bac9811d02928f58dd3 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 13:06:03 -0400 Subject: [PATCH 37/39] Cleanup Add missing newlines at EOF. Remove redundant comment. Fix grammar in comment. --- plugins/cap/cap.plugin.zsh | 2 +- plugins/compleat/compleat.plugin.zsh | 2 -- plugins/github/github.plugin.zsh | 1 - plugins/textmate/textmate.plugin.zsh | 4 +--- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh index a0fa21d0..8336182d 100644 --- a/plugins/cap/cap.plugin.zsh +++ b/plugins/cap/cap.plugin.zsh @@ -18,4 +18,4 @@ function _cap () { fi } -compctl -K _cap cap \ No newline at end of file +compctl -K _cap cap diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh index 8d16a568..38f1b396 100644 --- a/plugins/compleat/compleat.plugin.zsh +++ b/plugins/compleat/compleat.plugin.zsh @@ -5,7 +5,6 @@ # VERSION: 1.0.0 # ------------------------------------------------------------------------------ - if (( ${+commands[compleat]} )); then local prefix="${commands[compleat]:h:h}" local setup="${prefix}/share/compleat-1.0/compleat_setup" @@ -19,4 +18,3 @@ if (( ${+commands[compleat]} )); then source "$setup" fi fi - diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index df7053ba..1eb33811 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -4,4 +4,3 @@ if [ "$commands[(I)hub]" ]; then # eval `hub alias -s zsh` function git(){hub "$@"} fi - diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh index 7c4c14a5..aa2f75f4 100644 --- a/plugins/textmate/textmate.plugin.zsh +++ b/plugins/textmate/textmate.plugin.zsh @@ -1,11 +1,9 @@ - -# TextMate alias et='mate .' alias ett='mate app config lib db public spec test Rakefile Capfile Todo' alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo' alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo' -# Editor Ruby file in TextMate +# Edit Ruby app in TextMate alias mr='mate CHANGELOG app config db lib public script spec test' function tm() { From 18bfb14a2f774b115c8634cdaa3864cbdee91a94 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sat, 28 May 2011 13:12:03 -0400 Subject: [PATCH 38/39] Thor Add plugin with completion for thor. --- plugins/thor/_thor | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/thor/_thor diff --git a/plugins/thor/_thor b/plugins/thor/_thor new file mode 100644 index 00000000..9f7ed5ae --- /dev/null +++ b/plugins/thor/_thor @@ -0,0 +1,4 @@ +#compdef thor +#autoload + +compadd `thor list | grep thor | cut -d " " -f 2` From 205e2f4842d1d1808b0d8d16bcfd1daeadb111d9 Mon Sep 17 00:00:00 2001 From: Magnus Woldrich Date: Sun, 29 May 2011 11:55:24 +0200 Subject: [PATCH 39/39] add trapd00r theme --- themes/trapd00r.zsh-theme | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 themes/trapd00r.zsh-theme diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme new file mode 100644 index 00000000..cba14c42 --- /dev/null +++ b/themes/trapd00r.zsh-theme @@ -0,0 +1,95 @@ +# Name: trapd00r zsh theme +# Author: Magnus Woldrich +# +# This theme needs a terminal supporting 256 colors as well as unicode. It also +# needs the script that splits up the current path and makes it fancy as located +# here: https://github.com/trapd00r/utils/blob/master/zsh_path +# +# By default it spans over two lines like so: +# +# scp1@shiva:pts/9-> /home » scp1 (0) +# > +# +# that's user@host:pts/-> splitted path (return status) +# +# If the current directory is a git repository, we span 3 lines; +# +# git❨ master ❩ DIRTY +# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) +# > + +autoload -U add-zsh-hook +autoload -Uz vcs_info + +local c0=$( printf "\e[m") +local c1=$( printf "\e[38;5;245m") +local c2=$( printf "\e[38;5;250m") +local c3=$( printf "\e[38;5;242m") +local c4=$( printf "\e[38;5;197m") +local c5=$( printf "\e[38;5;225m") +local c6=$( printf "\e[38;5;240m") +local c7=$( printf "\e[38;5;242m") +local c8=$( printf "\e[38;5;244m") +local c9=$( printf "\e[38;5;162m") +local c10=$(printf "\e[1m") +local c11=$(printf "\e[38;5;208m\e[1m") +local c12=$(printf "\e[38;5;142m\e[1m") +local c13=$(printf "\e[38;5;196m\e[1m") + + +# We dont want to use the extended colorset in the TTY / VC. +if [ "$TERM" = "linux" ]; then + c1=$( printf "\e[34;1m") + c2=$( printf "\e[35m") + c3=$( printf "\e[31m") + c4=$( printf "\e[31;1m") + c5=$( printf "\e[32m") + c6=$( printf "\e[32;1m") + c7=$( printf "\e[33m") + c8=$( printf "\e[33;1m") + c9=$( printf "\e[34m") + + c11=$(printf "\e[35;1m") + c12=$(printf "\e[36m") + c13=$(printf "\e[31;1m") +fi + +zstyle ':vcs_info:*' actionformats \ + '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' + +zstyle ':vcs_info:*' formats \ + "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " + +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' +zstyle ':vcs_info:*' enable git + +add-zsh-hook precmd prompt_jnrowe_precmd + +prompt_jnrowe_precmd () { + vcs_info + if [ "${vcs_info_msg_0_}" = "" ]; then + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} +> ' + +# modified, to be commited + elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} +> ' + + elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} +%{$c13%}>%{$c0%} ' + else + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='${vcs_info_msg_0_} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} +> ' +fi +} + +# vim: set ft=zsh sw=2 et tw=0: