mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +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
|
|
@ -11,7 +11,7 @@ $FG[032]%~\
|
|||
$(git_prompt_info) \
|
||||
$FG[105]%(!.#.»)%{$reset_color%} '
|
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
RPS1='${return_code}'
|
||||
RPROMPT="${return_code}"
|
||||
|
||||
|
||||
# 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)%}'
|
||||
|
||||
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%}"
|
||||
_current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
|
||||
_return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
|
||||
_hist_no="%{$fg[grey]%}%h%{$reset_color%}"
|
||||
|
||||
function _current_dir() {
|
||||
local _max_pwd_length="65"
|
||||
|
|
|
|||
|
|
@ -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]%}%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_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@ 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=${return_status}'$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ local host="@${host_repr[$HOST]:-$HOST}%{$reset_color%}"
|
|||
# Compacted $PWD
|
||||
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,
|
||||
# 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_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_MODIFIED="%{$fg[blue]%} ✹"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ PROMPT='%{$fg[$NCOLOR]%}%n%{$reset_color%}@%{$fg[cyan]%}%m\
|
|||
$(git_prompt_info) \
|
||||
%{$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_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%}%(!.#.>) '
|
||||
PROMPT2='%{$fg[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_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}%} '
|
||||
|
||||
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_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='
|
||||
%{$fg_bold[gray]%}%~%{$fg_bold[blue]%}%{$fg_bold[blue]%} % %{$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_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
||||
|
||||
local host_color="green"
|
||||
host_color="green"
|
||||
if [ -n "$SSH_CLIENT" ]; then
|
||||
local host_color="red"
|
||||
host_color="red"
|
||||
fi
|
||||
|
||||
PROMPT='
|
||||
|
|
@ -12,7 +12,7 @@ PROMPT='
|
|||
%{$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_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ local user="%{$fg[cyan]%}%n%{$reset_color%}"
|
|||
local host="%{$fg[cyan]%}@%m%{$reset_color%}"
|
||||
local pwd="%{$fg[yellow]%}%~%{$reset_color%}"
|
||||
|
||||
PROMPT='${user}${host} ${pwd}
|
||||
${smiley} '
|
||||
PROMPT="${user}${host} ${pwd}
|
||||
${smiley} "
|
||||
|
||||
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%}
|
||||
${ret_status} %{$reset_color%} '
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ add-zsh-hook precmd prompt_vcs
|
|||
prompt_vcs () {
|
||||
vcs_info
|
||||
|
||||
if [ "${vcs_info_msg_0_}" = "" ]; then
|
||||
if [[ "${vcs_info_msg_0_}" == "" ]]; then
|
||||
dir_status="%F{2}→%f"
|
||||
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
||||
dir_status="%F{1}▶%f"
|
||||
|
|
@ -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]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
|
||||
|
||||
# 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)\
|
||||
%{$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_SUFFIX="%{$reset_color%} "
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ $(git_prompt_info)\
|
|||
\
|
||||
%{$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_SUFFIX=")%{$reset_color%} "
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function ssh_connection() {
|
|||
}
|
||||
|
||||
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_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ git_prompt() {
|
|||
|
||||
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%}'
|
||||
|
|
|
|||
|
|
@ -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[$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_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
|
||||
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
|
||||
local ret_status='%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )'
|
||||
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_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[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_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_MODIFIED="%{$fg[blue]%} ✹"
|
||||
|
|
@ -31,7 +31,7 @@ else
|
|||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
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_MODIFIED=" ✹"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX=" "
|
|||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
local user_color='green'
|
||||
user_color='green'
|
||||
test $UID -eq 0 && user_color='red'
|
||||
|
||||
PROMPT='%(?..%{$fg_bold[red]%}exit %?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue