From c24936ece51940536f3e62fc9e458b74c2affe68 Mon Sep 17 00:00:00 2001 From: steeef Date: Thu, 30 Sep 2010 19:56:56 -0700 Subject: [PATCH 001/137] 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 002/137] 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 003/137] 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 004/137] 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 005/137] 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 006/137] 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 007/137] 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 008/137] 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 8b4858b6646ef2ce1bf4ab33ba94db33a95559b4 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Sat, 9 Oct 2010 16:52:53 -0700 Subject: [PATCH 009/137] themes: philips customize git/ls for developers - Customize LS_COLORS for developers working on C code bases like the Kernel. - Add a * to the dirty prompt. Missed this accidently. Oops. Signed-off-by: Brandon Philips --- themes/philips.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme index fa7c5903..c7952559 100644 --- a/themes/philips.zsh-theme +++ b/themes/philips.zsh-theme @@ -7,8 +7,8 @@ RPROMPT='[%*]' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B" ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}" +ZSH_THEME_GIT_PROMPT_DIRTY="*" # LS colors, made with http://geoff.greer.fm/lscolors/ export LSCOLORS="Gxfxcxdxbxegedabagacad" -export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' From 4e433eb6bb578c864116cbcf0aa201227f80e4aa Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Fri, 15 Oct 2010 11:05:47 +0200 Subject: [PATCH 010/137] 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 011/137] 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 012/137] 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 013/137] 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 014/137] 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 015/137] 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 016/137] 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 017/137] 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 1a673fc1d582463c17168557b95fe6a55e0757e5 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 1 Dec 2010 18:07:28 +0100 Subject: [PATCH 018/137] Don't export oh-my-zsh configuration paramaters to the environment These variables are only used by oh-my-zsh, so there's no need to populate the environment of all children with them. --- templates/zshrc.zsh-template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 8022b350..69cbbb0f 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,18 +1,18 @@ # Path to your oh-my-zsh configuration. -export ZSH=$HOME/.oh-my-zsh +ZSH=$HOME/.oh-my-zsh # Set to the name theme to load. # Look in ~/.oh-my-zsh/themes/ -export ZSH_THEME="robbyrussell" +ZSH_THEME="robbyrussell" # Set to this to use case-sensitive completion -# export CASE_SENSITIVE="true" +# CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# export DISABLE_AUTO_UPDATE="true" +# DISABLE_AUTO_UPDATE="true" # Uncomment following line if you want to disable colors in ls -# export DISABLE_LS_COLORS="true" +# DISABLE_LS_COLORS="true" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) From 06472515e137df32ad2f898962a3ca05c24ad8d0 Mon Sep 17 00:00:00 2001 From: Jarin Udom Date: Mon, 20 Dec 2010 13:51:29 -0800 Subject: [PATCH 019/137] Add superjarin theme that shows current Ruby version via RVM --- themes/superjarin.zsh-theme | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 themes/superjarin.zsh-theme diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme new file mode 100644 index 00000000..16eeb531 --- /dev/null +++ b/themes/superjarin.zsh-theme @@ -0,0 +1,18 @@ +# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] +JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" + +# Grab the current filepath, use shortcuts: ~/Desktop +# Append the current git branch, if in a git repository +JARIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + +# Do nothing if the branch is clean (no changes). +ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}>" + +# Add a yellow ✗ if the branch is dirty +ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}> %{$fg[yellow]%}✗" + +# Put it all together! +PROMPT="$JARIN_CURRENT_RUBY_ $JARIN_CURRENT_LOCA_ " + From fcc7801435fd2c5c6defcfbfc736e22341500a9d Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Mon, 24 Jan 2011 15:49:49 +0100 Subject: [PATCH 020/137] 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 021/137] 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 4facba9824b7c3d0115c5f66e5b1517bd5674027 Mon Sep 17 00:00:00 2001 From: Joakim Ekberg Date: Thu, 17 Mar 2011 22:29:58 +0100 Subject: [PATCH 022/137] Added terminal party theme. --- themes/terminalparty.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 themes/terminalparty.zsh-theme diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme new file mode 100644 index 00000000..73653aca --- /dev/null +++ b/themes/terminalparty.zsh-theme @@ -0,0 +1,9 @@ +PROMPT='%{$fg[green]%} %% ' +# RPS1='%{$fg[blue]%}%~%{$reset_color%} ' +RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[yellow]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}" + From d5ce689a0c10f71967dcc163cd66ef9bd2778416 Mon Sep 17 00:00:00 2001 From: Daniel Wehner Date: Sat, 26 Mar 2011 15:06:30 +0100 Subject: [PATCH 023/137] Add a plugin to support kate the kde texteditor --- plugins/kate/kate.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/kate/kate.plugin.zsh diff --git a/plugins/kate/kate.plugin.zsh b/plugins/kate/kate.plugin.zsh new file mode 100644 index 00000000..eb16522a --- /dev/null +++ b/plugins/kate/kate.plugin.zsh @@ -0,0 +1,9 @@ + +# Kate +# Start kate always silent +alias kate='kate >/dev/null 2>&1' + +function kt () { + cd $1 + kate $1 +} \ No newline at end of file From c7c959de60add8371e08926d642b2bbb7406ce84 Mon Sep 17 00:00:00 2001 From: Arthur Kalmenson Date: Tue, 19 Apr 2011 19:01:18 -0400 Subject: [PATCH 024/137] Make the delete key work correctly, instead of outputting a ~ --- lib/key-bindings.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 7196a88f..e12d8010 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -22,6 +22,10 @@ bindkey ' ' magic-space # also do history expansion on space bindkey '^[[Z' reverse-menu-complete +# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ +bindkey "^[[3~" delete-char +bindkey "^[3;5~" delete-char + # consider emacs keybindings: #bindkey -e ## emacs key bindings From 7d9628b2dcccb5627c59380de331e3c906c8164d Mon Sep 17 00:00:00 2001 From: Arthur Kalmenson Date: Tue, 19 Apr 2011 22:40:46 -0400 Subject: [PATCH 025/137] Added bindings for Gnome terminal. --- lib/key-bindings.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index e12d8010..a7d5095e 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -25,6 +25,7 @@ bindkey '^[[Z' reverse-menu-complete # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char +bindkey "\e[3~" delete-char # consider emacs keybindings: From 34f1944016a7671fe47aca99f18f25d19f6ff5dc Mon Sep 17 00:00:00 2001 From: Alexander Rinass Date: Wed, 20 Apr 2011 15:54:51 +0200 Subject: [PATCH 026/137] Added start/stop aliases for Apache 2 installation via macports. --- plugins/apache2-macports/apache2-macports.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/apache2-macports/apache2-macports.plugin.zsh diff --git a/plugins/apache2-macports/apache2-macports.plugin.zsh b/plugins/apache2-macports/apache2-macports.plugin.zsh new file mode 100644 index 00000000..1caa4cf9 --- /dev/null +++ b/plugins/apache2-macports/apache2-macports.plugin.zsh @@ -0,0 +1,6 @@ +# commands to control local apache2 server installation +# paths are for osx installation via macports + +alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start' +alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop' +alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart' From 5f103c750891b926aab9f24f896853ea2a0493d5 Mon Sep 17 00:00:00 2001 From: Luke Randall Date: Wed, 13 Oct 2010 16:54:12 +0200 Subject: [PATCH 027/137] Add fine-grained git prompt status to lukerandall.zsh-theme --- themes/lukerandall.zsh-theme | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/themes/lukerandall.zsh-theme b/themes/lukerandall.zsh-theme index 24a0612b..f4045bd8 100644 --- a/themes/lukerandall.zsh-theme +++ b/themes/lukerandall.zsh-theme @@ -3,8 +3,22 @@ local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B»%b ' +function my_git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + GIT_STATUS=$(git_prompt_status) + [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS" + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +PROMPT='%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%B»%b ' RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" +ZSH_THEME_GIT_PROMPT_ADDED="+" +ZSH_THEME_GIT_PROMPT_MODIFIED="*" +ZSH_THEME_GIT_PROMPT_RENAMED="~" +ZSH_THEME_GIT_PROMPT_DELETED="!" +ZSH_THEME_GIT_PROMPT_UNMERGED="?" + From e1210cdfaab6baba2eeb62599fea832ea446af85 Mon Sep 17 00:00:00 2001 From: Jonas Huckestein Date: Tue, 3 May 2011 14:07:35 -0700 Subject: [PATCH 028/137] added my theme --- themes/jispwoso.zsh-theme | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 themes/jispwoso.zsh-theme diff --git a/themes/jispwoso.zsh-theme b/themes/jispwoso.zsh-theme new file mode 100644 index 00000000..cdfef387 --- /dev/null +++ b/themes/jispwoso.zsh-theme @@ -0,0 +1,4 @@ +PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} +%{$fg_bold[red]%}➜ %{$reset_color%} ' + +PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" From bd1a78ae34cc3ce81a7b858f459ad0ad8da2cf62 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 5 May 2011 18:41:05 -0400 Subject: [PATCH 029/137] Added Compleat - Completion for Human Beings plugin. --- plugins/compleat/compleat.plugin.zsh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugins/compleat/compleat.plugin.zsh diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh new file mode 100644 index 00000000..8d16a568 --- /dev/null +++ b/plugins/compleat/compleat.plugin.zsh @@ -0,0 +1,22 @@ +# ------------------------------------------------------------------------------ +# FILE: compleat.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) +# VERSION: 1.0.0 +# ------------------------------------------------------------------------------ + + +if (( ${+commands[compleat]} )); then + local prefix="${commands[compleat]:h:h}" + local setup="${prefix}/share/compleat-1.0/compleat_setup" + + if [[ -f "$setup" ]]; then + if ! bashcompinit >/dev/null 2>&1; then + autoload -U bashcompinit + bashcompinit -i + fi + + source "$setup" + fi +fi + From e129fc5a285ccc8ff3c6ae9770908a0b5c2836e7 Mon Sep 17 00:00:00 2001 From: "Juan G. Hurtado" Date: Mon, 9 May 2011 13:32:42 +0200 Subject: [PATCH 030/137] Adds support for $(current_branch) on git_parse_ahead() Changes method git_parse_ahead() on git.zsh lib file. Before this change it checked directly against origin/master branch. Now it uses $(current_branch) to check for not pushed changes against the current remote branch. --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index e96f075b..2ace3d0e 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -15,7 +15,7 @@ parse_git_dirty() { # Checks if there are commits ahead from remote function git_prompt_ahead() { - if $(echo "$(git log origin/master..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } From 5440815c8303e715f04da48fb85e5d05400afb7d Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Mon, 9 May 2011 10:19:10 -0400 Subject: [PATCH 031/137] remove git status from prompt --- themes/jtriley.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/jtriley.zsh-theme b/themes/jtriley.zsh-theme index ec62a220..15d77ed2 100644 --- a/themes/jtriley.zsh-theme +++ b/themes/jtriley.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[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d -%{$fg_bold[yellow]%}%% $(git_prompt_info)%{$reset_color%}" +%{$fg_bold[yellow]%}%% %{$reset_color%}" #ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" #ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" From 31ef6199675be846e473c20681da339b6ea864cd Mon Sep 17 00:00:00 2001 From: Jacob Atzen Date: Thu, 19 May 2011 16:20:30 +0200 Subject: [PATCH 032/137] 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 033/137] 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 034/137] 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 035/137] 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 036/137] 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 037/137] 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 f78218f625846afe2b6a487d18b0d7c65daa4edf Mon Sep 17 00:00:00 2001 From: Pete Clark Date: Tue, 24 May 2011 15:25:18 -0400 Subject: [PATCH 038/137] Adds compl .swp caches to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4b555067..ecb8e46b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ projects.zsh custom/* !custom/example.zsh cache +*.swp From 5da609e2c96c100c3c862e83f96e618d693c934f Mon Sep 17 00:00:00 2001 From: Pete Clark Date: Tue, 24 May 2011 15:28:42 -0400 Subject: [PATCH 039/137] Adds the _task script included with TaskWarrior On my Ubuntu system this file was found in /usr/share/doc/task/scripts/zsh/_task.gz --- plugins/taskwarrior/_task | 280 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 plugins/taskwarrior/_task diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task new file mode 100644 index 00000000..5bffa911 --- /dev/null +++ b/plugins/taskwarrior/_task @@ -0,0 +1,280 @@ +#compdef task +# +# zsh completion for taskwarrior +# +# Copyright 2010 - 2011 Johannes Schlatow +# Copyright 2009 P.C. Shyamshankar +# All rights reserved. +# +# This script is part of the taskwarrior project. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the +# +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, +# Boston, MA +# 02110-1301 +# USA +# +typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers +_task_projects=($(task _projects)) +_task_tags=($(task _tags)) +_task_ids=($(task _ids)) +_task_config=($(task _config)) +_task_modifiers=( + 'before' \ + 'after' \ + 'none' \ + 'any' \ + 'is' \ + 'isnt' \ + 'has' \ + 'hasnt' \ + 'startswith' \ + 'endswith' \ + 'word' \ + 'noword' +) +_task_cmds=($(task _commands)) +_task_zshcmds=( ${(f)"$(task _zshcommands)"} ) + + +_task_idCmds=( + 'append' \ + 'prepend' \ + 'annotate' \ + 'denotate' \ + 'edit' \ + 'duplicate' \ + 'info' \ + 'start' \ + 'stop' \ + 'done' +) + +_task_idCmdsDesc=( + 'append:Appends more description to an existing task.' \ + 'prepend:Prepends more description to an existing task.' \ + 'annotate:Adds an annotation to an existing task.' \ + 'denotate:Deletes an annotation of an existing task.' \ + 'edit:Launches an editor to let you modify a task directly.' \ + 'duplicate:Duplicates the specified task, and allows modifications.' \ + 'info:Shows all data, metadata for specified task.' \ + 'start:Marks specified task as started.' \ + 'stop:Removes the start time from a task.' \ + 'done:Marks the specified task as completed.' +) + +_task() { + _arguments -s -S \ + "*::task command:_task_commands" + return 0 +} + +local -a reply args word +word=$'[^\0]#\0' + +# priorities +local -a task_priorities +_regex_words values 'task priorities' \ + 'H:High' \ + 'M:Middle' \ + 'L:Low' +task_priorities=("$reply[@]") + +# projects +local -a task_projects +task_projects=( + /"$word"/ + ":values:task projects:compadd -a _task_projects" +) + +local -a _task_dates +_regex_words values 'task dates' \ + 'tod*ay:Today' \ + 'yes*terday:Yesterday' \ + 'tom*orrow:Tomorrow' \ + 'sow:Start of week' \ + 'soww:Start of work week' \ + 'socw:Start of calendar week' \ + 'som:Start of month' \ + 'soy:Start of year' \ + 'eow:End of week' \ + 'eoww:End of work week' \ + 'eocw:End of calendar week' \ + 'eom:End of month' \ + 'eoy:End of year' \ + 'mon:Monday' \ + 'tue:Tuesday'\ + 'wed:Wednesday' \ + 'thu:Thursday' \ + 'fri:Friday' \ + 'sat:Saturday' \ + 'sun:Sunday' +_task_dates=("$reply[@]") + +local -a _task_reldates +_regex_words values 'task reldates' \ + 'hrs:n hours' \ + 'day:n days' \ + '1st:first' \ + '2nd:second' \ + '3rd:third' \ + 'th:4th, 5th, etc.' \ + 'wks:weeks' +_task_reldates=("$reply[@]") + +task_dates=( + \( "$_task_dates[@]" \| + \( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \) + \) +) + +_regex_words values 'task frequencies' \ + 'daily:Every day' \ + 'day:Every day' \ + 'weekdays:Every day skipping weekend days' \ + 'weekly:Every week' \ + 'biweekly:Every two weeks' \ + 'fortnight:Every two weeks' \ + 'quarterly:Every three months' \ + 'semiannual:Every six months' \ + 'annual:Every year' \ + 'yearly:Every year' \ + 'biannual:Every two years' \ + 'biyearly:Every two years' +_task_freqs=("$reply[@]") + +local -a _task_frequencies +_regex_words values 'task frequencies' \ + 'd:days' \ + 'w:weeks' \ + 'q:quarters' \ + 'y:years' +_task_frequencies=("$reply[@]") + +task_freqs=( + \( "$_task_freqs[@]" \| + \( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \) + \) +) + +# attributes +local -a task_attributes +_regex_words -t ':' default 'task attributes' \ + 'pro*ject:Project name:$task_projects' \ + 'du*e:Due date:$task_dates' \ + 'wa*it:Date until task becomes pending:$task_dates' \ + 're*cur:Recurrence frequency:$task_freqs' \ + 'pri*ority:priority:$task_priorities' \ + 'un*til:Recurrence end date:$task_dates' \ + 'fg:Foreground color' \ + 'bg:Background color' \ + 'li*mit:Desired number of rows in report' +task_attributes=("$reply[@]") + +args=( + \( "$task_attributes[@]" \| + \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \| + \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \| + \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \| + \( /"$word"/ \) + \) \# +) +_regex_arguments _task_attributes "${args[@]}" + +## task commands + +# default completion +(( $+functions[_task_default] )) || +_task_default() { + _task_attributes "$@" +} + +# commands expecting an ID +(( $+functions[_task_id] )) || +_task_id() { + if (( CURRENT < 3 )); then + # update IDs + _task_zshids=( ${(f)"$(task _zshids)"} ) + _describe -t values 'task IDs' _task_zshids + else + _task_attributes "$@" + fi +} + +# merge completion +(( $+functions[_task_merge] )) || +_task_merge() { + # TODO match URIs in .taskrc + _files +} + +# push completion +(( $+functions[_task_push] )) || +_task_push() { + # TODO match URIs in .taskrc + _files +} + +# pull completion +(( $+functions[_task_pull] )) || +_task_pull() { + # TODO match URIs in .taskrc + _files +} + + +# modify (task [0-9]* ...) completion +(( $+functions[_task_modify] )) || +_task_modify() { + _describe -t commands 'task command' _task_idCmdsDesc + _task_attributes "$@" +} + +## first level completion => task sub-command completion +(( $+functions[_task_commands] )) || +_task_commands() { + local cmd ret=1 + if (( CURRENT == 1 )); then + # update IDs + _task_zshids=( ${(f)"$(task _zshids)"} ) + + _describe -t commands 'task command' _task_zshcmds + _describe -t values 'task IDs' _task_zshids + # TODO match more than one ID + elif [[ $words[1] =~ ^[0-9]*$ ]] then + _call_function ret _task_modify + return ret + else +# local curcontext="${curcontext}" +# cmd="${_task_cmds[(r)$words[1]:*]%%:*}" + cmd="${_task_cmds[(r)$words[1]]}" + idCmd="${(M)_task_idCmds[@]:#$words[1]}" + if (( $#cmd )); then +# curcontext="${curcontext%:*:*}:task-${cmd}" + + if (( $#idCmd )); then + _call_function ret _task_id + else + _call_function ret _task_${cmd} || + _call_function ret _task_default || + _message "No command remaining." + fi + else + _message "Unknown subcommand ${cmd}" + fi + return ret + fi +} From 1e86678f9d3c8c979ff8d3c8b5aac19e9e611441 Mon Sep 17 00:00:00 2001 From: Pete Clark Date: Tue, 24 May 2011 15:29:05 -0400 Subject: [PATCH 040/137] Adds oh-my-zsh plugin to load TaskWarrior completions --- plugins/taskwarrior/taskwarrior.plugin.zsh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/taskwarrior/taskwarrior.plugin.zsh diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh new file mode 100644 index 00000000..c1830042 --- /dev/null +++ b/plugins/taskwarrior/taskwarrior.plugin.zsh @@ -0,0 +1,21 @@ +################################################################################ +# Author: Pete Clark +# Email: pete[dot]clark[at]gmail[dot]com +# Version: 0.1 (05/24/2011) +# License: WTFPL +# +# This oh-my-zsh plugin adds smart tab completion for +# TaskWarrior. It uses the zsh tab completion +# script (_task) distributed with TaskWarrior for the completion definitions. +# +# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] +# gives a list of available modifications for that task, etc. +################################################################################ + +zstyle ':completion:*:*:task:*' verbose yes +zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u' + +zstyle ':completion:*:*:task:*' group-name '' + +alias t=task +compdef _task t=task From 21276546e9614576ce6e1a6be1393abce393d04f Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Wed, 23 Feb 2011 00:38:15 -0800 Subject: [PATCH 041/137] 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 042/137] 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 1816e957770f8e3f0ad22658f741c5f0492da982 Mon Sep 17 00:00:00 2001 From: alanpeabody Date: Thu, 26 May 2011 23:56:45 -0400 Subject: [PATCH 043/137] Added my own theme. --- themes/alanpeabody.zsh-theme | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/alanpeabody.zsh-theme diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme new file mode 100644 index 00000000..1f66f1ec --- /dev/null +++ b/themes/alanpeabody.zsh-theme @@ -0,0 +1,22 @@ + +local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}' +local pwd='%{$fg[blue]%}%~%{$reset_color%}' +local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' +local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" + +PROMPT="${user} ${pwd}$ " +RPROMPT="${return_code} ${git_branch} ${rvm}" + From 04573324d52aaadf947f3a80190e4f54d8580932 Mon Sep 17 00:00:00 2001 From: Martin Thurau Date: Fri, 27 May 2011 16:58:14 +0200 Subject: [PATCH 044/137] 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 045/137] 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 046/137] 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 047/137] 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 048/137] 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 049/137] 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 050/137] 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 051/137] 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 052/137] 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 053/137] 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 054/137] 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 055/137] 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 056/137] 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: From 1c2eb40e876db3d2bfad22a0b52f0d410e1d51f3 Mon Sep 17 00:00:00 2001 From: nebirhos Date: Thu, 26 May 2011 20:00:23 +0200 Subject: [PATCH 057/137] Added nebirhos theme --- themes/nebirhos.zsh-theme | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 themes/nebirhos.zsh-theme diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme new file mode 100644 index 00000000..c49df972 --- /dev/null +++ b/themes/nebirhos.zsh-theme @@ -0,0 +1,17 @@ +# Based on robbyrussell's theme, with host and rvm indicators. Example: +# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) + +# Get the current ruby version in use with RVM: +if [ -e ~/.rvm/bin/rvm-prompt ]; then + RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " +fi + +# Get the host name (first 4 chars) +HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c " +GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}" +PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT" + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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 1e3b441ce7e0b8706867801c1e5e7ca6760ff17e Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Mon, 30 May 2011 10:07:15 -0400 Subject: [PATCH 058/137] Rollback of Pull #366 sorin-ionescu had some good points. --- plugins/brew/brew.plugin.zsh | 12 ------------ plugins/node/node.plugin.zsh | 5 +---- plugins/npm/npm.plugin.zsh | 2 -- plugins/rvm/rvm.plugin.zsh | 9 ++------- 4 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index f584a468..c2e95884 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,13 +1 @@ -# 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" -} diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh index 18f35333..519bc18d 100644 --- a/plugins/node/node.plugin.zsh +++ b/plugins/node/node.plugin.zsh @@ -1,8 +1,5 @@ -# 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 { +function node-docs { 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 deleted file mode 100644 index 0b0a30e1..00000000 --- a/plugins/npm/npm.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# TODO: Don't do this in such a weird way. -export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/share/npm/bin:&|'` diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 8a3ec788..40fd88c1 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -1,6 +1,5 @@ -fpath=($ZSH/plugins/rvm $fpath) -autoload -U compinit -compinit -i +# What does this really do? +# fpath=($ZSH/plugins/rvm $fpath) alias rubies='rvm list rubies' alias gemsets='rvm gemset list' @@ -35,10 +34,6 @@ function rvm-update { rvm reload # TODO: Reload rvm completion? } -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` From 9801ad6453caa05925847f63401e6266378eb2de Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Mon, 30 May 2011 11:10:08 -0400 Subject: [PATCH 059/137] Remove Uneeded Lines --- plugins/rvm/rvm.plugin.zsh | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh index 40fd88c1..24621fe0 100644 --- a/plugins/rvm/rvm.plugin.zsh +++ b/plugins/rvm/rvm.plugin.zsh @@ -1,6 +1,3 @@ -# What does this really do? -# fpath=($ZSH/plugins/rvm $fpath) - alias rubies='rvm list rubies' alias gemsets='rvm gemset list' From 93dab36fcb7f138aba32e5102c621180055d67fe Mon Sep 17 00:00:00 2001 From: Second Planet Date: Mon, 30 May 2011 19:10:26 -0400 Subject: [PATCH 060/137] added humza.zsh-theme --- themes/humza.zsh-theme | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 themes/humza.zsh-theme diff --git a/themes/humza.zsh-theme b/themes/humza.zsh-theme new file mode 100644 index 00000000..10788629 --- /dev/null +++ b/themes/humza.zsh-theme @@ -0,0 +1,26 @@ +# ZSH THEME Preview: https://skitch.com/huyy/rk979/humza.zshtheme + +let TotalBytes=0 +for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }') +do + let TotalBytes=$TotalBytes+$Bytes +done + # should it say b, kb, Mb, or Gb +if [ $TotalBytes -lt 1024 ]; then + TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) + suffix="b" +elif [ $TotalBytes -lt 1048576 ]; then + TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) + suffix="kb" +elif [ $TotalBytes -lt 1073741824 ]; then + TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) + suffix="Mb" +else + TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) + suffix="Gb" +fi + +PROMPT='%{$reset_color%}%n %{$fg[green]%}{%{$reset_color%}%~%{$fg[green]%}}%{$reset_color%}$(git_prompt_info) greetings, earthling %{$fg[green]%}[%{$reset_color%}%{$TotalSize%}%{$suffix%}%{$fg[green]%}]%{$fg[red]%}$%{$reset_color%} ☞ ' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}±(" +ZSH_THEME_GIT_PROMPT_SUFFIX=");%{$reset_color%}" From 714cfb1db2966ddfc0330a09e620164189233b49 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 31 May 2011 11:46:26 +0200 Subject: [PATCH 061/137] Add guru theme --- themes/guru.zsh-theme | 98 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 themes/guru.zsh-theme diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme new file mode 100644 index 00000000..2a222352 --- /dev/null +++ b/themes/guru.zsh-theme @@ -0,0 +1,98 @@ +#------------------------------------------------------------------------------- +# Guru theme for oh-my-zsh by Adam Lindberg +# (Needs Git plugin for current_branch method) +#------------------------------------------------------------------------------- + + +# Color shortcuts +R=$fg[red] +Y=$fg[yellow] +G=$fg[green] +M=$fg[magenta] +W=$fg[white] +B=$fg[black] +RB=$fg_bold[red] +YB=$fg_bold[yellow] +GB=$fg_bold[green] +MB=$fg_bold[magenta] +WB=$fg_bold[white] +BB=$fg_bold[black] +RESET=$reset_color + +if [ "$(whoami)" = "root" ]; then + PROMPTCOLOR="%{$RB%}" PREFIX="-!-"; +else + PROMPTCOLOR="%{$BB%}" PREFIX="---"; +fi + +local return_code="%(?..%{$R%}%? ↵%{$RESET%})" + +GIT_PREFIX="%{$YB%}‹" +GIT_SUFFIX="%{$YB%}›" + +# Get the status of the working tree (copied and modified from git.zsh) +custom_git_prompt_status() { + INDEX=$(git status --porcelain 2> /dev/null) + STATUS="" + # Non-staged + if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" + fi + if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" + fi + if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + fi + if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + fi + # Staged + if $(echo "$INDEX" | grep '^D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS" + fi + if $(echo "$INDEX" | grep '^R ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS" + fi + if $(echo "$INDEX" | grep '^M ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS" + fi + if $(echo "$INDEX" | grep '^A' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS" + fi + echo $STATUS +} + +# get the name of the branch we are on (copied and modified from git.zsh) +function custom_git_prompt() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_ahead)$(parse_git_dirty)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" +} + +PROMPT='${PROMPTCOLOR}$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} " + +ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➝" + +# Staged +ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A" +ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M" +ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R" +ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D" + +# Not-staged +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}??" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M" +ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU" + +ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}* " + +ZSH_THEME_GIT_PROMPT_CLEAN="" From 9c306670a73ec3e313666fc497952153bdc16220 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 31 May 2011 14:07:38 +0200 Subject: [PATCH 062/137] Improve unicode characters and git status --- themes/guru.zsh-theme | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index 2a222352..c63f1082 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -64,13 +64,18 @@ custom_git_prompt_status() { if $(echo "$INDEX" | grep '^A' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS" fi + + if $(echo "$STATUS" &> /dev/null); then + STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS" + fi + echo $STATUS } # get the name of the branch we are on (copied and modified from git.zsh) function custom_git_prompt() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_ahead)$(parse_git_dirty)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" } PROMPT='${PROMPTCOLOR}$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' @@ -79,7 +84,12 @@ RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} " -ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➝" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔" + +ZSH_THEME_GIT_STATUS_PREFIX=" " # Staged ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A" @@ -88,11 +98,7 @@ ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R" ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D" # Not-staged -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}??" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M" ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU" - -ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}* " - -ZSH_THEME_GIT_PROMPT_CLEAN="" From f4878971752b6d76743c29d6f478d20c84755b8e Mon Sep 17 00:00:00 2001 From: Brian Riddle Date: Tue, 31 May 2011 14:16:43 +0200 Subject: [PATCH 063/137] fix double -f and corrected format. -f%m was getting called twice in the stat_cmd corrected format of stat command from y to Y. --- plugins/ant/ant.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh index 23bc7756..691d4d2d 100644 --- a/plugins/ant/ant.plugin.zsh +++ b/plugins/ant/ant.plugin.zsh @@ -2,14 +2,14 @@ stat -f%m . > /dev/null 2>&1 if [ "$?" = 0 ]; then stat_cmd=(stat -f%m) else - stat_cmd=(stat -L --format=%y) + stat_cmd=(stat -L --format=%Y) fi _ant_does_target_list_need_generating () { if [ ! -f .ant_targets ]; then return 0; else - accurate=$($stat_cmd -f%m .ant_targets) - changed=$($stat_cmd -f%m build.xml) + accurate=$($stat_cmd .ant_targets) + changed=$($stat_cmd build.xml) return $(expr $accurate '>=' $changed) fi } From c014dca141588737a13c4e3974adb4afd58c09bb Mon Sep 17 00:00:00 2001 From: Michael Hanson Date: Tue, 31 May 2011 15:13:23 -0700 Subject: [PATCH 064/137] Fix deleted in git.zsh --- lib/git.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 2ace3d0e..ce4de559 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -52,11 +52,11 @@ git_prompt_status() { if $(echo "$INDEX" | grep '^R ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" fi - if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then + if $(echo "$INDEX" | grep '^D ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" fi if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" fi echo $STATUS -} \ No newline at end of file +} From 23a082df129b12b6edf8ea04432b0cb2be0588fd Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Wed, 1 Jun 2011 09:33:12 +0200 Subject: [PATCH 065/137] Revert "Added my zsh theme file, heavily based on sjl's" as it relies on a dotfile to be in ~/bin. This reverts commit f2f34f5404e8ab674a0e345a709783b6c56a3b72. --- themes/thomasjbradley.zsh-theme | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 themes/thomasjbradley.zsh-theme diff --git a/themes/thomasjbradley.zsh-theme b/themes/thomasjbradley.zsh-theme deleted file mode 100644 index 857301d1..00000000 --- a/themes/thomasjbradley.zsh-theme +++ /dev/null @@ -1,29 +0,0 @@ -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - hg root >/dev/null 2>/dev/null && echo '☿' && return - echo '○' -} - -function virtualenv_info { - [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' -} - -function hg_prompt_info { - hg prompt --angle-brackets "\ -< on %{$fg[magenta]%}%{$reset_color%}>\ -< at %{$fg[yellow]%}%{$reset_color%}>\ -%{$fg[green]%}%{$reset_color%}< -patches: >" 2>/dev/null -} - -PROMPT=' -%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) -$(virtualenv_info)$(prompt_char) ' - -ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" -ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" -ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" -ZSH_THEME_GIT_PROMPT_CLEAN="" - -. ~/bin/dotfiles/zsh/aliases From a9b6f081b4a405dd1365df9c35aa3603196e3fc7 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Wed, 1 Jun 2011 10:11:06 +0200 Subject: [PATCH 066/137] Remove extra space when no status --- themes/guru.zsh-theme | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index c63f1082..aa7b28b3 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -27,9 +27,6 @@ fi local return_code="%(?..%{$R%}%? ↵%{$RESET%})" -GIT_PREFIX="%{$YB%}‹" -GIT_SUFFIX="%{$YB%}›" - # Get the status of the working tree (copied and modified from git.zsh) custom_git_prompt_status() { INDEX=$(git status --porcelain 2> /dev/null) @@ -65,7 +62,7 @@ custom_git_prompt_status() { STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS" fi - if $(echo "$STATUS" &> /dev/null); then + if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS" fi From 0d476e02cd1b5660b09acde25725191044f062ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Had=C5=BEi=C4=87?= Date: Wed, 1 Jun 2011 12:45:15 +0200 Subject: [PATCH 067/137] Adds my theme --- themes/miloshadzic.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/miloshadzic.zsh-theme diff --git a/themes/miloshadzic.zsh-theme b/themes/miloshadzic.zsh-theme new file mode 100644 index 00000000..ad539442 --- /dev/null +++ b/themes/miloshadzic.zsh-theme @@ -0,0 +1,8 @@ +# Yay! High voltage and arrows! + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} ' From f401d6ef78a94b723ce841b77151eaac477b8074 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 22 Feb 2011 23:32:50 -0500 Subject: [PATCH 068/137] Vastly improved osx plugin. --- plugins/osx/osx.plugin.zsh | 138 +++++++++++++++++++++++-------------- 1 file changed, 87 insertions(+), 51 deletions(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index a65ca642..682bb266 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -1,63 +1,99 @@ -alias showfiles='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder' -alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder' +# ------------------------------------------------------------------------------ +# FILE: osx.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) +# VERSION: 1.0.1 +# ------------------------------------------------------------------------------ -# Recursively delete .DS_Store files -alias rm-dsstore="find . -name '*.DS_Store' -type f -delete" - -function savepath() { - pwd > ~/.current_path~ -} function tab() { -savepath -osascript >/dev/null < 0 )) && command="${command}; $*" + + the_app=$( + osascript 2>/dev/null </dev/null </dev/null </dev/null </dev/null </dev/null < 0 )) && qlmanage -p $* &>/dev/null & +} + +function man-preview() { + man -t "$@" | open -f -a Preview +} + +function trash() { + local trash_dir="${HOME}/.Trash" + local temp_ifs=$IFS + IFS=$'\n' + for item in "$@"; do + if [[ -e "$item" ]]; then + item_name="$(basename $item)" + if [[ -e "${trash_dir}/${item_name}" ]]; then + mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")" + else + mv -f "$item" "${trash_dir}/" + fi + fi + done + IFS=$temp_ifs +} + From 5e5096dad60ef0f41aea384c1e249a3bf0377be6 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 22 Apr 2011 19:13:37 -0400 Subject: [PATCH 069/137] Added man-preview completion suggested by @webflo. --- plugins/osx/_man-preview | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/osx/_man-preview diff --git a/plugins/osx/_man-preview b/plugins/osx/_man-preview new file mode 100644 index 00000000..6cc344ad --- /dev/null +++ b/plugins/osx/_man-preview @@ -0,0 +1,5 @@ +#compdef man-preview +#autoload + +_man + From 1db6575f14d07b9ed3b0ce530837a8a0713b69d0 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 3 Feb 2011 22:46:52 -0500 Subject: [PATCH 070/137] Added extract plugin. --- lib/aliases.zsh | 1 - lib/functions.zsh | 35 ------------- plugins/extract/_extract | 8 +++ plugins/extract/extract.plugin.zsh | 83 ++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 36 deletions(-) create mode 100644 plugins/extract/_extract create mode 100644 plugins/extract/extract.plugin.zsh diff --git a/lib/aliases.zsh b/lib/aliases.zsh index b47de5bd..0555be26 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -22,4 +22,3 @@ alias sl=ls # often screw this up alias afind='ack-grep -il' -alias x=extract diff --git a/lib/functions.zsh b/lib/functions.zsh index b29d3e48..ef7cc638 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -15,38 +15,3 @@ function take() { cd $1 } -function extract() { - unset REMOVE_ARCHIVE - - if test "$1" = "-r"; then - REMOVE=1 - shift - fi - if [[ -f $1 ]]; then - case $1 in - *.tar.bz2) tar xvjf $1;; - *.tar.gz) tar xvzf $1;; - *.tar.xz) tar xvJf $1;; - *.tar.lzma) tar --lzma -xvf $1;; - *.bz2) bunzip $1;; - *.rar) unrar x $1;; - *.gz) gunzip $1;; - *.tar) tar xvf $1;; - *.tbz2) tar xvjf $1;; - *.tgz) tar xvzf $1;; - *.zip) unzip $1;; - *.Z) uncompress $1;; - *.7z) 7z x $1;; - *) echo "'$1' cannot be extracted via >extract<";; - esac - - if [[ $REMOVE_ARCHIVE -eq 1 ]]; then - echo removing "$1"; - /bin/rm "$1"; - fi - - else - echo "'$1' is not a valid file" - fi -} - diff --git a/plugins/extract/_extract b/plugins/extract/_extract new file mode 100644 index 00000000..dca89095 --- /dev/null +++ b/plugins/extract/_extract @@ -0,0 +1,8 @@ +#compdef extract +#autoload + +_arguments \ + '(-r --remove)'{-r,--remove}'[Remove archive.]' \ + "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 + + diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh new file mode 100644 index 00000000..c58692fb --- /dev/null +++ b/plugins/extract/extract.plugin.zsh @@ -0,0 +1,83 @@ +# ------------------------------------------------------------------------------ +# FILE: extract.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) +# VERSION: 1.0.0 +# ------------------------------------------------------------------------------ + + +function extract() { + local remove_archive + local success + local file_name + local extract_dir + + if (( $# == 0 )); then + echo "Usage: extract [-option] [file ...]" + echo + echo Options: + echo " -r, --remove Remove archive." + echo + echo "Report bugs to ." + fi + + remove_archive=1 + if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then + remove_archive=0 + shift + fi + + while (( $# > 0 )); do + if [[ ! -f "$1" ]]; then + echo "extract: '$1' is not a valid file" 1>&2 + shift + continue + fi + + success=0 + file_name="$( basename "$1" )" + extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )" + case "$1" in + (*.tar.gz|*.tgz) tar xvzf "$1" ;; + (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; + (*.tar.xz|*.txz) tar xvJf "$1" ;; + # (*.tar.xz|*.txz) xzcat "$1" | tar xvf - ;; + (*.tar.lzma|*.tlz) tar --lzma -xvf "$1" ;; + # (*.tar.lzma|*.tlz) lzcat "$1" | tar xvf - ;; + (*.tar) tar xvf "$1" ;; + (*.gz) gunzip "$1" ;; + (*.bz2) bunzip2 "$1" ;; + (*.xz) unxz "$1" ;; + (*.lzma) unlzma "$1" ;; + (*.Z) uncompress "$1" ;; + (*.zip) unzip "$1" -d $extract_dir ;; + (*.rar) unrar e -ad "$1" ;; + (*.7z) 7za x "$1" ;; + (*.deb) + mkdir -p "$extract_dir/control" + mkdir -p "$extract_dir/data" + cd "$extract_dir"; ar vx "../${1}" > /dev/null + cd control; tar xzvf ../control.tar.gz + cd ../data; tar xzvf ../data.tar.gz + cd ..; rm *.tar.gz debian-binary + cd .. + ;; + (*) + echo "extract: '$1' cannot be extracted" 1>&2 + success=1 + ;; + esac + + (( success = $success > 0 ? $success : $? )) + (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" + shift + done +} + +alias x=extract + +# add extract completion function to path +fpath=($ZSH/plugins/extract $fpath) +autoload -U compinit +compinit -i + From a5c383258b760ad1c34d550edb86d7d63e8f5877 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 17 Apr 2011 23:17:48 -0400 Subject: [PATCH 071/137] Handle tar.xz and tar.lzma better (credit: @gwjo). --- plugins/extract/extract.plugin.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index c58692fb..8cc17f7d 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -2,7 +2,7 @@ # FILE: extract.plugin.zsh # DESCRIPTION: oh-my-zsh plugin file. # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) -# VERSION: 1.0.0 +# VERSION: 1.0.1 # ------------------------------------------------------------------------------ @@ -40,10 +40,12 @@ function extract() { case "$1" in (*.tar.gz|*.tgz) tar xvzf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) tar xvJf "$1" ;; - # (*.tar.xz|*.txz) xzcat "$1" | tar xvf - ;; - (*.tar.lzma|*.tlz) tar --lzma -xvf "$1" ;; - # (*.tar.lzma|*.tlz) lzcat "$1" | tar xvf - ;; + (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ + && tar --xz -xvf "$1" \ + || xzcat "$1" | tar xvf - ;; + (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ + && tar --lzma -xvf "$1" \ + || lzcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; (*.gz) gunzip "$1" ;; (*.bz2) bunzip2 "$1" ;; From c1b5d72830629c737f40abebf87fcca797bf730c Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Wed, 1 Jun 2011 20:38:25 -0700 Subject: [PATCH 072/137] add "sunaku" theme, see http://ompldr.org/vOHcwZg --- themes/sunaku.zsh-theme | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 themes/sunaku.zsh-theme diff --git a/themes/sunaku.zsh-theme b/themes/sunaku.zsh-theme new file mode 100644 index 00000000..440fa90b --- /dev/null +++ b/themes/sunaku.zsh-theme @@ -0,0 +1,26 @@ +# Git-centric variation of the "fishy" theme. +# See screenshot at http://ompldr.org/vOHcwZg + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}+" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[magenta]%}!" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}-" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}>" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}#" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[yellow]%}?" + +ZSH_THEME_GIT_PROMPT_PREFIX="" +ZSH_THEME_GIT_PROMPT_SUFFIX=" " +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +local user_color='green' +test $UID -eq 0 && user_color='red' + +PROMPT='%(?..%{$fg_bold[red]%}exit %? +%{$reset_color%})'\ +'%{$bold_color%}$(git_prompt_status)%{$reset_color%}'\ +'$(git_prompt_info)'\ +'%{$fg[$user_color]%}%~%{$reset_color%}'\ +'%(!.#.>) ' + +PROMPT2='%{$fg[red]%}\ %{$reset_color%}' From 9b63a03bcfb7a6c34281d7d905575c5647e9c8d2 Mon Sep 17 00:00:00 2001 From: Matt Doran Date: Sat, 4 Jun 2011 00:32:05 +1000 Subject: [PATCH 073/137] Fix typos in the svn plugin that would cause calls to 'svn' when not in an svn working copy. --- plugins/svn/svn.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 45d46130..86050227 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -13,7 +13,7 @@ function in_svn() { } function svn_get_repo_name { - if [ is_svn ]; then + if [ in_svn ]; then svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//" @@ -21,13 +21,13 @@ function svn_get_repo_name { } function svn_get_rev_nr { - if [ is_svn ]; then + if [ in_svn ]; then svn info 2> /dev/null | sed -n s/Revision:\ //p fi } function svn_dirty_choose { - if [ is_svn ]; then + if [ in_svn ]; then s=$(svn status 2>/dev/null) if [ $s ]; then echo $1 @@ -39,4 +39,4 @@ function svn_dirty_choose { function svn_dirty { svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN -} \ No newline at end of file +} From 0c41b1cdc3ff7b00ffb2310b91becb91b31704f7 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Fri, 3 Jun 2011 14:05:25 -0400 Subject: [PATCH 074/137] Colorize Install & Upgrade Scripts Make tools/install.sh and tools/upgrade.sh pretty. --- tools/install.sh | 28 ++++++++++++++-------------- tools/upgrade.sh | 21 +++++++++++---------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 8ed1403a..aedb706d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,36 +1,36 @@ if [ -d ~/.oh-my-zsh ] then - echo "You already have Oh My Zsh installed. You'll need to remove ~/.oh-my-zsh if you want to install" + echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" exit fi -echo "Cloning Oh My Zsh..." +echo "\033[0;34mCloning Oh My Zsh...\033[0m" /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh -echo "Looking for an existing zsh config..." +echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] then - echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh"; + echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32]Backing up to ~/.zshrc.pre-oh-my-zsh\033[0m"; cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh; rm ~/.zshrc; fi -echo "Using the Oh My Zsh template file and adding it to ~/.zshrc" +echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc -echo "Copying your current PATH and adding it to the end of ~/.zshrc for you." +echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" echo "export PATH=$PATH" >> ~/.zshrc -echo "Time to change your default shell to zsh!" +echo "\033[0;34mTime to change your default shell to zsh!\033[0m" chsh -s `which zsh` -echo ' __ __ ' -echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' -echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' -echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' -echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' -echo ' /____/' +echo "\033[0;32m"' __ __ '"\033[0m" +echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" +echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" +echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" +echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" +echo "\033[0;32m"' /____/ '"\033[0m" -echo "\n\n ....is now installed." +echo "\n\n \033[0;32m....is now installed.\033[0m" /usr/bin/env zsh source ~/.zshrc diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 6bdd02e3..7e5cc765 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,13 @@ current_path=`pwd` -echo "Upgrading Oh My Zsh" +echo "\033[0;34mUpgrading Oh My Zsh\033[0m" ( cd $ZSH && git pull origin master ) -echo ' __ __ ' -echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' -echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' -echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' -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 +echo "\033[0;32m"' __ __ '"\033[0m" +echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" +echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" +echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" +echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" +echo "\033[0;32m"' /____/ '"\033[0m" +echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" +echo "\033[0;34mAny new updates will be reflected when you start your next terminal session.\033[0m" +echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" +cd $current_path From 7c9474508cade14102a2fe1c63ad845fda521bec Mon Sep 17 00:00:00 2001 From: vguerci Date: Sat, 4 Jun 2011 11:02:25 +0200 Subject: [PATCH 075/137] [upgrade] before init (no reload needed unless oh-my-zsh.sh has been modified) --- oh-my-zsh.sh | 17 ++++++++--------- tools/upgrade.sh | 1 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index dbff1ced..2157c38a 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,3 +1,11 @@ +# Check for updates on initial load... +if [ "$DISABLE_AUTO_UPDATE" = "true" ] +then + return +else + /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh +fi + # Initializes Oh My Zsh # add a function path @@ -28,7 +36,6 @@ done for config_file ($ZSH/custom/*.zsh) source $config_file # Load the theme -# Check for updates on initial load... if [ "$ZSH_THEME" = "random" ] then themes=($ZSH/themes/*zsh-theme) @@ -41,11 +48,3 @@ else source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi - -# Check for updates on initial load... -if [ "$DISABLE_AUTO_UPDATE" = "true" ] -then - return -else - /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh -fi diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 7e5cc765..e3048882 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -8,6 +8,5 @@ echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" echo "\033[0;32m"' /____/ '"\033[0m" echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo "\033[0;34mAny new updates will be reflected when you start your next terminal session.\033[0m" echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" cd $current_path From 9b4a89f327a045ed5e756ae4e75d1aac68803164 Mon Sep 17 00:00:00 2001 From: Michael Komitee Date: Sat, 4 Jun 2011 14:03:10 -0400 Subject: [PATCH 076/137] Fix bug from Pull request #395 #395 broke oh-my-zsh for users who disable check-for-updates --- oh-my-zsh.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 2157c38a..d72d90cf 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,8 +1,6 @@ # Check for updates on initial load... -if [ "$DISABLE_AUTO_UPDATE" = "true" ] +if [ "$DISABLE_AUTO_UPDATE" != "true" ] then - return -else /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh fi From 35b879a17b965b0ea28009c4561962c9ed17ef1f Mon Sep 17 00:00:00 2001 From: gwjo Date: Sat, 4 Jun 2011 21:07:55 -0400 Subject: [PATCH 077/137] Add support for agent forwarding --- plugins/ssh-agent/ssh-agent.plugin.zsh | 52 ++++++++++++++++++++------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 0efc4546..0f5b03d2 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -1,23 +1,51 @@ -# Based on code from Joseph M. Reagle -# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html +# +# INSTRUCTIONS +# +# To enabled agent forwarding support add the following to +# your .zshrc file: +# +# zstyle :omz:plugins:ssh-agent agent-forwarding on +# +# +# CREDITS +# +# Based on code from Joseph M. Reagle +# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html +# +# Agent forwarding support based on ideas from +# Florent Thoumie and Jonas Pfenniger +# -local SSH_ENV=$HOME/.ssh/environment-$HOST +local _plugin__ssh_env=$HOME/.ssh/environment-$HOST +local _plugin__forwarding -function start_agent { - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} - chmod 600 ${SSH_ENV} - . ${SSH_ENV} > /dev/null +function _plugin__start_agent() +{ + /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} + chmod 600 ${_plugin__ssh_env} + . ${_plugin__ssh_env} > /dev/null /usr/bin/ssh-add; } -# Source SSH settings, if applicable +# test if agent-forwarding is enabled +zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding +if [[ ${_plugin__forwarding} == "yes" && -z $SSH_AGENT_PID && -n "$SSH_AUTH_SOCK" ]]; then + # No PID but a AUTH_SOCK means agent forwarding is enabled + # Add a nifty symlink for screen/tmux + [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen -if [ -f "${SSH_ENV}" ]; then - . ${SSH_ENV} > /dev/null +elif [ -f "${_plugin__ssh_env}" ]; then + # Source SSH settings, if applicable + . ${_plugin__ssh_env} > /dev/null ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - start_agent; + _plugin__start_agent; } else - start_agent; + _plugin__start_agent; fi +# tidy up after ourselves +unfunction _plugin__start_agent +unset _plugin__forwarding +unset _plugin__ssh_env + From 40b7f2099d393950e26d1a9720743e161b1abe49 Mon Sep 17 00:00:00 2001 From: gwjo Date: Sat, 4 Jun 2011 22:16:10 -0400 Subject: [PATCH 078/137] Add support for loading mulitple identities --- plugins/ssh-agent/ssh-agent.plugin.zsh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 0f5b03d2..c4e92a1f 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -6,6 +6,11 @@ # # zstyle :omz:plugins:ssh-agent agent-forwarding on # +# To load multiple identies use the identities style, For +# example: +# +# zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github +# # # CREDITS # @@ -21,17 +26,23 @@ local _plugin__forwarding function _plugin__start_agent() { + local -a identities + + # start ssh-agent and setup environment /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null - /usr/bin/ssh-add; + + # load identies + zstyle -a :omz:plugins:ssh-agent identities identities + echo starting... + /usr/bin/ssh-add $HOME/.ssh/${^identities} } # test if agent-forwarding is enabled zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding -if [[ ${_plugin__forwarding} == "yes" && -z $SSH_AGENT_PID && -n "$SSH_AUTH_SOCK" ]]; then - # No PID but a AUTH_SOCK means agent forwarding is enabled - # Add a nifty symlink for screen/tmux +if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then + # Add a nifty symlink for screen/tmux if agent forwarding [[ -L $SSH_AUTH_SOCK ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen elif [ -f "${_plugin__ssh_env}" ]; then From 715be61966acecb4d30953e3dd4c9d8a3f8637eb Mon Sep 17 00:00:00 2001 From: Clement Girault Date: Mon, 6 Jun 2011 01:37:07 +1000 Subject: [PATCH 079/137] New theme, Read contents for further customising. --- themes/wedisagree.zsh-theme | 107 ++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 themes/wedisagree.zsh-theme diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme new file mode 100644 index 00000000..7cb27934 --- /dev/null +++ b/themes/wedisagree.zsh-theme @@ -0,0 +1,107 @@ +# On a mac with snow leopard, for nicer terminal colours: + +# - Install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php +# - Download'Terminal-Colours': http://bwaht.net/code/TerminalColours.bundle.zip +# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist) +# - Open Terminal preferences. Go to Settings -> Text -> More +# - Change default colours to your liking. +# +# Here are the colours from Textmate's Monokai theme: +# +# Black: 0, 0, 0 +# Red: 229, 34, 34 +# Green: 166, 227, 45 +# Yellow: 252, 149, 30 +# Blue: 196, 141, 255 +# Magenta: 250, 37, 115 +# Cyan: 103, 217, 240 +# White: 242, 242, 242 + +# Thanks to Steve Losh: http://stevelosh.com/blog/2009/03/candy-colored-terminal/ + +# The prompt + +PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}' + +# The right-hand prompt + +RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}' + +# Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name +# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} + +# local time, color coded by last return code +time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}" +time_disabled="%{$fg[green]%}%*%{$reset_color%}" +time=$time_enabled + +ZSH_THEME_GIT_PROMPT_PREFIX=" ☁ %{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃ +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁ +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂ +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄ +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊ + +# More symbols to choose from: +# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ +# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠ +# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ + +# Determine if we are using a gemset. +function rvm_gemset() { + GEMSET=`rvm gemset list | grep '=>' | cut -b4-` + if [[ -n $GEMSET ]]; then + echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|" + fi +} + +# Determine the time since last commit. If branch is clean, +# use a neutral color, otherwise colors will vary according to time. +function git_time_since_commit() { + if git rev-parse --git-dir > /dev/null 2>&1; then + # Only proceed if there is actually a commit. + if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + # Get the last commit. + last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` + now=`date +%s` + seconds_since_last_commit=$((now-last_commit)) + + # Totals + MINUTES=$((seconds_since_last_commit / 60)) + HOURS=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + DAYS=$((seconds_since_last_commit / 86400)) + SUB_HOURS=$((HOURS % 24)) + SUB_MINUTES=$((MINUTES % 60)) + + if [[ -n $(git status -s 2> /dev/null) ]]; then + if [ "$MINUTES" -gt 30 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" + elif [ "$MINUTES" -gt 10 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + fi + + if [ "$HOURS" -gt 24 ]; then + echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" + elif [ "$MINUTES" -gt 60 ]; then + echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" + else + echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + echo "($(rvm_gemset)$COLOR~|" + fi + fi +} \ No newline at end of file From 5444d2088c97dc776dcbd17acf55dd54b9d7060a Mon Sep 17 00:00:00 2001 From: thunfischbrot Date: Sun, 5 Jun 2011 15:19:46 -0700 Subject: [PATCH 080/137] Included some essential aliases, inspired by http://lolcode.com/ --- plugins/lol/lol.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index a7153bb5..e455527e 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -8,19 +8,30 @@ alias rtfm='man' alias visible='echo' alias invisible='cat' alias moar='more' +alias tldr='less' +alias alwayz='tail -f' alias icanhas='mkdir' +alias gimmeh='touch' alias donotwant='rm' alias dowant='cp' alias gtfo='mv' +alias nowai='chmod' alias hai='cd' +alias iz='ls' alias plz='pwd' +alias ihasbucket='df -h' alias inur='locate' +alias iminurbase='finger' + +alias btw='nice' +alias obtw='nohup' alias nomz='ps -aux' alias nomnom='killall' +alias byes='exit' alias cya='reboot' alias kthxbai='halt' From 70cb607b7bee04ceef74d6f7aa80589e009e4c78 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 7 Jun 2011 15:28:43 +0200 Subject: [PATCH 081/137] Remove unused colors and use original prompt color --- themes/guru.zsh-theme | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index aa7b28b3..b99cd816 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -6,23 +6,17 @@ # Color shortcuts R=$fg[red] -Y=$fg[yellow] G=$fg[green] M=$fg[magenta] -W=$fg[white] -B=$fg[black] RB=$fg_bold[red] YB=$fg_bold[yellow] -GB=$fg_bold[green] -MB=$fg_bold[magenta] -WB=$fg_bold[white] -BB=$fg_bold[black] +BB=$fg_bold[blue] RESET=$reset_color if [ "$(whoami)" = "root" ]; then PROMPTCOLOR="%{$RB%}" PREFIX="-!-"; else - PROMPTCOLOR="%{$BB%}" PREFIX="---"; + PROMPTCOLOR="" PREFIX="---"; fi local return_code="%(?..%{$R%}%? ↵%{$RESET%})" @@ -75,7 +69,8 @@ function custom_git_prompt() { echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" } -PROMPT='${PROMPTCOLOR}$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' +# %B sets bold text +PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹" From 915c28752eb8bfb9610e14f62161ab3bd573d218 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 7 Jun 2011 15:32:48 +0200 Subject: [PATCH 082/137] Add email address --- themes/guru.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index b99cd816..cbd56194 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# Guru theme for oh-my-zsh by Adam Lindberg +# Guru theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) # (Needs Git plugin for current_branch method) #------------------------------------------------------------------------------- From 73946a6066fa8bf740b4765b7e204df9599f9689 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 7 Jun 2011 15:40:18 +0200 Subject: [PATCH 083/137] Add note about Solarized color theme --- themes/guru.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index cbd56194..a5ffdb72 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -1,9 +1,9 @@ #------------------------------------------------------------------------------- # Guru theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) +# Intended to be used with Solarized: http://ethanschoonover.com/solarized # (Needs Git plugin for current_branch method) #------------------------------------------------------------------------------- - # Color shortcuts R=$fg[red] G=$fg[green] From 4a7392fdd0be8fafcaffccc206f23c7746129fb8 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 7 Jun 2011 15:40:32 +0200 Subject: [PATCH 084/137] Fix git R and M status when used together --- themes/guru.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/guru.zsh-theme b/themes/guru.zsh-theme index a5ffdb72..dfec3dfb 100644 --- a/themes/guru.zsh-theme +++ b/themes/guru.zsh-theme @@ -35,7 +35,7 @@ custom_git_prompt_status() { if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" fi - if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then + if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" @@ -46,7 +46,7 @@ custom_git_prompt_status() { if $(echo "$INDEX" | grep '^D ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS" fi - if $(echo "$INDEX" | grep '^R ' &> /dev/null); then + if $(echo "$INDEX" | grep '^R' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS" fi if $(echo "$INDEX" | grep '^M ' &> /dev/null); then From d99284f6b569a0860ed14330c8c9eaf5f0441fe8 Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Tue, 7 Jun 2011 15:42:55 +0200 Subject: [PATCH 085/137] Rename guru theme to sunrise --- themes/{guru.zsh-theme => sunrise.zsh-theme} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename themes/{guru.zsh-theme => sunrise.zsh-theme} (97%) diff --git a/themes/guru.zsh-theme b/themes/sunrise.zsh-theme similarity index 97% rename from themes/guru.zsh-theme rename to themes/sunrise.zsh-theme index dfec3dfb..15004084 100644 --- a/themes/guru.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# Guru theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) +# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com) # Intended to be used with Solarized: http://ethanschoonover.com/solarized # (Needs Git plugin for current_branch method) #------------------------------------------------------------------------------- From 3eae652a6d4bc5f280bb7f9d33000f378becf13c Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Wed, 8 Jun 2011 16:33:29 +0100 Subject: [PATCH 086/137] Fix MM lines being read correctly --- themes/sunrise.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index 15004084..88b371d7 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -49,7 +49,7 @@ custom_git_prompt_status() { if $(echo "$INDEX" | grep '^R' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS" fi - if $(echo "$INDEX" | grep '^M ' &> /dev/null); then + if $(echo "$INDEX" | grep '^M' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS" fi if $(echo "$INDEX" | grep '^A' &> /dev/null); then From f9bf396e4ac68299f1370ed54350cc14ce954eea Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Thu, 9 Jun 2011 21:22:33 -0700 Subject: [PATCH 087/137] Add Django plugin. This is a slight modification of the Django zsh completions that I found at https://raw.github.com/technolize/zsh-completion-funcs/master/_manage.py --- plugins/django/django.plugin.zsh | 222 +++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 plugins/django/django.plugin.zsh diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh new file mode 100644 index 00000000..1d72a2f2 --- /dev/null +++ b/plugins/django/django.plugin.zsh @@ -0,0 +1,222 @@ +#compdef manage.py + +typeset -ga nul_args +nul_args=( + '--settings=-[the Python path to a settings module.]:file:_files' + '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' + '--traceback[print traceback on exception.]' + "--version[show program's version number and exit.]" + {-h,--help}'[show this help message and exit.]' +) + +_managepy-adminindex(){ + _arguments -s : \ + $nul_args \ + '*::directory:_directories' && ret=0 +} + +_managepy-createcachetable(){ + _arguments -s : \ + $nul_args && ret=0 +} + +_managepy-dbshell(){ + _arguments -s : \ + $nul_args && ret=0 +} + +_managepy-diffsettings(){ + _arguments -s : \ + $nul_args && ret=0 +} + +_managepy-dumpdata(){ + _arguments -s : \ + '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \ + '--indent=-[specifies the indent level to use when pretty-printing output.]:' \ + $nul_args \ + '*::appname:_applist' && ret=0 +} + +_managepy-flush(){ + _arguments -s : \ + '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ + '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ + $nul_args && ret=0 +} + +_managepy-help(){ + _arguments -s : \ + '*:command:_managepy_cmds' \ + $nul_args && ret=0 +} + +_managepy_cmds(){ + local line + local -a cmd + _call_program help-command ./manage.py help \ + |& sed -n '/^ /s/[(), ]/ /gp' \ + | while read -A line; do cmd=($line $cmd) done + _describe -t managepy-command 'manage.py command' cmd +} + +_managepy-inspectdb(){ + _arguments -s : \ + $nul_args && ret=0 +} + +_managepy-loaddata(){ + _arguments -s : \ + '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ + '*::file:_files' \ + $nul_args && ret=0 +} + +_managepy-reset(){ + _arguments -s : \ + '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ + '*::appname:_applist' \ + $nul_args && ret=0 +} + +_managepy-runfcgi(){ + local state + + local fcgi_opts + fcgi_opts=( + 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)' + 'host[hostname to listen on..]:' + 'port[port to listen on.]:' + 'socket[UNIX socket to listen on.]::file:_files' + 'method[prefork or threaded (default prefork)]:method:(prefork threaded)' + 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:' + 'maxspare[max number of spare processes / threads.]:' + 'minspare[min number of spare processes / threads.]:' + 'maxchildren[hard limit number of processes / threads.]:' + 'daemonize[whether to detach from terminal.]:boolean:(False True)' + 'pidfile[write the spawned process-id to this file.]:file:_files' + 'workdir[change to this directory when daemonizing.]:directory:_files' + 'outlog[write stdout to this file.]:file:_files' + 'errlog[write stderr to this file.]:file:_files' + ) + + _arguments -s : \ + $nul_args \ + '*: :_values "FCGI Setting" $fcgi_opts' && ret=0 +} + +_managepy-runserver(){ + _arguments -s : \ + '--noreload[tells Django to NOT use the auto-reloader.]' \ + '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \ + $nul_args && ret=0 +} + +_managepy-shell(){ + _arguments -s : \ + '--plain[tells Django to use plain Python, not IPython.]' \ + $nul_args && ret=0 +} + +_managepy-sql(){} +_managepy-sqlall(){} +_managepy-sqlclear(){} +_managepy-sqlcustom(){} +_managepy-sqlflush(){} +_managepy-sqlindexes(){} +_managepy-sqlinitialdata(){} +_managepy-sqlreset(){} +_managepy-sqlsequencereset(){} +_managepy-startapp(){} + +_managepy-syncdb() { + _arguments -s : \ + '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ + '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ + $nul_args && ret=0 +} + +_managepy-test() { + _arguments -s : \ + '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ + '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ + '*::appname:_applist' \ + $nul_args && ret=0 +} + +_managepy-testserver() { + _arguments -s : \ + '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ + '--addrport=-[port number or ipaddr:port to run the server on.]' \ + '*::fixture:_files' \ + $nul_args && ret=0 +} + +_managepy-validate() { + _arguments -s : \ + $nul_args && ret=0 +} + +_managepy-commands() { + local -a commands + + commands=( + 'adminindex:prints the admin-index template snippet for the given app name(s).' + 'createcachetable:creates the table needed to use the SQL cache backend.' + 'dbshell:runs the command-line client for the current DATABASE_ENGINE.' + "diffsettings:displays differences between the current settings.py and Django's default settings." + 'dumpdata:Output the contents of the database as a fixture of the given format.' + 'flush:Executes ``sqlflush`` on the current database.' + 'help:manage.py help.' + 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.' + 'loaddata:Installs the named fixture(s) in the database.' + 'reset:Executes ``sqlreset`` for the given app(s) in the current database.' + 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,' + 'runserver:Starts a lightweight Web server for development.' + 'shell:Runs a Python interactive interpreter.' + 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).' + 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).' + 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).' + 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).' + 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.' + 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).' + "sqlinitialdata:RENAMED: see 'sqlcustom'" + 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).' + 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).' + "startapp:Creates a Django app directory structure for the given app name in this project's directory." + "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." + 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.' + 'testserver:Runs a development server with data from the given fixture(s).' + 'validate:Validates all installed models.' + ) + + _describe -t commands 'manage.py command' commands && ret=0 +} + +_applist() { + local line + local -a apps + _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\ + bn=op.basename(op.abspath(op.curdir));[sys\\ + .stdout.write(str(re.sub(r'^%s\.(.*?)$' % + bn, r'\1', i)) + '\n') for i in django.conf.settings.\\ + INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \ + | while read -A line; do apps=($line $apps) done + _values 'Application' $apps && ret=0 +} + +_managepy() { + local curcontext=$curcontext ret=1 + + if ((CURRENT == 2)); then + _managepy-commands + else + shift words + (( CURRENT -- )) + curcontext="${curcontext%:*:*}:managepy-$words[1]:" + _call_function ret _managepy-$words[1] + fi +} + +compdef _managepy manage.py +compdef _managepy django From 527355eae3c8b019ce203c38b6aa5ffd818c3640 Mon Sep 17 00:00:00 2001 From: Marius Ghita Date: Wed, 15 Jun 2011 01:17:22 +0300 Subject: [PATCH 088/137] When the theme choice is left out, oh-my-zsh will not try to load it --- oh-my-zsh.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index d72d90cf..c4522491 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -43,6 +43,9 @@ then source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." else - source "$ZSH/themes/$ZSH_THEME.zsh-theme" + if [ ! "$ZSH_THEME" = "" ] + then + source "$ZSH/themes/$ZSH_THEME.zsh-theme" + fi fi From f22460f18125421a73a60893ae97ed545465bca7 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Sat, 18 Jun 2011 19:24:55 -0400 Subject: [PATCH 089/137] Add ohmyzsh theme, my version of dogenpunk --- themes/smt.zsh-theme | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 themes/smt.zsh-theme diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme new file mode 100644 index 00000000..fcb4858d --- /dev/null +++ b/themes/smt.zsh-theme @@ -0,0 +1,91 @@ +# ----------------------------------------------------------------------------- +# FILE: smt.zsh-theme +# DESCRIPTION: oh-my-zsh theme file, based on dogenpunk by Matthew Nelson. +# AUTHOR: Stephen Tudor (stephen@tudorstudio.com +# VERSION: 0.1 +# SCREENSHOT: coming soon +# ----------------------------------------------------------------------------- + +MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" +local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} " + +ZSH_THEME_GIT_PROMPT_PREFIX="|" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[red]%}!%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" + +# Format for git_prompt_long_sha() and git_prompt_short_sha() +ZSH_THEME_GIT_PROMPT_SHA_BEFORE="➤ %{$fg_bold[yellow]%}" +ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" + +function prompt_char() { + git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return + hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return + echo "%{$fg[cyan]%}◯%{$reset_color%}" +} + +# Colors vary depending on time lapsed. +ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" +ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" +ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" + +# Determine the time since last commit. If branch is clean, +# use a neutral color, otherwise colors will vary according to time. +function git_time_since_commit() { + if git rev-parse --git-dir > /dev/null 2>&1; then + # Only proceed if there is actually a commit. + if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + # Get the last commit. + last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` + now=`date +%s` + seconds_since_last_commit=$((now-last_commit)) + + # Totals + MINUTES=$((seconds_since_last_commit / 60)) + HOURS=$((seconds_since_last_commit/3600)) + + # Sub-hours and sub-minutes + DAYS=$((seconds_since_last_commit / 86400)) + SUB_HOURS=$((HOURS % 24)) + SUB_MINUTES=$((MINUTES % 60)) + + if [[ -n $(git status -s 2> /dev/null) ]]; then + if [ "$MINUTES" -gt 30 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG" + elif [ "$MINUTES" -gt 10 ]; then + COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM" + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + fi + + if [ "$HOURS" -gt 24 ]; then + echo "[$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}]" + elif [ "$MINUTES" -gt 60 ]; then + echo "[$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}]" + else + echo "[$COLOR${MINUTES}m%{$reset_color%}]" + fi + else + COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" + echo "[$COLOR~]" + fi + fi +} + +PROMPT=' +%{$fg[blue]%}%m%{$reset_color%} 寿帝文 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info) +%{$fg[red]%}%!%{$reset_color%} $(prompt_char) : ' + +RPROMPT='${return_status}$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}' From 03f71d14dd1866b9da58f28f8f40f5c12bf3072f Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Sun, 19 Jun 2011 12:22:23 -0400 Subject: [PATCH 090/137] Changed kanji to fuku (good luck) --- themes/smt.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme index fcb4858d..7a287523 100644 --- a/themes/smt.zsh-theme +++ b/themes/smt.zsh-theme @@ -85,7 +85,7 @@ function git_time_since_commit() { } PROMPT=' -%{$fg[blue]%}%m%{$reset_color%} 寿帝文 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info) +%{$fg[blue]%}%m%{$reset_color%} 福 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info) %{$fg[red]%}%!%{$reset_color%} $(prompt_char) : ' RPROMPT='${return_status}$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}' From e43eec99f94c00a6a9d2b30f9c449aff5ab0dfe5 Mon Sep 17 00:00:00 2001 From: Matthew McCullough Date: Tue, 28 Jun 2011 19:42:50 -0600 Subject: [PATCH 091/137] Added cloudapp from @holman of @GitHub fame --- plugins/cloudapp/cloudapp.plugin.zsh | 2 + plugins/cloudapp/cloudapp.rb | 60 ++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 plugins/cloudapp/cloudapp.plugin.zsh create mode 100755 plugins/cloudapp/cloudapp.rb diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh new file mode 100644 index 00000000..99252f69 --- /dev/null +++ b/plugins/cloudapp/cloudapp.plugin.zsh @@ -0,0 +1,2 @@ +#!/bin/zsh +alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb new file mode 100755 index 00000000..a11cfdb3 --- /dev/null +++ b/plugins/cloudapp/cloudapp.rb @@ -0,0 +1,60 @@ +#!/usr/bin/env ruby +# +# cloudapp +# Zach Holman / @holman +# +# Uploads a file from the command line to CloudApp, drops it into your +# clipboard (on a Mac, at least). +# +# Example: +# +# cloudapp drunk-blake.png +# +# This requires Aaron Russell's cloudapp_api gem: +# +# gem install cloudapp_api +# +# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: +# +# email +# password + +require 'rubygems' +begin + require 'cloudapp_api' +rescue LoadError + puts "You need to install cloudapp_api: gem install cloudapp_api" + exit!(1) +end + +config_file = "#{ENV['HOME']}/.cloudapp" +unless File.exist?(config_file) + puts "You need to type your email and password (one per line) into "+ + "`~/.cloudapp`" + exit!(1) +end + +email,password = File.read(config_file).split("\n") + +class HTTParty::Response + # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU + # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT + def ok? ; true end +end + +if ARGV[0].nil? + puts "You need to specify a file to upload." + exit!(1) +end + +CloudApp.authenticate(email,password) +url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url + +# Say it for good measure. +puts "Uploaded to #{url}." + +# Get the embed link. +url = "#{url}/#{ARGV[0].split('/').last}" + +# Copy it to your (Mac's) clipboard. +`echo '#{url}' | tr -d "\n" | pbcopy` From b61fcb64abfd733a95f0e83e3009086959623252 Mon Sep 17 00:00:00 2001 From: Frank Louwers Date: Thu, 30 Jun 2011 15:19:50 +0200 Subject: [PATCH 092/137] knife autocompletion --- plugins/knife/_knife | 174 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 plugins/knife/_knife diff --git a/plugins/knife/_knife b/plugins/knife/_knife new file mode 100644 index 00000000..7f8c95ee --- /dev/null +++ b/plugins/knife/_knife @@ -0,0 +1,174 @@ +#compdef knife + +# These flags should be available everywhere according to man knife +knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes ) + +# knife has a very special syntax, some example calls are: +# knife status +# knife cookbook list +# knife role show ROLENAME +# knife data bag show DATABAGNAME +# knife role show ROLENAME --attribute ATTRIBUTENAME +# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes + +# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces +_knife() { + local curcontext="$curcontext" state line + typeset -A opt_args + cloudproviders=(bluebox ec2 rackspace slicehost terremark) + _arguments \ + '1: :->knifecmd'\ + '2: :->knifesubcmd'\ + '3: :->knifesubcmd2' \ + '4: :->knifesubcmd3' \ + '5: :->knifesubcmd4' \ + '6: :->knifesubcmd5' + + case $state in + knifecmd) + compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders + ;; + knifesubcmd) + case $words[2] in + (bluebox|ec2|rackspace|slicehost|terremark) + compadd "$@" server images + ;; + client) + compadd -Q "$@" "bulk delete" list create show delete edit reregister + ;; + configure) + compadd "$@" client + ;; + cookbook) + compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload + ;; + node) + compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" + ;; + recipe) + compadd "$@" list + ;; + role) + compadd -Q "$@" "bulk delete" create delete edit "from file" list show + ;; + windows) + compadd "$@" bootstrap + ;; + *) + _arguments '2:Subsubcommands:($(_knife_options1))' + esac + ;; + knifesubcmd2) + case $words[3] in + server) + compadd "$@" list create delete + ;; + images) + compadd "$@" list + ;; + site) + compadd "$@" vendor show share search download list unshare + ;; + (show|delete|edit) + _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))' + ;; + (upload|test) + _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)' + ;; + list) + compadd -a "$@" knife_general_flags + ;; + bag) + compadd -Q "$@" show edit list "from file" create delete + ;; + *) + _arguments '3:Subsubcommands:($(_knife_options2))' + esac + ;; + knifesubcmd3) + case $words[3] in + show) + case $words[2] in + cookbook) + versioncomp=1 + _arguments '4:Cookbookversions:($(_cookbook_versions) latest)' + ;; + (node|client|role) + compadd "$@" --attribute + esac + esac + case $words[4] in + (show|edit) + _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))' + ;; + file) + _arguments '*:file or directory:_files -g "*.(rb|json)"' + ;; + list) + compadd -a "$@" knife_general_flags + ;; + *) + _arguments '*:Subsubcommands:($(_knife_options3))' + esac + ;; + knifesubcmd4) + if (( versioncomp > 0 )); then + compadd "$@" attributes definitions files libraries providers recipes resources templates + else + _arguments '*:Subsubcommands:($(_knife_options2))' + fi + ;; + knifesubcmd5) + _arguments '*:Subsubcommands:($(_knife_options3))' + esac +} + +# Helper functions to provide the argument completion for several depths of commands +_knife_options1() { + ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) +} + +_knife_options2() { + ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) +} + +_knife_options3() { + ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) +} + +# The chef_x_remote functions use knife to get a list of objects of type x on the server +_chef_roles_remote() { + (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +_chef_clients_remote() { + (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +_chef_nodes_remote() { + (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +_chef_cookbooks_remote() { + (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +_chef_sitecookbooks_remote() { + (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +_chef_data_bags_remote() { + (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') +} + +# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server +_chef_cookbooks_local() { + (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done) +} + +# This function extracts the available cookbook versions on the chef server +_cookbook_versions() { + (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g') +} + +_knife "$@" From 8f62ef490de6945308c144a3bee7c3509a16d421 Mon Sep 17 00:00:00 2001 From: Dan Poggi Date: Tue, 12 Jul 2011 23:20:21 -0400 Subject: [PATCH 093/137] Added 'dpoggi' theme --- themes/dpoggi.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 themes/dpoggi.zsh-theme diff --git a/themes/dpoggi.zsh-theme b/themes/dpoggi.zsh-theme new file mode 100644 index 00000000..6469a200 --- /dev/null +++ b/themes/dpoggi.zsh-theme @@ -0,0 +1,14 @@ +if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\ +%{$reset_color%}:%{$fg[magenta]%}%~\ +$(git_prompt_info) \ +%{$fg[red]%}%(!.#.»)%{$reset_color%} ' +PROMPT2='%{$fg[red]%}\ %{$reset_color%}' +RPS1='${return_code}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}⚡%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" From 9e8194355c1a4f69dc52fbe2699fbce1be5c6493 Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 13:13:39 +0200 Subject: [PATCH 094/137] Added bundler-exec plugin --- plugins/bundler-exec/bundler-exec.plugin.zsh | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/bundler-exec/bundler-exec.plugin.zsh diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh new file mode 100644 index 00000000..96672597 --- /dev/null +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -0,0 +1,37 @@ +# This plugin is based on https://github.com/gma/bundler-exec +# modify the BUNDLED_COMMANDS if needed + +BUNDLED_COMMANDS=(cucumber heroku rackup rails rake rspec ruby shotgun spec spork) + +## Functions + +bundler-installed() +{ + which bundle > /dev/null 2>&1 +} + +within-bundled-project() +{ + local dir="$(pwd)" + while [ "$(dirname $dir)" != "/" ]; do + [ -f "$dir/Gemfile" ] && return + dir="$(dirname $dir)" + done + false +} + +run-with-bundler() +{ + local command="$1" + shift + if bundler-installed && within-bundled-project; then + bundle exec $command "$@" + else + $command "$@" + fi +} + +## Main program +for CMD in $BUNDLED_COMMANDS; do + alias $CMD="run-with-bundler $CMD" +done From 05883f383143fa4821a5b07a748a800c0299f1fd Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 15:52:58 +0200 Subject: [PATCH 095/137] use lowercase for variablenames --- plugins/bundler-exec/bundler-exec.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index 96672597..cfab16c5 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -1,7 +1,7 @@ # This plugin is based on https://github.com/gma/bundler-exec # modify the BUNDLED_COMMANDS if needed -BUNDLED_COMMANDS=(cucumber heroku rackup rails rake rspec ruby shotgun spec spork) +bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spork) ## Functions @@ -32,6 +32,6 @@ run-with-bundler() } ## Main program -for CMD in $BUNDLED_COMMANDS; do - alias $CMD="run-with-bundler $CMD" +for cmd in $bundled_commands; do + alias $cmd="run-with-bundler $cmd" done From 3aee5c19412dea541495e10f1c4cc7a6d8e4af50 Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 19:16:04 +0200 Subject: [PATCH 096/137] changed names of functions and variables to fit naming conventions --- plugins/bundler-exec/bundler-exec.plugin.zsh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index cfab16c5..4684dcb8 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -5,26 +5,26 @@ bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spor ## Functions -bundler-installed() +_bundler-installed() { which bundle > /dev/null 2>&1 } -within-bundled-project() +_within-bundled-project() { - local dir="$(pwd)" - while [ "$(dirname $dir)" != "/" ]; do - [ -f "$dir/Gemfile" ] && return - dir="$(dirname $dir)" + local check_dir=$PWD + while [ "$(dirname $check_dir)" != "/" ]; do + [ -f "$check_dir/Gemfile" ] && return + dir="$(dirname $check_dir)" done false } -run-with-bundler() +_run-with-bundler() { local command="$1" shift - if bundler-installed && within-bundled-project; then + if _bundler-installed && _within-bundled-project; then bundle exec $command "$@" else $command "$@" @@ -33,5 +33,5 @@ run-with-bundler() ## Main program for cmd in $bundled_commands; do - alias $cmd="run-with-bundler $cmd" + alias $cmd="_run-with-bundler $cmd" done From 86958a32f3d3e647fc61e92700a9ce393e11a3cb Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 20:28:27 +0200 Subject: [PATCH 097/137] forgot to rename one variable --- plugins/bundler-exec/bundler-exec.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index 4684dcb8..bc4d35a8 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -15,7 +15,7 @@ _within-bundled-project() local check_dir=$PWD while [ "$(dirname $check_dir)" != "/" ]; do [ -f "$check_dir/Gemfile" ] && return - dir="$(dirname $check_dir)" + check_dir="$(dirname $check_dir)" done false } @@ -27,7 +27,7 @@ _run-with-bundler() if _bundler-installed && _within-bundled-project; then bundle exec $command "$@" else - $command "$@" + $command "$@" fi } From 69d30a6302f8c7daf6ad5ecf23224074789843db Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 23:16:47 +0200 Subject: [PATCH 098/137] Moved opening braces --- plugins/bundler-exec/bundler-exec.plugin.zsh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index bc4d35a8..09f44ed5 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -1,17 +1,15 @@ # This plugin is based on https://github.com/gma/bundler-exec -# modify the BUNDLED_COMMANDS if needed +# modify the bundled_commands if needed bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spork) ## Functions -_bundler-installed() -{ +_bundler-installed() { which bundle > /dev/null 2>&1 } -_within-bundled-project() -{ +_within-bundled-project() { local check_dir=$PWD while [ "$(dirname $check_dir)" != "/" ]; do [ -f "$check_dir/Gemfile" ] && return @@ -20,8 +18,7 @@ _within-bundled-project() false } -_run-with-bundler() -{ +_run-with-bundler() { local command="$1" shift if _bundler-installed && _within-bundled-project; then From 37fcd4af049ad9b755d7b1d32cf63b537da0342c Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 13 Jul 2011 22:39:23 +0100 Subject: [PATCH 099/137] update bundled commands --- plugins/bundler-exec/bundler-exec.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index 09f44ed5..61829eb2 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -1,7 +1,7 @@ # This plugin is based on https://github.com/gma/bundler-exec # modify the bundled_commands if needed -bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spork) +bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From a77e6fb003cc80fbbff5d453a5ca3d38638d99ed Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 13 Jul 2011 22:40:23 +0100 Subject: [PATCH 100/137] fix indentation --- plugins/bundler-exec/bundler-exec.plugin.zsh | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index 61829eb2..3417ea81 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -6,29 +6,29 @@ bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgu ## Functions _bundler-installed() { - which bundle > /dev/null 2>&1 + which bundle > /dev/null 2>&1 } _within-bundled-project() { - local check_dir=$PWD - while [ "$(dirname $check_dir)" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return - check_dir="$(dirname $check_dir)" - done - false + local check_dir=$PWD + while [ "$(dirname $check_dir)" != "/" ]; do + [ -f "$check_dir/Gemfile" ] && return + check_dir="$(dirname $check_dir)" + done + false } _run-with-bundler() { - local command="$1" - shift - if _bundler-installed && _within-bundled-project; then - bundle exec $command "$@" - else - $command "$@" - fi + local command="$1" + shift + if _bundler-installed && _within-bundled-project; then + bundle exec $command "$@" + else + $command "$@" + fi } ## Main program for cmd in $bundled_commands; do - alias $cmd="_run-with-bundler $cmd" + alias $cmd="_run-with-bundler $cmd" done From 60e104acd1710c04057d079cfa5ac9316762f580 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 13 Jul 2011 22:41:09 +0100 Subject: [PATCH 101/137] merge bundler and bundle-exec plugins --- plugins/bundler-exec/bundler-exec.plugin.zsh | 34 -------------------- plugins/bundler/bundler.plugin.zsh | 34 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 plugins/bundler-exec/bundler-exec.plugin.zsh diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh deleted file mode 100644 index 3417ea81..00000000 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# This plugin is based on https://github.com/gma/bundler-exec -# modify the bundled_commands if needed - -bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) - -## Functions - -_bundler-installed() { - which bundle > /dev/null 2>&1 -} - -_within-bundled-project() { - local check_dir=$PWD - while [ "$(dirname $check_dir)" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return - check_dir="$(dirname $check_dir)" - done - false -} - -_run-with-bundler() { - local command="$1" - shift - if _bundler-installed && _within-bundled-project; then - bundle exec $command "$@" - else - $command "$@" - fi -} - -## Main program -for cmd in $bundled_commands; do - alias $cmd="_run-with-bundler $cmd" -done diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index fb40e2ce..fcf3e85f 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,3 +1,37 @@ alias be="bundle exec" alias bi="bundle install" alias bu="bundle update" + +# The following is based on https://github.com/gma/bundler-exec + +bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) + +## Functions + +_bundler-installed() { + which bundle > /dev/null 2>&1 +} + +_within-bundled-project() { + local check_dir=$PWD + while [ "$(dirname $check_dir)" != "/" ]; do + [ -f "$check_dir/Gemfile" ] && return + check_dir="$(dirname $check_dir)" + done + false +} + +_run-with-bundler() { + local command="$1" + shift + if _bundler-installed && _within-bundled-project; then + bundle exec $command "$@" + else + $command "$@" + fi +} + +## Main program +for cmd in $bundled_commands; do + alias $cmd="_run-with-bundler $cmd" +done From ba5fa3abc8ccf1f05e48c9b201282792c956c337 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 13 Jul 2011 22:41:36 +0100 Subject: [PATCH 102/137] alias bundle list --- plugins/bundler/bundler.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index fcf3e85f..c91dc9ab 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -1,5 +1,6 @@ alias be="bundle exec" alias bi="bundle install" +alias bl="bundle list" alias bu="bundle update" # The following is based on https://github.com/gma/bundler-exec From 7d19ae8fab80c826156f984aa6dd8221a9aaada0 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 13 Jul 2011 22:42:44 +0100 Subject: [PATCH 103/137] clean up rails plugin, removing bundler-specific logic --- plugins/rails3/rails3.plugin.zsh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh index f669ef04..f4ee637e 100644 --- a/plugins/rails3/rails3.plugin.zsh +++ b/plugins/rails3/rails3.plugin.zsh @@ -1,13 +1,5 @@ # Rails 3 aliases, backwards-compatible with Rails 2. -function _bundle_command { - if command -v bundle && [ -e "Gemfile" ]; then - bundle exec $@ - else - $@ - fi -} - function _rails_command () { if [ -e "script/server" ]; then ruby script/$@ @@ -25,6 +17,3 @@ alias rp='_rails_command plugin' alias rs='_rails_command server' alias rsd='_rails_command server --debugger' alias devlog='tail -f log/development.log' - -alias rspec='_bundle_command rspec' -alias cuke='_bundle_command cucumber' From 6774fb3d59365ddb8520cdb4d46444720f788be0 Mon Sep 17 00:00:00 2001 From: Brandon Konkle Date: Wed, 13 Jul 2011 23:23:01 -0700 Subject: [PATCH 104/137] Minor corrections to deletion detection in git_prompt_status --- lib/git.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index ce4de559..f0434365 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -52,7 +52,9 @@ git_prompt_status() { if $(echo "$INDEX" | grep '^R ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" fi - if $(echo "$INDEX" | grep '^D ' &> /dev/null); then + if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" fi if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then From 913cf5325264960d4c1dfe678a2adadeaecdbf6a Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Thu, 14 Jul 2011 17:34:18 +0100 Subject: [PATCH 105/137] refactor _run-with-bundler --- plugins/bundler/bundler.plugin.zsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c91dc9ab..e98bb4b4 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -23,12 +23,10 @@ _within-bundled-project() { } _run-with-bundler() { - local command="$1" - shift if _bundler-installed && _within-bundled-project; then - bundle exec $command "$@" + bundle exec $@ else - $command "$@" + $@ fi } From 9308a7d472a1dea6610887b98d6d789741f96a49 Mon Sep 17 00:00:00 2001 From: Adam Blinkinsop Date: Thu, 14 Jul 2011 11:04:46 -0700 Subject: [PATCH 106/137] Added a new theme. --- themes/blinks.zsh-theme | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 themes/blinks.zsh-theme diff --git a/themes/blinks.zsh-theme b/themes/blinks.zsh-theme new file mode 100644 index 00000000..3db7012f --- /dev/null +++ b/themes/blinks.zsh-theme @@ -0,0 +1,20 @@ +# https://github.com/blinks zsh theme + +function _prompt_char() { + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + echo "%{%F{blue}%}±%{%f%k%b%}" + else + echo ' ' + fi +} + +ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +PROMPT='%{%f%k%b%} +%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%} +%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} ' + +RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}' From caa1cc70678e15fe0da93a89e52f543c6bda7494 Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Thu, 14 Jul 2011 21:41:26 -0700 Subject: [PATCH 107/137] zsh-history-substring-search plugin at 15f63de https://github.com/sunaku/zsh-history-substring-search --- README | 7 + history-substring-search.plugin.zsh | 12 + history-substring-search.zsh | 642 ++++++++++++++++++++++++++++ 3 files changed, 661 insertions(+) create mode 100644 README create mode 100644 history-substring-search.plugin.zsh create mode 100644 history-substring-search.zsh diff --git a/README b/README new file mode 100644 index 00000000..be11adf7 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +To activate this script, load it into an interactive ZSH session: + + % source history-substring-search.zsh + +See the "history-substring-search.zsh" file for more information: + + % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more diff --git a/history-substring-search.plugin.zsh b/history-substring-search.plugin.zsh new file mode 100644 index 00000000..99a5922c --- /dev/null +++ b/history-substring-search.plugin.zsh @@ -0,0 +1,12 @@ +# This file integrates the history-substring-search script into oh-my-zsh. + +source "$ZSH/plugins/history-substring-search/history-substring-search.zsh" + +if test "$CASE_SENSITIVE" = true; then + unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS +fi + +if test "$DISABLE_COLOR" = true; then + unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND +fi diff --git a/history-substring-search.zsh b/history-substring-search.zsh new file mode 100644 index 00000000..53f707c7 --- /dev/null +++ b/history-substring-search.zsh @@ -0,0 +1,642 @@ +#!/usr/bin/env zsh +# +# This is a clean-room implementation of the Fish[1] shell's history search +# feature, where you can type in any part of any previously entered command +# and press the UP and DOWN arrow keys to cycle through the matching commands. +# +#----------------------------------------------------------------------------- +# Usage +#----------------------------------------------------------------------------- +# +# 1. Load this script into your interactive ZSH session: +# +# % source history-substring-search.zsh +# +# If you want to use the zsh-syntax-highlighting[6] script along with this +# script, then make sure that you load it *before* you load this script: +# +# % source zsh-syntax-highlighting.zsh +# % source history-substring-search.zsh +# +# 2. Type any part of any previous command and then: +# +# * Press the UP arrow key to select the nearest command that (1) contains +# your query and (2) is older than the current command in the command +# history. +# +# * Press the DOWN arrow key to select the nearest command that (1) +# contains your query and (2) is newer than the current command in the +# command history. +# +# * Press ^U (the Control and U keys simultaneously) to abort the search. +# +# 3. If a matching command spans more than one line of text, press the LEFT +# arrow key to move the cursor away from the end of the command, and then: +# +# * Press the UP arrow key to move the cursor to the line above. When the +# cursor reaches the first line of the command, pressing the UP arrow +# key again will cause this script to perform another search. +# +# * Press the DOWN arrow key to move the cursor to the line below. When +# the cursor reaches the last line of the command, pressing the DOWN +# arrow key again will cause this script to perform another search. +# +#----------------------------------------------------------------------------- +# Configuration +#----------------------------------------------------------------------------- +# +# This script defines the following global variables. You may override their +# default values only after having loaded this script into your ZSH session. +# +# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND is a global variable that defines +# how the query should be highlighted inside a matching command. Its default +# value causes this script to highlight using bold, white text on a magenta +# background. See the "Character Highlighting" section in the zshzle(1) man +# page to learn about the kinds of values you may assign to this variable. +# +# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND is a global variable that +# defines how the query should be highlighted when no commands in the +# history match it. Its default value causes this script to highlight using +# bold, white text on a red background. See the "Character Highlighting" +# section in the zshzle(1) man page to learn about the kinds of values you +# may assign to this variable. +# +# * HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS is a global variable that defines +# how the command history will be searched for your query. Its default value +# causes this script to perform a case-insensitive search. See the "Globbing +# Flags" section in the zshexpn(1) man page to learn about the kinds of +# values you may assign to this variable. +# +#----------------------------------------------------------------------------- +# History +#----------------------------------------------------------------------------- +# +# This script was originally written by Peter Stephenson[2], who published it +# to the ZSH users mailing list (thereby making it public domain) in September +# 2009. It was later revised by Guido van Steen and released under the BSD +# license (see below) as part of the fizsh[3] project in January 2011. +# +# It was later extracted from fizsh[3] release 1.0.1, refactored heavily, and +# repackaged as both an oh-my-zsh plugin[4] and as an independently loadable +# ZSH script[5] by Suraj N. Kurapati in 2011. +# +# It was further developed[4] by Guido van Steen, Suraj N. Kurapati, Sorin +# Ionescu, and Vincent Guerci in 2011. +# +# [1]: http://fishshell.com +# [2]: http://www.zsh.org/mla/users/2009/msg00818.html +# [3]: http://sourceforge.net/projects/fizsh/ +# [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 +# [5]: https://github.com/sunaku/zsh-history-substring-search +# [6]: https://github.com/nicoulaj/zsh-syntax-highlighting +# +############################################################################## +# +# Copyright (c) 2009 Peter Stephenson +# Copyright (c) 2011 Guido van Steen +# Copyright (c) 2011 Suraj N. Kurapati +# Copyright (c) 2011 Sorin Ionescu +# Copyright (c) 2011 Vincent Guerci +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# * Neither the name of the FIZSH nor the names of its contributors +# may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################## + +#----------------------------------------------------------------------------- +# configuration variables +#----------------------------------------------------------------------------- + +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' +HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' + +#----------------------------------------------------------------------------- +# the main ZLE widgets +#----------------------------------------------------------------------------- + +function history-substring-search-up() { + _history-substring-search-begin + + _history-substring-search-up-history || + _history-substring-search-up-buffer || + _history-substring-search-up-search + + _history-substring-search-end +} + +function history-substring-search-down() { + _history-substring-search-begin + + _history-substring-search-down-history || + _history-substring-search-down-buffer || + _history-substring-search-down-search + + _history-substring-search-end +} + +zle -N history-substring-search-up +zle -N history-substring-search-down + +bindkey '\e[A' history-substring-search-up +bindkey '\e[B' history-substring-search-down + +#----------------------------------------------------------------------------- +# implementation details +#----------------------------------------------------------------------------- + +setopt extendedglob +zmodload -F zsh/parameter + +# +# We have to "override" some keys and widgets if the +# zsh-syntax-highlighting plugin has not been loaded: +# +# https://github.com/nicoulaj/zsh-syntax-highlighting +# +if [[ $+functions[_zsh_highlight] -eq 0 ]]; then + # + # Dummy implementation of _zsh_highlight() + # that simply removes existing highlights + # + function _zsh_highlight() { + region_highlight=() + } + + # + # Remove existing highlights when the user + # inserts printable characters into $BUFFER + # + function ordinary-key-press() { + if [[ $KEYS == [[:print:]] ]]; then + region_highlight=() + fi + zle .self-insert + } + zle -N self-insert ordinary-key-press + + # + # Override ZLE widgets to invoke _zsh_highlight() + # + # https://github.com/nicoulaj/zsh-syntax-highlighting/blob/ + # bb7fcb79fad797a40077bebaf6f4e4a93c9d8163/zsh-syntax-highlighting.zsh#L121 + # + #--------------8<-------------------8<-------------------8<----------------- + # + # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # + # * Redistributions in binary form must reproduce the above copyright + # notice, this list of conditions and the following disclaimer in the + # documentation and/or other materials provided with the distribution. + # + # * Neither the name of the zsh-syntax-highlighting contributors nor the + # names of its contributors may be used to endorse or promote products + # derived from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + # Load ZSH module zsh/zleparameter, needed to override user defined widgets. + zmodload zsh/zleparameter 2>/dev/null || { + echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter, exiting.' >&2 + return -1 + } + + # Override ZLE widgets to make them invoke _zsh_highlight. + for event in ${${(f)"$(zle -la)"}:#(_*|orig-*|.run-help|.which-command)}; do + if [[ "$widgets[$event]" == completion:* ]]; then + eval "zle -C orig-$event ${${${widgets[$event]}#*:}/:/ } ; $event() { builtin zle orig-$event && _zsh_highlight } ; zle -N $event" + else + case $event in + accept-and-menu-complete) + eval "$event() { builtin zle .$event && _zsh_highlight } ; zle -N $event" + ;; + + # The following widgets should NOT remove any previously + # applied highlighting. Therefore we do not remap them. + .forward-char|.backward-char|.up-line-or-history|.down-line-or-history) + ;; + + .*) + clean_event=$event[2,${#event}] # Remove the leading dot in the event name + case ${widgets[$clean_event]-} in + (completion|user):*) + ;; + *) + eval "$clean_event() { builtin zle $event && _zsh_highlight } ; zle -N $clean_event" + ;; + esac + ;; + *) + ;; + esac + fi + done + unset event clean_event + #-------------->8------------------->8------------------->8----------------- +fi + +function _history-substring-search-begin() { + _history_substring_search_move_cursor_eol=false + _history_substring_search_query_highlight= + + # + # Continue using the previous $_history_substring_search_result by default, + # unless the current query was cleared or a new/different query was entered. + # + if [[ -z $BUFFER || $BUFFER != $_history_substring_search_result ]]; then + # + # For the purpose of highlighting we will also keep + # a version without doubly-escaped meta characters. + # + _history_substring_search_query=$BUFFER + + # + # $BUFFER contains the text that is in the command-line currently. + # we put an extra "\\" before meta characters such as "\(" and "\)", + # so that they become "\\\(" and "\\\)". + # + _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH} + + # + # Find all occurrences of the search query in the history file. + # + # (k) turns it an array of line numbers. + # + # (on) seems to remove duplicates, which are default + # options. They can be turned off by (ON). + # + _history_substring_search_matches=(${(kon)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)*${_history_substring_search_query_escaped}*]}) + + # + # Define the range of values that $_history_substring_search_match_index + # can take: [0, $_history_substring_search_matches_count_plus]. + # + _history_substring_search_matches_count=$#_history_substring_search_matches + _history_substring_search_matches_count_plus=$(( _history_substring_search_matches_count + 1 )) + _history_substring_search_matches_count_sans=$(( _history_substring_search_matches_count - 1 )) + + # + # If $_history_substring_search_match_index is equal to + # $_history_substring_search_matches_count_plus, this indicates that we + # are beyond the beginning of $_history_substring_search_matches. + # + # If $_history_substring_search_match_index is equal to 0, this indicates + # that we are beyond the end of $_history_substring_search_matches. + # + # If we have initially pressed "up" we have to initialize + # $_history_substring_search_match_index to + # $_history_substring_search_matches_count_plus so that it will be + # decreased to $_history_substring_search_matches_count. + # + # If we have initially pressed "down" we have to initialize + # $_history_substring_search_match_index to + # $_history_substring_search_matches_count so that it will be increased to + # $_history_substring_search_matches_count_plus. + # + if [[ $WIDGET == history-substring-search-down ]]; then + _history_substring_search_match_index=$_history_substring_search_matches_count + else + _history_substring_search_match_index=$_history_substring_search_matches_count_plus + fi + fi +} + +function _history-substring-search-end() { + _history_substring_search_result=$BUFFER + + # move the cursor to the end of the command line + if [[ $_history_substring_search_move_cursor_eol == true ]]; then + CURSOR=${#BUFFER} + fi + + # highlight command line using zsh-syntax-highlighting + _zsh_highlight + + # highlight the search query inside the command line + if [[ -n $_history_substring_search_query_highlight && -n $_history_substring_search_query ]]; then + # + # The following expression yields a variable $MBEGIN, which + # indicates the begin position + 1 of the first occurrence + # of _history_substring_search_query_escaped in $BUFFER. + # + : ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($_history_substring_search_query##)} + local begin=$(( MBEGIN - 1 )) + local end=$(( begin + $#_history_substring_search_query )) + region_highlight+=("$begin $end $_history_substring_search_query_highlight") + fi + + # For debugging purposes: + # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} + # read -k -t 200 && zle -U $REPLY + + # Exit successfully from the history-substring-search-* widgets. + true +} + +function _history-substring-search-up-buffer() { + # + # Check if the UP arrow was pressed to move the cursor within a multi-line + # buffer. This amounts to three tests: + # + # 1. $#buflines -gt 1. + # + # 2. $CURSOR -ne $#BUFFER. + # + # 3. Check if we are on the first line of the current multi-line buffer. + # If so, pressing UP would amount to leaving the multi-line buffer. + # + # We check this by adding an extra "x" to $LBUFFER, which makes + # sure that xlbuflines is always equal to the number of lines + # until $CURSOR (including the line with the cursor on it). + # + local buflines XLBUFFER xlbuflines + buflines=(${(f)BUFFER}) + XLBUFFER=$LBUFFER"x" + xlbuflines=(${(f)XLBUFFER}) + + if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then + zle up-line-or-history + return true + fi + + false +} + +function _history-substring-search-down-buffer() { + # + # Check if the DOWN arrow was pressed to move the cursor within a multi-line + # buffer. This amounts to three tests: + # + # 1. $#buflines -gt 1. + # + # 2. $CURSOR -ne $#BUFFER. + # + # 3. Check if we are on the last line of the current multi-line buffer. + # If so, pressing DOWN would amount to leaving the multi-line buffer. + # + # We check this by adding an extra "x" to $RBUFFER, which makes + # sure that xrbuflines is always equal to the number of lines + # from $CURSOR (including the line with the cursor on it). + # + local buflines XRBUFFER xrbuflines + buflines=(${(f)BUFFER}) + XRBUFFER="x"$RBUFFER + xrbuflines=(${(f)XRBUFFER}) + + if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then + zle down-line-or-history + return true + fi + + false +} + +function _history-substring-search-up-history() { + # + # Behave like up in ZSH, except clear the $BUFFER + # when beginning of history is reached like in Fish. + # + if [[ -z $_history_substring_search_query ]]; then + + # we have reached the absolute top of history + if [[ $HISTNO -eq 1 ]]; then + BUFFER= + + # going up from somewhere below the top of history + else + zle up-history + fi + + return true + fi + + false +} + +function _history-substring-search-down-history() { + # + # Behave like down-history in ZSH, except clear the + # $BUFFER when end of history is reached like in Fish. + # + if [[ -z $_history_substring_search_query ]]; then + + # going down from the absolute top of history + if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then + BUFFER=${history[1]} + _history_substring_search_move_cursor_eol=true + + # going down from somewhere above the bottom of history + else + zle down-history + fi + + return true + fi + + false +} + +function _history-substring-search-up-search() { + _history_substring_search_move_cursor_eol=true + + # + # Highlight matches during history-substring-up-search: + # + # The following constants have been initialized in + # _history-substring-search-up/down-search(): + # + # $_history_substring_search_matches is the current list of matches + # $_history_substring_search_matches_count is the current number of matches + # $_history_substring_search_matches_count_plus is the current number of matches + 1 + # $_history_substring_search_matches_count_sans is the current number of matches - 1 + # $_history_substring_search_match_index is the index of the current match + # + # The range of values that $_history_substring_search_match_index can take + # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 + # indicates that we are beyond the end of + # $_history_substring_search_matches. A value of + # $_history_substring_search_matches_count_plus indicates that we are beyond + # the beginning of $_history_substring_search_matches. + # + # In _history-substring-search-up-search() the initial value of + # $_history_substring_search_match_index is + # $_history_substring_search_matches_count_plus. This value is set in + # _history-substring-search-begin(). _history-substring-search-up-search() + # will initially decrease it to $_history_substring_search_matches_count. + # + if [[ $_history_substring_search_match_index -ge 2 ]]; then + # + # Highlight the next match: + # + # 1. Decrease the value of $_history_substring_search_match_index. + # + # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) + BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + + elif [[ $_history_substring_search_match_index -eq 1 ]]; then + # + # We will move beyond the end of $_history_substring_search_matches: + # + # 1. Decrease the value of $_history_substring_search_match_index. + # + # 2. Save the current buffer in $_history_substring_search_old_buffer, + # so that it can be retrieved by + # _history-substring-search-down-search() later. + # + # 3. Make $BUFFER equal to $_history_substring_search_query. + # + # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) + _history_substring_search_old_buffer=$BUFFER + BUFFER=$_history_substring_search_query + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + + elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count_plus ]]; then + # + # We were beyond the beginning of $_history_substring_search_matches but + # UP makes us move back to $_history_substring_search_matches: + # + # 1. Decrease the value of $_history_substring_search_match_index. + # + # 2. Restore $BUFFER from $_history_substring_search_old_buffer. + # + # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) + BUFFER=$_history_substring_search_old_buffer + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + fi +} + +function _history-substring-search-down-search() { + _history_substring_search_move_cursor_eol=true + + # + # Highlight matches during history-substring-up-search: + # + # The following constants have been initialized in + # _history-substring-search-up/down-search(): + # + # $_history_substring_search_matches is the current list of matches + # $_history_substring_search_matches_count is the current number of matches + # $_history_substring_search_matches_count_plus is the current number of matches + 1 + # $_history_substring_search_matches_count_sans is the current number of matches - 1 + # $_history_substring_search_match_index is the index of the current match + # + # The range of values that $_history_substring_search_match_index can take + # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 + # indicates that we are beyond the end of + # $_history_substring_search_matches. A value of + # $_history_substring_search_matches_count_plus indicates that we are beyond + # the beginning of $_history_substring_search_matches. + # + # In _history-substring-search-down-search() the initial value of + # $_history_substring_search_match_index is + # $_history_substring_search_matches_count. This value is set in + # _history-substring-search-begin(). + # _history-substring-search-down-search() will initially increase it to + # $_history_substring_search_matches_count_plus. + # + if [[ $_history_substring_search_match_index -le $_history_substring_search_matches_count_sans ]]; then + # + # Highlight the next match: + # + # 1. Increase $_history_substring_search_match_index by 1. + # + # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) + BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + + elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count ]]; then + # + # We will move beyond the beginning of $_history_substring_search_matches: + # + # 1. Increase $_history_substring_search_match_index by 1. + # + # 2. Save the current buffer in $_history_substring_search_old_buffer, so + # that it can be retrieved by _history-substring-search-up-search() + # later. + # + # 3. Make $BUFFER equal to $_history_substring_search_query. + # + # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) + _history_substring_search_old_buffer=$BUFFER + BUFFER=$_history_substring_search_query + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + + elif [[ $_history_substring_search_match_index -eq 0 ]]; then + # + # We were beyond the end of $_history_substring_search_matches but DOWN + # makes us move back to the $_history_substring_search_matches: + # + # 1. Increase $_history_substring_search_match_index by 1. + # + # 2. Restore $BUFFER from $_history_substring_search_old_buffer. + # + # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) + BUFFER=$_history_substring_search_old_buffer + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + fi +} + +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et From 66c6260c10422bf50c474c9654a7928ce99e7ceb Mon Sep 17 00:00:00 2001 From: Paul Serby Date: Sat, 16 Jul 2011 16:15:15 +0100 Subject: [PATCH 108/137] Completion for cake the coffee-script build tool --- plugins/cake/cake.plugin.zsh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 plugins/cake/cake.plugin.zsh diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh new file mode 100644 index 00000000..75997521 --- /dev/null +++ b/plugins/cake/cake.plugin.zsh @@ -0,0 +1,32 @@ +# Set this to 1 if you want to cache the tasks +cacheTaskList=1 + +# Cache filename +cacheFile='.cake-task-cache' + +_cake_does_target_list_need_generating () { + + if [ $cacheTaskList -eq 0 ]; then + return 1; + fi + + if [ ! -f $cacheFile ]; then return 0; + else + accurate=$(stat -f%m $cacheFile) + changed=$(stat -f%m Cakefile) + return $(expr $accurate '>=' $changed) + fi +} + +_cake () { + if [ -f Cakefile ]; then + if _cake_does_target_list_need_generating; then + cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cacheFile + compadd `cat $cacheFile` + else + compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'` + fi + fi +} + +compdef _cake cake From e7e9e5bbe608fd7572a810f36e7f1b3321c25136 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Sat, 16 Jul 2011 18:42:09 -0400 Subject: [PATCH 109/137] Added archlinux plugin --- plugins/archlinux/archlinux.plugin.zsh | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 plugins/archlinux/archlinux.plugin.zsh diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh new file mode 100644 index 00000000..acb8df05 --- /dev/null +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -0,0 +1,67 @@ +# Archlinux zsh aliases and functions for zsh + +# Aliases ################################################################### + +# Look for yaourt, and add some useful functions if we have it. +if [[ -x `which yaourt` ]]; then + upgrade () { + yaourt -Syu -C + } + # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips + alias yaupg='sudo yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. + alias yain='sudo yaourt -S' # Install specific package(s) from the repositories + alias yains='sudo yaourt -U' # Install specific package not from the repositories but from a file + alias yare='sudo yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies + alias yarem='sudo yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies + alias yarep='yaourt -Si' # Display information about a given package in the repositories + alias yareps='yaourt -Ss' # Search for package(s) in the repositories + alias yaloc='yaourt -Qi' # Display information about a given package in the local database + alias yalocs='yaourt -Qs' # Search for package(s) in the local database + # Additional yaourt alias examples + alias yaupd='sudo yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories + alias yainsd='sudo yaourt -S --asdeps' # Install given package(s) as dependencies of another package + alias yamir='sudo yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist +else + upgrade() { + sudo pacman -Syu + } +fi + +# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips +alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. +alias pacin='sudo pacman -S' # Install specific package(s) from the repositories +alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file +alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies +alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies +alias pacrep='pacman -Si' # Display information about a given package in the repositories +alias pacreps='pacman -Ss' # Search for package(s) in the repositories +alias pacloc='pacman -Qi' # Display information about a given package in the local database +alias paclocs='pacman -Qs' # Search for package(s) in the local database +# Additional pacman alias examples +alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories +alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package +alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist + +# https://bbs.archlinux.org/viewtopic.php?id=93683 +paclist() { + sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' +} +alias paclsorhpans='sudo pacman -Qdt' +alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' + +pacdisowned() { + tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ + db=$tmp/db + fs=$tmp/fs + + mkdir "$tmp" + trap 'rm -rf "$tmp"' EXIT + + pacman -Qlq | sort -u > "$db" + + find /bin /etc /lib /sbin /usr \ + ! -name lost+found \ + \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" + + comm -23 "$fs" "$db" +} From edcd4f7eea357cefee37a25a371e1dd5d1a6b598 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Sun, 17 Jul 2011 13:01:48 -0500 Subject: [PATCH 110/137] Adding quotes to deal with paths that have spaces. --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index e3048882..2b75e554 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -9,4 +9,4 @@ echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m echo "\033[0;32m"' /____/ '"\033[0m" echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" -cd $current_path +cd "$current_path" From 127d2ae57b01ae13dd6017c3c104a45a0086e88e Mon Sep 17 00:00:00 2001 From: alexandru totolici Date: Sun, 17 Jul 2011 21:01:06 -0700 Subject: [PATCH 111/137] Fixed typo for one of the subcommands (linset -> linsert) --- plugins/redis-cli/_redis-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/redis-cli/_redis-cli b/plugins/redis-cli/_redis-cli index 3789add1..1569f291 100644 --- a/plugins/redis-cli/_redis-cli +++ b/plugins/redis-cli/_redis-cli @@ -51,7 +51,7 @@ _1st_arguments=( 'keys:find all keys matching the given pattern' 'lastsave:get the UNIX timestamp of the last successful save to disk' 'lindex:get an element from a list by its index' - 'linset:insert an element before or after another element in a list' + 'linsert:insert an element before or after another element in a list' 'llen:get the length of a list' 'lpop:remove and get the first element in a list' 'lpush:prepend a value to a list' From a38774c98d1c08f82b1325a40b2de1a76586e02a Mon Sep 17 00:00:00 2001 From: Christopher Sexton Date: Tue, 17 May 2011 14:13:07 -0400 Subject: [PATCH 112/137] C-x C-e to edit current command in EDITOR The command C-x C-e opens the current command line for editing in the editor defined by the $EDITOR environment variable. Thanks to Craig Bosma and his blog post about this: http://distrustsimplicity.net/articles/zsh-command-editing --- lib/edit-command-line.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/edit-command-line.zsh diff --git a/lib/edit-command-line.zsh b/lib/edit-command-line.zsh new file mode 100644 index 00000000..db200032 --- /dev/null +++ b/lib/edit-command-line.zsh @@ -0,0 +1,3 @@ +autoload -U edit-command-line +zle -N edit-command-line +bindkey '\C-x\C-e' edit-command-line From c09e2f2986aafbf2a67004f8df6b5dd10abb8d61 Mon Sep 17 00:00:00 2001 From: Paul Serby Date: Mon, 18 Jul 2011 16:05:05 +0100 Subject: [PATCH 113/137] Bringing inline with oh-my-zsh coding convensions --- plugins/cake/cake.plugin.zsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh index 75997521..f968c71d 100644 --- a/plugins/cake/cake.plugin.zsh +++ b/plugins/cake/cake.plugin.zsh @@ -1,18 +1,18 @@ # Set this to 1 if you want to cache the tasks -cacheTaskList=1 +cache_task_list=1 # Cache filename -cacheFile='.cake-task-cache' +cache_file='.cake_task_cache' _cake_does_target_list_need_generating () { - if [ $cacheTaskList -eq 0 ]; then + if [ $cache_task_list -eq 0 ]; then return 1; fi - if [ ! -f $cacheFile ]; then return 0; + if [ ! -f $cache_file ]; then return 0; else - accurate=$(stat -f%m $cacheFile) + accurate=$(stat -f%m $cache_file) changed=$(stat -f%m Cakefile) return $(expr $accurate '>=' $changed) fi @@ -21,8 +21,8 @@ _cake_does_target_list_need_generating () { _cake () { if [ -f Cakefile ]; then if _cake_does_target_list_need_generating; then - cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cacheFile - compadd `cat $cacheFile` + cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file + compadd `cat $cache_file` else compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'` fi From 8e77ad468dd22f25c461a0f69f9c03cbb2fb2d05 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Tue, 19 Jul 2011 19:38:29 -0700 Subject: [PATCH 114/137] Fix typo --- plugins/archlinux/archlinux.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index acb8df05..8ed291fc 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -46,7 +46,8 @@ alias pacmir='sudo pacman -Syy' # Force refresh of all package li paclist() { sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' } -alias paclsorhpans='sudo pacman -Qdt' + +alias paclsorphans='sudo pacman -Qdt' alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' pacdisowned() { From cbaa97d8c38bf7bc1a92480ae83e323e1e0cac02 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Sat, 23 Jul 2011 10:42:43 -0400 Subject: [PATCH 115/137] Add utility method to spectrum --- lib/spectrum.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 4006a7fe..2fdf537e 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -18,3 +18,11 @@ for color in {000..255}; do FG[$color]="%{[38;5;${color}m%}" BG[$color]="%{[48;5;${color}m%}" done + +# Show all 256 colors with color number +function spectrum_ls() { + for code in {000..255}; do + print -P -- "$code: %F{$code}Test%f" + done +} + From 512f3678c07accd6d121e9c0d6d50f008c99708a Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Sat, 23 Jul 2011 11:22:39 -0400 Subject: [PATCH 116/137] Remove sudo when using yaourt + do not rely on abs when not in path - In archlinux plugin --- plugins/archlinux/archlinux.plugin.zsh | 42 +++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 8ed291fc..b5e51903 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,26 +1,30 @@ -# Archlinux zsh aliases and functions for zsh - -# Aliases ################################################################### +# Archlinux zsh aliases and functions +# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins # Look for yaourt, and add some useful functions if we have it. if [[ -x `which yaourt` ]]; then upgrade () { - yaourt -Syu -C + yaourt -Syu } + alias yaconf='yaourt -C' # Fix all configuration files with vimdiff # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips - alias yaupg='sudo yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. - alias yain='sudo yaourt -S' # Install specific package(s) from the repositories - alias yains='sudo yaourt -U' # Install specific package not from the repositories but from a file - alias yare='sudo yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies - alias yarem='sudo yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies - alias yarep='yaourt -Si' # Display information about a given package in the repositories - alias yareps='yaourt -Ss' # Search for package(s) in the repositories - alias yaloc='yaourt -Qi' # Display information about a given package in the local database - alias yalocs='yaourt -Qs' # Search for package(s) in the local database + alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. + alias yain='yaourt -S' # Install specific package(s) from the repositories + alias yains='yaourt -U' # Install specific package not from the repositories but from a file + alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies + alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies + alias yarep='yaourt -Si' # Display information about a given package in the repositories + alias yareps='yaourt -Ss' # Search for package(s) in the repositories + alias yaloc='yaourt -Qi' # Display information about a given package in the local database + alias yalocs='yaourt -Qs' # Search for package(s) in the local database # Additional yaourt alias examples - alias yaupd='sudo yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories - alias yainsd='sudo yaourt -S --asdeps' # Install given package(s) as dependencies of another package - alias yamir='sudo yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist + if [[ -x `which abs` ]]; then + alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories + else + alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories + fi + alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package + alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist else upgrade() { sudo pacman -Syu @@ -38,7 +42,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori alias pacloc='pacman -Qi' # Display information about a given package in the local database alias paclocs='pacman -Qs' # Search for package(s) in the local database # Additional pacman alias examples -alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories +if [[ -x `which abs` ]]; then + alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories +else + alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories +fi alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist From 34f00f385ce1b322ee7de48f30d175746bba94fc Mon Sep 17 00:00:00 2001 From: hobbestigrou Date: Mon, 11 Oct 2010 21:19:23 +0200 Subject: [PATCH 117/137] More generic. --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 4c174365..88732e66 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -10,4 +10,4 @@ setopt long_list_jobs ## pager export PAGER=less -export LC_CTYPE=en_US.UTF-8 +export LC_CTYPE=$LANG From eb63ddf6bb119e3d0e62f012b2f9b5fe95e0d647 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Tue, 12 Oct 2010 20:02:04 +0100 Subject: [PATCH 118/137] added mac keybinding for backward-delete-char --- lib/key-bindings.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 9f28d576..9c2dda35 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -21,6 +21,7 @@ bindkey ' ' magic-space # also do history expansion on space bindkey '^[[Z' reverse-menu-complete # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ +bindkey '^?' backward-delete-char bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char bindkey "\e[3~" delete-char From 6bb0c1c9269025867e886b76bcbf737e5a54400d Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Mon, 11 Oct 2010 02:43:51 +0100 Subject: [PATCH 119/137] added git log with graph --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index bc340e86..0c94cc99 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -27,6 +27,8 @@ alias gcp='git cherry-pick' compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5' compdef _git glg=git-log +alias glgg='git log --graph --max-count=5' +compdef _git glgg=git-log # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 96b0af68242ec6235e4162f5e7e1f4d470cb2b22 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 9 Oct 2010 23:09:42 +0100 Subject: [PATCH 120/137] adding git svn aliases --- plugins/git/git.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 0c94cc99..3721d334 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -34,6 +34,8 @@ compdef _git glgg=git-log alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' compdef git-svn-dcommit-push=git +alias gsr='git svn rebase' +alias gsd='git svn dcommit' # # Will return the current branch name # Usage example: git pull origin $(current_branch) @@ -47,6 +49,10 @@ function current_branch() { alias ggpull='git pull origin $(current_branch)' compdef ggpull=git alias ggpush='git push origin $(current_branch)' +<<<<<<< HEAD compdef ggpush=git alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' compdef ggpnp=git +======= +alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' +>>>>>>> e5e032f... adding git svn aliases From 9e783c0a8e276e89d9d81951a4c32ea61dadccf1 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Sat, 23 Jul 2011 09:14:44 -0700 Subject: [PATCH 121/137] fixing issue with last commit merge. missed a conflict --- plugins/git/git.plugin.zsh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 3721d334..5132b639 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -49,10 +49,6 @@ function current_branch() { alias ggpull='git pull origin $(current_branch)' compdef ggpull=git alias ggpush='git push origin $(current_branch)' -<<<<<<< HEAD compdef ggpush=git alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' compdef ggpnp=git -======= -alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' ->>>>>>> e5e032f... adding git svn aliases From 428f18cf428fd86bd6e99c4363e5f25d0e392506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Sat, 23 Jul 2011 23:09:03 +0200 Subject: [PATCH 122/137] Add key bindings for gnome-terminal on Fedora --- lib/key-bindings.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 9c2dda35..5c1b90bf 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -14,10 +14,15 @@ bindkey '^[[B' down-line-or-search bindkey "^[[H" beginning-of-line bindkey "^[[1~" beginning-of-line +bindkey "^[OH" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[4~" end-of-line +bindkey "^[OF" end-of-line bindkey ' ' magic-space # also do history expansion on space +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word + bindkey '^[[Z' reverse-menu-complete # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ From 0848acfb25b6601adcabc406089b6c7788df5749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Sat, 23 Jul 2011 23:34:02 +0200 Subject: [PATCH 123/137] Display red dots during completion process (disabled by default) --- lib/completion.zsh | 9 +++++++++ templates/zshrc.zsh-template | 3 +++ 2 files changed, 12 insertions(+) diff --git a/lib/completion.zsh b/lib/completion.zsh index fdd0a853..b3cc9182 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show +if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then + expand-or-complete-with-dots() { + echo -n "\e[31m......\e[0m" + zle expand-or-complete + zle redisplay + } + zle -N expand-or-complete-with-dots + bindkey "^I" expand-or-complete-with-dots +fi diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 77f866d5..1ab40aba 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable autosetting terminal title. # DISABLE_AUTO_TITLE="true" +# Uncomment following line if you want red dots to be displayed while waiting for completion +# COMPLETION_WAITING_DOTS="true" + # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) From 3cb33fc254290a848a602af634cfa26179d630e5 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Mon, 25 Jul 2011 09:46:17 +1000 Subject: [PATCH 124/137] Replace a duplicated test to see if we're in an SVN folder with a call to the 'in_svn' function. --- plugins/svn/svn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 86050227..77de2748 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,5 +1,5 @@ function svn_prompt_info { - if [[ -d .svn ]]; then + if [ in_svn ]; then echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\ $ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR" fi From 7b25a3fca90e31f2c272fd8d2ef1dfa3e61dc9e4 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Mon, 25 Jul 2011 09:50:54 +1000 Subject: [PATCH 125/137] The original SVN pluging would mark a folder as dirty if there was an svn:external set and the output of 'svn status' returned the check for the external. E.g. $ svn st X Application Performing status on external item at 'Application' Shouldn't be marked as being dirty. By grepping for only the valid output for what should be class as dirty, it won't return false positives. --- plugins/svn/svn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 77de2748..53a8a513 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -28,7 +28,7 @@ function svn_get_rev_nr { function svn_dirty_choose { if [ in_svn ]; then - s=$(svn status 2>/dev/null) + s=$(svn status|grep -E '^\s*[ACDIM!?L]' 2>/dev/null) if [ $s ]; then echo $1 else From 6bf468f92c9302f84d3b21358202c3a956cad02b Mon Sep 17 00:00:00 2001 From: Shane Emmons Date: Mon, 25 Jul 2011 08:02:25 -0700 Subject: [PATCH 126/137] add alias for `bundle package` to the bundler plugin --- plugins/bundler/bundler.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index e98bb4b4..f005700f 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -2,6 +2,7 @@ alias be="bundle exec" alias bi="bundle install" alias bl="bundle list" alias bu="bundle update" +alias bp="bundle package" # The following is based on https://github.com/gma/bundler-exec From fd732eb3ff4984ddc9109e950cf7ceb472cb9824 Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Wed, 27 Jul 2011 10:28:55 -0700 Subject: [PATCH 127/137] move history-substring-search* files into plugins/ --- README => plugins/history-substring-search/README | 0 .../history-substring-search/history-substring-search.plugin.zsh | 0 .../history-substring-search/history-substring-search.zsh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename README => plugins/history-substring-search/README (100%) rename history-substring-search.plugin.zsh => plugins/history-substring-search/history-substring-search.plugin.zsh (100%) rename history-substring-search.zsh => plugins/history-substring-search/history-substring-search.zsh (100%) diff --git a/README b/plugins/history-substring-search/README similarity index 100% rename from README rename to plugins/history-substring-search/README diff --git a/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh similarity index 100% rename from history-substring-search.plugin.zsh rename to plugins/history-substring-search/history-substring-search.plugin.zsh diff --git a/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh similarity index 100% rename from history-substring-search.zsh rename to plugins/history-substring-search/history-substring-search.zsh From fc49b4a4ded376cd82b813dcb6d72fdc050b7bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Thu, 28 Jul 2011 19:52:35 +0200 Subject: [PATCH 128/137] Enable red dots during completion by default --- lib/completion.zsh | 2 +- templates/zshrc.zsh-template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc9182..2a457402 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,7 +59,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then +if [ "$DISABLE_COMPLETION_WAITING_DOTS" != "true" ]; then expand-or-complete-with-dots() { echo -n "\e[31m......\e[0m" zle expand-or-complete diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba..4de1fa4e 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,8 +19,8 @@ ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable autosetting terminal title. # DISABLE_AUTO_TITLE="true" -# Uncomment following line if you want red dots to be displayed while waiting for completion -# COMPLETION_WAITING_DOTS="true" +# Uncomment following line if you want disable red dots displayed while waiting for completion +# DISABLE_COMPLETION_WAITING_DOTS="true" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse) From d866662c4af4c6e6e661c59d2da8f60eabbfba1d Mon Sep 17 00:00:00 2001 From: Fredrik Wallgren Date: Sat, 30 Jul 2011 04:38:57 +0200 Subject: [PATCH 129/137] Add autocomplete for gas. Based on the rvm plugin. --- plugins/gas/_gas | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/gas/_gas diff --git a/plugins/gas/_gas b/plugins/gas/_gas new file mode 100644 index 00000000..069713fc --- /dev/null +++ b/plugins/gas/_gas @@ -0,0 +1,34 @@ +#compdef gas + +local curcontext="$curcontext" state line cmds ret=1 + +_arguments -C \ + '(- 1 *)'{-v,--version}'[display version information]' \ + '(-h|--help)'{-h,--help}'[show help information]' \ + '1: :->cmds' \ + '*: :->args' && ret=0 + +case $state in + cmds) + cmds=( + "version:Prints Gas's version" + "use:Uses author" + "show:Shows your current user" + "list:Lists your authors" + "import:Imports current user to gasconfig" + "help:Describe available tasks or one specific task" + "delete:Deletes author" + "add:Adds author to gasconfig" + ) + _describe -t commands 'gas command' cmds && ret=0 + ;; + args) + case $line[1] in + (use|delete) + _values -S , 'rubies' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 + ;; + esac + ;; +esac + +return ret From c3412ca57d313a0a1419d26b5529f28de49285d0 Mon Sep 17 00:00:00 2001 From: Fredrik Wallgren Date: Sat, 30 Jul 2011 04:57:25 +0200 Subject: [PATCH 130/137] Replace forgotten rubies with authors --- plugins/gas/_gas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gas/_gas b/plugins/gas/_gas index 069713fc..befdc945 100644 --- a/plugins/gas/_gas +++ b/plugins/gas/_gas @@ -25,7 +25,7 @@ case $state in args) case $line[1] in (use|delete) - _values -S , 'rubies' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 + _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 ;; esac ;; From b160ee6512f58a3a7f2c18f12feab3e32884003b Mon Sep 17 00:00:00 2001 From: Ilya Chesnokov Date: Mon, 1 Aug 2011 10:58:05 +0400 Subject: [PATCH 131/137] 'echo' did not show colors without -e in upgrade.sh --- tools/upgrade.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 2b75e554..52a8cc4d 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,12 +1,12 @@ current_path=`pwd` -echo "\033[0;34mUpgrading Oh My Zsh\033[0m" +echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" ( cd $ZSH && git pull origin master ) -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" -echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" -echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" +echo -e "\033[0;32m"' __ __ '"\033[0m" +echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" +echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" +echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" +echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" +echo -e "\033[0;32m"' /____/ '"\033[0m" +echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m" +echo -e "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m" cd "$current_path" From 68b5ef2aabddc1049738a80f6cbfa470fd538e95 Mon Sep 17 00:00:00 2001 From: Rahul Trikha Date: Tue, 2 Aug 2011 11:24:09 +0930 Subject: [PATCH 132/137] Added auto complete plugin for powder gem https://github.com/Rodreegez/powder --- plugins/powder/_powder | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/powder/_powder diff --git a/plugins/powder/_powder b/plugins/powder/_powder new file mode 100644 index 00000000..84e260a1 --- /dev/null +++ b/plugins/powder/_powder @@ -0,0 +1,4 @@ +#compdef powder +#autoload + +compadd `powder help | grep powder | cut -d " " -f 4` From d5333e8efc0f6669d64bba1b2aa6e80bc2e7c8e8 Mon Sep 17 00:00:00 2001 From: Ali B Date: Fri, 12 Aug 2011 00:40:35 +1000 Subject: [PATCH 133/137] Heroku completion plugin --- plugins/heroku/_heroku | 158 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 plugins/heroku/_heroku diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku new file mode 100644 index 00000000..dc899e2b --- /dev/null +++ b/plugins/heroku/_heroku @@ -0,0 +1,158 @@ +#compdef heroku + +# Heroku Autocomplete plugin for Oh-My-Zsh +# Requires: The Heroku client gem (https://github.com/heroku/heroku) +# Author: Ali B. (http://awhitebox.com) + +local -a _1st_arguments +_1st_arguments=( + "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" + "addons":"list installed addons" + "addons\:list":"list all available addons" + "addons\:add":"install an addon" + "addons\:upgrade":"upgrade an existing addon" + "addons\:downgrade":"downgrade an existing addon" + "addons\:remove":"uninstall an addon" + "addons\:open":"open an addon's dashboard in your browser" + "apps":"list your apps" + "apps\:info":"show detailed app information" + "apps\:create":"create a new app" + "apps\:rename":"rename the app" + "apps\:open":"open the app in a web browser" + "apps\:destroy":"permanently destroy an app" + "auth\:login":"log in with your heroku credentials" + "auth\:logout":"clear local authentication credentials" + "config":"display the config vars for an app" + "config\:add":"add one or more config vars" + "config\:remove":"remove a config var" + "db\:push":"push local data up to your app" + "db\:pull":"pull heroku data down into your local database" + "domains":"list custom domains for an app" + "domains\:add":"add a custom domain to an app" + "domains\:remove":"remove a custom domain from an app" + "domains\:clear":"remove all custom domains from an app" + "help":"list available commands or display help for a specific command" + "keys":"display keys for the current user" + "keys\:add":"add a key for the current user" + "keys\:remove":"remove a key from the current user" + "keys\:clear":"remove all authentication keys from the current user" + "logs":"display recent log output" + "logs\:cron":"DEPRECATED: display cron logs from legacy logging" + "logs\:drains":"manage syslog drains" + "maintenance\:on":"put the app into maintenance mode" + "maintenance\:off":"take the app out of maintenance mode" + "pg\:info":"display database information" + "pg\:ingress":"allow direct connections to the database from this IP for one minute" + "pg\:promote":"sets DATABASE as your DATABASE_URL" + "pg\:psql":"open a psql shell to the database" + "pg\:reset":"delete all data in DATABASE" + "pg\:unfollow":"stop a replica from following and make it a read/write database" + "pg\:wait":"monitor database creation, exit when complete" + "pgbackups":"list captured backups" + "pgbackups\:url":"get a temporary URL for a backup" + "pgbackups\:capture":"capture a backup from a database id" + "pgbackups\:restore":"restore a backup to a database" + "pgbackups\:destroy":"destroys a backup" + "plugins":"list installed plugins" + "plugins\:install":"install a plugin" + "plugins\:uninstall":"uninstall a plugin" + "ps\:dynos":"scale to QTY web processes" + "ps\:workers":"scale to QTY background processes" + "ps":"list processes for an app" + "ps\:restart":"restart an app process" + "ps\:scale":"scale processes by the given amount" + "releases":"list releases" + "releases\:info":"view detailed information for a release" + "rollback":"roll back to an older release" + "run":"run an attached process" + "run\:rake":"remotely execute a rake command" + "run\:console":"open a remote console session" + "sharing":"list collaborators on an app" + "sharing\:add":"add a collaborator to an app" + "sharing\:remove":"remove a collaborator from an app" + "sharing\:transfer":"transfer an app to a new owner" + "ssl":"list certificates for an app" + "ssl\:add":"add an ssl certificate to an app" + "ssl\:remove":"remove an ssl certificate from an app" + "ssl\:clear":"remove all ssl certificates from an app" + "stack":"show the list of available stacks" + "stack\:migrate":"prepare migration of this app to a new stack" + "version":"show heroku client version" +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "heroku command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + apps:info) + _command_args=( + '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ + ) + ;; + apps:create) + _command_args=( + '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ + '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ + '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ + ) + ;; + config) + _command_args=( + '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ + ) + ;; + db:push) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \ + '(-f|--filter)'{-f,--filter}'[only push certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \ + ) + ;; + db:pull) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \ + '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \ + ) + ;; + keys) + _command_args=( + '(-l|--long)'{-l,--long}'[display extended information for each key]' \ + ) + ;; + logs) + _command_args=( + '(-n|--num)'{-n,--num}'[the number of lines to display]' \ + '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ + '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ + '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ + ) + ;; + pgbackups:capture) + _command_args=( + '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ + ) + ;; + stack) + _command_args=( + '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + '(--app)--app[the app name]' \ + && return 0 + From 11fcdb844d67492080befd8dcd1f995deb26b8ee Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Sat, 13 Aug 2011 04:53:23 +0700 Subject: [PATCH 134/137] Add guard to bundler plugin's wrapped commands --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index f005700f..a6c11640 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -6,7 +6,7 @@ alias bp="bundle package" # The following is based on https://github.com/gma/bundler-exec -bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) +bundled_commands=(cap capify cucumber guard heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) ## Functions From 1fb141cfb51f753fe997d17c12ac810ad321f36f Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Aug 2011 16:16:51 -0500 Subject: [PATCH 135/137] Add gss alias for git status -s --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5132b639..37bfd383 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -29,6 +29,8 @@ alias glg='git log --stat --max-count=5' compdef _git glg=git-log alias glgg='git log --graph --max-count=5' compdef _git glgg=git-log +alias gss='git status -s' +compdef _git gss=git-status # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From bd6aba9c68db06758593e9ef707839c2f0271235 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Aug 2011 16:23:49 -0500 Subject: [PATCH 136/137] Add an alias for ga --> git add, too --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 37bfd383..4fcf9425 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -31,6 +31,8 @@ alias glgg='git log --graph --max-count=5' compdef _git glgg=git-log alias gss='git status -s' compdef _git gss=git-status +alias ga='git add' +compdef _git ga=git-add # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' From 9d67d75b0ad62242e60db1bd6d22ae7ea252c7bc Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 30 Aug 2011 20:56:13 -0700 Subject: [PATCH 137/137] Revert "Enable red dots during completion by default". After a few weeks of using this, I'd prefer this to not be enabled by default. My bad for suggesting that in the first place. This reverts commit fc49b4a4ded376cd82b813dcb6d72fdc050b7bed. --- lib/completion.zsh | 2 +- templates/zshrc.zsh-template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 2a457402..b3cc9182 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -59,7 +59,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -if [ "$DISABLE_COMPLETION_WAITING_DOTS" != "true" ]; then +if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then expand-or-complete-with-dots() { echo -n "\e[31m......\e[0m" zle expand-or-complete diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 4de1fa4e..1ab40aba 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -19,8 +19,8 @@ ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable autosetting terminal title. # DISABLE_AUTO_TITLE="true" -# Uncomment following line if you want disable red dots displayed while waiting for completion -# DISABLE_COMPLETION_WAITING_DOTS="true" +# Uncomment following line if you want red dots to be displayed while waiting for completion +# COMPLETION_WAITING_DOTS="true" # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Example format: plugins=(rails git textmate ruby lighthouse)