From 4a4262343f76823a6c038b2219de61d26149cc27 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 21:17:20 +0800 Subject: [PATCH 01/68] Don't auto-correct ebuild commands. It breaks "ebuild manifest", as there are Manifest files in the directory. --- lib/correction.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/correction.zsh b/lib/correction.zsh index a96f7ff..043320a 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -6,3 +6,4 @@ alias mysql='nocorrect mysql' alias mkdir='nocorrect mkdir' alias gist='nocorrect gist' alias heroku='nocorrect heroku' +alias ebuild='nocorrect ebuild' From f87db739c05766a959421781eab79a93d13a8a5b Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 21:16:33 +0800 Subject: [PATCH 02/68] Ignore commands that start with a space. This is useful when you want to use a dangerous command, as it won't be available with history searching. --- lib/history.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/history.zsh b/lib/history.zsh index 509be8f..ca6f570 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -10,6 +10,7 @@ setopt hist_verify setopt inc_append_history setopt extended_history setopt hist_expire_dups_first +setopt hist_ignore_space setopt SHARE_HISTORY setopt APPEND_HISTORY From e10d8beba837b1fc2db0cb8897d8e2cd10b8f198 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 9 May 2010 22:23:11 +0800 Subject: [PATCH 03/68] Don't display dotfiles or reverse sort with ll alias. The ll alias is a very common default for bash in Linux distributions, so use that definition. --- lib/aliases.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 89c904a..80760a1 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -18,7 +18,7 @@ alias history='fc -l 1' # List direcory contents alias lsa='ls -lah' alias l='ls -la' -alias ll='ls -alr' +alias ll='ls -l' alias sl=ls # often screw this up alias afind='ack-grep -il' From 83e8aa50869367c64cfcd727b98155d7692faa8b Mon Sep 17 00:00:00 2001 From: James Rowe Date: Thu, 12 Nov 2009 14:52:53 +0800 Subject: [PATCH 04/68] Added a minimum zsh version note. --- README.textile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.textile b/README.textile index 950f886..23d8b53 100644 --- a/README.textile +++ b/README.textile @@ -4,6 +4,8 @@ bq. "OH MY ZSHELL!" h2. Setup +@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9. + h3. The automatic installer... (do you trust me?) @wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ From 0d22789e97760f463356fbe57075d86867e9f0c1 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Sun, 22 Nov 2009 01:38:55 +0800 Subject: [PATCH 05/68] Don't correct hpodder commands. --- lib/correction.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/correction.zsh b/lib/correction.zsh index 043320a..fc60dcd 100644 --- a/lib/correction.zsh +++ b/lib/correction.zsh @@ -7,3 +7,4 @@ alias mkdir='nocorrect mkdir' alias gist='nocorrect gist' alias heroku='nocorrect heroku' alias ebuild='nocorrect ebuild' +alias hpodder='nocorrect hpodder' From 8682ab61ad058de38566f80ff580cb5586df8406 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Thu, 14 Jan 2010 03:45:10 +0800 Subject: [PATCH 06/68] add fletcherm theme; a slightly modified copy of an old tonotdo theme --- themes/fletcherm.zsh-theme | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 themes/fletcherm.zsh-theme diff --git a/themes/fletcherm.zsh-theme b/themes/fletcherm.zsh-theme new file mode 100644 index 0000000..e961885 --- /dev/null +++ b/themes/fletcherm.zsh-theme @@ -0,0 +1,12 @@ +# Copied from old version of tonotdo's theme. LSCOLORS modified. +PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[magenta]%}•%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' +RPROMPT='[%*]' + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}⚡%{$fg_bold[blue]%})" + +export LSCOLORS="exfxcxdxbxegedabagacad" +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:' From 2db18cb0505068e782687c2eb40b9dbf4ac6dd93 Mon Sep 17 00:00:00 2001 From: Andy Fowler Date: Tue, 4 May 2010 16:18:57 -0400 Subject: [PATCH 07/68] makes git status prompt 4x faster (via git status -s, benchmarked) --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 629a08b..1d1d24d 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -5,7 +5,7 @@ function git_prompt_info() { } parse_git_dirty () { - if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then + if [[ -n $(git status -s 2> /dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" From 5b7b5bc9d10b37e36e0c899419abf2cd03fe1dac Mon Sep 17 00:00:00 2001 From: canthiswait Date: Mon, 26 Apr 2010 16:02:19 -0700 Subject: [PATCH 08/68] Added scpectrum script for easy 256 color theaming --- lib/spectrum.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/spectrum.zsh diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh new file mode 100644 index 0000000..4864654 --- /dev/null +++ b/lib/spectrum.zsh @@ -0,0 +1,20 @@ +#! /bin/zsh +# A script to make using 256 colors in zsh less painful. +# P.C. Shyamshankar +# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ + +typeset -Ag FX FG BG + +FX=( + reset "" + bold "" no-bold "" + italic "" no-italic "" + underline "" no-underline "" + blink "" no-blink "" + reverse "" no-reverse "" +) + +for color in {000..255}; do + FG[$color]="[38;5;${color}m" + BG[$color]="[48;5;${color}m" +done From 32b8cedb7213e99ac73c046aa62d62814ded0ebe Mon Sep 17 00:00:00 2001 From: canthiswait Date: Mon, 26 Apr 2010 22:01:41 -0700 Subject: [PATCH 09/68] escape sequences so rprompt doesn't mess up --- lib/spectrum.zsh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 4864654..4006a7f 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -6,15 +6,15 @@ typeset -Ag FX FG BG FX=( - reset "" - bold "" no-bold "" - italic "" no-italic "" - underline "" no-underline "" - blink "" no-blink "" - reverse "" no-reverse "" + reset "%{%}" + bold "%{%}" no-bold "%{%}" + italic "%{%}" no-italic "%{%}" + underline "%{%}" no-underline "%{%}" + blink "%{%}" no-blink "%{%}" + reverse "%{%}" no-reverse "%{%}" ) for color in {000..255}; do - FG[$color]="[38;5;${color}m" - BG[$color]="[48;5;${color}m" + FG[$color]="%{[38;5;${color}m%}" + BG[$color]="%{[48;5;${color}m%}" done From 96e33c6f6bb6f5a6610fbc7bba6775b039f1f254 Mon Sep 17 00:00:00 2001 From: canthiswait Date: Mon, 26 Apr 2010 22:27:32 -0700 Subject: [PATCH 10/68] 256 color theme with bright blue and orange --- themes/sporty_256.zsh-theme | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 themes/sporty_256.zsh-theme diff --git a/themes/sporty_256.zsh-theme b/themes/sporty_256.zsh-theme new file mode 100644 index 0000000..66c8698 --- /dev/null +++ b/themes/sporty_256.zsh-theme @@ -0,0 +1,13 @@ +# zsh theme requires 256 color enabled terminal +# i.e TERM=xterm-256color +# Preview - http://www.flickr.com/photos/adelcampo/4556482563/sizes/o/ +# based on robbyrussell's shell but louder! + +PROMPT='%{$fg_bold[blue]%}$(git_prompt_info) %F{208}%c%f +%{$fg_bold[white]%}%# %{$reset_color%}' +RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$fg[blue]%}|" From f53b74bddb20333c834d9e2a31f9a80b0212de02 Mon Sep 17 00:00:00 2001 From: canthiswait Date: Tue, 27 Apr 2010 00:55:15 -0700 Subject: [PATCH 11/68] Fixed color in last character of clean git info --- themes/sporty_256.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/sporty_256.zsh-theme b/themes/sporty_256.zsh-theme index 66c8698..db0fc42 100644 --- a/themes/sporty_256.zsh-theme +++ b/themes/sporty_256.zsh-theme @@ -10,4 +10,4 @@ RPROMPT='%B%F{208}%n%f%{$fg_bold[white]%}@%F{039}%m%f%{$reset_color%}' ZSH_THEME_GIT_PROMPT_PREFIX="%F{154}±|%f%F{124}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}%B✘%b%F{154}|%f%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$fg[blue]%}|" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%F{154}|" From 2e1eaf4040c8fb233a3ab15fa074231131703507 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 6 May 2010 21:04:09 -0700 Subject: [PATCH 12/68] Removing rake autocompletion as this is apparently baked into recent versions of zsh --- lib/rake_completion.zsh | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh index c425a62..8336182 100644 --- a/lib/rake_completion.zsh +++ b/lib/rake_completion.zsh @@ -1,24 +1,3 @@ -_rake_does_task_list_need_generating () { - if [ ! -f .rake_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .rake_tasks~) - changed=$(stat -f%m Rakefile) - return $(expr $accurate '>=' $changed) - fi -} - -_rake () { - if [ -f Rakefile ]; then - if _rake_does_task_list_need_generating; then - echo "\nGenerating .rake_tasks~..." > /dev/stderr - rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~ - fi - compadd `cat .rake_tasks~` - fi -} - -compctl -K _rake rake - function _cap_does_task_list_need_generating () { if [ ! -f .cap_tasks~ ]; then return 0; else From 9ec6086282b0090f562c39285602e0a161aa7f3c Mon Sep 17 00:00:00 2001 From: kremso Date: Tue, 9 Mar 2010 14:09:08 +0100 Subject: [PATCH 13/68] Don't autoselect first completion entry (Fixes #14) The key here is not using MENU_COMPLETE which autoselects the first entry, but using AUTO_MENU which displays the menu but autoselects on successive tab hit. Also, do not use zstyle menu yes because that somehow overrides the setopts. --- lib/completion.zsh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 46b6d8f..619dc02 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,11 +1,11 @@ ## fixme - the load process here seems a bit bizarre -setopt noautomenu +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 always_to_end -unsetopt flowcontrol - WORDCHARS='' autoload -U compinit @@ -23,14 +23,10 @@ fi zstyle ':completion:*' list-colors '' - -unsetopt MENU_COMPLETE -#setopt AUTO_MENU - # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history -zstyle ':completion:*:*:*:*:*' menu yes select +zstyle ':completion:*:*:*:*:*' menu select # zstyle ':completion:*:*:*:*:processes' force-list always zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' From a7641c92b9e4d8720c1d97c83e2f9745601ded4e Mon Sep 17 00:00:00 2001 From: Nikita Vasilyev Date: Sun, 14 Mar 2010 23:08:27 +0300 Subject: [PATCH 14/68] Arrow theme: http://elv1s.ru/i/zsh-arrow-theme.png --- themes/arrow.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 themes/arrow.zsh-theme diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme new file mode 100644 index 0000000..cfe558c --- /dev/null +++ b/themes/arrow.zsh-theme @@ -0,0 +1,9 @@ +if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi + +PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}' +RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}' + +# See http://geoff.greer.fm/lscolors/ +export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" +export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" + From 33e99a145ba87a237ceb71bcb6dbaf3c84115c3d Mon Sep 17 00:00:00 2001 From: Nikita Vasilyev Date: Tue, 16 Mar 2010 23:44:01 +0300 Subject: [PATCH 15/68] git:(master) --> git:master Parenthesis removed --- themes/arrow.zsh-theme | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme index cfe558c..a23efd1 100644 --- a/themes/arrow.zsh-theme +++ b/themes/arrow.zsh-theme @@ -3,6 +3,11 @@ if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}' RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}' +ZSH_THEME_GIT_PROMPT_PREFIX="git:" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="*" +ZSH_THEME_GIT_PROMPT_CLEAN="" + # See http://geoff.greer.fm/lscolors/ export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx" export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:" From bd481dd34641afb2095b4739e72632ead3ca023d Mon Sep 17 00:00:00 2001 From: Dallas Reedy Date: Wed, 17 Mar 2010 11:25:17 -0700 Subject: [PATCH 16/68] added my personal theme: the dallas them --- themes/dallas.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 themes/dallas.zsh-theme diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme new file mode 100644 index 0000000..10e019b --- /dev/null +++ b/themes/dallas.zsh-theme @@ -0,0 +1,14 @@ +# Personalized! +# [red][normal][purple][yellow][normal] +# dallas@lappy ~/Sites % +# PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " +# PROMPT="{white}\{{yellow}{time}{white}\}{green}{host}{white}:{cyan}{pwd} {red,bold}{user}{white}%{normal} " + +DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%T%{$fg[white]%}}%{$reset_color%}" +DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" +DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~%{$reset_color%}" +DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" +DALLAS_PROMPT_CHAR_="%{$fg[white]%}%%%{$reset_color%}" + +PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " From 1faec3fbd882e583a9e211f50993ef49d5d0b37e Mon Sep 17 00:00:00 2001 From: John Reese Date: Thu, 8 Apr 2010 14:11:42 -0400 Subject: [PATCH 17/68] Added theme "jreese" to oh-my-zsh --- themes/jreese.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 themes/jreese.zsh-theme diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme new file mode 100644 index 0000000..0f91776 --- /dev/null +++ b/themes/jreese.zsh-theme @@ -0,0 +1,14 @@ +if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %2~ \ +$(git_prompt_info)\ +%{$fg[red]%}%(!.#.»)%{$reset_color%} ' +PROMPT2='%{$fg[red]%}\ %{$reset_color%}' +RPS1='${return_code}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="⚡" + From 7d186816290bbc3011ff3d48e39ea6724fbd6d52 Mon Sep 17 00:00:00 2001 From: John Reese Date: Thu, 8 Apr 2010 15:02:56 -0400 Subject: [PATCH 18/68] Added screenshot link for jreese theme --- themes/jreese.zsh-theme | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme index 0f91776..111dc0d 100644 --- a/themes/jreese.zsh-theme +++ b/themes/jreese.zsh-theme @@ -1,3 +1,5 @@ +# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png + if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" From 3ecabe4f5b2963d7dec7f76e668347a0e3a2f7cf Mon Sep 17 00:00:00 2001 From: John Reese Date: Thu, 8 Apr 2010 15:07:43 -0400 Subject: [PATCH 19/68] Remove limit of two segments to PWD --- themes/jreese.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme index 111dc0d..534664f 100644 --- a/themes/jreese.zsh-theme +++ b/themes/jreese.zsh-theme @@ -3,7 +3,7 @@ if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %2~ \ +PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \ $(git_prompt_info)\ %{$fg[red]%}%(!.#.»)%{$reset_color%} ' PROMPT2='%{$fg[red]%}\ %{$reset_color%}' From ab010947aec9751ab879653dbd904b3580f7701e Mon Sep 17 00:00:00 2001 From: John Reese Date: Thu, 8 Apr 2010 22:35:35 -0400 Subject: [PATCH 20/68] Ignore errors from compaudit when using `sudo -s` --- lib/completion.zsh | 2 +- lib/key-bindings.zsh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 46b6d8f..b58612d 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -9,7 +9,7 @@ unsetopt flowcontrol WORDCHARS='' autoload -U compinit -compinit +compinit -i zmodload -i zsh/complist diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 87e47ba..2e282d6 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -1,6 +1,6 @@ # TODO: Explain what some of this does.. autoload -U compinit -compinit +compinit -i bindkey -e bindkey '\ew' kill-region @@ -38,4 +38,4 @@ bindkey ' ' magic-space # also do history expansion on space #bindkey '^I' complete-word ## Fix weird sequence that rxvt produces #bindkey -s '^[[Z' '\t' -# \ No newline at end of file +# From e3027eee8ab23f859805d869494dd9d8592eef51 Mon Sep 17 00:00:00 2001 From: Jon Duell Date: Tue, 27 Apr 2010 05:47:02 +0800 Subject: [PATCH 21/68] Adds new duellj theme --- themes/duellj.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/duellj.zsh-theme diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme new file mode 100644 index 0000000..7350b43 --- /dev/null +++ b/themes/duellj.zsh-theme @@ -0,0 +1,8 @@ + +# user, host, full path, and time/date +# on two lines for easier vgrepping +# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}%!%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b ' +RPROMPT='[%*]' +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' From 91c98643260c9a5535871106c20c27493a80fe87 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 6 May 2010 21:13:59 -0700 Subject: [PATCH 22/68] Unsetting config_file after loading config --- oh-my-zsh.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index fa2738e..a41f3d8 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -17,3 +17,5 @@ then else /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh fi + +unset config_file \ No newline at end of file From f2c600a709aa18c860cb326e2747167fa694fafb Mon Sep 17 00:00:00 2001 From: Dallas Reedy Date: Fri, 7 May 2010 11:17:12 -0700 Subject: [PATCH 23/68] updated my theme with the date and git branch (+ dirty or not) --- themes/dallas.zsh-theme | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme index 10e019b..eef32e9 100644 --- a/themes/dallas.zsh-theme +++ b/themes/dallas.zsh-theme @@ -1,14 +1,26 @@ # Personalized! -# [red][normal][purple][yellow][normal] -# dallas@lappy ~/Sites % -# PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " -# PROMPT="{white}\{{yellow}{time}{white}\}{green}{host}{white}:{cyan}{pwd} {red,bold}{user}{white}%{normal} " -DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%T%{$fg[white]%}}%{$reset_color%}" +# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} +DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}" +# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +# Grab the current machine name: muscato DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" -DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~%{$reset_color%}" +# Grab the current filepath, use shortcuts: ~/Desktop +# Append the current git branch, if in a git repository: ~aw@master +DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" +# Grab the current username: dallas DALLAS_CURRENT_USER_="%{$fg[red]%}%n%{$reset_color%}" -DALLAS_PROMPT_CHAR_="%{$fg[white]%}%%%{$reset_color%}" +# Use a % for normal users and a # for privelaged (root) users. +DALLAS_PROMPT_CHAR_="%{$fg[white]%}%(!.#.%%)%{$reset_color%}" +# For the git prompt, use a white @ and blue text for the branch name +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}@%{$fg[blue]%}" +# Close it all off by resetting the color and styles. +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +# Do nothing if the branch is clean (no changes). +ZSH_THEME_GIT_PROMPT_CLEAN="" +# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗" +# Put it all together! PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ " From af0e77b0c1b88b82e9c2b9b8551c0ac4d21858b3 Mon Sep 17 00:00:00 2001 From: Mario Gutierrez Date: Wed, 21 Apr 2010 19:24:53 +0800 Subject: [PATCH 24/68] my theme --- themes/mgutz.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/mgutz.zsh-theme diff --git a/themes/mgutz.zsh-theme b/themes/mgutz.zsh-theme new file mode 100644 index 0000000..dcf3270 --- /dev/null +++ b/themes/mgutz.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg_bold[magenta]%}%1~$(git_prompt_info) %{$fg_bold[magenta]%}%# %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="*]" +ZSH_THEME_GIT_PROMPT_CLEAN="]" From 8ca0e16e0578470f62456d1da52f7d498fdd4a58 Mon Sep 17 00:00:00 2001 From: Dylan Clendenin Date: Tue, 4 May 2010 02:49:48 +0800 Subject: [PATCH 25/68] two aliases set to 'ss', clobbering rails script/server --- lib/aliases.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index f97daf4..d891cc0 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -21,7 +21,6 @@ alias -- -='cd -' # Super user alias _='sudo' -alias ss='sudo su -' #alias g='grep -in' From 749960fe30a253e2fb9466c97cf84b084ed784a7 Mon Sep 17 00:00:00 2001 From: Mike Hostetler Date: Wed, 31 Mar 2010 00:21:42 +0800 Subject: [PATCH 26/68] added my theme, based on xiong-chiamiov-plus but using vcs_info instead of just git --- themes/mikeh.zsh-theme | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 themes/mikeh.zsh-theme diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme new file mode 100644 index 0000000..943f04d --- /dev/null +++ b/themes/mikeh.zsh-theme @@ -0,0 +1,23 @@ +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 + +add-zsh-hook precmd mikeh_precmd + +mikeh_precmd() { + vcs_info +} + +# user, host, full path, and time/date +# on two lines for easier vgrepping +# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 +PROMPT=$'%{\e[0;34m%}%B..[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %I:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} +%{\e[0;34m%}%B..%B[%{\e[1;35m%}$%{\e[0;34m%}%B] <($vcs_info_msg_0_)>%{\e[0m%}%b ' +PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' \ No newline at end of file From 1d93b2346fca1e85dd25571c835fc84896ce2e72 Mon Sep 17 00:00:00 2001 From: Mike Hostetler Date: Wed, 31 Mar 2010 01:31:41 +0800 Subject: [PATCH 27/68] share history with your zsh's on the same host --- lib/history.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/history.zsh b/lib/history.zsh index 527c327..509be8f 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -10,3 +10,6 @@ setopt hist_verify setopt inc_append_history setopt extended_history setopt hist_expire_dups_first + +setopt SHARE_HISTORY +setopt APPEND_HISTORY From 9b479c6af25b950e2b3a458ec47af1ae5bebecc1 Mon Sep 17 00:00:00 2001 From: Matthew Gadd Date: Tue, 6 Apr 2010 08:24:33 +0800 Subject: [PATCH 28/68] Add my oh-my-zsh theme --- themes/dst.zsh-theme | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 themes/dst.zsh-theme diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme new file mode 100644 index 0000000..fa0d9cb --- /dev/null +++ b/themes/dst.zsh-theme @@ -0,0 +1,16 @@ + +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +function prompt_char { + if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi +} + +PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%} +) +%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) +%_ $(prompt_char) ' + +RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' From 30ad562db9566bd5a5596b965f8b2fb327461419 Mon Sep 17 00:00:00 2001 From: dstufft Date: Wed, 24 Mar 2010 08:51:57 +0800 Subject: [PATCH 29/68] added the dstufft theme (based on prose by sjl) --- themes/dstufft.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/dstufft.zsh-theme diff --git a/themes/dstufft.zsh-theme b/themes/dstufft.zsh-theme new file mode 100644 index 0000000..5a23fce --- /dev/null +++ b/themes/dstufft.zsh-theme @@ -0,0 +1,19 @@ +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + hg root >/dev/null 2>/dev/null && echo 'Hg' && return + echo '○' +} + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +PROMPT=' +%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(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="" From 1a6a29e8880d2d050a5b83728e7dd11eeeafa764 Mon Sep 17 00:00:00 2001 From: Ryan McCuaig Date: Fri, 16 Apr 2010 08:22:50 +0800 Subject: [PATCH 30/68] Add my preferred prompt --- themes/rgm.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/rgm.zsh-theme diff --git a/themes/rgm.zsh-theme b/themes/rgm.zsh-theme new file mode 100644 index 0000000..9452a8b --- /dev/null +++ b/themes/rgm.zsh-theme @@ -0,0 +1,8 @@ +PROMPT=' +%n@%m %{$fg[cyan]%}%~ +%? $(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[red]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" From ea0a1a9f5130aa55c995f264f197ae499937964e Mon Sep 17 00:00:00 2001 From: Christopher Chow Date: Fri, 30 Apr 2010 16:36:03 +0800 Subject: [PATCH 31/68] Added my own theme. --- themes/Soliah.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/Soliah.zsh-theme diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme new file mode 100644 index 0000000..7ad876d --- /dev/null +++ b/themes/Soliah.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg[blue]%}%B%20~%b%{$reset_color%}%{$(git_prompt_info)%} $ ' + +ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})" +ZSH_THEME_GIT_PROMPT_DIRTY="*%{$reset_color%}" + From e5b7072ab3d29cf78df8009856dc6134108def3f Mon Sep 17 00:00:00 2001 From: Andy Fowler Date: Wed, 5 May 2010 04:19:09 +0800 Subject: [PATCH 32/68] my WIP theme --- themes/afowler.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/afowler.zsh-theme diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme new file mode 100644 index 0000000..f82e7bc --- /dev/null +++ b/themes/afowler.zsh-theme @@ -0,0 +1,8 @@ +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg[blue]}%}»%{${reset_color}%} ' + +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" From d2be10e7e4fabec8711a60c2ab85387a4e00dd5b Mon Sep 17 00:00:00 2001 From: Andy Fowler Date: Wed, 5 May 2010 04:58:10 +0800 Subject: [PATCH 33/68] happy with my theme. caret turns red for root --- themes/afowler.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme index f82e7bc..b5a9bb1 100644 --- a/themes/afowler.zsh-theme +++ b/themes/afowler.zsh-theme @@ -1,6 +1,8 @@ +if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi + local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg[blue]}%}»%{${reset_color}%} ' +PROMPT='%m %{${fg_bold[blue]}%}:: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}»%{${reset_color}%} ' RPS1="${return_code}" From 142490d04a6d2c9f6737201ed54036beb784dfe4 Mon Sep 17 00:00:00 2001 From: Parker McGee Date: Fri, 30 Apr 2010 00:12:26 +0800 Subject: [PATCH 34/68] added my own theme --- themes/pmcgee.zsh-theme | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 themes/pmcgee.zsh-theme diff --git a/themes/pmcgee.zsh-theme b/themes/pmcgee.zsh-theme new file mode 100644 index 0000000..4eb54df --- /dev/null +++ b/themes/pmcgee.zsh-theme @@ -0,0 +1,16 @@ +if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi + +PROMPT=' +%{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%} +$(git_prompt_info)%(!.#.$) ' +RPROMPT='[%*]' + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_no_bold[yellow]%}%B" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}*" + +# 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:' From 6ccca35e9de3ad8135628058568ca77e6422a9d8 Mon Sep 17 00:00:00 2001 From: Dave Verwer Date: Thu, 22 Apr 2010 17:32:36 +0800 Subject: [PATCH 35/68] New theme "daveverwer", based on "geoffgarside". --- themes/daveverwer.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/daveverwer.zsh-theme diff --git a/themes/daveverwer.zsh-theme b/themes/daveverwer.zsh-theme new file mode 100644 index 0000000..89aef92 --- /dev/null +++ b/themes/daveverwer.zsh-theme @@ -0,0 +1,7 @@ +# Copied and modified from the oh-my-zsh theme from geoffgarside +# Red server name, green cwd, blue git status + +PROMPT='%{$fg[red]%}%m%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}$(git_prompt_info) %(!.#.$) ' + +ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" From 73aa7d3fa636621f7513c2b20542175ef815bcc8 Mon Sep 17 00:00:00 2001 From: Edvard Majakari Date: Wed, 14 Apr 2010 04:44:51 +0800 Subject: [PATCH 36/68] added my theme --- themes/edvardm.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/edvardm.zsh-theme diff --git a/themes/edvardm.zsh-theme b/themes/edvardm.zsh-theme new file mode 100644 index 0000000..f9ca1a9 --- /dev/null +++ b/themes/edvardm.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + +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 b716d1c12c080ba066b089004aaaa42a94b94b08 Mon Sep 17 00:00:00 2001 From: Doug Fritz Date: Sat, 3 Apr 2010 15:48:35 +0800 Subject: [PATCH 37/68] added skaro theme --- themes/skaro.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/skaro.zsh-theme diff --git a/themes/skaro.zsh-theme b/themes/skaro.zsh-theme new file mode 100644 index 0000000..84b7b11 --- /dev/null +++ b/themes/skaro.zsh-theme @@ -0,0 +1,7 @@ +PROMPT='%{$fg_bold[green]%}%h %{$fg[cyan]%}%2~ %{$fg_bold[blue]%}$(git_prompt_info) %{$reset_color%}» ' + +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 9056b681fb29cd17d59b8e57a216e6290aafb564 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Fri, 7 May 2010 15:35:03 -0700 Subject: [PATCH 38/68] Sprinkling some candy on this muffin. --- tools/install.sh | 9 ++++++++- tools/upgrade.sh | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 5a7c009..004b252 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -24,6 +24,13 @@ echo "export PATH=$PATH" >> ~/.zshrc echo "Time to change your default shell to zsh!" chsh -s /bin/zsh -echo "Hooray! Oh My Zsh has been installed." +echo ' __ __ ' +echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' +echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' +echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' +echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' +echo ' /____/' + +echo "\n\n ....is now installed." /bin/zsh source ~/.zshrc diff --git a/tools/upgrade.sh b/tools/upgrade.sh index f749404..6dee42c 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -2,4 +2,5 @@ current_path=`pwd` echo "Upgrading Oh My Zsh" ( cd $ZSH && git pull origin master ) 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 From 6bb4e2388af05243afe3be7267b2ac5bcdaedbd3 Mon Sep 17 00:00:00 2001 From: Hayes Williams Date: Wed, 26 May 2010 21:49:55 -0700 Subject: [PATCH 39/68] Adds a new theme that only seems to work on Linux --- themes/linuxonly | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 themes/linuxonly diff --git a/themes/linuxonly b/themes/linuxonly new file mode 100644 index 0000000..a11b80d --- /dev/null +++ b/themes/linuxonly @@ -0,0 +1,80 @@ +# vim: set ts=2 textwidth=0 + +autoload -U add-zsh-hook +autoload -Uz vcs_info +local c0=$(printf "\033[0m") +local c1=$(printf "\033[38;5;215m") +local c2=$(printf "\033[38;5;209m") +local c3=$(printf "\033[38;5;203m") +local c4=$(printf "\033[33;4m") +local c5=$(printf "\033[38;5;137m") +local c6=$(printf "\033[38;5;240m") +local c7=$(printf "\033[38;5;149m") +local c8=$(printf "\033[38;5;126m") +local c9=$(printf "\033[38;5;162m") + +local foopath=$(perl /home/scp1/bin/foopath) + +if [ "$TERM" = "linux" ]; then + c1=$(printf "\033[34;1m") + c2=$(printf "\033[35m") + c3=$(printf "\033[31m") + c4=$(printf "\033[31;1m") + c5=$(printf "\033[32m") + c6=$(printf "\033[32;1m") + c7=$(printf "\033[33m") + c8=$(printf "\033[33;1m") + c9=$(printf "\033[34m") +fi + +#local newtv=$(perl $HOME/devel/newtv.pl) +local newtv='' + +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%}:%{$c7%}(%{$c9%}%b%{$c7%})%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="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f" + #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/" + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" + #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})" + + PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} +> ' + elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='${vcs_info_msg_0_} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} +> ' + + elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" + + PROMPT='${vcs_info_msg_0_} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} +%{$c9%}·>%{$c0%} ' + else + dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})" + PROMPT='${vcs_info_msg_0_} +%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} +> ' + + fi +} + + +#PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%} +#> ' + +# vim: set ft=zsh ts=4 sw=4 et: + + From f399d215aa704bd869055d7a35d86f62261748a7 Mon Sep 17 00:00:00 2001 From: lunks Date: Fri, 14 May 2010 04:42:24 +0800 Subject: [PATCH 40/68] modified macovsky to support ruby version --- themes/macovsky.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme index db7f914..4eb4102 100644 --- a/themes/macovsky.zsh-theme +++ b/themes/macovsky.zsh-theme @@ -1,8 +1,8 @@ # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -PROMPT='%{$fg[green]%}%~%{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" \ No newline at end of file +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" From 61172d3713706d8b1a989f7040b1a92daa3709e9 Mon Sep 17 00:00:00 2001 From: lunks Date: Fri, 14 May 2010 07:15:31 +0800 Subject: [PATCH 41/68] macowsky modified theme with ruby version on prompt --- themes/macovsky-ruby.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/macovsky-ruby.zsh-theme diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme new file mode 100644 index 0000000..4eb4102 --- /dev/null +++ b/themes/macovsky-ruby.zsh-theme @@ -0,0 +1,8 @@ +# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" From f961374db3db289d761d4d9da8bba50698d2eca1 Mon Sep 17 00:00:00 2001 From: Alan Harper Date: Wed, 19 May 2010 14:53:16 +0800 Subject: [PATCH 42/68] Import rvm prompt --- lib/rvm.zsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lib/rvm.zsh diff --git a/lib/rvm.zsh b/lib/rvm.zsh new file mode 100644 index 0000000..597be1b --- /dev/null +++ b/lib/rvm.zsh @@ -0,0 +1,7 @@ +# get the name of the branch we are on +function rvm_prompt_info() { + ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return + echo "($ruby_version)" +} + + From d9294f9878a6b59ef66b235e58e46f279c040776 Mon Sep 17 00:00:00 2001 From: Alan Harper Date: Wed, 19 May 2010 14:53:38 +0800 Subject: [PATCH 43/68] aussiegeek theme (include showing rvm prompt) --- themes/aussiegeek.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/aussiegeek.zsh-theme diff --git a/themes/aussiegeek.zsh-theme b/themes/aussiegeek.zsh-theme new file mode 100644 index 0000000..c2c7f65 --- /dev/null +++ b/themes/aussiegeek.zsh-theme @@ -0,0 +1,8 @@ + +PROMPT='$fg_bold[blue][ $fg[red]%t $fg_bold[blue]] $fg_bold[blue] [ $fg[red]%n@%m:%~$(git_prompt_info)$fg[yellow]$(rvm_prompt_info)$fg_bold[blue] ]$reset_color + $ ' +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="$fg_bold[green](" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_CLEAN="✔" +ZSH_THEME_GIT_PROMPT_DIRTY="✗" From 6878f3ad22ad395e451f5850ca9856b41e009b0f Mon Sep 17 00:00:00 2001 From: Thomas J Bradley Date: Thu, 27 May 2010 06:37:52 +0800 Subject: [PATCH 44/68] Added my zsh theme file, heavily based on sjl's --- themes/thomasjbradley.zsh-theme | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 themes/thomasjbradley.zsh-theme diff --git a/themes/thomasjbradley.zsh-theme b/themes/thomasjbradley.zsh-theme new file mode 100644 index 0000000..857301d --- /dev/null +++ b/themes/thomasjbradley.zsh-theme @@ -0,0 +1,29 @@ +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 02f43b2e8b3c398cb2869d3cd1fa988a9fd68c25 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 28 May 2010 03:20:27 +0800 Subject: [PATCH 45/68] Added customized version of the wezm theme (mainly added username/host in the prompt). --- themes/wezm+.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/wezm+.zsh-theme diff --git a/themes/wezm+.zsh-theme b/themes/wezm+.zsh-theme new file mode 100644 index 0000000..fee3eb0 --- /dev/null +++ b/themes/wezm+.zsh-theme @@ -0,0 +1,7 @@ +PROMPT='%{${fg_bold[yellow]}%}%n%{$reset_color%}%{${fg[yellow]}%}@%m%{$reset_color%} $(git_prompt_info)%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )%{$fg[yellow]%}%#%{$reset_color%} ' +RPROMPT='%{$fg[green]%}%~%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" From 073d75e490bb6a084ca5e267dcd16a97793c7e0b Mon Sep 17 00:00:00 2001 From: Joseph Bergantine Date: Mon, 24 May 2010 04:03:27 +0800 Subject: [PATCH 46/68] adding my zsh theme -- only difference from robby's being that i'm using white instead of blue for legibility over brown --- themes/jbergantine.zsh-theme | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/jbergantine.zsh-theme diff --git a/themes/jbergantine.zsh-theme b/themes/jbergantine.zsh-theme new file mode 100644 index 0000000..d84247c --- /dev/null +++ b/themes/jbergantine.zsh-theme @@ -0,0 +1,6 @@ +PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%})" From ac13115d22a4a1f16f6c512f600d38317484e108 Mon Sep 17 00:00:00 2001 From: Takashi Yoshida Date: Mon, 31 May 2010 00:56:26 +0800 Subject: [PATCH 47/68] Added my own theme. --- themes/takashiyoshida.zsh-theme | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 themes/takashiyoshida.zsh-theme diff --git a/themes/takashiyoshida.zsh-theme b/themes/takashiyoshida.zsh-theme new file mode 100644 index 0000000..419a8cf --- /dev/null +++ b/themes/takashiyoshida.zsh-theme @@ -0,0 +1,27 @@ +# +# PROMPT +# +PROMPT_BRACKET_BEGIN='%{$fg_bold[white]%}[' +PROMPT_HOST='%{$fg_bold[cyan]%}%m' +PROMPT_SEPARATOR='%{$reset_color%}:' +PROMPT_DIR='%{$fg_bold[yellow]%}%c' +PROMPT_BRACKET_END='%{$fg_bold[white]%}]' + +PROMPT_USER='%{$fg_bold[white]%}%n' +PROMPT_SIGN='%{$reset_color%}%#' + +GIT_PROMPT_INFO='$(git_prompt_info)' + +# My current prompt looks like: +# [host:current_dir] (git_prompt_info) +# [username]% +PROMPT="${PROMPT_BRACKET_BEGIN}${PROMPT_HOST}${PROMPT_SEPARATOR}${PROMPT_DIR}${PROMPT_BRACKET_END}${GIT_PROMPT_INFO} +${PROMPT_BRACKET_BEGIN}${PROMPT_USER}${PROMPT_BRACKET_END}${PROMPT_SIGN} " + +# +# Git repository +# +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_CLEAN='' From 0b56ae5020ce86cf3c5f38b005c93739c16b9bff Mon Sep 17 00:00:00 2001 From: MasterLambaster Date: Mon, 31 May 2010 17:09:45 +0800 Subject: [PATCH 48/68] Eastwood theme with optional RVM support --- themes/eastwood.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/eastwood.zsh-theme diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme new file mode 100644 index 0000000..8366451 --- /dev/null +++ b/themes/eastwood.zsh-theme @@ -0,0 +1,19 @@ +#RVM settings +if [[ -s ~/.rvm/scripts/rvm ]] ; then + RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1" +fi + +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 +} + +PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b ' From 210a72b44110741fc347fd93723f48f08fc87a46 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:03:26 -0700 Subject: [PATCH 49/68] Initial implementation of a new plugin system, so that people can managed which aliases/functions they want. --- lib/aliases.zsh | 28 ---------------------------- lib/functions.zsh | 21 --------------------- lib/git.zsh | 15 --------------- oh-my-zsh.sh | 4 ++++ plugins/git.plugin.zsh | 21 +++++++++++++++++++++ plugins/lighthouse.plugin.zsh | 16 ++++++++++++++++ plugins/rails.plugin.zsh | 10 ++++++++++ plugins/ruby.plugin.zsh | 4 ++++ plugins/textmate.plugin.zsh | 14 ++++++++++++++ 9 files changed, 69 insertions(+), 64 deletions(-) create mode 100644 plugins/git.plugin.zsh create mode 100644 plugins/lighthouse.plugin.zsh create mode 100644 plugins/rails.plugin.zsh create mode 100644 plugins/ruby.plugin.zsh create mode 100644 plugins/textmate.plugin.zsh diff --git a/lib/aliases.zsh b/lib/aliases.zsh index d891cc0..89c904a 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -1,19 +1,7 @@ -#!/bin/zsh - # Push and pop directories on directory stack alias pu='pushd' alias po='popd' -alias ss='thin --stats "/thin/stats" start' -alias sg='ruby script/generate' -alias sd='ruby script/destroy' -alias sp='ruby script/plugin' -alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias sc='ruby script/console' -alias sd='ruby script/server --debugger' -alias devlog='tail -f log/development.log' - # Basic directory operations alias .='pwd' alias ...='cd ../..' @@ -33,20 +21,4 @@ alias l='ls -la' alias ll='ls -alr' alias sl=ls # often screw this up -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' alias afind='ack-grep -il' - -# Git and svn mix -alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' - -# 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 -alias mr='mate CHANGELOG app config db lib public script spec test' diff --git a/lib/functions.zsh b/lib/functions.zsh index 74b93f0..35c3f3c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -54,24 +54,3 @@ function take() { cd $1 } -function tm() { - cd $1 - mate $1 -} - -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: http://screencast.com/t/ZDgwNDUwNT -open_lighthouse_ticket () { - if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - `open $lighthouse_url/tickets/$1`; - fi -} - -alias lho='open_lighthouse_ticket' diff --git a/lib/git.zsh b/lib/git.zsh index 1d1d24d..a54e5bc 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -20,18 +20,3 @@ function current_branch() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } - -# Aliases -alias g='git' -alias gst='git status' -alias gl='git pull' -alias gup='git fetch && git rebase' -alias gp='git push' -alias gd='git diff | mate' -alias gdv='git diff -w "$@" | vim -R -' -alias gc='git commit -v' -alias gca='git commit -v -a' -alias gb='git branch' -alias gba='git branch -a' -alias gcount='git shortlog -sn' -alias gcp='git cherry-pick' diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index a41f3d8..bb45c71 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -10,6 +10,10 @@ for config_file ($ZSH/lib/*.zsh) source $config_file # Load all of your custom configurations from custom/ for config_file ($ZSH/custom/*.zsh) source $config_file +# Load all of the plugins that were defined in ~/.zshrc +plugin=${plugin:=()} +for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] then diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh new file mode 100644 index 0000000..26777a6 --- /dev/null +++ b/plugins/git.plugin.zsh @@ -0,0 +1,21 @@ +# Aliases +alias g='git' +alias gst='git status' +alias gl='git pull' +alias gup='git fetch && git rebase' +alias gp='git push' +alias gd='git diff | mate' +alias gdv='git diff -w "$@" | vim -R -' +alias gc='git commit -v' +alias gca='git commit -v -a' +alias gb='git branch' +alias gba='git branch -a' +alias gcount='git shortlog -sn' +alias gcp='git cherry-pick' + + +# Git and svn mix +alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' + +alias ggpull='git pull origin $(current_branch)' +alias ggpush='git push origin $(current_branch)' diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse.plugin.zsh new file mode 100644 index 0000000..4eb06a9 --- /dev/null +++ b/plugins/lighthouse.plugin.zsh @@ -0,0 +1,16 @@ +# To use: add a .lighthouse file into your directory with the URL to the +# individual project. For example: +# https://rails.lighthouseapp.com/projects/8994 +# Example usage: http://screencast.com/t/ZDgwNDUwNT +open_lighthouse_ticket () { + if [ ! -f .lighthouse-url ]; then + echo "There is no .lighthouse file in the current directory..." + return 0; + else + lighthouse_url=$(cat .lighthouse-url); + echo "Opening ticket #$1"; + `open $lighthouse_url/tickets/$1`; + fi +} + +alias lho='open_lighthouse_ticket' \ No newline at end of file diff --git a/plugins/rails.plugin.zsh b/plugins/rails.plugin.zsh new file mode 100644 index 0000000..fb21da8 --- /dev/null +++ b/plugins/rails.plugin.zsh @@ -0,0 +1,10 @@ + +alias ss='thin --stats "/thin/stats" start' +alias sg='ruby script/generate' +alias sd='ruby script/destroy' +alias sp='ruby script/plugin' +alias ssp='ruby script/spec' +alias rdbm='rake db:migrate' +alias sc='ruby script/console' +alias sd='ruby script/server --debugger' +alias devlog='tail -f log/development.log' \ No newline at end of file diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby.plugin.zsh new file mode 100644 index 0000000..82bf5d4 --- /dev/null +++ b/plugins/ruby.plugin.zsh @@ -0,0 +1,4 @@ +alias sgem='sudo gem' + +# Find ruby file +alias rfind='find . -name *.rb | xargs grep -n' \ No newline at end of file diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate.plugin.zsh new file mode 100644 index 0000000..7b73e27 --- /dev/null +++ b/plugins/textmate.plugin.zsh @@ -0,0 +1,14 @@ + +# 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 +alias mr='mate CHANGELOG app config db lib public script spec test' + +function tm() { + cd $1 + mate $1 +} From 96e5f542003a5d03c728419dd53dad6619278f3c Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:05:12 -0700 Subject: [PATCH 50/68] Updating default .zshrc template file to include plugins declaration --- templates/zshrc.zsh-template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index d905be0..8022b35 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -14,6 +14,10 @@ export ZSH_THEME="robbyrussell" # Uncomment following line if you want to disable colors in ls # export 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) +plugins=(git) + source $ZSH/oh-my-zsh.sh # Customize to your needs... From 7e8fd8922c0cfcc8a75a70b4395936a228116cac Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:32:55 -0700 Subject: [PATCH 51/68] Moving capistrano functions to rails plugin --- plugins/rails.plugin.zsh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/rails.plugin.zsh b/plugins/rails.plugin.zsh index fb21da8..b7f62a0 100644 --- a/plugins/rails.plugin.zsh +++ b/plugins/rails.plugin.zsh @@ -7,4 +7,26 @@ alias ssp='ruby script/spec' alias rdbm='rake db:migrate' alias sc='ruby script/console' alias sd='ruby script/server --debugger' -alias devlog='tail -f log/development.log' \ No newline at end of file +alias devlog='tail -f log/development.log' + +function _cap_does_task_list_need_generating () { + if [ ! -f .cap_tasks~ ]; then return 0; + else + accurate=$(stat -f%m .cap_tasks~) + changed=$(stat -f%m config/deploy.rb) + return $(expr $accurate '>=' $changed) + fi +} + +function _cap () { + if [ -f config/deploy.rb ]; then + if _cap_does_task_list_need_generating; then + echo "\nGenerating .cap_tasks~..." > /dev/stderr + cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' +> .cap_tasks~ + fi + compadd `cat .cap_tasks~` + fi +} + +compctl -K _cap cap From 318ff007d3de86c7900af6998adace6b0f81119a Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:33:15 -0700 Subject: [PATCH 52/68] Removing rake completion from lib/ as it was moved to rails plugin --- lib/rake_completion.zsh | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 lib/rake_completion.zsh diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh deleted file mode 100644 index 8336182..0000000 --- a/lib/rake_completion.zsh +++ /dev/null @@ -1,21 +0,0 @@ -function _cap_does_task_list_need_generating () { - if [ ! -f .cap_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .cap_tasks~) - changed=$(stat -f%m config/deploy.rb) - return $(expr $accurate '>=' $changed) - fi -} - -function _cap () { - if [ -f config/deploy.rb ]; then - if _cap_does_task_list_need_generating; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' -> .cap_tasks~ - fi - compadd `cat .cap_tasks~` - fi -} - -compctl -K _cap cap From 4381863fd2d934568f48d8e5816cd71e8e63a1a7 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:54:40 -0700 Subject: [PATCH 53/68] Removing legacy completion code --- lib/completion.zsh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b627ef8..cba9017 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -27,8 +27,6 @@ zstyle ':completion:*' list-colors '' bindkey -M menuselect '^o' accept-and-infer-next-history zstyle ':completion:*:*:*:*:*' menu select -# zstyle ':completion:*:*:*:*:processes' force-list always - zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" @@ -37,9 +35,3 @@ if [ -f ~/.ssh/known_hosts ]; then zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` fi - -# Complete on history -#zstyle ':completion:*:history-words' stop yes -#zstyle ':completion:*:history-words' remove-all-dups yes -#zstyle ':completion:*:history-words' list false -#zstyle ':completion:*:history-words' menu yes From a77aceaf5eee42227993b8da7dd55c9f0e6375d0 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:55:07 -0700 Subject: [PATCH 54/68] Moving some rails and osx-specific functions to their corresponding plugin files --- lib/functions.zsh | 16 ---------------- plugins/osx.plugin.zsh | 11 +++++++++++ plugins/rails.plugin.zsh | 4 ++++ 3 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 plugins/osx.plugin.zsh diff --git a/lib/functions.zsh b/lib/functions.zsh index 35c3f3c..fcbe994 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -21,10 +21,6 @@ function preexec { title $cmd[1]:t "$cmd[2,-1]" } -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} - function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head } @@ -37,18 +33,6 @@ function upgrade_oh_my_zsh() { /bin/sh $ZSH/tools/upgrade.sh } -function tab() { - osascript 2>/dev/null </dev/null < Date: Thu, 3 Jun 2010 12:56:11 -0700 Subject: [PATCH 55/68] Moving current_branch() to git plugin --- lib/git.zsh | 9 --------- plugins/git.plugin.zsh | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index a54e5bc..889dd98 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -11,12 +11,3 @@ parse_git_dirty () { echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } - -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh index 26777a6..e0d9670 100644 --- a/plugins/git.plugin.zsh +++ b/plugins/git.plugin.zsh @@ -17,5 +17,15 @@ alias gcp='git cherry-pick' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' +# +# Will return the current branch name +# Usage example: git pull origin $(current_branch) +# +function current_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo ${ref#refs/heads/} +} + +# these aliases take advangate of the previous function alias ggpull='git pull origin $(current_branch)' alias ggpush='git push origin $(current_branch)' From b025e7ed470182a41b6254f68a529d838a52a0df Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:59:49 -0700 Subject: [PATCH 56/68] Moving brew functions to it's own plugin --- functions/_brew => plugins/brew.plugin.zsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename functions/_brew => plugins/brew.plugin.zsh (100%) diff --git a/functions/_brew b/plugins/brew.plugin.zsh similarity index 100% rename from functions/_brew rename to plugins/brew.plugin.zsh From a367c83463ce438cc0aecbb73667a13eeaaeb9fb Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 13:01:41 -0700 Subject: [PATCH 57/68] Adding some candy to the upgrade script --- tools/upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 6dee42c..6bdd02e 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,6 +1,12 @@ current_path=`pwd` echo "Upgrading Oh My Zsh" ( 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 From 65b43db5b374a57943121053863422e41208c5bc Mon Sep 17 00:00:00 2001 From: Tobias Birmili Date: Sun, 6 Jun 2010 18:42:25 +0800 Subject: [PATCH 58/68] added plugin to control macports mysql-server installation --- plugins/mysql-macports.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/mysql-macports.plugin.zsh diff --git a/plugins/mysql-macports.plugin.zsh b/plugins/mysql-macports.plugin.zsh new file mode 100644 index 0000000..63b881c --- /dev/null +++ b/plugins/mysql-macports.plugin.zsh @@ -0,0 +1,6 @@ +# 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 33d4faa92889734fd6f1ac145cc9a906af39d45a Mon Sep 17 00:00:00 2001 From: toabi Date: Sun, 6 Jun 2010 22:14:13 +0800 Subject: [PATCH 59/68] updated the readme --- README.textile | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/README.textile b/README.textile index 23d8b53..8b1b687 100644 --- a/README.textile +++ b/README.textile @@ -27,22 +27,19 @@ h3. The manual way @chsh -s /bin/zsh@ -4. Start / restart zsh (open a new terminal is easy enough..) +4. Start / restart zsh (open a new terminal is easy enough...) h3. Problems? -You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to oh-my-zsh. +You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_. h2. Usage -TODO: Update this.. - -* Rake autocomplete: @rake (tab)@. Will generate a cache of all your rake tasks and then let you auto-complete and/or select the task to run. -* ssh autocomplete: @ssh (tab)@ or @scp (tab)@ -* Git branch, it'll tell you which branch you're in when you're in a git repository directory. +* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible) +** example: @plugins=(git osx ruby)@ * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@. -** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with Oh My Zsh. -* much much more.. +** Take a look at the "current themes":http://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_. +* much much more... take a look at @lib/@ what _Oh My Zsh_ offers... h2. Useful @@ -51,6 +48,7 @@ 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. h3. Uninstalling @@ -68,8 +66,4 @@ 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. - -h3. Todo from imajes: - -* need to make the title bar support git folder \ No newline at end of file +I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. \ No newline at end of file From ba9b9111b58e64398715613fc38cadb1025fbc41 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 10 Jun 2010 07:50:13 -0700 Subject: [PATCH 60/68] Adding a ggpnp which does a git pull followed by a git push. --- plugins/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh index e0d9670..655eaf7 100644 --- a/plugins/git.plugin.zsh +++ b/plugins/git.plugin.zsh @@ -29,3 +29,4 @@ function current_branch() { # these aliases take advangate of the previous function alias ggpull='git pull origin $(current_branch)' alias ggpush='git push origin $(current_branch)' +alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' \ No newline at end of file From 5f62c6af832c72b96961f2075b4a4b0ae05d329d Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 16 Aug 2010 21:47:21 +0200 Subject: [PATCH 61/68] add candy theme --- themes/candy.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/candy.zsh-theme diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme new file mode 100644 index 0000000..bc125c5 --- /dev/null +++ b/themes/candy.zsh-theme @@ -0,0 +1,7 @@ +PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ +%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$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 5137931254379e892bfe5b22da607686c1e7771a Mon Sep 17 00:00:00 2001 From: Josh Price Date: Tue, 17 Aug 2010 22:45:10 +1000 Subject: [PATCH 62/68] Added my own theme based on pat's --- themes/josh.zsh-theme | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 themes/josh.zsh-theme diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme new file mode 100644 index 0000000..9d59bd9 --- /dev/null +++ b/themes/josh.zsh-theme @@ -0,0 +1,43 @@ +grey='\e[0;90m' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}(" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" + +function pat_prompt { + (( spare_width = ${COLUMNS} )) + prompt=" " + + branch=$(current_branch) + ruby_version=$(rvm_prompt_info) + path_size=${#PWD} + branch_size=${#branch} + ruby_size=${#ruby_version} + machine_size=11 + + if [[ ${#branch} -eq 0 ]] + then (( ruby_size = ruby_size + 1 )) + else + (( branch_size = branch_size + 4 )) + if [[ -n $(git status -s 2> /dev/null) ]]; then + (( branch_size = branch_size + 2 )) + fi + fi + + (( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) + + while [ ${#prompt} -lt $spare_width ]; do + prompt=" $prompt" + done + + prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)" + + echo $prompt +} + +setopt prompt_subst + +PROMPT=' +%n@%m $(pat_prompt) +%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} ' From b0b7915d9d65bd2d036d203c39dd6b364a784b9e Mon Sep 17 00:00:00 2001 From: Josh Price Date: Tue, 17 Aug 2010 23:22:26 +1000 Subject: [PATCH 63/68] Made the user_machine_size calculation generic. Pwned the function name. --- themes/josh.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme index 9d59bd9..6bed1a7 100644 --- a/themes/josh.zsh-theme +++ b/themes/josh.zsh-theme @@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})" -function pat_prompt { +function josh_prompt { (( spare_width = ${COLUMNS} )) prompt=" " @@ -14,7 +14,7 @@ function pat_prompt { path_size=${#PWD} branch_size=${#branch} ruby_size=${#ruby_version} - machine_size=11 + user_machine_size=${#${(%):-%n@%m-}} if [[ ${#branch} -eq 0 ]] then (( ruby_size = ruby_size + 1 )) @@ -25,7 +25,7 @@ function pat_prompt { fi fi - (( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) + (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) )) while [ ${#prompt} -lt $spare_width ]; do prompt=" $prompt" @@ -39,5 +39,5 @@ function pat_prompt { setopt prompt_subst PROMPT=' -%n@%m $(pat_prompt) +%n@%m $(josh_prompt) %(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} ' From 2f2a4a1372f9a6b6c8fd9cc13fbd242cd2172e07 Mon Sep 17 00:00:00 2001 From: Daniel Schauenberg Date: Mon, 9 Aug 2010 15:45:40 +0200 Subject: [PATCH 64/68] update brew plugin from homebrew contributions --- plugins/brew.plugin.zsh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/plugins/brew.plugin.zsh b/plugins/brew.plugin.zsh index 91397bf..162eb64 100644 --- a/plugins/brew.plugin.zsh +++ b/plugins/brew.plugin.zsh @@ -1,6 +1,6 @@ #compdef brew -# copied from _fink +# imported from the latest homebrew contributions _brew_all_formulae() { formulae=(`brew search`) @@ -12,19 +12,25 @@ _brew_installed_formulae() { local -a _1st_arguments _1st_arguments=( - 'install:install a formula' - 'remove:remove a formula' - 'search:search for a formula (/regex/ or string)' - 'list:list files in a formula or not-installed formulae' - 'link:link a formula' - 'unlink:unlink a formula' + 'cat:display formula file for a formula' + 'cleanup:uninstall unused and old versions of packages' + 'create:create a new formula' + 'deps:list dependencies and dependants of a formula' + 'doctor:audits your installation for common issues' + 'edit:edit a formula' 'home:visit the homepage of a formula or the brew project' 'info:information about a formula' - 'prune:remove dead links' - 'update:freshen up links' + 'install:install a formula' + 'link:link a formula' + 'list:list files in a formula or not-installed formulae' 'log:git commit log for a formula' - 'create:create a new formula' - 'edit:edit a formula' + '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)' + 'unlink:unlink a formula' + 'update:freshen up links' + 'uses:show formulas which depend on a formula' ) local expl @@ -47,12 +53,12 @@ case "$words[1]" in _arguments \ '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \ '1: :->forms' && return 0 - + if [[ "$state" == forms ]]; then _brew_installed_formulae _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae fi ;; - install|home|log|info) + install|home|log|info|uses|cat|deps) _brew_all_formulae _wanted formulae expl 'all formulae' compadd -a formulae ;; remove|edit|xo) From 3205628a51608ab68d6e1db4908130df806edc20 Mon Sep 17 00:00:00 2001 From: Daniel Schauenberg Date: Sun, 8 Aug 2010 19:45:49 +0200 Subject: [PATCH 65/68] add simple mrtazz theme based on robbyrussell - simple theme - hostname and current folder on left prompt - git branch and working tree status on the right --- themes/mrtazz.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 themes/mrtazz.zsh-theme diff --git a/themes/mrtazz.zsh-theme b/themes/mrtazz.zsh-theme new file mode 100644 index 0000000..214ba5a --- /dev/null +++ b/themes/mrtazz.zsh-theme @@ -0,0 +1,7 @@ +PROMPT='%{$fg_bold[red]%}%m%{$reset_color%}:%{$fg[cyan]%}%c%{$reset_color%}:%# ' +RPROMPT='%{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}% ' + +ZSH_THEME_GIT_PROMPT_PREFIX="<%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}✗%{$fg[green]%}>%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}>" From d0eb0d9fbc846530fd3ec4812762ce18462c1e87 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 19 Aug 2010 08:04:18 -0700 Subject: [PATCH 66/68] Switching to /usr/bin/env zsh instead of /bin/zsh in the installer --- tools/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 004b252..6e3872b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -22,7 +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!" -chsh -s /bin/zsh +chsh -s "/usr/bin/env zsh" echo ' __ __ ' echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' @@ -32,5 +32,5 @@ echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' echo ' /____/' echo "\n\n ....is now installed." -/bin/zsh +/usr/bin/env zsh source ~/.zshrc From 1d4098bd293285b7f008b9d76a4dfe7f1bbc1808 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 24 Aug 2010 11:08:20 -0700 Subject: [PATCH 67/68] Removing '.' alias as it is overwriting a bash/zsh feature. Closes #63 --- lib/aliases.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index 80760a1..d2d3aed 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -3,7 +3,6 @@ alias pu='pushd' alias po='popd' # Basic directory operations -alias .='pwd' alias ...='cd ../..' alias -- -='cd -' From 572a66395511814a1b973ba13c4f7cf3eb65ee7c Mon Sep 17 00:00:00 2001 From: Tomas Kramar Date: Sun, 26 Sep 2010 22:25:31 +0200 Subject: [PATCH 68/68] Add vi-mode plugin for vi-like editing --- plugins/vi-mode.plugin.zsh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugins/vi-mode.plugin.zsh diff --git a/plugins/vi-mode.plugin.zsh b/plugins/vi-mode.plugin.zsh new file mode 100644 index 0000000..c47ab72 --- /dev/null +++ b/plugins/vi-mode.plugin.zsh @@ -0,0 +1,22 @@ +function zle-line-init zle-keymap-select { + zle reset-prompt +} + +zle -N zle-line-init +zle -N zle-keymap-select + +bindkey -v + +# if mode indicator wasn't setup by theme, define default +if [[ "$MODE_INDICATOR" == "" ]]; then + MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" +fi + +function vi_mode_prompt_info() { + echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" +} + +# define right prompt, if it wasn't defined by a theme +if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then + RPS1='$(vi_mode_prompt_info)' +fi