From c02b29159b036e7dd70caa2acd071f9817007b0a Mon Sep 17 00:00:00 2001 From: Lorrin Nelson Date: Wed, 23 Mar 2011 21:20:08 -0700 Subject: [PATCH 01/29] Introduce DISABLE_AUTO_TITLE option --- lib/termsupport.zsh | 10 +++++++--- templates/zshrc.zsh-template | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index e1e5366..b250833 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -16,11 +16,15 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" #Appears when you have the prompt function precmd { - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE + if [ "$DISABLE_AUTO_TITLE" != "true" ]; then + title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE + fi } #Appears at the beginning of (and during) of command execution function preexec { - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>$2%<<" + if [ "$DISABLE_AUTO_TITLE" != "true" ]; then + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd + title "$CMD" "%100>...>$2%<<" + fi } diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 8022b35..506daa9 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -14,6 +14,9 @@ export ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable colors in ls # export DISABLE_LS_COLORS="true" +# Uncomment following line if you want to disable autosetting terminal title. +# export DISABLE_AUTO_TITLE="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 758b415e72dfbb3f1e6f0088e8792d6ba039ada5 Mon Sep 17 00:00:00 2001 From: Jakub Nawalaniec Date: Sun, 3 Apr 2011 13:50:05 +0200 Subject: [PATCH 02/29] Zsh will now complete git aliases with git stuff --- plugins/git/git.plugin.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 71a6281..fc4e56f 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,19 +1,34 @@ # Aliases alias g='git' +compdef g=git alias gst='git status' +compdef gst=git alias gl='git pull' +compdef gl=git alias gup='git fetch && git rebase' +compdef gup=git alias gp='git push' +compdef gp=git alias gd='git diff | mate' +compdef gd=git alias gdv='git diff -w "$@" | vim -R -' +compdef gdv=git alias gc='git commit -v' +compdef gc=git alias gca='git commit -v -a' +compdef gca=git alias gco='git checkout' +compdef gco=git alias gb='git branch' +compdef gb=git alias gba='git branch -a' +compdef gba=git alias gcount='git shortlog -sn' +compdef gcount=git alias gcp='git cherry-pick' +compdef gcp=git alias glg='git log --stat --max-count=5' +compdef glg=git # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' @@ -29,5 +44,8 @@ function current_branch() { # these aliases take advantage of the previous function alias ggpull='git pull origin $(current_branch)' +compdef ggpull=git alias ggpush='git push origin $(current_branch)' +compdef ggpush=git alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' +compdef ggpnp=git From e684afcba0bc15f7330f03d4f1f652e1865b3d6a Mon Sep 17 00:00:00 2001 From: Jakub Nawalaniec Date: Sun, 3 Apr 2011 15:43:39 +0200 Subject: [PATCH 03/29] Completions are git subdommand-aware now --- plugins/git/git.plugin.zsh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index fc4e56f..8470c28 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -2,15 +2,16 @@ alias g='git' compdef g=git alias gst='git status' -compdef gst=git +compdef _git gst=git-status alias gl='git pull' -compdef gl=git +compdef _git gl=git-pull alias gup='git fetch && git rebase' compdef gup=git alias gp='git push' -compdef gp=git +compdef _git gp=git-push alias gd='git diff | mate' -compdef gd=git +# WTF is mate?? +compdef _git gd=git-diff alias gdv='git diff -w "$@" | vim -R -' compdef gdv=git alias gc='git commit -v' @@ -18,20 +19,21 @@ compdef gc=git alias gca='git commit -v -a' compdef gca=git alias gco='git checkout' -compdef gco=git +compdef _git gco=git-checkout alias gb='git branch' -compdef gb=git +compdef _git gb=git-branch alias gba='git branch -a' compdef gba=git alias gcount='git shortlog -sn' compdef gcount=git alias gcp='git cherry-pick' -compdef gcp=git +compdef _git gcp=git-cherry-pick alias glg='git log --stat --max-count=5' -compdef glg=git +compdef _git glg=git-log # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' +compdef git-svn-dcommit-push=git # # Will return the current branch name From e4ded4e6ff222b5020b4d52a4953502aabd56b5d Mon Sep 17 00:00:00 2001 From: Jakub Nawalaniec Date: Sun, 3 Apr 2011 21:28:19 +0200 Subject: [PATCH 04/29] Further git completion improovements In detail: gup - now completes with remotes like git fetch would gdv - got git diff completions gc/gca - now zsh will suggest files in staging area gba - suggestions as for git branch --- plugins/git/git.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 8470c28..9fe7a64 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -6,24 +6,24 @@ compdef _git gst=git-status alias gl='git pull' compdef _git gl=git-pull alias gup='git fetch && git rebase' -compdef gup=git +compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push alias gd='git diff | mate' # WTF is mate?? compdef _git gd=git-diff alias gdv='git diff -w "$@" | vim -R -' -compdef gdv=git +compdef _git gdv=git-diff alias gc='git commit -v' -compdef gc=git +compdef _git gc=git-commit alias gca='git commit -v -a' -compdef gca=git +compdef _git gca=git-commit alias gco='git checkout' compdef _git gco=git-checkout alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' -compdef gba=git +compdef _git gba=git-branch alias gcount='git shortlog -sn' compdef gcount=git alias gcp='git cherry-pick' From bb8bbf33b72cc3dea91c9603c111921d10c29e9e Mon Sep 17 00:00:00 2001 From: "Renaud (Nel) Morvan" Date: Mon, 4 Apr 2011 13:30:39 +0200 Subject: [PATCH 05/29] Escape characters used in escape sequence to avoid triggering bugs in Apple Terminal Closes #45 #57 #58 #86. --- lib/termsupport.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index b250833..494ef89 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -4,10 +4,10 @@ #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { if [[ "$TERM" == "screen" ]]; then - print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars + print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2\a" #set window name - print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal) + print -Pn "\e]2;$2:q\a" #set window name + print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) fi } From 044012b9653ff4b46ddab0884cc935035eeddf7a Mon Sep 17 00:00:00 2001 From: "Renaud (Nel) Morvan" Date: Mon, 4 Apr 2011 13:44:48 +0200 Subject: [PATCH 06/29] Command title behavior no longer depend on local zsh configuration Fix by derekjw. closes #52. --- lib/termsupport.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 494ef89..42bbb9e 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -3,7 +3,7 @@ #Fully support screen, iterm, and probably most modern xterm and rxvt #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { - if [[ "$TERM" == "screen" ]]; then + if [[ $TERM =~ "^screen" ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" #set window name @@ -24,6 +24,8 @@ function precmd { #Appears at the beginning of (and during) of command execution function preexec { if [ "$DISABLE_AUTO_TITLE" != "true" ]; then + emulate -L zsh + setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd title "$CMD" "%100>...>$2%<<" fi From bb609fce12648ca6728bb5b97b373f88bf3c336b Mon Sep 17 00:00:00 2001 From: "Renaud (Nel) Morvan" Date: Mon, 4 Apr 2011 14:02:50 +0200 Subject: [PATCH 07/29] Refactor DISABLE_AUTO_TITLE to be more DRY --- lib/termsupport.zsh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 42bbb9e..3152751 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -3,6 +3,7 @@ #Fully support screen, iterm, and probably most modern xterm and rxvt #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { + [ "$DISABLE_AUTO_TITLE" != "true" ] || return if [[ $TERM =~ "^screen" ]]; then print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then @@ -16,17 +17,13 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" #Appears when you have the prompt function precmd { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE - fi + title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } #Appears at the beginning of (and during) of command execution function preexec { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - emulate -L zsh - setopt extended_glob - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>$2%<<" - fi + emulate -L zsh + setopt extended_glob + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd + title "$CMD" "%100>...>$2%<<" } From d15d88cf813cc6a99b92ee3621dad14ea621299f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 4 Apr 2011 00:54:43 +0200 Subject: [PATCH 08/29] Fix `gdv`: make it a function, and use `view`. I've changed it to use `view` instead of `vim -R` to make it hopefully more editor-agnostic. --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 8470c28..b21c6a8 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -12,7 +12,7 @@ compdef _git gp=git-push alias gd='git diff | mate' # WTF is mate?? compdef _git gd=git-diff -alias gdv='git diff -w "$@" | vim -R -' +gdv() { git diff -w "$@" | view - } compdef gdv=git alias gc='git commit -v' compdef gc=git From ca710c949a5c9a902e45728e9bb86f88e9fe0d1a Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 12 Apr 2011 10:19:15 +0200 Subject: [PATCH 09/29] Using git-diff instead of git diff --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 85eabce..bc340e8 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -9,7 +9,7 @@ alias gup='git fetch && git rebase' compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push -gdv() { git diff -w "$@" | view - } +gdv() { git-diff -w "$@" | view - } compdef _git gdv=git-diff alias gc='git commit -v' compdef _git gc=git-commit From 49b4a1b14bcda0ae8a3baf97266e2285044b6cba Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 20 Mar 2011 16:29:00 -0400 Subject: [PATCH 10/29] Added npm plugin. --- plugins/npm/_npm | 19 +++++++++++++++++++ plugins/npm/npm.plugin.zsh | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/npm/_npm create mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/npm/_npm b/plugins/npm/_npm new file mode 100644 index 0000000..24b5361 --- /dev/null +++ b/plugins/npm/_npm @@ -0,0 +1,19 @@ +#compdef npm + +# Node Package Manager 0.3.15 completion, letting npm do all the completion work + +_npm() { + compadd -- $(_npm_complete $words) +} + +# We want to show all errors of any substance, but never the "npm (not )ok" one. +# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) +_npm_complete() { + local ask_npm + ask_npm=(npm completion --color false --loglevel error -- $@) + { _call_program npm $ask_npm 2>&1 >&3 \ + | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ + } 3>&1 +} + +_npm "$@" diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh new file mode 100644 index 0000000..826f0f7 --- /dev/null +++ b/plugins/npm/npm.plugin.zsh @@ -0,0 +1,4 @@ +# add npm completion function to path +fpath=($ZSH/plugins/npm $fpath) +autoload -U compinit +compinit -i From 7b8cf376d1d0937330416c7394f4791b90d53503 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 12 Apr 2011 10:24:06 +0200 Subject: [PATCH 11/29] Revert "Enable alias completion, do not limit completion to just files" This reverts commit c3a58b00040018743ead1e6672910433fc1ca7c2. --- lib/completion.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index e8e9776..9c2dfec 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -4,7 +4,6 @@ unsetopt menu_complete # do not autoselect the first completion entry unsetopt flowcontrol setopt auto_menu # show completion menu on succesive tab press setopt complete_in_word -setopt complete_aliases setopt always_to_end WORDCHARS='' From 1dae8c088bc082e925722a48ec9de31db87ecc6e Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Tue, 1 Mar 2011 01:04:10 -0500 Subject: [PATCH 12/29] added hub plugin from defunkt --- plugins/hub/hub.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 plugins/hub/hub.plugin.zsh diff --git a/plugins/hub/hub.plugin.zsh b/plugins/hub/hub.plugin.zsh new file mode 100644 index 0000000..e82a0ec --- /dev/null +++ b/plugins/hub/hub.plugin.zsh @@ -0,0 +1,5 @@ +# hub alias from defunkt +# https://github.com/defunkt/hub +if [ $( which hub > /dev/null 2>&1 ; echo -n $? ) -lt 1 ]; then + eval $( hub alias -s $( ps -o comm= -p $$ ) ) +fi From d7375c3b545ce2e32cea11f2406b6dac2f605f26 Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Tue, 1 Mar 2011 21:34:25 -0500 Subject: [PATCH 13/29] no need for an extra fork --- plugins/hub/hub.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hub/hub.plugin.zsh b/plugins/hub/hub.plugin.zsh index e82a0ec..9f95c63 100644 --- a/plugins/hub/hub.plugin.zsh +++ b/plugins/hub/hub.plugin.zsh @@ -1,5 +1,5 @@ # hub alias from defunkt # https://github.com/defunkt/hub if [ $( which hub > /dev/null 2>&1 ; echo -n $? ) -lt 1 ]; then - eval $( hub alias -s $( ps -o comm= -p $$ ) ) + eval $( hub alias -s zsh ) fi From c642dec2569642466ba8c5d8fca87beef71b1dcb Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Wed, 2 Mar 2011 20:00:40 -0500 Subject: [PATCH 14/29] blueyed's ZSH-fu is much stronger than mine. --- plugins/hub/hub.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hub/hub.plugin.zsh b/plugins/hub/hub.plugin.zsh index 9f95c63..48e1fa4 100644 --- a/plugins/hub/hub.plugin.zsh +++ b/plugins/hub/hub.plugin.zsh @@ -1,5 +1,5 @@ # hub alias from defunkt # https://github.com/defunkt/hub -if [ $( which hub > /dev/null 2>&1 ; echo -n $? ) -lt 1 ]; then - eval $( hub alias -s zsh ) +if which hub > /dev/null; then + eval $(hub alias -s zsh) fi From 0e423ff98864720cb16beb8f83cfa8ebf4d5c4c7 Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Thu, 3 Mar 2011 21:36:35 -0500 Subject: [PATCH 15/29] Moved this to the existing github plugin --- plugins/hub/hub.plugin.zsh | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 plugins/hub/hub.plugin.zsh diff --git a/plugins/hub/hub.plugin.zsh b/plugins/hub/hub.plugin.zsh deleted file mode 100644 index 48e1fa4..0000000 --- a/plugins/hub/hub.plugin.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# hub alias from defunkt -# https://github.com/defunkt/hub -if which hub > /dev/null; then - eval $(hub alias -s zsh) -fi From 7380c1b7833b32d9bd1ca638ceae5661898143e5 Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Thu, 3 Mar 2011 21:38:56 -0500 Subject: [PATCH 16/29] Whoops, this was supposed to be in the last commit! --- plugins/github/github.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index c23504b..72e9b07 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,3 +1,9 @@ +# hub alias from defunkt +# https://github.com/defunkt/hub +if which hub > /dev/null; then + eval $(hub alias -s zsh) +fi + # add github completion function to path fpath=($ZSH/plugins/github $fpath) autoload -U compinit From 4a46f72bb4bcb80ce472c78474e46db6ac885f1c Mon Sep 17 00:00:00 2001 From: Theodore Robert Campbell Jr Date: Sat, 19 Mar 2011 10:29:22 -0400 Subject: [PATCH 17/29] changes recommended by blueyed --- plugins/github/github.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 72e9b07..8d45806 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,7 +1,8 @@ # hub alias from defunkt # https://github.com/defunkt/hub -if which hub > /dev/null; then - eval $(hub alias -s zsh) +if [ "$commands[(I)hub]" ]; then + # eval `hub alias -s zsh` + function git(){hub "$@"} fi # add github completion function to path From dc768085b7f42e13157b6477f14d97538664fffe Mon Sep 17 00:00:00 2001 From: Dmitry Maksimov Date: Sat, 26 Feb 2011 10:04:45 +0300 Subject: [PATCH 18/29] kolo.zsh-theme --- themes/kolo.zsh-theme | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 themes/kolo.zsh-theme diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme new file mode 100644 index 0000000..6e04e15 --- /dev/null +++ b/themes/kolo.zsh-theme @@ -0,0 +1,21 @@ +autoload -U colors && colors + +autoload -Uz vcs_info + +zstyle ':vcs_info:*' stagedstr '%F{green}●' +zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' +zstyle ':vcs_info:*' enable git svn +precmd () { + if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' + } else { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' + } + + vcs_info +} + +setopt prompt_subst +PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' From b900162b21206c48363ed8e227e507e1603e3f4d Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 12 Apr 2011 10:36:45 +0200 Subject: [PATCH 19/29] Updating the README... now links to contributors page --- README.textile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.textile b/README.textile index 86d2652..d01c331 100644 --- a/README.textile +++ b/README.textile @@ -54,12 +54,6 @@ h3. Uninstalling If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). -h2. Thanks - -* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago. -* Marcel (noradio) provided Rick the original zsh configuration. -* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh. - h2. Help out! I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! @@ -67,3 +61,11 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y h3. Send us your theme! I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. + +h2. Contributors + +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 From 0190b07feab22c64514e3eae9667927426e76c04 Mon Sep 17 00:00:00 2001 From: James Frasca Date: Thu, 17 Mar 2011 11:22:51 -0700 Subject: [PATCH 20/29] Added the Frisk theme --- themes/frisk.zsh-theme | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 themes/frisk.zsh-theme diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme new file mode 100644 index 0000000..f181aec --- /dev/null +++ b/themes/frisk.zsh-theme @@ -0,0 +1,10 @@ +PROMPT=$' +%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} +%{$fg_bold[black]%}>%{$reset_color%} ' + +PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 4330218e1187bd39aa06288e648e2956ae275ade Mon Sep 17 00:00:00 2001 From: James Frasca Date: Thu, 17 Mar 2011 11:22:51 -0700 Subject: [PATCH 21/29] Added the Frisk theme --- themes/frisk.zsh-theme | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 themes/frisk.zsh-theme diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme new file mode 100644 index 0000000..f181aec --- /dev/null +++ b/themes/frisk.zsh-theme @@ -0,0 +1,10 @@ +PROMPT=$' +%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} +%{$fg_bold[black]%}>%{$reset_color%} ' + +PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" From 68335ebbe929d29ebc18212e71cdfc766acfaf45 Mon Sep 17 00:00:00 2001 From: kphoen Date: Mon, 7 Mar 2011 15:15:46 +0100 Subject: [PATCH 22/29] Add: new theme --- themes/kphoen.zsh-theme | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 themes/kphoen.zsh-theme diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme new file mode 100644 index 0000000..0e9b5e7 --- /dev/null +++ b/themes/kphoen.zsh-theme @@ -0,0 +1,50 @@ +# ------------------------------------------------------------------------------ +# FILE: kphoen.zsh-theme +# DESCRIPTION: oh-my-zsh theme file. +# AUTHOR: Kévin Gomez (geek63@gmail.com) +# VERSION: 1.0.0 +# SCREENSHOT: +# ------------------------------------------------------------------------------ + + +if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then + PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] +%# ' + + ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_DIRTY="" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + # display exitcode on the right when >0 + return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + + RPROMPT='${return_code}$(git_prompt_status)%{$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]%} ✭" +else + PROMPT='[%n@%m:%~$(git_prompt_info)] +%# ' + + ZSH_THEME_GIT_PROMPT_PREFIX=" on" + ZSH_THEME_GIT_PROMPT_SUFFIX="" + ZSH_THEME_GIT_PROMPT_DIRTY="" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + # display exitcode on the right when >0 + return_code="%(?..%? ↵)" + + RPROMPT='${return_code}$(git_prompt_status)' + + ZSH_THEME_GIT_PROMPT_ADDED=" ✚" + ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" + ZSH_THEME_GIT_PROMPT_DELETED=" ✖" + ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" + ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" + ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" +fi From 15f3b09cbf23b2d8563978d8350b0073e9c68f42 Mon Sep 17 00:00:00 2001 From: Arthur Kalmenson Date: Mon, 18 Apr 2011 07:48:35 -0400 Subject: [PATCH 23/29] Make the chsh more reliable. --- tools/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 6e3872b..2d5fde4 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -22,7 +22,12 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you." echo "export PATH=$PATH" >> ~/.zshrc echo "Time to change your default shell to zsh!" -chsh -s "/usr/bin/env zsh" +if [ -f /bin/zsh ] +then + chsh -s /bin/zsh +else + chsh -s "/usr/bin/env zsh" +fi echo ' __ __ ' echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' From cd3896b0c493c98fb0caaffd1bf16196243090a4 Mon Sep 17 00:00:00 2001 From: Arthur Kalmenson Date: Mon, 18 Apr 2011 07:50:14 -0400 Subject: [PATCH 24/29] Change URL to https since most corporate environments block git port. --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 2d5fde4..1b8c80f 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,7 +5,7 @@ then fi echo "Cloning Oh My Zsh..." -/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh echo "Looking for an existing zsh config..." if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] From 0f25c6dbd9c9e8ce65745182950f0611d91dd266 Mon Sep 17 00:00:00 2001 From: Arthur Kalmenson Date: Mon, 18 Apr 2011 22:51:28 -0400 Subject: [PATCH 25/29] Changed to use which. --- tools/install.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 1b8c80f..8ed1403 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -22,12 +22,7 @@ echo "Copying your current PATH and adding it to the end of ~/.zshrc for you." echo "export PATH=$PATH" >> ~/.zshrc echo "Time to change your default shell to zsh!" -if [ -f /bin/zsh ] -then - chsh -s /bin/zsh -else - chsh -s "/usr/bin/env zsh" -fi +chsh -s `which zsh` echo ' __ __ ' echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' From 5ea555b208e1a963be2d5b2a1a169705c4e21303 Mon Sep 17 00:00:00 2001 From: Alexander Rinass Date: Wed, 20 Apr 2011 15:50:55 +0200 Subject: [PATCH 26/29] Fixed folder naming for mysql-macports plugin and improved start/stop scripts. --- plugins/mysql-macports/mysql-macports.plugin.zsh | 8 ++++++++ plugins/mysql/mysql-macports.plugin.zsh | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 plugins/mysql-macports/mysql-macports.plugin.zsh delete mode 100644 plugins/mysql/mysql-macports.plugin.zsh diff --git a/plugins/mysql-macports/mysql-macports.plugin.zsh b/plugins/mysql-macports/mysql-macports.plugin.zsh new file mode 100644 index 0000000..c39563f --- /dev/null +++ b/plugins/mysql-macports/mysql-macports.plugin.zsh @@ -0,0 +1,8 @@ +# commands to control local mysql-server installation +# paths are for osx installation via macports + +alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start' +alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop' +alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart' + +alias mysqlstatus='mysqladmin5 -u root -p ping' diff --git a/plugins/mysql/mysql-macports.plugin.zsh b/plugins/mysql/mysql-macports.plugin.zsh deleted file mode 100644 index 63b881c..0000000 --- a/plugins/mysql/mysql-macports.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# commands to control local mysql-server installation -# paths are for osx installtion via macports - -alias mysqlstart='sudo /opt/local/bin/mysqld_safe5' -alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown' -alias mysqlstatus='mysqladmin5 -u root -p ping' \ No newline at end of file From be502b5f45acc47696ff9c4b32a5180d2994904e Mon Sep 17 00:00:00 2001 From: Christopher Chow Date: Thu, 21 Apr 2011 21:40:34 +1000 Subject: [PATCH 27/29] Made my them display the current rvm gemset and check for detached head state in git. --- themes/Soliah.zsh-theme | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme index 1c0ab3c..237e70f 100644 --- a/themes/Soliah.zsh-theme +++ b/themes/Soliah.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(git_prompt_info) +PROMPT='%{$fg[blue]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} in %{$fg[blue]%}%~%b%{$reset_color%}$(git_time_since_commit)$(check_git_prompt_info) $ ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}" @@ -16,6 +16,29 @@ 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]%}" + +# Git sometimes goes into a detached head state. git_prompt_info doesn't +# return anything in this case. So wrap it in another function and check +# for an empty string. +function check_git_prompt_info() { + if git rev-parse --git-dir > /dev/null 2>&1; then + if [[ -z $(git_prompt_info) ]]; then + echo "%{$fg[magenta]%}detached-head%{$reset_color%})" + else + echo "$(git_prompt_info)" + fi + fi +} + +# 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() { @@ -49,15 +72,15 @@ function git_time_since_commit() { fi if [ "$HOURS" -gt 24 ]; then - echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|" + echo "($(rvm_gemset)$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%}|" + echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|" else - echo "($COLOR${MINUTES}m%{$reset_color%}|" + echo "($(rvm_gemset)$COLOR${MINUTES}m%{$reset_color%}|" fi else COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL" - echo "($COLOR~|" + echo "($(rvm_gemset)$COLOR~|" fi fi } From 2d29f73f5470dc7b801e409cfd41e37f22996562 Mon Sep 17 00:00:00 2001 From: Ilmari Vacklin Date: Fri, 22 Apr 2011 00:16:29 +0300 Subject: [PATCH 28/29] Add 'upgrade' to brew completions. --- plugins/brew/_brew | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/brew/_brew b/plugins/brew/_brew index 4e590ac..cee1e25 100644 --- a/plugins/brew/_brew +++ b/plugins/brew/_brew @@ -31,6 +31,7 @@ _1st_arguments=( 'search:search for a formula (/regex/ or string)' 'unlink:unlink a formula' 'update:freshen up links' + 'upgrade:upgrade outdated formulae' 'uses:show formulas which depend on a formula' ) From 4b353f1a0661aaa75ac7746465de6bc4980df07d Mon Sep 17 00:00:00 2001 From: Felipe Gallois Date: Sat, 23 Apr 2011 17:31:15 -0300 Subject: [PATCH 29/29] added custom theme, based on eastwood --- themes/gallois.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/gallois.zsh-theme diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme new file mode 100644 index 0000000..259640b --- /dev/null +++ b/themes/gallois.zsh-theme @@ -0,0 +1,19 @@ +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" +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 "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} + +#RVM and git settings +if [[ -s ~/.rvm/scripts/rvm ]] ; then + RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' +fi + +PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '