Merge branch 'master' of https://github.com/sorin-ionescu/prezto into patch-1
This commit is contained in:
commit
823adaa313
5 changed files with 49 additions and 19 deletions
|
@ -1 +1 @@
|
|||
Subproject commit d7c796719e6352666f7a9c94da9ddaed10f3217d
|
||||
Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60
|
|
@ -12,9 +12,28 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
|
|||
# Load command-not-found on Arch Linux-based distributions.
|
||||
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
||||
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
||||
# Load command-not-found on macOS when homebrew tap is configured.
|
||||
elif [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then
|
||||
source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh'
|
||||
# Load command-not-found on macOS when Homebrew tap is configured.
|
||||
# To avoid performance penalty, we do not use Homebrew's ruby based command
|
||||
# lookup mechanism (viz., `brew command command-not-found-init`) and instead
|
||||
# `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew.
|
||||
elif (( $+commands[brew] )); then
|
||||
cnf_command=("$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.NL+0))
|
||||
if (( $#cnf_command )); then
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh"
|
||||
|
||||
if [[ "${${(@o)cnf_command}[1]}" -nt "$cache_file" \
|
||||
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||
|| ! -s "$cache_file" ]]; then
|
||||
# brew command-not-found-init is slow; cache its output.
|
||||
brew command-not-found-init >! "$cache_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
source "$cache_file"
|
||||
|
||||
unset cache_file
|
||||
fi
|
||||
|
||||
unset cnf_command
|
||||
# Return if requirements are not found.
|
||||
else
|
||||
return 1
|
||||
|
|
|
@ -28,18 +28,28 @@ elif (( ! $+commands[node] )); then
|
|||
return 1
|
||||
fi
|
||||
|
||||
# Load NPM completion.
|
||||
if (( $+commands[npm] )); then
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh"
|
||||
# Load NPM and known helper completions.
|
||||
typeset -A compl_commands=(
|
||||
npm 'npm completion'
|
||||
grunt 'grunt --completion=zsh'
|
||||
gupl 'gulp --completion=zsh'
|
||||
)
|
||||
|
||||
if [[ "$commands[npm]" -nt "$cache_file" \
|
||||
for compl_command in "${(k)compl_commands[@]}"; do
|
||||
if (( $+commands[$compl_command] )); then
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-$compl_command-cache.$UID.zsh"
|
||||
|
||||
# Completion commands are slow; cache their output if old or missing.
|
||||
if [[ "$commands[$compl_command]" -nt "$cache_file" \
|
||||
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||
|| ! -s "$cache_file" ]]; then
|
||||
# npm is slow; cache its output.
|
||||
npm completion >! "$cache_file" 2> /dev/null
|
||||
command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
source "$cache_file"
|
||||
|
||||
unset cache_file
|
||||
fi
|
||||
done
|
||||
|
||||
unset compl_command{s,}
|
||||
|
|
2
modules/prompt/external/powerlevel9k
vendored
2
modules/prompt/external/powerlevel9k
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 358c105de7aa5e8109788adf65c08c44e368d418
|
||||
Subproject commit 2f4b15041fe31d85dc9ef705b818c3a0e6985da3
|
|
@ -144,7 +144,7 @@ fi
|
|||
|
||||
# Load PIP completion.
|
||||
if (( $#commands[(i)pip(|[23])] )); then
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-python-cache.$UID.zsh"
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-pip-cache.$UID.zsh"
|
||||
|
||||
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
|
||||
pip_command="$commands[(i)pip(|[23])]"
|
||||
|
@ -154,10 +154,11 @@ if (( $#commands[(i)pip(|[23])] )); then
|
|||
|| ! -s "$cache_file" ]]; then
|
||||
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
||||
$pip_command completion --zsh \
|
||||
| sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null
|
||||
| sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
source "$cache_file"
|
||||
|
||||
unset cache_file pip_command
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue