Skip to content

Commit

Permalink
Merge commit '8914274ca9f7b997d4a1663e0f290c691772db7f'
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Andreas Pataki committed Aug 20, 2019
2 parents 5cf7f0d + 8914274 commit 4ca33f8
Show file tree
Hide file tree
Showing 24 changed files with 148 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
[submodule "modules/prompt/external/powerlevel9k"]
path = modules/prompt/external/powerlevel9k
url = https://github.com/bhilburn/powerlevel9k.git
[submodule "modules/prompt/external/powerlevel10k"]
path = modules/prompt/external/powerlevel10k
url = https://github.com/romkatv/powerlevel10k.git
14 changes: 11 additions & 3 deletions modules/archive/functions/archive
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# function archive {

local archive_name path_to_archive _gzip_bin _bzip2_bin
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin

if (( $# < 2 )); then
cat >&2 <<EOF
Expand Down Expand Up @@ -40,7 +40,15 @@ else
_gzip_bin='gzip'
fi

if (( $+commands[pbzip2] )); then
if (( $+commands[pixz] )); then
_xz_bin='pixz'
else
_xz_bin='xz'
fi

if (( $+commands[lbzip2] )); then
_bzip2_bin='lbzip2'
elif (( $+commands[pbzip2] )); then
_bzip2_bin='pbzip2'
else
_bzip2_bin='bzip2'
Expand All @@ -49,7 +57,7 @@ fi
case "${archive_name}" in
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${=path_to_archive}" ;;
(*.tar.xz|*.txz) tar -cvf "${archive_name}" --use-compress-program="${_xz_bin}" "${=path_to_archive}" ;;
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;
Expand Down
36 changes: 29 additions & 7 deletions modules/archive/functions/unarchive
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local success
local file_name
local file_path
local extract_dir
local _gzip_bin _bzip2_bin _xz_bin

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

# here, we check for dropin/multi-threaded replacements
# this should eventually be moved to modules/archive/init.zsh
# as a global alias
if (( $+commands[pigz] )); then
_gzip_bin='pigz'
else
_gzip_bin='gzip'
fi

if (( $+commands[pixz] )); then
_xz_bin='pixz'
else
_xz_bin='xz'
fi

if (( $+commands[lbzip2] )); then
_bzip2_bin='lbzip2'
elif (( $+commands[pbzip2] )); then
_bzip2_bin='pbzip2'
else
_bzip2_bin='bzip2'
fi

while (( $# > 0 )); do
if [[ ! -s "$1" ]]; then
print "$0: file not valid: $1" >&2
Expand All @@ -42,15 +66,13 @@ while (( $# > 0 )); do
file_path="${1:A}"
extract_dir="${file_name:r}"
case "$1:l" in
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
&& tar --xz -xvf "$1" \
|| xzcat "$1" | tar xvf - ;;
(*.tar.gz|*.tgz) tar -xvf "$1" --use-compress-program="${_gzip_bin}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -xvf "$1" --use-compress-program="${_bzip2_bin}" ;;
(*.tar.xz|*.txz) tar -xvf "$1" --use-compress-program="${_xz_bin}" ;;
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
|| lzcat "$1" | tar -xvf - ;;
(*.tar) tar -xvf "$1" ;;
(*.gz) gunzip "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
Expand Down
48 changes: 27 additions & 21 deletions modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,32 @@ function bindkey-all {
# Exposes information about the Zsh Line Editor via the $editor_info associative
# array.
function editor-info {
# Clean up previous $editor_info.
unset editor_info
typeset -gA editor_info

if [[ "$KEYMAP" == 'vicmd' ]]; then
zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY'
editor_info[keymap]="$REPLY"
else
zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY'
editor_info[keymap]="$REPLY"

if [[ "$ZLE_STATE" == *overwrite* ]]; then
zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY'
editor_info[overwrite]="$REPLY"
# Ensure that we're going to set the editor-info for prompts that
# are prezto managed and/or compatible.
if zstyle -t ':prezto:module:prompt' managed; then
# Clean up previous $editor_info.
unset editor_info
typeset -gA editor_info

if [[ "$KEYMAP" == 'vicmd' ]]; then
zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY'
editor_info[keymap]="$REPLY"
else
zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY'
editor_info[overwrite]="$REPLY"
zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY'
editor_info[keymap]="$REPLY"

if [[ "$ZLE_STATE" == *overwrite* ]]; then
zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY'
editor_info[overwrite]="$REPLY"
else
zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY'
editor_info[overwrite]="$REPLY"
fi
fi
fi

unset REPLY
zle zle-reset-prompt
unset REPLY
zle zle-reset-prompt
fi
}
zle -N editor-info

Expand Down Expand Up @@ -269,9 +273,11 @@ bindkey -d
# Emacs Key Bindings
#

for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}"
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" \
"${key_info[Escape]}${key_info[Left]}"
bindkey -M emacs "$key" emacs-backward-word
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}"
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" \
"${key_info[Escape]}${key_info[Right]}"
bindkey -M emacs "$key" emacs-forward-word

# Kill to the beginning of the line.
Expand Down
2 changes: 1 addition & 1 deletion modules/node/functions/node-info
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ elif (( $+commands[node] )) ; then
version="${$(node -v)#v}"
fi

if [[ "$version" != (none|) ]]; then
if [[ "$version" != (none|system) ]]; then
zstyle -s ':prezto:module:node:info:version' format 'version_format'
zformat -f version_formatted "$version_format" "v:$version"
node_info[version]="$version_formatted"
Expand Down
16 changes: 16 additions & 0 deletions modules/prompt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ A prompt theme is an autoloadable function file with a special name,
project, themes **should** be placed in the *modules/prompt/functions*
directory.

### Required Variables

To ensure that your function works with the editor-info module you'll need to
set the following variable:

```
# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'
```

This is to ensure compatibility with outside prompts, while allowing prezto
and prezto-compatible prompts to take full advantage of the editor module.
This should be set in the `prompt_name_setup` function after you've added
any additional hooks with `add-zsh-hook precmd prompt_name_precmd`. See below
for additional information about functions and hooks.

### Theme Functions

There are three theme functions, a setup function, a help function, and
Expand Down
2 changes: 1 addition & 1 deletion modules/prompt/external/async
Submodule async updated 2 files
+6 −1 .travis.yml
+18 −2 async.zsh
1 change: 1 addition & 0 deletions modules/prompt/external/powerlevel10k
Submodule powerlevel10k added at 3090ae
1 change: 1 addition & 0 deletions modules/prompt/functions/prompt-pwd
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ unset current_pwd
print "$ret_directory"

# }
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_cloud_setup
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ function prompt_cloud_setup {
# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_cloud_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set git-info parameters.
zstyle ':prezto:module:git:info' verbose 'yes'
zstyle ':prezto:module:git:info:dirty' format "%%B%F{$secondary_color}]%f%%b %F{yellow}⚡%f"
Expand All @@ -119,3 +122,4 @@ function prompt_cloud_setup {
}

prompt_cloud_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_damoekri_setup
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function prompt_damoekri_setup {
# Add hook for calling git-info and ruby-info before each command.
add-zsh-hook precmd prompt_damoekri_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:keymap:primary' format ' %F{green}»%f'

Expand All @@ -63,3 +66,4 @@ function prompt_damoekri_setup {
}

prompt_damoekri_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_giddie_setup
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function prompt_giddie_setup {
# Add hook to set up prompt parameters before each command.
add-zsh-hook precmd prompt_giddie_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%F{green}...%f'
zstyle ':prezto:module:editor:info:keymap:alternate' format '%F{yellow}--- COMMAND ---%f'
Expand Down Expand Up @@ -74,3 +77,4 @@ function prompt_giddie_setup {
}

prompt_giddie_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_kylewest_setup
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function prompt_kylewest_setup {
# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_kylewest_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b'
zstyle ':prezto:module:editor:info:keymap:primary' format "%B%F{green}❯%f%b"
Expand All @@ -63,3 +66,4 @@ function prompt_kylewest_setup {
}

prompt_kylewest_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_minimal_setup
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function prompt_minimal_setup {
# Add hook for calling vcs_info before each command.
add-zsh-hook precmd prompt_minimal_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set vcs_info parameters.
zstyle ':vcs_info:*' enable bzr git hg svn
zstyle ':vcs_info:*' check-for-changes true
Expand All @@ -57,3 +60,4 @@ function prompt_minimal_preview {
}

prompt_minimal_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_nicoulaj_setup
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function prompt_nicoulaj_setup {
# Add hook for calling vcs_info before each command.
add-zsh-hook precmd prompt_nicoulaj_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Customizable parameters.
local max_path_chars=30
local user_char=''
Expand All @@ -58,3 +61,4 @@ function prompt_nicoulaj_setup {
}

prompt_nicoulaj_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_paradox_setup
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function prompt_paradox_setup {
add-zsh-hook preexec prompt_paradox_preexec
add-zsh-hook precmd prompt_paradox_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b'
zstyle ':prezto:module:editor:info:keymap:primary' format '%B%F{blue}❯%f%b'
Expand Down Expand Up @@ -154,3 +157,4 @@ ${(e)$(prompt_paradox_build_prompt)}
}

prompt_paradox_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_peepcode_setup
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function prompt_peepcode_setup {
# Add a hook for calling info functions before each command.
add-zsh-hook precmd prompt_peepcode_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set git-info parameters.
zstyle ':prezto:module:git:info' verbose 'no'
zstyle ':prezto:module:git:info:action' format ' +%s'
Expand Down Expand Up @@ -83,3 +86,4 @@ function prompt_peepcode_preview {
}

prompt_peepcode_setup "$@"
# vim: ft=zsh
1 change: 1 addition & 0 deletions modules/prompt/functions/prompt_powerlevel10k_setup
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_skwp_setup
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function prompt_skwp_setup {
# Add hook to set up prompt parameters before each command.
add-zsh-hook precmd prompt_skwp_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Use extended color pallete if available.
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
_prompt_skwp_colors=(
Expand Down Expand Up @@ -73,3 +76,4 @@ function prompt_skwp_setup {
}

prompt_skwp_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_smiley_setup
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function prompt_smiley_setup {
# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_smiley_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b'

Expand All @@ -63,3 +66,4 @@ function prompt_smiley_setup {
}

prompt_smiley_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_sorin_setup
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ function prompt_sorin_setup {
# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_sorin_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{7}...%f%b'
zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{1}❯%F{3}❯%F{2}❯%f%b'
Expand Down Expand Up @@ -176,3 +179,4 @@ function prompt_sorin_preview {
}

prompt_sorin_setup "$@"
# vim: ft=zsh
4 changes: 4 additions & 0 deletions modules/prompt/functions/prompt_steeef_setup
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function prompt_steeef_setup {
# Add hook for calling vcs_info before each command.
add-zsh-hook precmd prompt_steeef_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Use extended color pallete if available.
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
_prompt_steeef_colors=(
Expand Down Expand Up @@ -104,3 +107,4 @@ function prompt_steeef_preview {
}

prompt_steeef_setup "$@"
# vim: ft=zsh
Loading

0 comments on commit 4ca33f8

Please sign in to comment.