1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-23 23:51:58 +00:00

Merge branch 'master' into dynamic

This commit is contained in:
romkatv 2019-11-05 13:09:51 +01:00
commit 8231995ed5
15 changed files with 83 additions and 10 deletions

5
.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
* text=auto
*.zsh text eol=lf
*.zsh-theme text eol=lf
/prompt_powerlevel9k_setup text eol=lf
/prompt_powerlevel10k_setup text eol=lf

View file

@ -65,6 +65,7 @@
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
# vpn_ip # virtual private network indicator
# ram # free RAM
# load # CPU load
@ -512,6 +513,23 @@
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
# Text and color for normal (a.k.a. command) vi mode.
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL
typeset -g POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND=106
# Text and color for visual vi mode.
typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL
typeset -g POWERLEVEL9K_VI_MODE_VISUAL_FOREGROUND=68
# Text and color for overtype (a.k.a. overwrite and replace) vi mode.
typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE
typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_FOREGROUND=172
# Text and color for insert vi mode.
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=66
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################################[ ram: free RAM ]#######################################
# RAM color.
typeset -g POWERLEVEL9K_RAM_FOREGROUND=66

View file

@ -65,6 +65,7 @@
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
# vpn_ip # virtual private network indicator
# ram # free RAM
# load # CPU load
@ -511,6 +512,22 @@
# Custom icon.
# typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
# Foreground color.
typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0
# Text and color for normal (a.k.a. command) vi mode.
typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL
typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2
# Text and color for visual vi mode.
typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL
typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4
# Text and color for overtype (a.k.a. overwrite and replace) vi mode.
typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE
typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3
# Text and color for insert vi mode.
typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8
######################################[ ram: free RAM ]#######################################
# RAM color.
# typeset -g POWERLEVEL9K_RAM_FOREGROUND=0

Binary file not shown.

View file

