mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Updated risto theme to support 256 colors
This commit is contained in:
parent
db6412c031
commit
c3bb04cad3
1 changed files with 44 additions and 5 deletions
|
|
@ -1,6 +1,45 @@
|
||||||
# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4:
|
# Risto Theme
|
||||||
# It might be bash like, but I can't have my co-workers knowing I use zsh
|
|
||||||
PROMPT='%{$fg[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) '
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
# Get the name of the git branch and show two states:
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}"
|
# Working tree Dirty
|
||||||
|
# Files added ready to be commited
|
||||||
|
function git_prompt_dirty_add() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||||
|
gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Unmerged\|# Changed but not updated:\)')
|
||||||
|
|
||||||
|
if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
|
||||||
|
statchars="$ZSH_THEME_GIT_PROMPT_ADDED"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Unmerged paths:\|# Changed but not updated:\)$") > 0 ]]; then
|
||||||
|
statchars="$statchars$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$statchars$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $TERM != "xterm-256color" ]]
|
||||||
|
then
|
||||||
|
PROMPT='%{$fg[green]%}%n@%m:%{$fg[blue]%}%2~ $(git_prompt_dirty_add)%{$reset_color%}%(!.#.%%) %{$reset_color%}'
|
||||||
|
RPROMPT='%{$fg_bold[red]%}$(~/.rvm/bin/rvm-prompt 2> /dev/null)%{$reset_color%}%'
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[red]%}‹"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="$(git_prompt_info)%{$fg_bold[red]%}›%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}∗%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✓%{$reset_color%}"
|
||||||
|
else
|
||||||
|
|
||||||
|
darkred=052
|
||||||
|
red=008
|
||||||
|
blue=025
|
||||||
|
green=034
|
||||||
|
yellow=142
|
||||||
|
|
||||||
|
PROMPT='%{$FG[$green]%}%n@%m:%{$FG[$blue]%}%2~ $(git_prompt_dirty_add)%{$FX[reset]%}%(!.#.%%) %{$FX[reset]%}'
|
||||||
|
RPROMPT='%{$FG[$darkred]%}$(~/.rvm/bin/rvm-prompt 2> /dev/null)%{$reset_color%}%'
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[$red]‹"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="$(git_prompt_info)$FG[$red]›%{$FX[reset]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="$FG[$yellow]∗"
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="$FG[$green]✓"
|
||||||
|
LSCOLORS="ExGxBxDxbxEgEdxbxgacba"
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue