mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Added my theme called Numi
This commit is contained in:
parent
4224c2a1af
commit
38dba9aee8
1 changed files with 102 additions and 0 deletions
102
themes/numi.zsh-theme
Normal file
102
themes/numi.zsh-theme
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
# AVIT ZSH Theme
|
||||||
|
|
||||||
|
PROMPT='
|
||||||
|
[$(date +%H:%M)] $(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
|
||||||
|
▶ '
|
||||||
|
|
||||||
|
PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
|
||||||
|
|
||||||
|
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
|
||||||
|
|
||||||
|
local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
|
||||||
|
local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
|
||||||
|
local _hist_no="%{$fg_bold[grey]%}%h%{$reset_color%}"
|
||||||
|
|
||||||
|
function _user_host() {
|
||||||
|
if [[ -n $SSH_CONNECTION ]]; then
|
||||||
|
me="%n@%m"
|
||||||
|
elif [[ $LOGNAME != $USER ]]; then
|
||||||
|
me="%n"
|
||||||
|
fi
|
||||||
|
if [[ -n $me ]]; then
|
||||||
|
echo "%{$fg[cyan]%}$me%{$reset_color%}:"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _vi_status() {
|
||||||
|
if {echo $fpath | grep -q "plugins/vi-mode"}; then
|
||||||
|
echo "$(vi_mode_prompt_info)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _ruby_version() {
|
||||||
|
if {echo $fpath | grep -q "plugins/rvm"}; then
|
||||||
|
echo "%{$fg_bold[grey]%}$(rvm_prompt_info)%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Determine the time since last commit. If branch is clean,
|
||||||
|
# use a neutral color, otherwise colors will vary according to time.
|
||||||
|
function _git_time_since_commit() {
|
||||||
|
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
|
# Only proceed if there is actually a commit.
|
||||||
|
if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
|
||||||
|
# Get the last commit.
|
||||||
|
last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null)
|
||||||
|
now=$(date +%s)
|
||||||
|
seconds_since_last_commit=$((now-last_commit))
|
||||||
|
|
||||||
|
# Totals
|
||||||
|
minutes=$((seconds_since_last_commit / 60))
|
||||||
|
hours=$((seconds_since_last_commit/3600))
|
||||||
|
|
||||||
|
# Sub-hours and sub-minutes
|
||||||
|
days=$((seconds_since_last_commit / 86400))
|
||||||
|
sub_hours=$((hours % 24))
|
||||||
|
sub_minutes=$((minutes % 60))
|
||||||
|
|
||||||
|
if [ $hours -gt 24 ]; then
|
||||||
|
commit_age="${days}d"
|
||||||
|
elif [ $minutes -gt 60 ]; then
|
||||||
|
commit_age="${sub_hours}h${sub_minutes}m"
|
||||||
|
else
|
||||||
|
commit_age="${minutes}m"
|
||||||
|
fi
|
||||||
|
|
||||||
|
color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL
|
||||||
|
echo "$color$commit_age%{$reset_color%}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $USER == "root" ]]; then
|
||||||
|
CARETCOLOR="red"
|
||||||
|
else
|
||||||
|
CARETCOLOR="white"
|
||||||
|
fi
|
||||||
|
|
||||||
|
MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[red]%}✗%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg_bold[green]%}✔%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}✚ "
|
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}⚑ "
|
||||||
|
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}✖ "
|
||||||
|
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[blue]%}▴ "
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[cyan]%}§ "
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[grey]%}◒ "
|
||||||
|
|
||||||
|
# Colors vary depending on time lapsed.
|
||||||
|
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg_bold[green]%}"
|
||||||
|
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg_bold[yellow]%}"
|
||||||
|
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg_bold[red]%}"
|
||||||
|
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg_bold[grey]%}"
|
||||||
|
|
||||||
|
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||||
|
export LSCOLORS="exfxcxdxbxegedabagacad"
|
||||||
|
export LS_COLORS='di=1;34:ln=1;35:so=32:pi=33:ex=31:bd=1;34;46:cd=1;34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
|
||||||
|
export GREP_COLOR='1;33'
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue