From 887ca5a80df8bd17829409a59635878812c7ad70 Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Fri, 9 Jul 2010 16:12:15 -0600 Subject: [PATCH 1/6] added the jtzemp theme --- themes/jtzemp.zsh-theme | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 themes/jtzemp.zsh-theme diff --git a/themes/jtzemp.zsh-theme b/themes/jtzemp.zsh-theme new file mode 100644 index 000000000..19fc636e1 --- /dev/null +++ b/themes/jtzemp.zsh-theme @@ -0,0 +1,28 @@ +# Personalized! - Based on dallas.zsh-theme + +# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} +DALLAS_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$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%}" +# 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[green]%}%n@%{$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[blue]%}(%{$fg[cyan]%}" +# Close it all off by resetting the color and styles. +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[blue]%})%{$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[red]%} ✗✗✗" +#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} !" + + +# Put it all together! +PROMPT="$DALLAS_CURRENT_TIME_ $DALLAS_CURRENT_USER_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_PROMPT_CHAR_ " From 23b27fdd2d58841a92075cb37776535d4389b3ea Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Fri, 9 Jul 2010 16:24:09 -0600 Subject: [PATCH 2/6] renamed variables on jtzemp theme --- themes/jtzemp.zsh-theme | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/themes/jtzemp.zsh-theme b/themes/jtzemp.zsh-theme index 19fc636e1..8169664e2 100644 --- a/themes/jtzemp.zsh-theme +++ b/themes/jtzemp.zsh-theme @@ -1,28 +1,37 @@ # Personalized! - Based on dallas.zsh-theme # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} -DALLAS_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$reset_color%}" +JTZEMP_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$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%}" +JTZEMP_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%}" +JTZEMP_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$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%}" +JTZEMP_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" + # Grab the current username: dallas -DALLAS_CURRENT_USER_="%{$fg[green]%}%n@%{$reset_color%}" +JTZEMP_CURRENT_USER_="%{$fg[green]%}%n@%{$reset_color%}" + # Use a % for normal users and a # for privelaged (root) users. -DALLAS_PROMPT_CHAR_="%{$fg[white]%}%(!.#.%%)%{$reset_color%}" +JTZEMP_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[blue]%}(%{$fg[cyan]%}" + # Close it all off by resetting the color and styles. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[blue]%})%{$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! + +# Add 3 red ✗s if this branch is diiirrrty! Dirty branch! ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗✗✗" #ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} !" # Put it all together! -PROMPT="$DALLAS_CURRENT_TIME_ $DALLAS_CURRENT_USER_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_PROMPT_CHAR_ " +PROMPT="$JTZEMP_CURRENT_TIME_ $JTZEMP_CURRENT_USER_$JTZEMP_CURRENT_MACH_$JTZEMP_CURRENT_LOCA_ $JTZEMP_PROMPT_CHAR_ " From f7a8c33a6f865312caef1d835d149fd3718b52b8 Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Sat, 10 Jul 2010 23:39:08 -0600 Subject: [PATCH 3/6] re-added rvm portion to the prompt. --- themes/jtzemp.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/jtzemp.zsh-theme b/themes/jtzemp.zsh-theme index 8169664e2..eacc11ea6 100644 --- a/themes/jtzemp.zsh-theme +++ b/themes/jtzemp.zsh-theme @@ -4,7 +4,7 @@ JTZEMP_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$reset_color%}" # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -JTZEMP_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" +JTZEMP_CURRENT_RUBY_="%{$fg[blue]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[blue]%}]%{$reset_color%}" # Grab the current machine name: muscato JTZEMP_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" @@ -34,4 +34,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗✗✗" # Put it all together! -PROMPT="$JTZEMP_CURRENT_TIME_ $JTZEMP_CURRENT_USER_$JTZEMP_CURRENT_MACH_$JTZEMP_CURRENT_LOCA_ $JTZEMP_PROMPT_CHAR_ " +PROMPT="$JTZEMP_CURRENT_TIME_$JTZEMP_CURRENT_RUBY_ $JTZEMP_CURRENT_USER_$JTZEMP_CURRENT_MACH_$JTZEMP_CURRENT_LOCA_ $JTZEMP_PROMPT_CHAR_ " From cd906cad9c4862900220d5d935210003ebec6f3a Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Sat, 11 Sep 2010 00:38:08 -0600 Subject: [PATCH 4/6] RESOLVED: After updating rvm, the system ruby wasn't showing up in the prompt. --- themes/jtzemp.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/jtzemp.zsh-theme b/themes/jtzemp.zsh-theme index eacc11ea6..21542a89c 100644 --- a/themes/jtzemp.zsh-theme +++ b/themes/jtzemp.zsh-theme @@ -4,7 +4,7 @@ JTZEMP_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$reset_color%}" # Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -JTZEMP_CURRENT_RUBY_="%{$fg[blue]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[blue]%}]%{$reset_color%}" +JTZEMP_CURRENT_RUBY_="%{$fg[blue]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt s i v)%{$fg[blue]%}]%{$reset_color%}" # Grab the current machine name: muscato JTZEMP_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" From bef797c23c03ac69ca6d95e056b5da33976a9582 Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Mon, 20 Sep 2010 21:55:05 -0600 Subject: [PATCH 5/6] Added a rvm_with_gemset function to lib/rvm.zsh to print out the ruby along with the gemset ex.: ruby-1.9.2@rails3 --- lib/rvm.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/rvm.zsh b/lib/rvm.zsh index 597be1b33..58ae153f6 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -4,4 +4,15 @@ function rvm_prompt_info() { echo "($ruby_version)" } +# get the name of the ruby as well as the gemset +# from http://snipplr.com/view.php?codeview&id=36724 +function rvm_with_gemset { + local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') + [ "$gemset" != "" ] && gemset="@$gemset" + # local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') + local version=$(~/.rvm/bin/rvm-prompt s i v) + [ "$version" != "" ] && version="$version" + local full="$version$gemset" + [ "$full" != "" ] && echo "$full" +} From deb452e823876e26bc91947fdd55f75873b02c1d Mon Sep 17 00:00:00 2001 From: JT Zemp Date: Mon, 20 Sep 2010 21:58:37 -0600 Subject: [PATCH 6/6] Cleanup of the jtzemp theme also added rvm_with_gemset function to the prompt so I know which gemset is in use. --- themes/jtzemp.zsh-theme | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/themes/jtzemp.zsh-theme b/themes/jtzemp.zsh-theme index 21542a89c..4a994c29a 100644 --- a/themes/jtzemp.zsh-theme +++ b/themes/jtzemp.zsh-theme @@ -3,8 +3,8 @@ # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T} JTZEMP_CURRENT_TIME_="%{$fg[blue]%}[%{$fg[red]%}%T%{$fg[blue]%}]%{$reset_color%}" -# Grab the current version of ruby in use (via RVM): [ruby-1.8.7] -JTZEMP_CURRENT_RUBY_="%{$fg[blue]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt s i v)%{$fg[blue]%}]%{$reset_color%}" +# Grab the current version of ruby in use (via RVM): [ruby-1.8.7@rails2] +JTZEMP_CURRENT_RUBY_="%{$fg[blue]%}[%{$fg[red]%}\$(rvm_with_gemset)%{$fg[blue]%}]%{$reset_color%}" # Grab the current machine name: muscato JTZEMP_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" @@ -13,7 +13,7 @@ JTZEMP_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}" # Append the current git branch, if in a git repository: ~aw@master JTZEMP_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}" -# Grab the current username: dallas +# Grab the current username JTZEMP_CURRENT_USER_="%{$fg[green]%}%n@%{$reset_color%}" # Use a % for normal users and a # for privelaged (root) users. @@ -30,7 +30,6 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Add 3 red ✗s if this branch is diiirrrty! Dirty branch! ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗✗✗" -#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} !" # Put it all together!