Обновление ohmyzsh
This commit is contained in:
@@ -29,11 +29,13 @@
|
||||
# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info:
|
||||
# # https://pthree.org/2008/11/23/727/
|
||||
# # enjoy!
|
||||
|
||||
########## COLOR ###########
|
||||
for COLOR in CYAN WHITE YELLOW MAGENTA BLACK BLUE RED DEFAULT GREEN GREY; do
|
||||
eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
|
||||
eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
|
||||
eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
|
||||
eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
|
||||
done
|
||||
|
||||
PR_RESET="%{$reset_color%}"
|
||||
RED_START="${PR_RESET}${PR_GREY}<${PR_RESET}${PR_RED}<${PR_BRIGHT_RED}<${PR_RESET} "
|
||||
RED_END="${PR_RESET}${PR_BRIGHT_RED}>${PR_RESET}${PR_RED}>${PR_GREY}>${PR_RESET} "
|
||||
@@ -44,14 +46,14 @@ DIVISION="${PR_RESET}${PR_RED} < ${PR_RESET}"
|
||||
VCS_DIRTY_COLOR="${PR_RESET}${PR_YELLOW}"
|
||||
VCS_CLEAN_COLOR="${PR_RESET}${PR_GREEN}"
|
||||
VCS_SUFIX_COLOR="${PR_RESET}${PR_RED}› ${PR_RESET}"
|
||||
# ########## COLOR ###########
|
||||
# ########## SVN ###########
|
||||
|
||||
########## SVN ###########
|
||||
ZSH_THEME_SVN_PROMPT_PREFIX="${PR_RESET}${PR_RED}‹svn:"
|
||||
ZSH_THEME_SVN_PROMPT_SUFFIX=""
|
||||
ZSH_THEME_SVN_PROMPT_DIRTY="${VCS_DIRTY_COLOR} ✘${VCS_SUFIX_COLOR}"
|
||||
ZSH_THEME_SVN_PROMPT_CLEAN="${VCS_CLEAN_COLOR} ✔${VCS_SUFIX_COLOR}"
|
||||
# ########## SVN ###########
|
||||
# ########## GIT ###########
|
||||
|
||||
########## GIT ###########
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="${PR_RESET}${PR_RED}‹git:"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="${VCS_DIRTY_COLOR} ✘${VCS_SUFIX_COLOR}"
|
||||
@@ -62,53 +64,63 @@ ZSH_THEME_GIT_PROMPT_DELETED="${PR_RESET}${PR_YELLOW} ✖${PR_RESET}"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="${PR_RESET}${PR_YELLOW} ➜${PR_RESET}"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="${PR_RESET}${PR_YELLOW} ═${PR_RESET}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="${PR_RESET}${PR_YELLOW} ✭${PR_RESET}"
|
||||
# ########## GIT ###########
|
||||
function precmd {
|
||||
#gets the fortune
|
||||
ps1_fortune () {
|
||||
#Choose from all databases, regardless of whether they are considered "offensive"
|
||||
fortune -a
|
||||
}
|
||||
#obtains the tip
|
||||
ps1_command_tip () {
|
||||
wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d'
|
||||
}
|
||||
prompt_header () {
|
||||
if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then
|
||||
ps1_command_tip
|
||||
else
|
||||
ps1_fortune
|
||||
fi
|
||||
}
|
||||
PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}"
|
||||
# set a simple variable to show when in screen
|
||||
if [[ -n "${WINDOW}" ]]; then
|
||||
SCREEN=""
|
||||
|
||||
# Get a fortune quote
|
||||
ps1_fortune() {
|
||||
(( ${+commands[fortune]} )) && fortune
|
||||
}
|
||||
|
||||
# Obtain a command tip
|
||||
ps1_command_tip() {
|
||||
{
|
||||
if (( ${+commands[wget]} )); then
|
||||
command wget -qO- https://www.commandlinefu.com/commands/random/plaintext
|
||||
elif (( ${+commands[curl]} )); then
|
||||
command curl -fsL https://www.commandlinefu.com/commands/random/plaintext
|
||||
fi
|
||||
} | sed 1d | sed '/^$/d'
|
||||
}
|
||||
|
||||
function precmd_adben {
|
||||
prompt_header() {
|
||||
if [[ "$ENABLE_COMMAND_TIP" = true ]]; then
|
||||
ps1_command_tip
|
||||
else
|
||||
ps1_fortune
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}"
|
||||
|
||||
# set a simple variable to show when in screen
|
||||
if [[ -n "${WINDOW}" ]]; then
|
||||
SCREEN=""
|
||||
fi
|
||||
}
|
||||
|
||||
# Context: user@directory or just directory
|
||||
prompt_context () {
|
||||
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||
echo -n "${PR_RESET}${PR_RED}$USER@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
|
||||
else
|
||||
echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
|
||||
fi
|
||||
prompt_context() {
|
||||
if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||
echo -n "${PR_RESET}${PR_RED}$USERNAME@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
|
||||
else
|
||||
echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}"
|
||||
fi
|
||||
}
|
||||
|
||||
set_prompt () {
|
||||
# required for the prompt
|
||||
setopt prompt_subst
|
||||
autoload zsh/terminfo
|
||||
########## SETUP ###########
|
||||
|
||||
# ######### PROMPT #########
|
||||
PROMPT='${PROMPT_HEAD}
|
||||
# Required for the prompt
|
||||
setopt prompt_subst
|
||||
autoload zsh/terminfo
|
||||
|
||||
# Prompt
|
||||
PROMPT='${PROMPT_HEAD}
|
||||
${RED_START}$(prompt_context)
|
||||
${GREEN_START_P1}'
|
||||
RPROMPT='${PR_RESET}$(git_prompt_info)$(svn_prompt_info)${PR_YELLOW}%D{%R.%S %a %b %d %Y} ${GREEN_END}${PR_RESET}'
|
||||
# Matching continuation prompt
|
||||
PROMPT2='${GREEN_BASE_START}${PR_RESET} %_ ${GREEN_BASE_START}${PR_RESET} '
|
||||
# ######### PROMPT #########
|
||||
}
|
||||
RPROMPT='${PR_RESET}$(git_prompt_info)$(svn_prompt_info)${PR_YELLOW}%D{%R.%S %a %b %d %Y} ${GREEN_END}${PR_RESET}'
|
||||
# Matching continuation prompt
|
||||
PROMPT2='${GREEN_BASE_START}${PR_RESET} %_ ${GREEN_BASE_START}${PR_RESET} '
|
||||
|
||||
set_prompt
|
||||
# Prompt head
|
||||
autoload -Uz add-zsh-hook
|
||||
add-zsh-hook precmd precmd_adben
|
||||
|
||||
@@ -2,29 +2,33 @@
|
||||
# Repo: https://github.com/andyfleming/oh-my-zsh
|
||||
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
|
||||
|
||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
# settings
|
||||
typeset +H return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
typeset +H my_gray="$FG[237]"
|
||||
typeset +H my_orange="$FG[214]"
|
||||
|
||||
# separator dashes size
|
||||
function afmagic_dashes {
|
||||
local PYTHON_ENV="$VIRTUAL_ENV"
|
||||
[[ -z "$PYTHON_ENV" ]] && PYTHON_ENV="$CONDA_DEFAULT_ENV"
|
||||
|
||||
if [[ -n "$PYTHON_ENV" && "$PS1" = \(* ]]; then
|
||||
echo $(( COLUMNS - ${#PYTHON_ENV} - 3 ))
|
||||
else
|
||||
echo $COLUMNS
|
||||
fi
|
||||
}
|
||||
|
||||
# primary prompt
|
||||
PROMPT='$FG[237]${(l.COLUMNS..-.)}%{$reset_color%}
|
||||
$FG[032]%~\
|
||||
$(git_prompt_info)$(hg_prompt_info) \
|
||||
$FG[105]%(!.#.»)%{$reset_color%} '
|
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
PS1='$FG[237]${(l.$(afmagic_dashes)..-.)}%{$reset_color%}
|
||||
$FG[032]%~$(git_prompt_info)$(hg_prompt_info) $FG[105]%(!.#.»)%{$reset_color%} '
|
||||
PS2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
RPS1='${return_code}'
|
||||
|
||||
|
||||
# color vars
|
||||
eval my_gray='$FG[237]'
|
||||
eval my_orange='$FG[214]'
|
||||
|
||||
# right prompt
|
||||
if type "virtualenv_prompt_info" > /dev/null
|
||||
then
|
||||
RPROMPT='$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%'
|
||||
else
|
||||
RPROMPT='$my_gray%n@%m%{$reset_color%}%'
|
||||
fi
|
||||
(( $+functions[virtualenv_prompt_info] )) && RPS1+='$(virtualenv_prompt_info)'
|
||||
RPS1+=' $my_gray%n@%m%{$reset_color%}%'
|
||||
|
||||
# git settings
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
|
||||
@@ -37,3 +41,7 @@ ZSH_THEME_HG_PROMPT_PREFIX="$FG[075]($FG[078]"
|
||||
ZSH_THEME_HG_PROMPT_CLEAN=""
|
||||
ZSH_THEME_HG_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
|
||||
ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
|
||||
|
||||
# virtualenv settings
|
||||
ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075]["
|
||||
ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}"
|
||||
|
||||
@@ -88,7 +88,7 @@ prompt_end() {
|
||||
|
||||
# Context: user@hostname (who am I and where am I)
|
||||
prompt_context() {
|
||||
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||
if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||
prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
|
||||
fi
|
||||
}
|
||||
@@ -106,7 +106,7 @@ prompt_git() {
|
||||
}
|
||||
local ref dirty mode repo_path
|
||||
|
||||
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
|
||||
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
|
||||
repo_path=$(git rev-parse --git-dir 2>/dev/null)
|
||||
dirty=$(parse_git_dirty)
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
|
||||
@@ -131,7 +131,7 @@ prompt_git() {
|
||||
zstyle ':vcs_info:*' get-revision true
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' stagedstr '✚'
|
||||
zstyle ':vcs_info:*' unstagedstr '●'
|
||||
zstyle ':vcs_info:*' unstagedstr '±'
|
||||
zstyle ':vcs_info:*' formats ' %u%c'
|
||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||
vcs_info
|
||||
@@ -140,24 +140,30 @@ prompt_git() {
|
||||
}
|
||||
|
||||
prompt_bzr() {
|
||||
(( $+commands[bzr] )) || return
|
||||
if (bzr status >/dev/null 2>&1); then
|
||||
status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
|
||||
status_all=`bzr status | head -n1 | wc -m`
|
||||
revision=`bzr log | head -n2 | tail -n1 | sed 's/^revno: //'`
|
||||
if [[ $status_mod -gt 0 ]] ; then
|
||||
prompt_segment yellow black
|
||||
echo -n "bzr@"$revision "✚ "
|
||||
else
|
||||
if [[ $status_all -gt 0 ]] ; then
|
||||
prompt_segment yellow black
|
||||
echo -n "bzr@"$revision
|
||||
else
|
||||
prompt_segment green black
|
||||
echo -n "bzr@"$revision
|
||||
fi
|
||||
fi
|
||||
(( $+commands[bzr] )) || return
|
||||
|
||||
# Test if bzr repository in directory hierarchy
|
||||
local dir="$PWD"
|
||||
while [[ ! -d "$dir/.bzr" ]]; do
|
||||
[[ "$dir" = "/" ]] && return
|
||||
dir="${dir:h}"
|
||||
done
|
||||
|
||||
local bzr_status status_mod status_all revision
|
||||
if bzr_status=$(bzr status 2>&1); then
|
||||
status_mod=$(echo -n "$bzr_status" | head -n1 | grep "modified" | wc -m)
|
||||
status_all=$(echo -n "$bzr_status" | head -n1 | wc -m)
|
||||
revision=$(bzr log -r-1 --log-format line | cut -d: -f1)
|
||||
if [[ $status_mod -gt 0 ]] ; then
|
||||
prompt_segment yellow black "bzr@$revision ✚"
|
||||
else
|
||||
if [[ $status_all -gt 0 ]] ; then
|
||||
prompt_segment yellow black "bzr@$revision"
|
||||
else
|
||||
prompt_segment green black "bzr@$revision"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_hg() {
|
||||
@@ -229,7 +235,7 @@ prompt_status() {
|
||||
# ends in '-prod'
|
||||
# - displays black on green otherwise
|
||||
prompt_aws() {
|
||||
[[ -z "$AWS_PROFILE" ]] && return
|
||||
[[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return
|
||||
case "$AWS_PROFILE" in
|
||||
*-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;;
|
||||
*) prompt_segment green black "AWS: $AWS_PROFILE" ;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
|
||||
|
||||
PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
|
||||
RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'
|
||||
RPROMPT='%{$fg[$NCOLOR]%} $(git_prompt_info)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||
|
||||
@@ -1,30 +1,23 @@
|
||||
# AVIT ZSH Theme
|
||||
|
||||
# settings
|
||||
typeset +H _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
|
||||
typeset +H _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
|
||||
typeset +H _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
|
||||
|
||||
PROMPT='
|
||||
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
|
||||
%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
|
||||
$(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info)
|
||||
%{%(!.${fg[red]}.${fg[white]})%}▶%{$reset_color%} '
|
||||
|
||||
PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
|
||||
PROMPT2='%{%(!.${fg[red]}.${fg[white]})%}◀%{$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[grey]%}%h%{$reset_color%}"
|
||||
|
||||
function _current_dir() {
|
||||
local _max_pwd_length="65"
|
||||
if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
|
||||
echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
|
||||
else
|
||||
echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
|
||||
fi
|
||||
}
|
||||
RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
|
||||
|
||||
function _user_host() {
|
||||
local me
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
me="%n@%m"
|
||||
elif [[ $LOGNAME != $USER ]]; then
|
||||
elif [[ $LOGNAME != $USERNAME ]]; then
|
||||
me="%n"
|
||||
fi
|
||||
if [[ -n $me ]]; then
|
||||
@@ -32,61 +25,41 @@ function _user_host() {
|
||||
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[grey]%}$(rvm_prompt_info)%{$reset_color%}"
|
||||
elif {echo $fpath | grep -q "plugins/rbenv"}; then
|
||||
echo "%{$fg[grey]%}$(rbenv_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() {
|
||||
# Only proceed if there is actually a commit.
|
||||
local last_commit now seconds_since_last_commit
|
||||
local minutes hours days years commit_age
|
||||
# Only proceed if there is actually a commit.
|
||||
if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
|
||||
now=$(date +%s)
|
||||
seconds_since_last_commit=$((now-last_commit))
|
||||
|
||||
# Totals
|
||||
minutes=$((seconds_since_last_commit / 60))
|
||||
hours=$((seconds_since_last_commit/3600))
|
||||
hours=$((minutes / 60))
|
||||
days=$((hours / 24))
|
||||
years=$((days / 365))
|
||||
|
||||
# Sub-hours and sub-minutes
|
||||
days=$((seconds_since_last_commit / 86400))
|
||||
sub_hours=$((hours % 24))
|
||||
sub_minutes=$((minutes % 60))
|
||||
|
||||
if [ $hours -ge 24 ]; then
|
||||
commit_age="${days}d"
|
||||
elif [ $minutes -gt 60 ]; then
|
||||
commit_age="${sub_hours}h${sub_minutes}m"
|
||||
if [[ $years -gt 0 ]]; then
|
||||
commit_age="${years}y$((days % 365 ))d"
|
||||
elif [[ $days -gt 0 ]]; then
|
||||
commit_age="${days}d$((hours % 24))h"
|
||||
elif [[ $hours -gt 0 ]]; then
|
||||
commit_age+="${hours}h$(( minutes % 60 ))m"
|
||||
else
|
||||
commit_age="${minutes}m"
|
||||
fi
|
||||
|
||||
color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL
|
||||
echo "$color$commit_age%{$reset_color%}"
|
||||
echo "${ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL}${commit_age}%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $USER == "root" ]]; then
|
||||
CARETCOLOR="red"
|
||||
else
|
||||
CARETCOLOR="white"
|
||||
fi
|
||||
|
||||
MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}"
|
||||
|
||||
# Git prompt settings
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚ "
|
||||
@@ -96,6 +69,10 @@ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
|
||||
|
||||
# Ruby prompt settings
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[grey]%}"
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
# Colors vary depending on time lapsed.
|
||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# the svn plugin has to be activated for this to work.
|
||||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
|
||||
PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
||||
PROMPT='${ret_status}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -16,7 +16,7 @@ local venv_prompt='$(virtualenv_prompt_info)'
|
||||
|
||||
ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
|
||||
|
||||
PROMPT="╭─${venv_prompt}${user_host}${current_dir}${rvm_ruby}${git_branch}
|
||||
PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${git_branch}${venv_prompt}
|
||||
╰─%B${user_symbol}%b "
|
||||
RPROMPT="%B${return_code}%b"
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
# neuralsanwich.zsh-theme
|
||||
|
||||
if [ "x$OH_MY_ZSH_HG" = "x" ]; then
|
||||
OH_MY_ZSH_HG="hg"
|
||||
fi
|
||||
|
||||
function hg_prompt_info {
|
||||
$OH_MY_ZSH_HG prompt --angle-brackets "\
|
||||
if ! hg prompt 2>/dev/null; then
|
||||
function hg_prompt_info { }
|
||||
else
|
||||
function hg_prompt_info {
|
||||
hg prompt --angle-brackets "\
|
||||
< on %{$fg[magenta]%}<branch>%{$reset_color%}>\
|
||||
< at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
|
||||
%{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
|
||||
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
|
||||
}
|
||||
}
|
||||
fi
|
||||
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
|
||||
@@ -26,5 +24,9 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
||||
|
||||
local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
|
||||
RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
||||
RPROMPT='%{$fg[red]%}%(?..✘)%{$reset_color%}'
|
||||
|
||||
# Add battery status if the battery plugin is enabled
|
||||
if (( $+functions[battery_pct_prompt] )); then
|
||||
RPROMPT+='$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
||||
fi
|
||||
|
||||
@@ -2,7 +2,7 @@ if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
|
||||
ZSH_THEME_CLOUD_PREFIX='☁'
|
||||
fi
|
||||
|
||||
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%} %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%} %{$fg_bold[white]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
# Depends on the git-prompt plugin
|
||||
|
||||
# Colors: black red green yellow blue magenta cyan white
|
||||
# Symbols: … ● ✔ ✖ ↓ ↑ ➜ ☀ ♻ ⚒
|
||||
|
||||
# git-prompt customization
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_SEPARATOR=" "
|
||||
ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[white]%}%{⚒%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[yellow]%}%{☀%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[white]%}%{↓%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[white]%}%{↑%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}%{?%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}♻"
|
||||
|
||||
# Default mode (Small)
|
||||
#ZSH_THEME_EOF_NAMES="${USER%%@*}@%m"
|
||||
|
||||
case $ZSH_THEME_EOF_MODE in
|
||||
mega)
|
||||
ZSH_THEME_EOF_NAMES="%n@%M "
|
||||
;;
|
||||
big)
|
||||
ZSH_THEME_EOF_NAMES="%n@%m "
|
||||
;;
|
||||
small)
|
||||
ZSH_THEME_EOF_NAMES="${USER%%@*}@%m "
|
||||
;;
|
||||
tiny|*)
|
||||
ZSH_THEME_EOF_NAMES=""
|
||||
;;
|
||||
esac
|
||||
|
||||
PROMPT='%{$fg[green]%}[%B%{$fg[green]%}$ZSH_THEME_EOF_NAMES%b%{$fg[cyan]%}%~% %{$fg[green]%}]%(?.%{$fg[green]%}.%{$fg[red]%})%B%#%b '
|
||||
@@ -1,24 +1,14 @@
|
||||
# Theme with full path names and hostname
|
||||
# Handy if you work on different servers all the time;
|
||||
|
||||
local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
function my_git_prompt_info() {
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||
GIT_STATUS=$(git_prompt_status)
|
||||
[[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS"
|
||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
}
|
||||
|
||||
# Colored prompt
|
||||
ZSH_THEME_COLOR_USER="green"
|
||||
ZSH_THEME_COLOR_HOST="green"
|
||||
ZSH_THEME_COLOR_PWD="yellow"
|
||||
test -n "$SSH_CONNECTION" && ZSH_THEME_COLOR_USER="red" && ZSH_THEME_COLOR_HOST="red"
|
||||
test `id -u` = 0 && ZSH_THEME_COLOR_USER="magenta" && ZSH_THEME_COLOR_HOST="magenta"
|
||||
PROMPT='%{$fg_bold[$ZSH_THEME_COLOR_USER]%}%n@%{$fg_bold[$ZSH_THEME_COLOR_HOST]%}%M%{$reset_color%}:%{$fg_bold[$ZSH_THEME_COLOR_PWD]%}%~%{$reset_color%} $(my_git_prompt_info)%(!.#.$) '
|
||||
RPS1="${return_code}"
|
||||
# My custom theme:
|
||||
# - single line
|
||||
# - quite simple by default: user@host:$PWD
|
||||
# - green for local shell as non root
|
||||
# - red for ssh shell as non root
|
||||
# - magenta for root sessions
|
||||
# - prefix with remote address for ssh shells
|
||||
# - prefix to detect docker containers or chroot
|
||||
# - git plugin to display current branch and status
|
||||
|
||||
# git plugin
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%%"
|
||||
@@ -28,3 +18,33 @@ ZSH_THEME_GIT_PROMPT_RENAMED="~"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="!"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="?"
|
||||
|
||||
function zsh_essembeh_gitstatus {
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||
GIT_STATUS=$(git_prompt_status)
|
||||
if [[ -n $GIT_STATUS ]]; then
|
||||
GIT_STATUS=" $GIT_STATUS"
|
||||
fi
|
||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
}
|
||||
|
||||
# by default, use green for user@host and no prefix
|
||||
local ZSH_ESSEMBEH_COLOR="green"
|
||||
local ZSH_ESSEMBEH_PREFIX=""
|
||||
if [[ -n "$SSH_CONNECTION" ]]; then
|
||||
# display the source address if connected via ssh
|
||||
ZSH_ESSEMBEH_PREFIX="%{$fg[yellow]%}[$(echo $SSH_CONNECTION | awk '{print $1}')]%{$reset_color%} "
|
||||
# use red color to highlight a remote connection
|
||||
ZSH_ESSEMBEH_COLOR="red"
|
||||
elif [[ -r /etc/debian_chroot ]]; then
|
||||
# prefix prompt in case of chroot
|
||||
ZSH_ESSEMBEH_PREFIX="%{$fg[yellow]%}[chroot:$(cat /etc/debian_chroot)]%{$reset_color%} "
|
||||
elif [[ -r /.dockerenv ]]; then
|
||||
# also prefix prompt inside a docker contrainer
|
||||
ZSH_ESSEMBEH_PREFIX="%{$fg[yellow]%}[docker]%{$reset_color%} "
|
||||
fi
|
||||
if [[ $UID = 0 ]]; then
|
||||
# always use magenta for root sessions, even in ssh
|
||||
ZSH_ESSEMBEH_COLOR="magenta"
|
||||
fi
|
||||
PROMPT='${ZSH_ESSEMBEH_PREFIX}%{$fg[$ZSH_ESSEMBEH_COLOR]%}%n@%M%{$reset_color%}:%{%B$fg[yellow]%}%~%{$reset_color%b%} $(zsh_essembeh_gitstatus)%(!.#.$) '
|
||||
RPROMPT="%(?..%{$fg[red]%}%?%{$reset_color%})"
|
||||
|
||||
@@ -25,16 +25,12 @@ function box_name {
|
||||
}
|
||||
|
||||
|
||||
local rvm_ruby='using%{$FG[243]%}$(ruby_prompt_info)'
|
||||
local git_info='$(git_prompt_info)'
|
||||
|
||||
|
||||
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${rvm_ruby} %D - %*
|
||||
╰─$(virtualenv_info)$(prompt_char) "
|
||||
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}\$(git_prompt_info)\$(ruby_prompt_info) %D - %*
|
||||
╰─\$(virtualenv_info)\$(prompt_char) "
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="‹"
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX=" %{$FG[239]%}using%{$FG[243]%} ‹"
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
|
||||
|
||||
@@ -11,26 +11,35 @@
|
||||
#
|
||||
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
|
||||
|
||||
function virtualenv_prompt_info {
|
||||
[[ -n ${VIRTUAL_ENV} ]] || return
|
||||
echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}"
|
||||
}
|
||||
|
||||
function prompt_char {
|
||||
git branch >/dev/null 2>/dev/null && echo "±" && return
|
||||
echo '○'
|
||||
command git branch &>/dev/null && echo "±" || echo '○'
|
||||
}
|
||||
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
|
||||
}
|
||||
|
||||
local ruby_env='using%{$FG[243]%} $(ruby_prompt_info)'
|
||||
local ruby_env='$(ruby_prompt_info)'
|
||||
local git_info='$(git_prompt_info)'
|
||||
local virtualenv_info='$(virtualenv_prompt_info)'
|
||||
local prompt_char='$(prompt_char)'
|
||||
|
||||
|
||||
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env}
|
||||
PROMPT="╭─${FG[040]}%n ${FG[239]}at ${FG[033]}$(box_name) ${FG[239]}in %B${FG[226]}%~%b${git_info}${ruby_env}${virtualenv_info}
|
||||
╰─${prompt_char}%{$reset_color%} "
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="‹"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔"
|
||||
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} ‹"
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
|
||||
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «"
|
||||
ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}"
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
# ZSH Theme emulating the Fish shell's default prompt.
|
||||
|
||||
_fishy_collapsed_wd() {
|
||||
echo $(pwd | perl -pe '
|
||||
BEGIN {
|
||||
binmode STDIN, ":encoding(UTF-8)";
|
||||
binmode STDOUT, ":encoding(UTF-8)";
|
||||
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
|
||||
')
|
||||
local i pwd
|
||||
pwd=("${(s:/:)PWD/#$HOME/~}")
|
||||
if (( $#pwd > 1 )); then
|
||||
for i in {1..$(($#pwd-1))}; do
|
||||
if [[ "$pwd[$i]" = .* ]]; then
|
||||
pwd[$i]="${${pwd[$i]}[1,2]}"
|
||||
else
|
||||
pwd[$i]="${${pwd[$i]}[1]}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "${(j:/:)pwd}"
|
||||
}
|
||||
|
||||
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if [ "$USER" = "root" ]
|
||||
if [ "$USERNAME" = "root" ]
|
||||
then CARETCOLOR="red"
|
||||
else CARETCOLOR="blue"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[green]%} %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey
|
||||
# ZSH Theme - Preview: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#gallifrey
|
||||
return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
host_color="%(!.%{$fg[red]%}.%{$fg[green]%})"
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
# Depends on the git plugin for work_in_progress()
|
||||
(( $+functions[work_in_progress] )) || work_in_progress() {}
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
||||
# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
||||
git_custom_status() {
|
||||
local cb=$(git_current_branch)
|
||||
if [ -n "$cb" ]; then
|
||||
echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
fi
|
||||
local branch=$(git_current_branch)
|
||||
[[ -n "$branch" ]] || return 0
|
||||
echo "$(parse_git_dirty)\
|
||||
%{${fg_bold[yellow]}%}$(work_in_progress)%{$reset_color%}\
|
||||
${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
}
|
||||
|
||||
# RVM component of prompt
|
||||
@@ -18,6 +20,5 @@ ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}["
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||
|
||||
# Combine it all into a final right-side prompt
|
||||
RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1'
|
||||
|
||||
RPS1="\$(git_custom_status)\$(ruby_prompt_info)${RPS1:+ $RPS1}"
|
||||
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
function prompt_char {
|
||||
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
|
||||
autoload -Uz colors && colors
|
||||
|
||||
autoload -Uz vcs_info
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
|
||||
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
|
||||
zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f '
|
||||
zstyle ':vcs_info:*' formats '%F{5}(%F{2}%b%c%u%m%F{5})%f '
|
||||
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
|
||||
zstyle ':vcs_info:*' enable git cvs svn
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks untracked-git
|
||||
|
||||
+vi-untracked-git() {
|
||||
if command git status --porcelain 2>/dev/null | command grep -q '??'; then
|
||||
hook_com[misc]='%F{red}?'
|
||||
else
|
||||
hook_com[misc]=''
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)$(prompt_char)%{$reset_color%} '
|
||||
gentoo_precmd() {
|
||||
vcs_info
|
||||
}
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook precmd gentoo_precmd
|
||||
|
||||
PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%(!.%1~.%~) ${vcs_info_msg_0_}%F{blue}%(!.#.$)%k%b%f '
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[white]%}$(git_prompt_info)%{$fg_bold[white]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -33,6 +33,6 @@ function {
|
||||
|
||||
local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
|
||||
|
||||
PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
|
||||
PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%} %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
|
||||
|
||||
# vim: set ft=zsh ts=4 sw=4 et:
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT="%{$fg_bold[cyan]%}%T%{$fg_bold[green]%} %{$fg_bold[white]%}%n%{$fg[magenta]%}@%{$fg_bold[white]%}%m %{$fg_bold[green]%}%d
|
||||
%{$fg_bold[yellow]%}%% %{$reset_color%}"
|
||||
|
||||
#ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$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]%})"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n%{$fg[cyan]%}@%{$fg_bold[green]%}%m %{$fg_bold[green]%} %{$fg[cyan]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#
|
||||
# Kiwi ZSH Theme
|
||||
#
|
||||
(( $+functions[battery_pct_prompt] )) || function battery_pct_prompt { }
|
||||
|
||||
PROMPT='%{$fg_bold[green]%}┌[%{$fg_bold[cyan]%}kiwish-4.2%{$fg_bold[green]%}]-(%{$fg_bold[white]%}%2~%{$fg_bold[green]%})-$(git_prompt_info)$(svn_prompt_info)$(battery_pct_prompt)
|
||||
└> % %{$reset_color%}'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# vim: set ts=2 textwidth=0
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
local c0=$(printf "\033[0m")
|
||||
local c1=$(printf "\033[38;5;215m")
|
||||
local c2=$(printf "\033[38;5;209m")
|
||||
@@ -13,7 +12,6 @@ local c7=$(printf "\033[38;5;149m")
|
||||
local c8=$(printf "\033[38;5;126m")
|
||||
local c9=$(printf "\033[38;5;162m")
|
||||
|
||||
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
c1=$(printf "\033[34;1m")
|
||||
c2=$(printf "\033[35m")
|
||||
@@ -26,9 +24,6 @@ if [ "$TERM" = "linux" ]; then
|
||||
c9=$(printf "\033[34m")
|
||||
fi
|
||||
|
||||
#local newtv=$(perl $HOME/devel/newtv.pl)
|
||||
local newtv=''
|
||||
|
||||
zstyle ':vcs_info:*' actionformats \
|
||||
'%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
|
||||
zstyle ':vcs_info:*' formats \
|
||||
@@ -42,38 +37,23 @@ prompt_jnrowe_precmd () {
|
||||
vcs_info
|
||||
|
||||
if [ "${vcs_info_msg_0_}" = "" ]; then
|
||||
#dir_status="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f"
|
||||
#dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/"
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
#dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
|
||||
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
|
||||
PROMPT='${dir_status} ${ret_status}%{$reset_color%}
|
||||
> '
|
||||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
||||
${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
||||
> '
|
||||
|
||||
elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
|
||||
PROMPT='${vcs_info_msg_0_}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
${dir_status}%{$reset_color%}
|
||||
%{$c9%}·>%{$c0%} '
|
||||
else
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
||||
${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
||||
> '
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%}
|
||||
#> '
|
||||
|
||||
# vim: set ft=zsh ts=4 sw=4 et:
|
||||
|
||||
|
||||
|
||||
59
zsh/themes/mlh.zsh-theme
Normal file
59
zsh/themes/mlh.zsh-theme
Normal file
@@ -0,0 +1,59 @@
|
||||
# The Official Theme of
|
||||
## ## ## ## ##
|
||||
### ### ## ## ##
|
||||
#### #### ## ## ##
|
||||
## ### ## ## #########
|
||||
## ## ## ## ##
|
||||
## ## ## ## ##
|
||||
## ## ######## ## ##
|
||||
|
||||
# # # # # # # # # # # # # # # # # #
|
||||
# # # Feel free to customize! # # #
|
||||
# # # # # # # # # # # # # # # # # #
|
||||
|
||||
# To easily discover colors and their codes, type `spectrum_ls` in the terminal
|
||||
|
||||
AT_SYMBOL=" @ "
|
||||
IN_SYMBOL=" in "
|
||||
ON_SYMBOL=" on "
|
||||
SYMBOL="$"
|
||||
|
||||
USER_COLOR="%F{001}"
|
||||
DEVICE_COLOR="%F{033}"
|
||||
DIR_COLOR="%F{220}"
|
||||
BRANCH_COLOR="%F{001}"
|
||||
TIME_COLOR="%F{033}"
|
||||
|
||||
username() {
|
||||
echo "$USER_COLOR%n%f"
|
||||
}
|
||||
|
||||
# Returns device name
|
||||
device() {
|
||||
echo "$DEVICE_COLOR%m%f"
|
||||
}
|
||||
|
||||
# The current directory
|
||||
directory() {
|
||||
echo "$DIR_COLOR%1~%f"
|
||||
}
|
||||
|
||||
# Current time with milliseconds
|
||||
current_time() {
|
||||
echo "$TIME_COLOR%*%f"
|
||||
}
|
||||
|
||||
# Return status of the last command
|
||||
return_status() {
|
||||
echo "%(?..%F{001}out %?)%f"
|
||||
}
|
||||
|
||||
# Set the git_prompt_info text
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="${ON_SYMBOL}${BRANCH_COLOR}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
# %B and %b make the text bold
|
||||
PROMPT='%b$(username)$AT_SYMBOL$(device)$IN_SYMBOL$(directory)$(git_prompt_info)%b $SYMBOL '
|
||||
RPROMPT="$(return_status) $(current_time)"
|
||||
@@ -1,33 +1,16 @@
|
||||
#!/usr/bin/env zsh
|
||||
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
PROMPT="${FG[117]}%~%{$reset_color%}\$(git_prompt_info)\$(virtualenv_prompt_info)${FG[133]}\$(git_prompt_status) ${FG[077]}ᐅ%{$reset_color%} "
|
||||
|
||||
setopt promptsubst
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[012]}("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="${FG[012]})%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" ${FG[133]}✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" ${FG[118]}✔"
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
|
||||
PROMPT_SUCCESS_COLOR=$FG[117]
|
||||
PROMPT_FAILURE_COLOR=$FG[124]
|
||||
PROMPT_VCS_INFO_COLOR=$FG[242]
|
||||
PROMPT_PROMPT=$FG[077]
|
||||
GIT_DIRTY_COLOR=$FG[133]
|
||||
GIT_CLEAN_COLOR=$FG[118]
|
||||
GIT_PROMPT_INFO=$FG[012]
|
||||
|
||||
PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%}%{$GIT_PROMPT_INFO%}$(git_prompt_info)$(virtualenv_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
|
||||
|
||||
#RPS1="${return_code}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" ("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[082]%}✚%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="${FG[082]}✚%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="${FG[166]}✹%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="${FG[160]}✖%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="${FG[220]}➜%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="${FG[082]}═%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="${FG[190]}✭%{$reset_color%}"
|
||||
|
||||
ZSH_THEME_VIRTUALENV_PREFIX=" ["
|
||||
ZSH_THEME_VIRTUALENV_SUFFIX="]"
|
||||
|
||||
@@ -11,7 +11,7 @@ else
|
||||
fi
|
||||
|
||||
# Get the host name (first 4 chars)
|
||||
HOST_PROMPT_="%{$fg_bold[red]%}@$HOST ➜ %{$fg_bold[cyan]%}%c "
|
||||
HOST_PROMPT_="%{$fg_bold[red]%}@%m ➜ %{$fg_bold[cyan]%}%c "
|
||||
GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}"
|
||||
PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}'
|
||||
PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)$(hg_prompt_info)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
|
||||
ZSH_THEME_HG_PROMPT_PREFIX="λ %{$fg[blue]%}hg %{$fg[red]%}"
|
||||
ZSH_THEME_HG_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
|
||||
if [ "$USERNAME" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
|
||||
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
#
|
||||
|
||||
git_repo_path() {
|
||||
git rev-parse --git-dir 2>/dev/null
|
||||
command git rev-parse --git-dir 2>/dev/null
|
||||
}
|
||||
|
||||
git_commit_id() {
|
||||
git rev-parse --short HEAD 2>/dev/null
|
||||
command git rev-parse --short HEAD 2>/dev/null
|
||||
}
|
||||
|
||||
git_mode() {
|
||||
@@ -22,23 +22,26 @@ git_mode() {
|
||||
}
|
||||
|
||||
git_dirty() {
|
||||
if [[ "$repo_path" != '.' && `git ls-files -m` != "" ]]; then
|
||||
if [[ "$repo_path" != '.' && -n "$(command git ls-files -m)" ]]; then
|
||||
echo " %{$fg_bold[grey]%}✗%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
|
||||
git_prompt() {
|
||||
local cb=$(git_current_branch)
|
||||
if [ -n "$cb" ]; then
|
||||
if [[ -n "$cb" ]]; then
|
||||
local repo_path=$(git_repo_path)
|
||||
echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)"
|
||||
fi
|
||||
}
|
||||
|
||||
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
|
||||
local smiley='%(?.%F{green}☺%f.%F{red}☹%f)'
|
||||
|
||||
PROMPT='
|
||||
%~
|
||||
${smiley} %{$reset_color%}'
|
||||
${VIRTUAL_ENV:+"($VIRTUAL_ENV) "}%~
|
||||
${smiley} '
|
||||
|
||||
RPROMPT='%{$fg[white]%} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
|
||||
RPROMPT='%F{white} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
|
||||
|
||||
# Disable automatic virtualenv prompt change
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
|
||||
@@ -17,6 +17,8 @@ function _virtualenv_prompt_info {
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion(){
|
||||
setopt localoptions extendedglob
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
|
||||
@@ -25,15 +27,18 @@ prompt_setup_pygmalion(){
|
||||
base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}'
|
||||
post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} '
|
||||
|
||||
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}}
|
||||
post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}}
|
||||
|
||||
precmd_functions+=(prompt_pygmalion_precmd)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook precmd prompt_pygmalion_precmd
|
||||
}
|
||||
|
||||
prompt_pygmalion_precmd(){
|
||||
setopt localoptions extendedglob
|
||||
|
||||
local gitinfo=$(git_prompt_info)
|
||||
local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g")
|
||||
local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}}
|
||||
local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")"
|
||||
local prompt_length=${#exp_nocolor}
|
||||
|
||||
@@ -46,5 +51,3 @@ prompt_pygmalion_precmd(){
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Yay! High voltage and arrows!
|
||||
|
||||
prompt_setup_pygmalion(){
|
||||
setopt localoptions extendedglob
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
|
||||
@@ -9,26 +11,22 @@ prompt_setup_pygmalion(){
|
||||
base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}'
|
||||
post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} '
|
||||
|
||||
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}}
|
||||
post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}}
|
||||
|
||||
precmd_functions+=(prompt_pygmalion_precmd)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook precmd prompt_pygmalion_precmd
|
||||
}
|
||||
|
||||
prompt_pygmalion_precmd(){
|
||||
setopt localoptions extendedglob
|
||||
|
||||
local gitinfo=$(git_prompt_info)
|
||||
local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g")
|
||||
local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}}
|
||||
local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")"
|
||||
local prompt_length=${#exp_nocolor}
|
||||
|
||||
local nl=""
|
||||
|
||||
if [[ $prompt_length -gt 40 ]]; then
|
||||
nl=$'\n%{\r%}';
|
||||
fi
|
||||
PROMPT="$base_prompt$gitinfo$nl$post_prompt"
|
||||
PROMPT="${base_prompt}${gitinfo}${post_prompt}"
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion
|
||||
|
||||
|
||||
|
||||
47
zsh/themes/random.zsh-theme
Normal file
47
zsh/themes/random.zsh-theme
Normal file
@@ -0,0 +1,47 @@
|
||||
# Deprecate ZSH_THEME_RANDOM_BLACKLIST
|
||||
if [[ -n "$ZSH_THEME_RANDOM_BLACKLIST" ]]; then
|
||||
echo '[oh-my-zsh] ZSH_THEME_RANDOM_BLACKLIST is deprecated. Use `ZSH_THEME_RANDOM_IGNORED` instead.'
|
||||
ZSH_THEME_RANDOM_IGNORED=($ZSH_THEME_RANDOM_BLACKLIST)
|
||||
unset ZSH_THEME_RANDOM_BLACKLIST
|
||||
fi
|
||||
|
||||
# Make themes a unique array
|
||||
typeset -Ua themes
|
||||
|
||||
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDATES[@]} -gt 0 ]]; then
|
||||
# Use ZSH_THEME_RANDOM_CANDIDATES if properly defined
|
||||
themes=(${(@)ZSH_THEME_RANDOM_CANDIDATES:#random})
|
||||
else
|
||||
# Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name
|
||||
themes=(
|
||||
"$ZSH_CUSTOM"/*.zsh-theme(N:t:r)
|
||||
"$ZSH_CUSTOM"/themes/*.zsh-theme(N:t:r)
|
||||
"$ZSH"/themes/*.zsh-theme(N:t:r)
|
||||
)
|
||||
# Remove ignored themes from the list
|
||||
for theme in random ${ZSH_THEME_RANDOM_IGNORED[@]}; do
|
||||
themes=("${(@)themes:#$theme}")
|
||||
done
|
||||
fi
|
||||
|
||||
# Choose a theme out of the pool of candidates
|
||||
N=${#themes[@]}
|
||||
(( N = (RANDOM%N) + 1 ))
|
||||
RANDOM_THEME="${themes[$N]}"
|
||||
unset N themes theme
|
||||
|
||||
# Source theme
|
||||
if [[ -f "$ZSH_CUSTOM/$RANDOM_THEME.zsh-theme" ]]; then
|
||||
source "$ZSH_CUSTOM/$RANDOM_THEME.zsh-theme"
|
||||
elif [[ -f "$ZSH_CUSTOM/themes/$RANDOM_THEME.zsh-theme" ]]; then
|
||||
source "$ZSH_CUSTOM/themes/$RANDOM_THEME.zsh-theme"
|
||||
elif [[ -f "$ZSH/themes/$RANDOM_THEME.zsh-theme" ]]; then
|
||||
source "$ZSH/themes/$RANDOM_THEME.zsh-theme"
|
||||
else
|
||||
echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z "$ZSH_THEME_RANDOM_QUIET" ]]; then
|
||||
echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' loaded"
|
||||
fi
|
||||
@@ -1,4 +1,4 @@
|
||||
if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
|
||||
if [ "$USERNAME" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="magenta"; fi
|
||||
|
||||
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ ZSH_THEME_GIT_PROMPT_SHA_BEFORE="➤ %{$fg_bold[yellow]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}"
|
||||
|
||||
function prompt_char() {
|
||||
git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
|
||||
hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
|
||||
darcs show repo >/dev/null 2>/dev/null && echo "%{$fg_bold[green]%}❉%{$reset_color%}" && return
|
||||
command git branch &>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
|
||||
command hg root &>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
|
||||
command darcs show repo &>/dev/null && echo "%{$fg_bold[green]%}❉%{$reset_color%}" && return
|
||||
echo "%{$fg[cyan]%}◯%{$reset_color%}"
|
||||
}
|
||||
|
||||
@@ -36,47 +36,44 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
|
||||
# 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))
|
||||
local COLOR MINUTES HOURS DAYS SUB_HOURS SUB_MINUTES
|
||||
local last_commit seconds_since_last_commit
|
||||
|
||||
# Totals
|
||||
MINUTES=$((seconds_since_last_commit / 60))
|
||||
HOURS=$((seconds_since_last_commit/3600))
|
||||
# Only proceed if there is actually a commit
|
||||
if ! last_commit=$(command git log --pretty=format:'%at' -1 2>/dev/null); then
|
||||
echo "[$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL~%{$reset_color%}]"
|
||||
return
|
||||
fi
|
||||
|
||||
# Sub-hours and sub-minutes
|
||||
DAYS=$((seconds_since_last_commit / 86400))
|
||||
SUB_HOURS=$((HOURS % 24))
|
||||
SUB_MINUTES=$((MINUTES % 60))
|
||||
# Totals
|
||||
seconds_since_last_commit=$(( EPOCHSECONDS - last_commit ))
|
||||
MINUTES=$(( seconds_since_last_commit / 60 ))
|
||||
HOURS=$(( MINUTES / 60 ))
|
||||
|
||||
if [[ -n $(git status -s 2> /dev/null) ]]; then
|
||||
if [ "$MINUTES" -gt 30 ]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
|
||||
elif [ "$MINUTES" -gt 10 ]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
|
||||
else
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
|
||||
fi
|
||||
else
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
||||
fi
|
||||
# Sub-hours and sub-minutes
|
||||
DAYS=$(( HOURS / 24 ))
|
||||
SUB_HOURS=$(( HOURS % 24 ))
|
||||
SUB_MINUTES=$(( MINUTES % 60 ))
|
||||
|
||||
if [ "$HOURS" -gt 24 ]; then
|
||||
echo "[$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}]"
|
||||
elif [ "$MINUTES" -gt 60 ]; then
|
||||
echo "[$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}]"
|
||||
else
|
||||
echo "[$COLOR${MINUTES}m%{$reset_color%}]"
|
||||
fi
|
||||
if [[ -z "$(command git status -s 2>/dev/null)" ]]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
||||
else
|
||||
if [[ "$MINUTES" -gt 30 ]]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
|
||||
elif [[ "$MINUTES" -gt 10 ]]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
|
||||
else
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
|
||||
echo "[$COLOR~]"
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$HOURS" -gt 24 ]]; then
|
||||
echo "[${COLOR}${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}]"
|
||||
elif [[ "$MINUTES" -gt 60 ]]; then
|
||||
echo "[${COLOR}${HOURS}h${SUB_MINUTES}m%{$reset_color%}]"
|
||||
else
|
||||
echo "[${COLOR}${MINUTES}m%{$reset_color%}]"
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT='
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Sunrise theme for oh-my-zsh
|
||||
# Intended to be used with Solarized: http://ethanschoonover.com/solarized
|
||||
# Intended to be used with Solarized: https://ethanschoonover.com/solarized
|
||||
|
||||
# Color shortcuts
|
||||
R=$fg_no_bold[red]
|
||||
@@ -9,7 +9,7 @@ Y=$fg_no_bold[yellow]
|
||||
B=$fg_no_bold[blue]
|
||||
RESET=$reset_color
|
||||
|
||||
if [ "$USER" = "root" ]; then
|
||||
if [ "$USERNAME" = "root" ]; then
|
||||
PROMPTCOLOR="%{$R%}" PROMPTPREFIX="-!-";
|
||||
else
|
||||
PROMPTCOLOR="" PROMPTPREFIX="---";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This theme needs a terminal supporting 256 colors as well as unicode.
|
||||
# In order to avoid external dependencies, it also has a zsh version of
|
||||
# the perl script at https://github.com/trapd00r/utils/blob/master/zsh_path,
|
||||
# the previously used perl script https://github.com/trapd00r/utils/blob/master/zsh_path,
|
||||
# which splits up the current path and makes it fancy.
|
||||
#
|
||||
# By default it spans over two lines like so:
|
||||
@@ -109,23 +109,23 @@ prompt_jnrowe_precmd () {
|
||||
vcs_info
|
||||
if [ "${vcs_info_msg_0_}" = "" ]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
|
||||
PROMPT='${dir_status} ${ret_status}%{$reset_color%}
|
||||
> '
|
||||
# modified, to be committed
|
||||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
${dir_status}%{$reset_color%}
|
||||
> '
|
||||
elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
${dir_status}%{$reset_color%}
|
||||
%{$c13%}>%{$c0%} '
|
||||
else
|
||||
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
||||
PROMPT='${vcs_info_msg_0_}
|
||||
%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
||||
${dir_status}%{$reset_color%}
|
||||
> '
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist)
|
||||
# - Open Terminal preferences. Go to Settings -> Text -> More
|
||||
# - Change default colours to your liking.
|
||||
#
|
||||
#
|
||||
# Here are the colours from Textmate's Monokai theme:
|
||||
#
|
||||
#
|
||||
# Black: 0, 0, 0
|
||||
# Red: 229, 34, 34
|
||||
# Green: 166, 227, 45
|
||||
@@ -25,36 +25,35 @@ PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}'
|
||||
|
||||
# The right-hand prompt
|
||||
|
||||
RPROMPT='$(git_super_status)%{$reset_color%}'
|
||||
RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}$(git_prompt_ahead)%{$reset_color%}'
|
||||
|
||||
# Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name
|
||||
# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%}
|
||||
# $(ruby_prompt_info)
|
||||
|
||||
# local time, color coded by last return code
|
||||
time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
|
||||
time_disabled="%{$fg[green]%}%*%{$reset_color%}"
|
||||
time=$time_enabled
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%} ⑃ " # ☁
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" ☁ %{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="" # Ⓓ ☂ %{$fg[yellow]%} ☶
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ?" # ⓣ ✭
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔" # Ⓞ ☀
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%} +" # ⓐ ⑃
|
||||
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[yellow]%} ⚡" # ⓜ ⑁
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} -" # ⓧ ⑂
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[red]%} ♒" # ⓤ ⑊
|
||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[yellow]%} ⩲"
|
||||
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[yellow]%} ⩱"
|
||||
ZSH_THEME_GIT_PROMPT_SEPARATOR=" \\"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊
|
||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%} 𝝙"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_BRANCH="%{%}"
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[yellow]%}"
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
||||
# More symbols to choose from:
|
||||
# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷
|
||||
# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠
|
||||
# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵ ⩶ ⨠
|
||||
# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟ ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ
|
||||
|
||||
# Determine if we are using a gemset.
|
||||
@@ -62,7 +61,7 @@ function rvm_gemset() {
|
||||
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
|
||||
if [[ -n $GEMSET ]]; then
|
||||
echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Determine the time since last commit. If branch is clean,
|
||||
@@ -79,12 +78,12 @@ function git_time_since_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 [[ -n $(git status -s 2> /dev/null) ]]; then
|
||||
if [ "$MINUTES" -gt 30 ]; then
|
||||
COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
|
||||
|
||||
@@ -26,15 +26,26 @@ ys_hg_prompt_info() {
|
||||
if [ -d '.hg' ]; then
|
||||
echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
|
||||
echo -n $(hg branch 2>/dev/null)
|
||||
if [ -n "$(hg status 2>/dev/null)" ]; then
|
||||
echo -n "$YS_VCS_PROMPT_DIRTY"
|
||||
else
|
||||
echo -n "$YS_VCS_PROMPT_CLEAN"
|
||||
if [[ "$(hg config oh-my-zsh.hide-dirty 2>/dev/null)" != "1" ]]; then
|
||||
if [ -n "$(hg status 2>/dev/null)" ]; then
|
||||
echo -n "$YS_VCS_PROMPT_DIRTY"
|
||||
else
|
||||
echo -n "$YS_VCS_PROMPT_CLEAN"
|
||||
fi
|
||||
fi
|
||||
echo -n "$YS_VCS_PROMPT_SUFFIX"
|
||||
fi
|
||||
}
|
||||
|
||||
# Virtualenv
|
||||
local venv_info='$(virtenv_prompt)'
|
||||
YS_THEME_VIRTUALENV_PROMPT_PREFIX=" %{$fg[green]%}"
|
||||
YS_THEME_VIRTUALENV_PROMPT_SUFFIX=" %{$reset_color%}%"
|
||||
virtenv_prompt() {
|
||||
[[ -n ${VIRTUAL_ENV} ]] || return
|
||||
echo "${YS_THEME_VIRTUALENV_PROMPT_PREFIX}${VIRTUAL_ENV:t}${YS_THEME_VIRTUALENV_PROMPT_SUFFIX}"
|
||||
}
|
||||
|
||||
local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"
|
||||
|
||||
# Prompt format:
|
||||
@@ -55,6 +66,7 @@ PROMPT="
|
||||
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
|
||||
${hg_info}\
|
||||
${git_info}\
|
||||
${venv_info}\
|
||||
\
|
||||
%{$fg[white]%}[%*] $exit_code
|
||||
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
|
||||
|
||||
Reference in New Issue
Block a user