mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge deb452e823 into 14bb3105d3
This commit is contained in:
commit
ac681b6ddc
2 changed files with 47 additions and 0 deletions
11
lib/rvm.zsh
11
lib/rvm.zsh
|
|
@ -4,4 +4,15 @@ function rvm_prompt_info() {
|
||||||
echo "($ruby_version)"
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
36
themes/jtzemp.zsh-theme
Normal file
36
themes/jtzemp.zsh-theme
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
# Personalized! - Based on dallas.zsh-theme
|
||||||
|
|
||||||
|
# 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@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%}"
|
||||||
|
|
||||||
|
# Grab the current filepath, use shortcuts: ~/Desktop
|
||||||
|
# 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
|
||||||
|
JTZEMP_CURRENT_USER_="%{$fg[green]%}%n@%{$reset_color%}"
|
||||||
|
|
||||||
|
# Use a % for normal users and a # for privelaged (root) users.
|
||||||
|
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 red ✗s if this branch is diiirrrty! Dirty branch!
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ✗✗✗"
|
||||||
|
|
||||||
|
|
||||||
|
# Put it all together!
|
||||||
|
PROMPT="$JTZEMP_CURRENT_TIME_$JTZEMP_CURRENT_RUBY_ $JTZEMP_CURRENT_USER_$JTZEMP_CURRENT_MACH_$JTZEMP_CURRENT_LOCA_ $JTZEMP_PROMPT_CHAR_ "
|
||||||
Loading…
Add table
Add a link
Reference in a new issue