forked from ohmyzsh/ohmyzsh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Themes: switch to using ruby_prompt_info()
Changes themes displaying RVM or other Ruby version info to use the central ruby_prompt_info function. This supports more Ruby versioning mechanisms, reduces copy-and-paste code, and avoids "zsh: no such file or directory: rvm-prompt" when run on machines that do not have RVM installed. Changes the prefix/suffix variable names to ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX, since they apply to all Ruby versioning mechanisms, not just RVM. Allows empty ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX.
- Loading branch information
Showing
21 changed files
with
86 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
# vim:ft=zsh ts=2 sw=2 sts=2 | ||
|
||
rvm_current() { | ||
rvm current 2>/dev/null | ||
} | ||
|
||
rbenv_version() { | ||
rbenv version 2>/dev/null | awk '{print $1}' | ||
} | ||
|
||
PROMPT=' | ||
%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} | ||
$ ' | ||
|
||
# Must use Powerline font, for \uE0A0 to render. | ||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}\uE0A0 " | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!" | ||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" | ||
ZSH_THEME_GIT_PROMPT_CLEAN="" | ||
|
||
if [ -e ~/.rvm/bin/rvm-prompt ]; then | ||
RPROMPT='%{$fg_bold[red]%}‹$(rvm_current)›%{$reset_color%}' | ||
else | ||
if which rbenv &> /dev/null; then | ||
RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}' | ||
fi | ||
fi | ||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹" | ||
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" | ||
|
||
PROMPT=' | ||
%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} | ||
$ ' | ||
|
||
RPROMPT='$(ruby_prompt_info)' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}" | ||
|
||
PROMPT=' | ||
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%} | ||
%{$fg[green]%}➞ %{$reset_color%' | ||
|
||
RPROMPT='$(git_prompt_info) ${rvm}' | ||
RPROMPT='$(git_prompt_info) $(ruby_prompt_info)' | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:" | ||
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]%}] %{$fg[green]%}✔%{$reset_color%}" | ||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[green]%}[" | ||
ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
# jaischeema.zsh-theme | ||
|
||
PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} ' | ||
RPROMPT='$(ruby_prompt_info)' | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX="±(%{$fg[red]%}" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%} " | ||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " | ||
|
||
if which rbenv &> /dev/null; then | ||
RPROMPT='%{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}' | ||
else | ||
if which rvm-prompt &> /dev/null; then | ||
RPROMPT='%{$fg[red]%}$(rvm-prompt)%{$reset_color%}' | ||
fi | ||
fi | ||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}" | ||
ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
macovsky.zsh-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png | ||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | ||
|
||
if [ -e ~/.rvm/bin/rvm-prompt ]; then | ||
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' | ||
else | ||
if which rbenv &> /dev/null; then | ||
PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b ' | ||
fi | ||
fi | ||
RPS1="${return_code}" | ||
PROMPT='%{$fg[green]%}%~%{$reset_color%} $(ruby_prompt_info) $(git_prompt_info)%{$reset_color%}%B$%b ' | ||
RPROMPT="${return_code}" | ||
|
||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" | ||
|
||
|
||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}‹" | ||
ZSH_THEME_RUBY_PROMPT_SUFFIX="› %{$reset_color%}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.