Skip to content

Loading…

Add new smh-theme, based on dst + RVM info #527

Closed
wants to merge 4 commits into from

2 participants

@stevenharman

example prompt:
machine-name: ~/current/path [ruby-1.9.2-p290@foobar|master]
$ [10:15:32]

An example can be seen here: https://skitch.com/stevenharman/fpuee/oh-my-zsh-prompt

(note: this exact formatting is dependent on my change in Pull Request 526 [#526 ].)

@robbyrussell
Owner

Thanks for sending this across. However, at this point in time... I am not going to be accepting any new themes for a while. My aim is to work out a new solution for how to manage user theme contributions better in the future, but am thinking that 100+ is already too many for folks to browse/select from. :-)

Be sure to follow @ohmyzsh on twitter ( http://twitter.com/ohmyzsh ) to stay tuned for when we might have a good location for such themes.

ProTip: If you have a custom theme and want to use it... you might check out this (poorly documented) feature from pull-request #1111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 23 additions and 0 deletions.
  1. +23 −0 themes/smh.zsh-theme
View
23 themes/smh.zsh-theme
@@ -0,0 +1,23 @@
+
+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 smh_rvm_info {
+ echo "%{$fg[magenta]%}$(rvm_prompt_info)%{$reset_color%}"
+}
+
+function prompt_char {
+ if [ $UID -eq 0 ]; then echo "%{$fg[red]%}☠%{$reset_color%}"; else echo $; fi
+}
+
+# Save a smiley to a local variable if the last command exited with success.
+local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
+
+PROMPT='
+%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%} [$(smh_rvm_info)$(git_prompt_info)]
+%_${smiley} $(prompt_char) '
+
+RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
+
Something went wrong with that request. Please try again.