1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 18:38:00 +00:00

Merge upstream/master

This commit is contained in:
Daniel Carrillo 2018-12-13 19:52:04 +01:00
commit 1a48ae2e54
8 changed files with 61 additions and 22 deletions

@ -1 +1 @@
Subproject commit d7c796719e6352666f7a9c94da9ddaed10f3217d Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60

View File

@ -12,9 +12,28 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
# Load command-not-found on Arch Linux-based distributions. # Load command-not-found on Arch Linux-based distributions.
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
source '/usr/share/doc/pkgfile/command-not-found.zsh' source '/usr/share/doc/pkgfile/command-not-found.zsh'
# Load command-not-found on macOS when homebrew tap is configured. # 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 # To avoid performance penalty, we do not use Homebrew's ruby based command
source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' # 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. # Return if requirements are not found.
else else
return 1 return 1

View File

@ -68,10 +68,11 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias gcr='git revert' alias gcr='git revert'
alias gcR='git reset "HEAD^"' alias gcR='git reset "HEAD^"'
alias gcs='git show' alias gcs='git show'
alias gpS='git show --pretty=short --show-signature'
alias gcl='git-commit-lost' alias gcl='git-commit-lost'
alias gcy='git cherry -v --abbrev' alias gcy='git cherry -v --abbrev'
alias gcY='git cherry -v' alias gcY='git cherry -v'
# Conflict (C) # Conflict (C)
alias gCl='git --no-pager diff --name-only --diff-filter=U' alias gCl='git --no-pager diff --name-only --diff-filter=U'
alias gCa='git add $(gCl)' alias gCa='git add $(gCl)'
@ -190,6 +191,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"'
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
alias glc='git shortlog --summary --numbered' alias glc='git shortlog --summary --numbered'
alias glS='git log --show-signature'
# Merge (m) # Merge (m)
alias gm='git merge' alias gm='git merge'
@ -255,6 +257,8 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
# Tag (t) # Tag (t)
alias gt='git tag' alias gt='git tag'
alias gtl='git tag -l' alias gtl='git tag -l'
alias gts='git tag -s'
alias gtv='git verify-tag'
# Working Copy (w) # Working Copy (w)
alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short' alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'

View File

@ -11,8 +11,10 @@ if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
source "$HOME/.nvm/nvm.sh" source "$HOME/.nvm/nvm.sh"
# Load package manager installed NVM into the shell session. # Load package manager installed NVM into the shell session.
elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2> /dev/null)" ]]; then elif (( $+commands[brew] )) && \
[[ -d "${nvm_prefix::="$(brew --prefix 2> /dev/null)"/opt/nvm}" ]]; then
source "$(brew --prefix nvm)/nvm.sh" source "$(brew --prefix nvm)/nvm.sh"
unset nvm_prefix
# Load manually installed nodenv into the shell session. # Load manually installed nodenv into the shell session.
elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then
@ -28,18 +30,28 @@ elif (( ! $+commands[node] )); then
return 1 return 1
fi fi
# Load NPM completion. # Load NPM and known helper completions.
if (( $+commands[npm] )); then typeset -A compl_commands=(
cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh" 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
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ if (( $+commands[$compl_command] )); then
|| ! -s "$cache_file" ]]; then cache_file="${TMPDIR:-/tmp}/prezto-$compl_command-cache.$UID.zsh"
# npm is slow; cache its output.
npm completion >! "$cache_file" 2> /dev/null # 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
command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null
fi
source "$cache_file"
unset cache_file
fi fi
done
source "$cache_file" unset compl_command{s,}
unset cache_file
fi

@ -1 +1 @@
Subproject commit 358c105de7aa5e8109788adf65c08c44e368d418 Subproject commit 2f4b15041fe31d85dc9ef705b818c3a0e6985da3

View File

@ -150,7 +150,7 @@ fi
# Load PIP completion. # Load PIP completion.
if (( $#commands[(i)pip(|[23])] )); then 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 # Detect and use one available from among 'pip', 'pip2', 'pip3' variants
pip_command="$commands[(i)pip(|[23])]" pip_command="$commands[(i)pip(|[23])]"
@ -160,10 +160,11 @@ if (( $#commands[(i)pip(|[23])] )); then
|| ! -s "$cache_file" ]]; then || ! -s "$cache_file" ]]; then
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants # pip is slow; cache its output. And also support 'pip2', 'pip3' variants
$pip_command completion --zsh \ $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 fi
source "$cache_file" source "$cache_file"
unset cache_file pip_command unset cache_file pip_command
fi fi

View File

@ -22,7 +22,7 @@ if grep -q 'xattrs' <(rsync --help 2>&1); then
fi fi
# macOS and HFS+ Enhancements # macOS and HFS+ Enhancements
# http://help.bombich.com/kb/overview/credits#opensource # https://bombich.com/kb/ccc5/credits
if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then
_rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
fi fi

View File

@ -9,6 +9,9 @@ Additionally, if this module is used in conjunction with the
*history-substring-search* module, this module must be loaded **before** the *history-substring-search* module, this module must be loaded **before** the
*history-substring-search* module. *history-substring-search* module.
To elaborate: The relative order of loading the modules would be
'syntax-highlighting', 'history-substring-search' and 'prompt'.
Contributors Contributors
------------ ------------