@ -273,10 +273,19 @@ function _gitstatus_process_response() {
# -d INT Report at most this many untracked files; negative value means infinity.
# Defaults to 1.
#
# -m INT If a repo has more files in its index than this, override -u and -d (but not -s)
# with zeros. Negative value means infinity. Defaults to -1.
# -m INT Report -1 unstaged, untracked and conflicted if there are more than this many
# files in the index. Negative value means infinity. Defaults to -1.
#
# -e Count files within untracked directories like `git status --untracked-files`.
#
# -U Unless this option is specified, report zero untracked files for repositories
# with status.showUntrackedFiles = false.
#
# -W Unless this option is specified, report zero untracked files for repositories
# with bash.showUntrackedFiles = false.
#
# -D Unless this option is specified, report zero staged, unstaged and conflicted
# changes for repositories with bash.showDirtyState = false.
function gitstatus_start() {
emulate -L zsh
setopt err_return no_unset no_bg_nice
@ -289,9 +298,9 @@ function gitstatus_start() {
local -i max_num_untracked=1
local -i dirty_max_index_size=-1
local -i async
local recurse_untracked_dirs
local -a extra_flags=()
while true; do
getopts "t:s:u:c:d:m:ea" opt || break
getopts "t:s:u:c:d:m:eaUWD" opt || break
case $opt in
a) async=1;;
t) timeout=$OPTARG;;
@ -300,8 +309,14 @@ function gitstatus_start() {
c) max_num_conflicted=$OPTARG;;
d) max_num_untracked=$OPTARG;;
m) dirty_max_index_size=$OPTARG;;
e) recurse_untracked_dirs='--recurse-untracked-dirs';;
+e) recurse_untracked_dirs=;;
e) extra_flags+='--recurse-untracked-dirs';;
+e) extra_flags=(${(@)extra_flags:#--recurse-untracked-dirs});;
U) extra_flags+='--ignore-status-show-untracked-files';;
+U) extra_flags=(${(@)extra_flags:#--ignore-status-show-untracked-files});;
W) extra_flags+='--ignore-bash-show-untracked-files';;
+W) extra_flags=(${(@)extra_flags:#--ignore-bash-show-untracked-files});;
D) extra_flags+='--ignore-bash-show-dirty-state';;
+D) extra_flags=(${(@)extra_flags:#--ignore-bash-show-dirty-state});;
?) return 1;;
esac
done
@ -346,6 +361,7 @@ function gitstatus_start() {
[[ -n $daemon ]] || {
os="$(uname -s)" && [[ -n $os ]]
[[ $os != Linux || "$(uname -o)" != Android ]] || os=Android
[[ $os != (MINGW64_NT-10.0|MSYS_NT-10.0-*) ]] || os=MSYS_NT-10.0
local arch && arch="$(uname -m)" && [[ -n $arch ]]
daemon=$_gitstatus_plugin_dir/bin/gitstatusd-${os:l}-${arch:l}
}
@ -380,7 +396,7 @@ function gitstatus_start() {
--max-num-untracked=${(q)max_num_untracked}
--dirty-max-index-size=${(q)dirty_max_index_size}
--log-level=${(q)log_level:-INFO}
$recurse_untracked_dirs)
$extra_flags)
local cmd="
exec >&4

View file

@ -3432,6 +3432,8 @@ function _p9k_set_iface() {
function _p9k_build_segment() {
_p9k_segment_name=${_p9k_segment_name%_joined}
local disabled=POWERLEVEL9K_${(U)_p9k_segment_name}_DISABLED_DIR_PATTERN
[[ $_p9k_pwd == ${(P)~disabled} ]] && return
if [[ $_p9k_segment_name == custom_* ]]; then
_p9k_custom_prompt $_p9k_segment_name[8,-1]
elif (( $+functions[prompt_$_p9k_segment_name] )); then
@ -3442,6 +3444,8 @@ function _p9k_build_segment() {
function _p9k_build_instant_segment() {
_p9k_segment_name=${_p9k_segment_name%_joined}
local disabled=POWERLEVEL9K_${(U)_p9k_segment_name}_DISABLED_DIR_PATTERN
[[ $_p9k_pwd == ${(P)~disabled} ]] && return
if (( $+functions[instant_prompt_$_p9k_segment_name] )); then
local -i len=$#_p9k__prompt
_p9k_non_hermetic_expansion=0
@ -5428,7 +5432,13 @@ _p9k_init_vcs() {
local daemon=${GITSTATUS_DAEMON}
if [[ -z $daemon ]]; then
daemon=$gitstatus_dir/bin/gitstatusd-
[[ $_p9k_uname_o == Android ]] && daemon+=android || daemon+=${_p9k_uname:l}
if [[ $_p9k_uname_o == Android ]]; then
daemon+=android
elif [[ $_p9k_uname == (MINGW_64-10.0|MSYS_NT-10.0-*) ]]; then
daemon+=msys_nt-10.0
else
daemon+=${_p9k_uname:l}
fi
daemon+=-${_p9k_uname_m:l}
fi
local -i threads=${GITSTATUS_NUM_THREADS:-0}

View file

@ -1368,8 +1368,8 @@ function ask_zshrc_edit() {
cp -p $__p9k_zshrc $zshrc_backup || quit -c
print -r -- $zshrc_content >$zshrc_backup || quit -c
zshrc_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)zshrc_backup:t}
break
fi
break
;;
esac
done
@ -1538,12 +1538,19 @@ function generate_config() {
sub MULTILINE_FIRST_PROMPT_PREFIX ''
sub MULTILINE_NEWLINE_PROMPT_PREFIX ''
sub MULTILINE_LAST_PROMPT_PREFIX ''
uncomment prompt_char
sub STATUS_OK false
sub STATUS_ERROR false
fi
fi
if [[ $style == (classic|rainbow) ]]; then
if (( num_lines == 2 && ! left_frame )); then
uncomment prompt_char
else
uncomment vi_mode
fi
fi
(( empty_line )) && sub PROMPT_ADD_NEWLINE true || sub PROMPT_ADD_NEWLINE false
sub INSTANT_PROMPT $instant_prompt