mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Fix themes to work with really-local locals.
Fix quoting issue in theme debugging code.
This commit is contained in:
parent
ecb1fd91c8
commit
a352b1d43c
25 changed files with 41 additions and 57 deletions
|
|
@ -12,7 +12,8 @@
|
||||||
# Real implementations will be used when the respective plugins are loaded
|
# Real implementations will be used when the respective plugins are loaded
|
||||||
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
|
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
|
||||||
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
|
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
|
||||||
virtualenv_prompt_info {
|
virtualenv_prompt_info \
|
||||||
|
jenv_prompt_info {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,8 @@ function theme() {
|
||||||
local themes n_themes random_theme blacklist
|
local themes n_themes random_theme blacklist
|
||||||
if [[ -z $1 || $1 == "random" ]]; then
|
if [[ -z $1 || $1 == "random" ]]; then
|
||||||
# Special case: random theme
|
# Special case: random theme
|
||||||
blacklist=($(_omz_theme_blacklist))
|
blacklist=($ZSH_BLACKLISTED_THEMES)
|
||||||
themes=($(lstheme))
|
themes=($(lstheme))
|
||||||
#themes=(${themes:|blacklist})
|
|
||||||
_omz_array_setdiff themes themes blacklist
|
_omz_array_setdiff themes themes blacklist
|
||||||
n_themes=${#themes[@]}
|
n_themes=${#themes[@]}
|
||||||
((n=(RANDOM%n_themes)+1))
|
((n=(RANDOM%n_themes)+1))
|
||||||
|
|
@ -175,7 +174,7 @@ function _omz_theme_n() {
|
||||||
(( n = (last_n % n_themes) + 1 ))
|
(( n = (last_n % n_themes) + 1 ))
|
||||||
# Advance past blacklisted themes. Do it this way instead of removing blacklist
|
# Advance past blacklisted themes. Do it this way instead of removing blacklist
|
||||||
# from themes list to keep indexes stable
|
# from themes list to keep indexes stable
|
||||||
blacklist=($(_omz_theme_blacklist))
|
blacklist=($ZSH_BLACKLISTED_THEMES)
|
||||||
while [[ ${blacklist[(i)${themes[n]}]} -le ${#blacklist} ]]; do
|
while [[ ${blacklist[(i)${themes[n]}]} -le ${#blacklist} ]]; do
|
||||||
if [[ $ZSH_THEME_DEBUG == 'true' ]]; then
|
if [[ $ZSH_THEME_DEBUG == 'true' ]]; then
|
||||||
echo "[oh-my-zsh]: Skipping blacklisted theme ${themes[n]}"
|
echo "[oh-my-zsh]: Skipping blacklisted theme ${themes[n]}"
|
||||||
|
|
@ -238,15 +237,6 @@ _OMZ_THEME_CHPWD_FUNCTIONS=()
|
||||||
_OMZ_THEME_PRECMD_FUNCTIONS=()
|
_OMZ_THEME_PRECMD_FUNCTIONS=()
|
||||||
_OMZ_THEME_PREEXEC_FUNCTIONS=()
|
_OMZ_THEME_PREEXEC_FUNCTIONS=()
|
||||||
|
|
||||||
# Outputs the effective theme blacklist
|
|
||||||
function _omz_theme_blacklist() {
|
|
||||||
local blacklist=$ZSH_BLACKLISTED_THEMES
|
|
||||||
if [[ $ZSH_THEME_DEBUG == true ]]; then
|
|
||||||
blacklist+=($_OMZ_DEBUG_BLACKLISTED_THEMES)
|
|
||||||
fi
|
|
||||||
echo ${(F)blacklist}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Implementation of loading a theme
|
# Implementation of loading a theme
|
||||||
# Most of the code in here is for tracking hooks and debugging support
|
# Most of the code in here is for tracking hooks and debugging support
|
||||||
function _omz_load_theme_from_file() {
|
function _omz_load_theme_from_file() {
|
||||||
|
|
@ -269,7 +259,7 @@ function _omz_load_theme_from_file() {
|
||||||
params_before=($(set +))
|
params_before=($(set +))
|
||||||
fi
|
fi
|
||||||
for param ($params_before); do
|
for param ($params_before); do
|
||||||
values_before[$param]=${(P)param}
|
values_before[$param]="${(P)param}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Actually load the theme, using an indirection function
|
# Actually load the theme, using an indirection function
|
||||||
|
|
@ -278,12 +268,11 @@ function _omz_load_theme_from_file() {
|
||||||
# Debugging stuff
|
# Debugging stuff
|
||||||
if [[ $ZSH_THEME_DEBUG == true ]]; then
|
if [[ $ZSH_THEME_DEBUG == true ]]; then
|
||||||
params_after=($(set +))
|
params_after=($(set +))
|
||||||
#params_added=(${params_after:|params_before})
|
|
||||||
_omz_array_setdiff params_added params_after params_before
|
_omz_array_setdiff params_added params_after params_before
|
||||||
ignore_params=(LINENO RANDOM _ parameters prompt values_before modules \
|
ignore_params=(LINENO RANDOM _ parameters prompt values_before modules \
|
||||||
params_added ignore_params params_before params_after params_changed \
|
params_added ignore_params params_before params_after params_changed \
|
||||||
SECONDS TTYIDLE PS1 PS2 PS3 PS4 RPS1 RPS2)
|
SECONDS TTYIDLE PS1 PS2 PS3 PS4 RPS1 RPS2 '#')
|
||||||
#params_before=(${params_before:|ignore_params})
|
_omz_array_setdiff params_added params_added ignore_params
|
||||||
_omz_array_setdiff params_before params_before ignore_params
|
_omz_array_setdiff params_before params_before ignore_params
|
||||||
local params_changed
|
local params_changed
|
||||||
params_changed=()
|
params_changed=()
|
||||||
|
|
@ -298,11 +287,8 @@ function _omz_load_theme_from_file() {
|
||||||
ZSH_THEME=$name
|
ZSH_THEME=$name
|
||||||
|
|
||||||
# Track changes to hooks
|
# Track changes to hooks
|
||||||
#_OMZ_THEME_CHPWD_FUNCTIONS=(${chpwd_functions:|chpwd_fcns_0})
|
|
||||||
_omz_array_setdiff _OMZ_THEME_CHPWD_FUNCTIONS chpwd_functions chpwd_fcns_0
|
_omz_array_setdiff _OMZ_THEME_CHPWD_FUNCTIONS chpwd_functions chpwd_fcns_0
|
||||||
#_OMZ_THEME_PRECMD_FUNCTIONS=(${precmd_functions:|precmd_fcns_0})
|
|
||||||
_omz_array_setdiff _OMZ_THEME_PRECMD_FUNCTIONS precmd_functions precmd_fcns_0
|
_omz_array_setdiff _OMZ_THEME_PRECMD_FUNCTIONS precmd_functions precmd_fcns_0
|
||||||
#_OMZ_THEME_PREEXEC_FUNCTIONS=(${preexec_functions:|preexec_fcns_0})
|
|
||||||
_omz_array_setdiff _OMZ_THEME_PREEXEC_FUNCTIONS preexec_functions preexec_fcns_0
|
_omz_array_setdiff _OMZ_THEME_PREEXEC_FUNCTIONS preexec_functions preexec_fcns_0
|
||||||
|
|
||||||
# Post-loading debugging
|
# Post-loading debugging
|
||||||
|
|
@ -492,9 +478,6 @@ function _omz_theme_show_prompt_key {
|
||||||
# Note that this can cause unstable behavior, especially with these themes:
|
# Note that this can cause unstable behavior, especially with these themes:
|
||||||
# agnoster dstufft
|
# agnoster dstufft
|
||||||
ZSH_THEME_DEBUG=${ZSH_THEME_DEBUG:-false}
|
ZSH_THEME_DEBUG=${ZSH_THEME_DEBUG:-false}
|
||||||
# These themes are known to interact badly with our debugging support
|
|
||||||
_OMZ_DEBUG_BLACKLISTED_THEMES=(agnoster dstufft dogenpunk fino fino-time half-life \
|
|
||||||
kolo peepcode smt steeef suvash zhann)
|
|
||||||
|
|
||||||
# Configure and enable ls colors
|
# Configure and enable ls colors
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ $FG[032]%~\
|
||||||
$(git_prompt_info) \
|
$(git_prompt_info) \
|
||||||
$FG[105]%(!.#.»)%{$reset_color%} '
|
$FG[105]%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='${return_code}'
|
RPROMPT="${return_code}"
|
||||||
|
|
||||||
|
|
||||||
# color vars
|
# color vars
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
|
||||||
|
|
||||||
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
|
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%} "
|
_current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
|
||||||
local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
|
_return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
|
||||||
local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
|
_hist_no="%{$fg[grey]%}%h%{$reset_color%}"
|
||||||
|
|
||||||
function _current_dir() {
|
function _current_dir() {
|
||||||
local _max_pwd_length="65"
|
local _max_pwd_length="65"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# the svn plugin has to be activated for this to work.
|
# the svn plugin has to be activated for this to work.
|
||||||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
|
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]%}%p %{$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_PREFIX="git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
||||||
|
|
||||||
local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
|
local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
|
||||||
RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
RPROMPT=${return_status}'$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ local host="@${host_repr[$HOST]:-$HOST}%{$reset_color%}"
|
||||||
# Compacted $PWD
|
# Compacted $PWD
|
||||||
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
|
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
|
||||||
|
|
||||||
PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
|
PROMPT="${time} ${user}${host} ${pwd} "'$(git_prompt_info)'
|
||||||
|
|
||||||
# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
|
# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
|
||||||
# but lets see how this works out
|
# but lets see how this works out
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!%{$reset_color%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
|
RPROMPT=${return_status}'$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\
|
||||||
$(git_prompt_info) \
|
$(git_prompt_info) \
|
||||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='${return_code}'
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ _fishy_collapsed_wd() {
|
||||||
')
|
')
|
||||||
}
|
}
|
||||||
|
|
||||||
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
user_color='green'; [ $UID -eq 0 ] && user_color='red'
|
||||||
PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
|
PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
|
|
||||||
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
|
||||||
RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
|
RPROMPT=${return_status}'$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" "
|
ZSH_THEME_GIT_PROMPT_PREFIX=" "
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
|
PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
|
||||||
|
|
||||||
RPS1='$(vi_mode_prompt_info) ${return_code}'
|
RPS1='$(vi_mode_prompt_info) '${return_code}
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
local rvm="%{$fg[green]%}[$(rvm-prompt i v g)]%{$reset_color%}"
|
local rvm="%{$fg[green]%}[\$(rvm-prompt i v g)]%{$reset_color%}"
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%}
|
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$reset_color%}
|
||||||
%{$fg[green]%}➞ %{$reset_color%'
|
%{$fg[green]%}➞ %{$reset_color%'
|
||||||
|
|
||||||
RPROMPT='$(git_prompt_info) ${rvm}'
|
RPROMPT="\$(git_prompt_info) ${rvm}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[git:"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
||||||
|
|
||||||
local host_color="green"
|
host_color="green"
|
||||||
if [ -n "$SSH_CLIENT" ]; then
|
if [ -n "$SSH_CLIENT" ]; then
|
||||||
local host_color="red"
|
host_color="red"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PROMPT='
|
PROMPT='
|
||||||
|
|
@ -12,7 +12,7 @@ PROMPT='
|
||||||
%{$fg_bold[cyan]%}❯%{$reset_color%} '
|
%{$fg_bold[cyan]%}❯%{$reset_color%} '
|
||||||
|
|
||||||
|
|
||||||
RPROMPT='${return_status}%{$reset_color%}'
|
RPROMPT=${return_status}'%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ local user="%{$fg[cyan]%}%n%{$reset_color%}"
|
||||||
local host="%{$fg[cyan]%}@%m%{$reset_color%}"
|
local host="%{$fg[cyan]%}@%m%{$reset_color%}"
|
||||||
local pwd="%{$fg[yellow]%}%~%{$reset_color%}"
|
local pwd="%{$fg[yellow]%}%~%{$reset_color%}"
|
||||||
|
|
||||||
PROMPT='${user}${host} ${pwd}
|
PROMPT="${user}${host} ${pwd}
|
||||||
${smiley} '
|
${smiley} "
|
||||||
|
|
||||||
RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}'
|
RPROMPT='$(rvm-prompt || rbenv version) %{$fg[white]%}$(git_prompt_info)%{$reset_color%}'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
|
ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
|
||||||
PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/ %{$reset_color%}%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
|
PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/ %{$reset_color%}%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
|
||||||
${ret_status} %{$reset_color%} '
|
${ret_status} %{$reset_color%} '
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ add-zsh-hook precmd prompt_vcs
|
||||||
prompt_vcs () {
|
prompt_vcs () {
|
||||||
vcs_info
|
vcs_info
|
||||||
|
|
||||||
if [ "${vcs_info_msg_0_}" = "" ]; then
|
if [[ "${vcs_info_msg_0_}" == "" ]]; then
|
||||||
dir_status="%F{2}→%f"
|
dir_status="%F{2}→%f"
|
||||||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
||||||
dir_status="%F{1}▶%f"
|
dir_status="%F{1}▶%f"
|
||||||
|
|
@ -33,6 +33,6 @@ function {
|
||||||
|
|
||||||
local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
|
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]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
|
||||||
|
|
||||||
# vim: set ft=zsh ts=4 sw=4 et:
|
# vim: set ft=zsh ts=4 sw=4 et:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
|
||||||
$(git_prompt_info)\
|
$(git_prompt_info)\
|
||||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='${return_code}'
|
RPS1="${return_code}"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}±%{$fg[yellow]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ $(git_prompt_info)\
|
||||||
\
|
\
|
||||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||||
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
|
RPS1='%{$fg[blue]%}%~%{$reset_color%} '"${return_code} "
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ function ssh_connection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}"
|
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})%?%{$reset_color%}"
|
||||||
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n[${ret_status}] %# '
|
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_prompt) : %~\n['${ret_status}'] %# '
|
||||||
|
|
||||||
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
|
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ git_prompt() {
|
||||||
|
|
||||||
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
|
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
|
||||||
|
|
||||||
PROMPT='
|
PROMPT="
|
||||||
%~
|
%~
|
||||||
${smiley} %{$reset_color%}'
|
${smiley} "'%{$reset_color%}'
|
||||||
|
|
||||||
RPROMPT='%{$fg[white]%} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
|
RPROMPT='%{$fg[white]%} $(ruby_prompt_info)$(git_prompt)%{$reset_color%}'
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ PROMPT='
|
||||||
%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info)
|
%{$fg_bold[cyan]%}%n%{$reset_color%}%{$fg[yellow]%}@%{$reset_color%}%{$fg_bold[blue]%}%m%{$reset_color%}:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info)
|
||||||
%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}'
|
%{${fg[$CARETCOLOR]}%}%# %{${reset_color}%}'
|
||||||
|
|
||||||
RPS1='${return_code} %D - %*'
|
RPS1="${return_code} %D - %*"
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}^%{$reset_color%}%{$fg_bold[yellow]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
|
local ret_status='%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )'
|
||||||
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
|
PROMPT=${ret_status}' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||||
|
|
|
||||||
|
|
@ -83,4 +83,4 @@ PROMPT='
|
||||||
%{$fg[blue]%}%m%{$reset_color%} 福 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info)
|
%{$fg[blue]%}%m%{$reset_color%} 福 %{$fg[cyan]%}%~ %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info)
|
||||||
%{$fg[red]%}%!%{$reset_color%} $(prompt_char) : '
|
%{$fg[red]%}%!%{$reset_color%} $(prompt_char) : '
|
||||||
|
|
||||||
RPROMPT='${return_status}$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}'
|
RPROMPT=${return_status}'$(git_time_since_commit)$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
|
RPROMPT=${return_status}'$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
||||||
|
|
@ -31,7 +31,7 @@ else
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
RPROMPT='${return_status}$(git_prompt_status)'
|
RPROMPT=${return_status}'$(git_prompt_status)'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
|
ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
|
||||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
|
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX=" "
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
local user_color='green'
|
user_color='green'
|
||||||
test $UID -eq 0 && user_color='red'
|
test $UID -eq 0 && user_color='red'
|
||||||
|
|
||||||
PROMPT='%(?..%{$fg_bold[red]%}exit %?
|
PROMPT='%(?..%{$fg_bold[red]%}exit %?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue