Skip to content

Commit 4ca33f8

Browse files
author
Andreas Pataki
committed
Merge commit '8914274ca9f7b997d4a1663e0f290c691772db7f'
* commit '8914274ca9f7b997d4a1663e0f290c691772db7f': prompt: update zsh-async to fix an infinite loop (sorin-ionescu#1734) syntax-highlighting: update external dependency prompt: update powerlevel10k submodule to the latest commit prompt: update powerlevel10k submodule to the latest commit prompt: update powerlevel10k submodule to the latest commit Resolves 1641 - Checks whether the prompt is set to be managed or not. (sorin-ionescu#1723) prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1727) prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1726) prompt: update powerlevel10k submodule to the latest commit (sorin-ionescu#1717) prompt: update powerlevel10k submodule (sorin-ionescu#1715) prompt: update powerlevel10k to latest commit Add powerlevel10k theme (sorin-ionescu#1695) Update zsh-autosuggestions submodule Disable node-info output when value is system. Add zstyle option to disable zsh option CORRECT archive: enhance parallel operations editor: allow alt+arrow keys for word movement (sorin-ionescu#1688)
2 parents 5cf7f0d + 8914274 commit 4ca33f8

24 files changed

+148
-34
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@
2828
[submodule "modules/prompt/external/powerlevel9k"]
2929
path = modules/prompt/external/powerlevel9k
3030
url = https://github.com/bhilburn/powerlevel9k.git
31+
[submodule "modules/prompt/external/powerlevel10k"]
32+
path = modules/prompt/external/powerlevel10k
33+
url = https://github.com/romkatv/powerlevel10k.git

modules/archive/functions/archive

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# function archive {
1010

11-
local archive_name path_to_archive _gzip_bin _bzip2_bin
11+
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin
1212

1313
if (( $# < 2 )); then
1414
cat >&2 <<EOF
@@ -40,7 +40,15 @@ else
4040
_gzip_bin='gzip'
4141
fi
4242

43-
if (( $+commands[pbzip2] )); then
43+
if (( $+commands[pixz] )); then
44+
_xz_bin='pixz'
45+
else
46+
_xz_bin='xz'
47+
fi
48+
49+
if (( $+commands[lbzip2] )); then
50+
_bzip2_bin='lbzip2'
51+
elif (( $+commands[pbzip2] )); then
4452
_bzip2_bin='pbzip2'
4553
else
4654
_bzip2_bin='bzip2'
@@ -49,7 +57,7 @@ fi
4957
case "${archive_name}" in
5058
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
5159
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
52-
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${=path_to_archive}" ;;
60+
(*.tar.xz|*.txz) tar -cvf "${archive_name}" --use-compress-program="${_xz_bin}" "${=path_to_archive}" ;;
5361
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
5462
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
5563
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;

modules/archive/functions/unarchive

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ local success
1212
local file_name
1313
local file_path
1414
local extract_dir
15+
local _gzip_bin _bzip2_bin _xz_bin
1516

1617
if (( $# == 0 )); then
1718
cat >&2 <<EOF
@@ -30,6 +31,29 @@ if [[ "$1" == "-r" || "$1" == "--remove" ]]; then
3031
shift
3132
fi
3233

34+
# here, we check for dropin/multi-threaded replacements
35+
# this should eventually be moved to modules/archive/init.zsh
36+
# as a global alias
37+
if (( $+commands[pigz] )); then
38+
_gzip_bin='pigz'
39+
else
40+
_gzip_bin='gzip'
41+
fi
42+
43+
if (( $+commands[pixz] )); then
44+
_xz_bin='pixz'
45+
else
46+
_xz_bin='xz'
47+
fi
48+
49+
if (( $+commands[lbzip2] )); then
50+
_bzip2_bin='lbzip2'
51+
elif (( $+commands[pbzip2] )); then
52+
_bzip2_bin='pbzip2'
53+
else
54+
_bzip2_bin='bzip2'
55+
fi
56+
3357
while (( $# > 0 )); do
3458
if [[ ! -s "$1" ]]; then
3559
print "$0: file not valid: $1" >&2
@@ -42,15 +66,13 @@ while (( $# > 0 )); do
4266
file_path="${1:A}"
4367
extract_dir="${file_name:r}"
4468
case "$1:l" in
45-
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
46-
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
47-
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
48-
&& tar --xz -xvf "$1" \
49-
|| xzcat "$1" | tar xvf - ;;
69+
(*.tar.gz|*.tgz) tar -xvf "$1" --use-compress-program="${_gzip_bin}" ;;
70+
(*.tar.bz2|*.tbz|*.tbz2) tar -xvf "$1" --use-compress-program="${_bzip2_bin}" ;;
71+
(*.tar.xz|*.txz) tar -xvf "$1" --use-compress-program="${_xz_bin}" ;;
5072
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
5173
&& tar --lzma -xvf "$1" \
52-
|| lzcat "$1" | tar xvf - ;;
53-
(*.tar) tar xvf "$1" ;;
74+
|| lzcat "$1" | tar -xvf - ;;
75+
(*.tar) tar -xvf "$1" ;;
5476
(*.gz) gunzip "$1" ;;
5577
(*.bz2) bunzip2 "$1" ;;
5678
(*.xz) unxz "$1" ;;

modules/editor/init.zsh

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,32 @@ function bindkey-all {
9191
# Exposes information about the Zsh Line Editor via the $editor_info associative
9292
# array.
9393
function editor-info {
94-
# Clean up previous $editor_info.
95-
unset editor_info
96-
typeset -gA editor_info
97-
98-
if [[ "$KEYMAP" == 'vicmd' ]]; then
99-
zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY'
100-
editor_info[keymap]="$REPLY"
101-
else
102-
zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY'
103-
editor_info[keymap]="$REPLY"
104-
105-
if [[ "$ZLE_STATE" == *overwrite* ]]; then
106-
zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY'
107-
editor_info[overwrite]="$REPLY"
94+
# Ensure that we're going to set the editor-info for prompts that
95+
# are prezto managed and/or compatible.
96+
if zstyle -t ':prezto:module:prompt' managed; then
97+
# Clean up previous $editor_info.
98+
unset editor_info
99+
typeset -gA editor_info
100+
101+
if [[ "$KEYMAP" == 'vicmd' ]]; then
102+
zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY'
103+
editor_info[keymap]="$REPLY"
108104
else
109-
zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY'
110-
editor_info[overwrite]="$REPLY"
105+
zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY'
106+
editor_info[keymap]="$REPLY"
107+
108+
if [[ "$ZLE_STATE" == *overwrite* ]]; then
109+
zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY'
110+
editor_info[overwrite]="$REPLY"
111+
else
112+
zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY'
113+
editor_info[overwrite]="$REPLY"
114+
fi
111115
fi
112-
fi
113116

114-
unset REPLY
115-
zle zle-reset-prompt
117+
unset REPLY
118+
zle zle-reset-prompt
119+
fi
116120
}
117121
zle -N editor-info
118122

@@ -269,9 +273,11 @@ bindkey -d
269273
# Emacs Key Bindings
270274
#
271275

272-
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}"
276+
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" \
277+
"${key_info[Escape]}${key_info[Left]}"
273278
bindkey -M emacs "$key" emacs-backward-word
274-
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}"
279+
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" \
280+
"${key_info[Escape]}${key_info[Right]}"
275281
bindkey -M emacs "$key" emacs-forward-word
276282

277283
# Kill to the beginning of the line.

modules/node/functions/node-info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elif (( $+commands[node] )) ; then
2323
version="${$(node -v)#v}"
2424
fi
2525

26-
if [[ "$version" != (none|) ]]; then
26+
if [[ "$version" != (none|system) ]]; then
2727
zstyle -s ':prezto:module:node:info:version' format 'version_format'
2828
zformat -f version_formatted "$version_format" "v:$version"
2929
node_info[version]="$version_formatted"

modules/prompt/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ A prompt theme is an autoloadable function file with a special name,
4343
project, themes **should** be placed in the *modules/prompt/functions*
4444
directory.
4545

46+
### Required Variables
47+
48+
To ensure that your function works with the editor-info module you'll need to
49+
set the following variable:
50+
51+
```
52+
# Tell prezto we can manage this prompt
53+
zstyle ':prezto:module:prompt' managed 'yes'
54+
```
55+
56+
This is to ensure compatibility with outside prompts, while allowing prezto
57+
and prezto-compatible prompts to take full advantage of the editor module.
58+
This should be set in the `prompt_name_setup` function after you've added
59+
any additional hooks with `add-zsh-hook precmd prompt_name_precmd`. See below
60+
for additional information about functions and hooks.
61+
4662
### Theme Functions
4763

4864
There are three theme functions, a setup function, a help function, and

modules/prompt/external/async

Submodule powerlevel10k added at 3090ae6

modules/prompt/functions/prompt-pwd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ unset current_pwd
2828
print "$ret_directory"
2929

3030
# }
31+
# vim: ft=zsh

modules/prompt/functions/prompt_cloud_setup

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ function prompt_cloud_setup {
104104
# Add hook for calling git-info before each command.
105105
add-zsh-hook precmd prompt_cloud_precmd
106106

107+
# Tell prezto we can manage this prompt
108+
zstyle ':prezto:module:prompt' managed 'yes'
109+
107110
# Set git-info parameters.
108111
zstyle ':prezto:module:git:info' verbose 'yes'
109112
zstyle ':prezto:module:git:info:dirty' format "%%B%F{$secondary_color}]%f%%b %F{yellow}⚡%f"
@@ -119,3 +122,4 @@ function prompt_cloud_setup {
119122
}
120123

121124
prompt_cloud_setup "$@"
125+
# vim: ft=zsh

0 commit comments

Comments
 (0)