diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index d7c7967..a7f0106 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit d7c796719e6352666f7a9c94da9ddaed10f3217d +Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60 diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index 2c59a4b..bcb0dea 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -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 diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index dde5b35..4e4f482 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -68,10 +68,11 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias gcr='git revert' alias gcR='git reset "HEAD^"' alias gcs='git show' + alias gpS='git show --pretty=short --show-signature' alias gcl='git-commit-lost' alias gcy='git cherry -v --abbrev' alias gcY='git cherry -v' - + # Conflict (C) alias gCl='git --no-pager diff --name-only --diff-filter=U' 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 glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' alias glc='git shortlog --summary --numbered' + alias glS='git log --show-signature' # Merge (m) alias gm='git merge' @@ -255,6 +257,8 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then # Tag (t) alias gt='git tag' alias gtl='git tag -l' + alias gts='git tag -s' + alias gtv='git verify-tag' # Working Copy (w) alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short' diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 0a516f0..f452ec5 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -11,8 +11,10 @@ if [[ -s "$HOME/.nvm/nvm.sh" ]]; then source "$HOME/.nvm/nvm.sh" # 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" + unset nvm_prefix # Load manually installed nodenv into the shell session. elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then @@ -28,18 +30,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" \ - || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ! -s "$cache_file" ]]; then - # npm is slow; cache its output. - npm completion >! "$cache_file" 2> /dev/null +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 + command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null + fi + + source "$cache_file" + + unset cache_file fi +done - source "$cache_file" - - unset cache_file -fi +unset compl_command{s,} diff --git a/modules/prompt/external/powerlevel9k b/modules/prompt/external/powerlevel9k index 358c105..2f4b150 160000 --- a/modules/prompt/external/powerlevel9k +++ b/modules/prompt/external/powerlevel9k @@ -1 +1 @@ -Subproject commit 358c105de7aa5e8109788adf65c08c44e368d418 +Subproject commit 2f4b15041fe31d85dc9ef705b818c3a0e6985da3 diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 9796294..d61488e 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -150,7 +150,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])]" @@ -160,10 +160,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 diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index 3618812..b3010ed 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -22,7 +22,7 @@ if grep -q 'xattrs' <(rsync --help 2>&1); then fi # 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 _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" fi diff --git a/modules/syntax-highlighting/README.md b/modules/syntax-highlighting/README.md index 7a28892..7a5a30c 100644 --- a/modules/syntax-highlighting/README.md +++ b/modules/syntax-highlighting/README.md @@ -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. +To elaborate: The relative order of loading the modules would be +'syntax-highlighting', 'history-substring-search' and 'prompt'. + Contributors ------------