Merge branch 'master' into screenshot
commit
bd304edb47
@ -0,0 +1 @@
|
|||||||
|
*.zwc
|
@ -1,82 +0,0 @@
|
|||||||
# Powerlevel10k Extended Configuration
|
|
||||||
|
|
||||||
Powerlevel10k has configuration options that Powerlevel9k doesn't. These options have `POWERLEVEL9K`
|
|
||||||
prefix just like the rest.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS (FLOAT) [default=0.05]`
|
|
||||||
|
|
||||||
If it takes longer than this to fetch git repo status, display the prompt with a greyed out
|
|
||||||
vcs segment and fix it asynchronously when the results come it.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_VCS_BACKENDS (ARRAY) [default=(git)]`
|
|
||||||
|
|
||||||
The list of VCS backends to use. Supported values are `git`, `svn` and `hg`. Note that adding
|
|
||||||
anything other than git will make prompt slower even when your current directory isn't a repo.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_GITSTATUS_DIR (STRING) [default=$POWERLEVEL9K_INSTALLATION_DIR/gitstatus]`
|
|
||||||
|
|
||||||
Directory with gitstatus plugin. By default uses a copy bundled with Powerlevel10k.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_DISABLE_GITSTATUS (STRING) [default="false"]`
|
|
||||||
|
|
||||||
If set to `"true"`, Powerlevel10k won't use its fast git backend and will fall back to
|
|
||||||
`vcs_info` like Powerlevel9k.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_MAX_CACHE_SIZE (INT) [default=10000]`
|
|
||||||
|
|
||||||
The maximum number of elements that can be stored in the cache. When the cache grows over this
|
|
||||||
limit, it gets cleared.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (INT) [default=-1]`
|
|
||||||
|
|
||||||
Don't scan for dirty files in git repos with more files in the index than this. Instead, show
|
|
||||||
them with the "dirty" color (yellow by default) whether they are dirty or not. This makes git
|
|
||||||
prompt much faster on huge repositories.
|
|
||||||
|
|
||||||
`POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME (STRING) [default="false"]`
|
|
||||||
|
|
||||||
If set to `"true"`, `time` segment will update every second, turning into a realtime clock.
|
|
||||||
This option triggers a
|
|
||||||
[bug in completion menu](https://www.zsh.org/mla/workers//2019/msg00161.html) in zsh, and
|
|
||||||
another
|
|
||||||
[bug in history](https://github.com/bhilburn/powerlevel9k/commit/fb1ef540228ec7b4394cf2f6860137074c5838a6#commitcomment-32779672).
|
|
||||||
You can pick up a fix for the latter from
|
|
||||||
[a fork of zsh](https://github.com/romkatv/zsh/tree/gentle-reset-prompt).
|
|
||||||
|
|
||||||
When using gitstatus, there is an extra state called `LOADING` that is used by `vcs` prompt
|
|
||||||
segment when it's waiting for git status in the background. You can define styling for this
|
|
||||||
state the same way as for the other states -- `CLEAN`, `UNTRACKED` and `MODIFIED`. You can
|
|
||||||
also define the icon and the text that will be used when `LOADING` state is triggered for a
|
|
||||||
git repository for which no prior status is known. If both `POWERLEVEL9K_VCS_LOADING_ICON`
|
|
||||||
and `POWERLEVEL9K_VCS_LOADING_TEXT` are empty, `vcs` segment in such cases won't be shown.
|
|
||||||
|
|
||||||
* `POWERLEVEL9K_VCS_LOADING_ICON (STRING) [default=""]`
|
|
||||||
|
|
||||||
Icon shown while waiting for git status for a repo for the first time.
|
|
||||||
* `POWERLEVEL9K_VCS_LOADING_TEXT (STRING) [default="loading"]`
|
|
||||||
|
|
||||||
Text shown while waiting for git status for a repo for the first time.
|
|
||||||
* `POWERLEVEL9K_VCS_LOADING_BACKGROUND (STRING) [default="grey"]`
|
|
||||||
|
|
||||||
Background color for `LOADING` state.
|
|
||||||
* `POWERLEVEL9K_VCS_LOADING_FOREGROUND (STRING) [default="$DEFAULT_COLOR"]`
|
|
||||||
|
|
||||||
Foreground color for `LOADING` state.
|
|
||||||
* `POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR (STRING) [default=$POWERLEVEL9K_VCS_LOADING_FOREGROUND]`
|
|
||||||
|
|
||||||
Foreground color for `POWERLEVEL9K_VCS_LOADING_ICON`.
|
|
||||||
|
|
||||||
When using gitstatus, components of `vcs` segment can be colored individually by setting
|
|
||||||
`POWERLEVEL9K_VCS_${STATE}_${COMPONENT}FORMAT_FOREGROUND`. `${STATE}` should be one of `CLEAN`,
|
|
||||||
`UNTRACKED`, `MODIFIED` or `LOADING`. `${COMPONENT}` should be one of `REMOTE_URL`, `COMMIT`,
|
|
||||||
`BRANCH`, `TAG`, `REMOTE_BRANCH`, `STAGED`, `UNSTAGED`, `UNTRACKED`, `OUTGOING_CHANGES`,
|
|
||||||
`INCOMING_CHANGES`, `STASH` or `ACTION`. If
|
|
||||||
`POWERLEVEL9K_VCS_${STATE}_${COMPONENT}FORMAT_FOREGROUND` isn't set for some combination of
|
|
||||||
`${STATE}` and `${COMPONENT}`, the component is colored with
|
|
||||||
`POWERLEVEL9K_VCS_${COMPONENT}FORMAT_FOREGROUND`. If that one isn't set either, the component is
|
|
||||||
colored with `POWERLEVEL9K_VCS_${STATE}_FOREGROUND`. The fallback logic is consistent with
|
|
||||||
Powerlevel9k, meaning that your `vcs` prompt will look the same in Powerlevel10k and
|
|
||||||
Powerlevel9k if you don't define any `POWERLEVEL9K_VCS_${STATE}_${COMPONENT}_FOREGROUND`
|
|
||||||
parameters. Note that both the icon and the text in each component always have the same color.
|
|
||||||
There is currently no `POWERLEVEL9K_VCS_${STATE}_${COMPONENT}FORMAT_VISUAL_IDENTIFIER_COLOR`,
|
|
||||||
although it's easy to implement if desired.
|
|
Binary file not shown.
Before Width: | Height: | Size: 67 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,51 +1,77 @@
|
|||||||
typeset -gr __p9k_wizard_columns=70 # DO NOT SUBMIT: 76
|
typeset -gr __p9k_wizard_columns=55
|
||||||
typeset -gr __p9k_wizard_lines=20 # DO NOT SUBMIT: 21
|
typeset -gr __p9k_wizard_lines=21
|
||||||
typeset -gr __p9k_zd=${${ZDOTDIR:-$HOME}:A}
|
typeset -gr __p9k_zd=${ZDOTDIR:-$HOME}
|
||||||
typeset -gr __p9k_zd_u=${${(q-)__p9k_zd}/#(#b)$HOME(|\/*)/'~'$match[1]}
|
typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
||||||
typeset -gr __p9k_cfg_basename=.p10k.zsh
|
typeset -gr __p9k_cfg_basename=.p10k.zsh
|
||||||
typeset -gr __p9k_cfg_path=$__p9k_zd/$__p9k_cfg_basename
|
typeset -gr __p9k_cfg_path=$__p9k_zd/$__p9k_cfg_basename
|
||||||
typeset -gr __p9k_cfg_path_u=$__p9k_zd_u/$__p9k_cfg_basename
|
typeset -gr __p9k_cfg_path_u=$__p9k_zd_u/$__p9k_cfg_basename
|
||||||
typeset -gr __p9k_zshrc=$__p9k_zd/.zshrc
|
typeset -gr __p9k_zshrc=$__p9k_zd/.zshrc
|
||||||
typeset -gr __p9k_zshrc_u=$__p9k_zd_u/.zshrc
|
typeset -gr __p9k_zshrc_u=$__p9k_zd_u/.zshrc
|
||||||
typeset -gr __p9k_root_dir_u=${${(q-)__p9k_root_dir}/#(#b)$HOME(|\/*)/'~'$match[1]}
|
typeset -gr __p9k_root_dir_u=${${${(q)__p9k_root_dir}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
|
||||||
|
|
||||||
function _p9k_can_configure() {
|
function _p9k_can_configure() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt err_return extended_glob no_prompt_{bang,subst} prompt_{cr,percent,sp}
|
setopt extended_glob no_prompt_{bang,subst} prompt_percent
|
||||||
[[ $1 == '-q' ]] && local -i q=1 || local -i q=0
|
[[ $1 == '-q' ]] && local -i q=1 || local -i q=0
|
||||||
function $0_error() {
|
function $0_error() {
|
||||||
(( q )) || print -P "%1F[ERROR]%f %Bp9k_configure%b: $1" >&2
|
(( q )) || print -rP "%1F[ERROR]%f %Bp10k configure%b: $1" >&2
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
[[ -t 0 && -t 1 ]] || $0_error "no TTY"
|
[[ -t 0 && -t 1 ]] || { $0_error "no TTY"; return 1 }
|
||||||
[[ -o multibyte ]] || $0_error "multibyte option is not set"
|
[[ -o multibyte ]] || { $0_error "multibyte option is not set"; return 1 }
|
||||||
[[ "${#$(print -P '\u276F' 2>/dev/null)}" == 1 ]] || $0_error "shell doesn't support unicode"
|
[[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 }
|
||||||
[[ -w $__p9k_zd ]] || $0_error "$__p9k_zd_u is not writable"
|
[[ -d $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not a directory"; return 1 }
|
||||||
[[ ! -d $__p9k_cfg_path ]] || $0_error "$__p9k_cfg_path_u is a directory"
|
[[ -w $__p9k_zd ]] || { $0_error "$__p9k_zd_u is not writable"; return 1 }
|
||||||
[[ ! -d $__p9k_zshrc ]] || $0_error "$__p9k_zshrc_u is a directory"
|
[[ ! -d $__p9k_cfg_path ]] || { $0_error "$__p9k_cfg_path_u is a directory"; return 1 }
|
||||||
|
[[ ! -d $__p9k_zshrc ]] || { $0_error "$__p9k_zshrc_u is a directory"; return 1 }
|
||||||
|
|
||||||
[[ ! -e $__p9k_cfg_path || -f $__p9k_cfg_path || -h $__p9k_cfg_path ]] ||
|
[[ ! -e $__p9k_cfg_path || -f $__p9k_cfg_path || -h $__p9k_cfg_path ]] || {
|
||||||
$0_error "$__p9k_cfg_path_u is a special file"
|
$0_error "$__p9k_cfg_path_u is a special file"
|
||||||
[[ -r $__p9k_root_dir/config/p10k-lean.zsh ]] ||
|
return 1
|
||||||
|
}
|
||||||
|
[[ -r $__p9k_root_dir/config/p10k-lean.zsh ]] || {
|
||||||
$0_error "cannot read $__p9k_root_dir_u/config/p10k-lean.zsh"
|
$0_error "cannot read $__p9k_root_dir_u/config/p10k-lean.zsh"
|
||||||
[[ -r $__p9k_root_dir/config/p10k-classic.zsh ]] ||
|
return 1
|
||||||
|
}
|
||||||
|
[[ -r $__p9k_root_dir/config/p10k-classic.zsh ]] || {
|
||||||
$0_error "cannot read $__p9k_root_dir_u/config/p10k-classic.zsh"
|
$0_error "cannot read $__p9k_root_dir_u/config/p10k-classic.zsh"
|
||||||
[[ ! -e $__p9k_zshrc || -f $__p9k_zshrc || -h $__p9k_zshrc ]] ||
|
return 1
|
||||||
|
}
|
||||||
|
[[ ! -e $__p9k_zshrc || -f $__p9k_zshrc || -h $__p9k_zshrc ]] || {
|
||||||
$0_error "$__p9k_zshrc_u a special file"
|
$0_error "$__p9k_zshrc_u a special file"
|
||||||
[[ ! -e $__p9k_zshrc || -r $__p9k_zshrc ]] ||
|
return 1
|
||||||
|
}
|
||||||
|
[[ ! -e $__p9k_zshrc || -r $__p9k_zshrc ]] || {
|
||||||
$0_error "$__p9k_zshrc_u is not readable"
|
$0_error "$__p9k_zshrc_u is not readable"
|
||||||
[[ ! -e $__p9k_zshrc || -w $__p9k_zshrc ]] ||
|
return 1
|
||||||
|
}
|
||||||
|
[[ ! -e $__p9k_zshrc || -w $__p9k_zshrc ]] || {
|
||||||
$0_error "$__p9k_zshrc_u is not writable"
|
$0_error "$__p9k_zshrc_u is not writable"
|
||||||
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) ||
|
return 1
|
||||||
|
}
|
||||||
|
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) || {
|
||||||
$0_error "terminal size too small; must be at least $__p9k_wizard_columns x $__p9k_wizard_lines"
|
$0_error "terminal size too small; must be at least $__p9k_wizard_columns x $__p9k_wizard_lines"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
} always {
|
} always {
|
||||||
unfunction $0_error
|
unfunction $0_error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function p9k_configure() {
|
function p9k_configure() {
|
||||||
emulate -L zsh && setopt no_hist_expand extended_glob
|
emulate -L zsh
|
||||||
$__p9k_root_dir/internal/wizard.zsh -d $__p9k_root_dir -f || return
|
setopt no_hist_expand extended_glob
|
||||||
source $__p9k_cfg_path
|
(
|
||||||
|
local p=("${(@)parameters[(I)AWESOME_*|CODEPOINT_*]}")
|
||||||
|
if (( $#p )); then
|
||||||
|
typeset -x -- $p
|
||||||
|
fi
|
||||||
|
$__p9k_root_dir/internal/wizard.zsh -d $__p9k_root_dir -f
|
||||||
|
)
|
||||||
|
local ret=$?
|
||||||
|
case $ret in
|
||||||
|
0) source $__p9k_cfg_path;;
|
||||||
|
69) return 0;;
|
||||||
|
*) return $ret;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
powerlevel9k.zsh-theme
|
|
@ -0,0 +1,44 @@
|
|||||||
|
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
|
||||||
|
################################################################
|
||||||
|
# Powerlevel10k Theme
|
||||||
|
# https://github.com/romkatv/powerlevel10k
|
||||||
|
#
|
||||||
|
# Forked from Powerlevel9k Theme
|
||||||
|
# https://github.com/bhilburn/powerlevel9k
|
||||||
|
#
|
||||||
|
# Which in turn was forked from Agnoster Theme
|
||||||
|
# https://github.com/robbyrussell/oh-my-zsh/blob/74177c5320b2a1b2f8c4c695c05984b57fd7c6ea/themes/agnoster.zsh-theme
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
# Temporarily change options.
|
||||||
|
'builtin' 'local' '-a' '__p9k_src_opts'
|
||||||
|
[[ ! -o 'aliases' ]] || __p9k_src_opts+=('aliases')
|
||||||
|
[[ ! -o 'sh_glob' ]] || __p9k_src_opts+=('sh_glob')
|
||||||
|
[[ ! -o 'no_brace_expand' ]] || __p9k_src_opts+=('no_brace_expand')
|
||||||
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
|
(( $+__p9k_root_dir )) || typeset -gr __p9k_root_dir=${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}
|
||||||
|
|
||||||
|
() {
|
||||||
|
emulate -L zsh
|
||||||
|
setopt no_hist_expand extended_glob no_prompt_bang no_prompt_subst prompt_percent no_aliases
|
||||||
|
if (( $+__p9k_sourced )); then
|
||||||
|
prompt_powerlevel9k_setup
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
|
||||||
|
if [[ -z $__p9k_dump_file(.zwc|)(#qNW) ]] && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
|
||||||
|
_p9k_preinit
|
||||||
|
fi
|
||||||
|
typeset -gr __p9k_sourced=1
|
||||||
|
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then
|
||||||
|
local f
|
||||||
|
for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,gitstatus/gitstatus.plugin.zsh}; do
|
||||||
|
[[ $f.zwc -nt $f ]] || zcompile $f
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
source $__p9k_root_dir/internal/p10k.zsh || true
|
||||||
|
}
|
||||||
|
|
||||||
|
(( ${#__p9k_src_opts} )) && setopt ${__p9k_src_opts[@]}
|
||||||
|
'builtin' 'unset' '__p9k_src_opts'
|
@ -1,53 +1 @@
|
|||||||
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
|
'builtin' 'source' "${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}/powerlevel10k.zsh-theme"
|
||||||
################################################################
|
|
||||||
# Powerlevel10k Theme
|
|
||||||
# https://github.com/romkatv/powerlevel10k
|
|
||||||
#
|
|
||||||
# Forked from Powerlevel9k Theme
|
|
||||||
# https://github.com/bhilburn/powerlevel9k
|
|
||||||
#
|
|
||||||
# Which in turn was forked from Agnoster Theme
|
|
||||||
# https://github.com/robbyrussell/oh-my-zsh/blob/74177c5320b2a1b2f8c4c695c05984b57fd7c6ea/themes/agnoster.zsh-theme
|
|
||||||
################################################################
|
|
||||||
|
|
||||||
if [[ -o 'aliases' ]]; then
|
|
||||||
'builtin' 'unsetopt' 'aliases'
|
|
||||||
local __p9k_restore_aliases=1
|
|
||||||
else
|
|
||||||
local __p9k_restore_aliases=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
() {
|
|
||||||
emulate -L zsh
|
|
||||||
|
|
||||||
if (( $+__p9k_sourced )); then
|
|
||||||
prompt_powerlevel9k_setup
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
typeset -gr __p9k_sourced=1
|
|
||||||
typeset -g __p9k_root_dir=''
|
|
||||||
|
|
||||||
if [[ -n $POWERLEVEL9K_INSTALLATION_DIR ]]; then
|
|
||||||
__p9k_root_dir=${POWERLEVEL9K_INSTALLATION_DIR:A}
|
|
||||||
else
|
|
||||||
if [[ ${(%):-%N} == '(eval)' ]]; then
|
|
||||||
if [[ $0 == '-antigen-load' && -r powerlevel9k.zsh-theme ]]; then
|
|
||||||
# Antigen uses eval to load things so it can change the plugin (!!)
|
|
||||||
# https://github.com/zsh-users/antigen/issues/581
|
|
||||||
__p9k_root_dir=$PWD
|
|
||||||
else
|
|
||||||
>&2 print -P '%F{red}[ERROR]%f Powerlevel10k cannot figure out its installation directory.'
|
|
||||||
>&2 print -P 'Please set %F{green}POWERLEVEL9K_INSTALLATION_DIR.%f'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
__p9k_root_dir=${${(%):-%x}:A:h}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
typeset -gr __p9k_root_dir
|
|
||||||
source $__p9k_root_dir/internal/p10k.zsh || true
|
|
||||||
}
|
|
||||||
|
|
||||||
(( ! __p9k_restore_aliases )) || setopt aliases
|
|
||||||
'builtin' 'unset' '__p9k_restore_aliases'
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.0 KiB |
@ -1 +0,0 @@
|
|||||||
prompt_powerlevel9k_setup
|
|
@ -0,0 +1 @@
|
|||||||
|
'builtin' 'source' "${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}/powerlevel10k.zsh-theme"
|
@ -1 +0,0 @@
|
|||||||
powerlevel9k.zsh-theme
|
|
@ -0,0 +1 @@
|
|||||||
|
'builtin' 'source' "${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}/powerlevel10k.zsh-theme"
|
Loading…
Reference in New Issue