mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 03:29:26 +00:00
Make .zcomp* location configurable (#1842)
This commit is contained in:
@ -148,7 +148,7 @@ fi
|
||||
|
||||
# Load PIP completion.
|
||||
if (( $#commands[(i)pip(|[23])] )); then
|
||||
cache_file="${TMPDIR:-/tmp}/prezto-pip-cache.$UID.zsh"
|
||||
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pip-cache.zsh"
|
||||
|
||||
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
|
||||
pip_command="$commands[(i)pip(|[23])]"
|
||||
@ -156,6 +156,7 @@ if (( $#commands[(i)pip(|[23])] )); then
|
||||
if [[ "$pip_command" -nt "$cache_file" \
|
||||
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||
|| ! -s "$cache_file" ]]; then
|
||||
mkdir -p "$cache_file:h"
|
||||
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
||||
$pip_command completion --zsh \
|
||||
| sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \
|
||||
|
Reference in New Issue
Block a user