From d955fbdeb729ed038ffa7af16c1cf82dd68aff1e Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 6 Mar 2020 17:40:32 +0100 Subject: [PATCH 01/25] prompt: update powerlevel10k submodule to v1.3.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.3.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index cb3f58d21f..7306efb94b 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit cb3f58d21f643d26d71f520d61a592816cca3edf +Subproject commit 7306efb94ba739f714972038ad74c48d2bebfdd6 From cfeb8cd6c9f60c2a928f4c706d0137c7de2ef106 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 16 Mar 2020 08:34:02 +0100 Subject: [PATCH 02/25] prompt: update powerlevel10k submodule to v1.4.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.4.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index 7306efb94b..d53355cd30 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 7306efb94ba739f714972038ad74c48d2bebfdd6 +Subproject commit d53355cd30acf8888bc1cf5caccea52f486c5584 From 1b99be879c84be12364ca9d1db553de61fd5586e Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 19 Mar 2020 11:19:25 -0700 Subject: [PATCH 03/25] Update syntax-highlighting module --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 35c8690c00..932e29a0c7 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 35c8690c0025ceef9584f64da86ced3a72ee32b6 +Subproject commit 932e29a0c75411cb618f02995b66c0a4a25699bc From f4ca9ebfc913453f98ba6912a8c42684fd742cc1 Mon Sep 17 00:00:00 2001 From: Kaspar Vollenweider Date: Thu, 13 Feb 2020 09:56:29 +0100 Subject: [PATCH 04/25] feat(helper): add os-type helper functions Add the following functions: - is-darwin - is-linux - is-bsd - is-cygwin And apply them everywhere I found code doing that what these functions do. --- modules/haskell/init.zsh | 2 +- modules/helper/init.zsh | 20 ++++++++++++++++++++ modules/homebrew/init.zsh | 2 +- modules/macports/init.zsh | 2 +- modules/osx/init.zsh | 2 +- modules/perl/init.zsh | 2 +- modules/python/init.zsh | 2 +- modules/rsync/init.zsh | 2 +- modules/utility/init.zsh | 6 +++--- 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/modules/haskell/init.zsh b/modules/haskell/init.zsh index c1c78ca2a0..7863528a72 100644 --- a/modules/haskell/init.zsh +++ b/modules/haskell/init.zsh @@ -11,7 +11,7 @@ if (( ! $+commands[ghc] )); then fi # Prepend Cabal per user directories to PATH. -if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then +if is-darwin && [[ -d $HOME/Library/Haskell ]]; then path=($HOME/Library/Haskell/bin(/N) $path) else path=($HOME/.cabal/bin(/N) $path) diff --git a/modules/helper/init.zsh b/modules/helper/init.zsh index 328bed4f71..6e83f89a18 100644 --- a/modules/helper/init.zsh +++ b/modules/helper/init.zsh @@ -29,3 +29,23 @@ function coalesce { done return 1 } + +# is true on MacOS Darwin +function is-darwin { + [[ "$OSTYPE" == darwin* ]] +} + +# is true on Linux's +function is-linux { + [[ "$OSTYPE" == linux* ]] +} + +# is true on BSD's +function is-bsd { + [[ "$OSTYPE" == *bsd* ]] +} + +# is true on Cygwin (Windows) +function is-cygwin { + [[ "$OSTYPE" == cygwin* ]] +} diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 9f7e0b4646..6605426f4f 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != (darwin|linux)* ]]; then +if ! is-darwin || ! is-linux; then return 1 fi diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index d55744a875..943ff5bad6 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -7,7 +7,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then +if ! is-darwin; then return 1 fi diff --git a/modules/osx/init.zsh b/modules/osx/init.zsh index f7871ca718..2b74d3ad11 100644 --- a/modules/osx/init.zsh +++ b/modules/osx/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then +if ! is-darwin; then return 1 fi diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index b7a794797a..50e9b64ff2 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -37,7 +37,7 @@ fi # Local Module Installation # -if [[ "$OSTYPE" == darwin* ]]; then +if is-darwin; then # Perl is slow; cache its output. cache_file="${TMPDIR:-/tmp}/prezto-perl-cache.$UID.zsh" perl_path="$HOME/Library/Perl/5.12" diff --git a/modules/python/init.zsh b/modules/python/init.zsh index e5967f7aa8..a7e8b6e8af 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -22,7 +22,7 @@ elif (( $+commands[pyenv] )); then else if [[ -n "$PYTHONUSERBASE" ]]; then path=($PYTHONUSERBASE/bin $path) - elif [[ "$OSTYPE" == darwin* ]]; then + elif is-darwin; then path=($HOME/Library/Python/*/bin(N) $path) else # This is subject to change. diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index b3010ede32..f2eb89132f 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -23,7 +23,7 @@ fi # macOS and HFS+ Enhancements # https://bombich.com/kb/ccc5/credits -if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then +if is-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/utility/init.zsh b/modules/utility/init.zsh index a2e5c2bdfe..caa0ec8d41 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -134,9 +134,9 @@ if zstyle -t ':prezto:module:utility:grep' color; then fi # macOS Everywhere -if [[ "$OSTYPE" == darwin* ]]; then +if is-darwin; then alias o='open' -elif [[ "$OSTYPE" == cygwin* ]]; then +elif is-cygwin; then alias o='cygstart' alias pbcopy='tee > /dev/clipboard' alias pbpaste='cat /dev/clipboard' @@ -166,7 +166,7 @@ fi alias df='df -kh' alias du='du -kh' -if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then +if is-darwin || is-bsd; then alias topc='top -o cpu' alias topm='top -o vsize' else From f479f37ead5476c1c5029ed7476375cb7eed562f Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 22 Mar 2020 17:31:35 +0100 Subject: [PATCH 05/25] prompt: update powerlevel10k submodule to v1.5.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.5.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index d53355cd30..6a0e7523b2 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit d53355cd30acf8888bc1cf5caccea52f486c5584 +Subproject commit 6a0e7523b232d02854008405a3645031c848922b From d5bef142d44138e18865199df0e4e81aa8bdd792 Mon Sep 17 00:00:00 2001 From: Charith Amarasinghe <995136+char8@users.noreply.github.com> Date: Sun, 29 Mar 2020 20:49:35 +0100 Subject: [PATCH 06/25] Fix missing dependency on helper module for helpers added in #1793 (#1811) PR #1793 introduced helper functions for OS detection in some modules. These helpers require a module dependency on the 'helper' module. --- modules/haskell/init.zsh | 3 +++ modules/macports/init.zsh | 3 +++ modules/osx/init.zsh | 3 +++ modules/perl/init.zsh | 3 +++ modules/python/init.zsh | 3 +++ modules/rsync/init.zsh | 3 +++ 6 files changed, 18 insertions(+) diff --git a/modules/haskell/init.zsh b/modules/haskell/init.zsh index 7863528a72..cb76864122 100644 --- a/modules/haskell/init.zsh +++ b/modules/haskell/init.zsh @@ -10,6 +10,9 @@ if (( ! $+commands[ghc] )); then return 1 fi +# Load dependencies. +pmodload 'helper' + # Prepend Cabal per user directories to PATH. if is-darwin && [[ -d $HOME/Library/Haskell ]]; then path=($HOME/Library/Haskell/bin(/N) $path) diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index 943ff5bad6..7bf4ab2940 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -6,6 +6,9 @@ # Sorin Ionescu # +# Load dependencies. +pmodload 'helper' + # Return if requirements are not found. if ! is-darwin; then return 1 diff --git a/modules/osx/init.zsh b/modules/osx/init.zsh index 2b74d3ad11..62f219437b 100644 --- a/modules/osx/init.zsh +++ b/modules/osx/init.zsh @@ -5,6 +5,9 @@ # Sorin Ionescu # +# Load dependencies. +pmodload 'helper' + # Return if requirements are not found. if ! is-darwin; then return 1 diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 50e9b64ff2..8f097f6cac 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -10,6 +10,9 @@ if (( ! $+commands[perl] )); then return 1 fi +# Load dependencies. +pmodload 'helper' + # # Load Perlbrew or plenv # diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a7e8b6e8af..809ab406e9 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -7,6 +7,9 @@ # Patrick Bos # +# Load dependencies +pmodload 'helper' + # Load manually installed pyenv into the path if [[ -s "${PYENV_ROOT:=$HOME/.pyenv}/bin/pyenv" ]]; then path=("${PYENV_ROOT}/bin" $path) diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index f2eb89132f..79432c1251 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -10,6 +10,9 @@ if (( ! $+commands[rsync] )); then return 1 fi +# Load dependencies. +pmodload 'helper' + # # Aliases # From 5b03d7fa32cae51cee7903d3338f87c2d7d89657 Mon Sep 17 00:00:00 2001 From: Ackerley Tng Date: Mon, 30 Mar 2020 03:51:11 +0800 Subject: [PATCH 07/25] prompt: fix usage of zsh-async in sorin prompt (#1810) --- modules/prompt/functions/prompt_sorin_setup | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 41ac7d0175..a7d341ee8d 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -54,6 +54,13 @@ function prompt_sorin_async_callback { zle && zle reset-prompt fi ;; + "[async]") + # Code is 1 for corrupted worker output and 2 for dead worker. + if [[ $2 -eq 2 ]]; then + # Our worker died unexpectedly. + typeset -g prompt_prezto_async_init=0 + fi + ;; esac } From 95ff0360aeef951111c5ca6a80939e9329ddb434 Mon Sep 17 00:00:00 2001 From: Srijan R Shetty Date: Mon, 6 Apr 2020 15:25:01 +0530 Subject: [PATCH 08/25] fix: regression in homebrew module (#1816) --- modules/homebrew/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 6605426f4f..fb05042509 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if ! is-darwin || ! is-linux; then +if ! is-darwin && ! is-linux; then return 1 fi From de7b3b7fdc99f8a67320dc64085dea44914969c7 Mon Sep 17 00:00:00 2001 From: Vladimir Bauer Date: Thu, 9 Apr 2020 01:15:23 +0500 Subject: [PATCH 09/25] Use shallow clone for powerlevel9k and powerlevel10k submodules (#1819) --- .gitmodules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitmodules b/.gitmodules index fcc482621e..547effa3e7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,6 +28,8 @@ [submodule "modules/prompt/external/powerlevel9k"] path = modules/prompt/external/powerlevel9k url = https://github.com/bhilburn/powerlevel9k.git + shallow = true [submodule "modules/prompt/external/powerlevel10k"] path = modules/prompt/external/powerlevel10k url = https://github.com/romkatv/powerlevel10k.git + shallow = true From 342385618cad9d4ecbce74cc492f60a22b7c5fa3 Mon Sep 17 00:00:00 2001 From: Zac Bergquist Date: Wed, 22 Apr 2020 17:43:57 -0600 Subject: [PATCH 10/25] homebrew: load helper dependency Updates #1815 --- modules/homebrew/init.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index fb05042509..bfa667c0bc 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -5,6 +5,9 @@ # Sorin Ionescu # +# Load dependencies. +pmodload 'helper' + # Return if requirements are not found. if ! is-darwin && ! is-linux; then return 1 From 530ea10126119e28b457a96e6c7325e6111c92fd Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 27 Apr 2020 11:36:54 +0200 Subject: [PATCH 11/25] prompt: update powerlevel10k submodule to v1.7.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.6.0 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.6.1 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.7.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index 6a0e7523b2..7c4b0f36c0 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 6a0e7523b232d02854008405a3645031c848922b +Subproject commit 7c4b0f36c0b5d3dc1049115ecca192463c19278d From 13c61bae30c3a8cf610623c094f2aa0a95fbf035 Mon Sep 17 00:00:00 2001 From: Amyn Date: Sat, 2 May 2020 19:21:27 +0100 Subject: [PATCH 12/25] Do not source history-substring-search if already loaded (#1830) --- modules/history-substring-search/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index d3ee3a1131..0de78918dc 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -10,7 +10,9 @@ pmodload 'editor' # Source module files. -source "${0:h}/external/zsh-history-substring-search.zsh" || return 1 +if (( ! $+functions[history-substring-search-up] )); then + source "${0:h}/external/zsh-history-substring-search.zsh" || return 1 +fi # # Search From 649c0e4561dc2acb599a464a750bfad426173aff Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Thu, 14 May 2020 15:19:03 -0300 Subject: [PATCH 13/25] [git] Add git pull autostash alias Adds the gfma and gfra aliases with the `--autostash` flag. --- modules/git/alias.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 89ba558733..3076708996 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -97,7 +97,9 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias gfc='git clone' alias gfcr='git clone --recurse-submodules' alias gfm='git pull' + alias gfma='git pull --autostash' alias gfr='git pull --rebase' + alias gfra='git pull --rebase --autostash' # Flow (F) alias gFi='git flow init' From 793f239a5e38ef2c4b76a4955bb734520303e8c4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 20 May 2020 12:16:06 +0200 Subject: [PATCH 14/25] prompt: update powerlevel10k submodule to v1.10.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.0 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.1 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.8.2 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.9.0 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.9.1 - https://github.com/romkatv/powerlevel10k/releases/tag/v1.10.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index 7c4b0f36c0..c713ded9e7 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 7c4b0f36c0b5d3dc1049115ecca192463c19278d +Subproject commit c713ded9e76032f90014bc6829165d0dd69d28b3 From b8f5b31573968f03a91a3f197d8759333901f159 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sun, 31 May 2020 20:07:49 +0200 Subject: [PATCH 15/25] prompt: update powerlevel10k submodule to v1.11.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.11.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index c713ded9e7..801bfbb294 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit c713ded9e76032f90014bc6829165d0dd69d28b3 +Subproject commit 801bfbb2946b10527e75e77838a3657d78cb92e5 From ff91c8d410df3e6141248474389051c7ddcaf80a Mon Sep 17 00:00:00 2001 From: Texas Toland Date: Fri, 5 Jun 2020 05:53:44 +0900 Subject: [PATCH 16/25] Make .zcomp* location configurable (#1842) --- modules/command-not-found/init.zsh | 3 ++- modules/completion/init.zsh | 15 +++++++++------ modules/fasd/init.zsh | 3 ++- modules/gpg/init.zsh | 3 ++- modules/node/init.zsh | 3 ++- modules/pacman/functions/pacman-list-disowned | 4 ++-- modules/perl/init.zsh | 3 ++- modules/python/init.zsh | 3 ++- modules/ssh/init.zsh | 6 ++++-- runcoms/zlogin | 2 +- 10 files changed, 28 insertions(+), 17 deletions(-) diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index f3d7ea6287..35884ce6e0 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -21,11 +21,12 @@ elif (( $+commands[brew] )); then "$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.N) ) if (( $#cnf_command )); then - cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh" + cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/brew-command-not-found-cache.zsh" if [[ "${${(@o)cnf_command}[1]}" -nt "$cache_file" \ || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ || ! -s "$cache_file" ]]; then + mkdir -p "$cache_file:h" # brew command-not-found-init is slow; cache its output. brew command-not-found-init >! "$cache_file" 2> /dev/null fi diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 07acf13bf3..4cf46fa95d 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -32,13 +32,16 @@ unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor. # cache time of 20 hours, so it should almost always regenerate the first time a # shell is opened each day. autoload -Uz compinit -_comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20)) -if (( $#_comp_files )); then - compinit -i -C +_comp_path="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" +# #q expands globs in conditional expressions +if [[ $_comp_path(#qNmh-20) ]]; then + # -C (skip function check) implies -i (skip security check). + compinit -C -d "$_comp_path" else - compinit -i + mkdir -p "$_comp_path:h" + compinit -i -d "$_comp_path" fi -unset _comp_files +unset _comp_path # # Styles @@ -46,7 +49,7 @@ unset _comp_files # Use caching to make completion for commands such as dpkg and apt usable. zstyle ':completion::complete:*' use-cache on -zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache" +zstyle ':completion::complete:*' cache-path "${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompcache" # Case-insensitive (all), partial-word, and then substring completion. if zstyle -t ':prezto:module:completion:*' case-sensitive; then diff --git a/modules/fasd/init.zsh b/modules/fasd/init.zsh index 37babd8e3e..f948789ec8 100644 --- a/modules/fasd/init.zsh +++ b/modules/fasd/init.zsh @@ -19,7 +19,7 @@ fi # Initialization # -cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh" +cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/fasd-cache.zsh" if [[ "${commands[fasd]}" -nt "$cache_file" \ || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ || ! -s "$cache_file" ]]; then @@ -31,6 +31,7 @@ if [[ "${commands[fasd]}" -nt "$cache_file" \ init_args+=(zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install) fi + mkdir -p "$cache_file:h" # Cache init code. fasd --init "$init_args[@]" >! "$cache_file" 2> /dev/null fi diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index 4498b7b066..a3b37ba3bc 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -12,7 +12,7 @@ fi # Set the default paths to gpg-agent files. _gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf" -_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID" +_gpg_agent_env="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/gpg-agent.env" # Load environment variables from previous run source "$_gpg_agent_env" 2> /dev/null @@ -21,6 +21,7 @@ source "$_gpg_agent_env" 2> /dev/null if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then # Start gpg-agent if not started. if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then + mkdir -p "$_gpg_agent_env:h" eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")" fi fi diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 1ea66f9c6c..6fb68f307d 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -39,12 +39,13 @@ typeset -A compl_commands=( for compl_command in "${(k)compl_commands[@]}"; do if (( $+commands[$compl_command] )); then - cache_file="${TMPDIR:-/tmp}/prezto-$compl_command-cache.$UID.zsh" + cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/$compl_command-cache.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 + mkdir -p "$cache_file:h" command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null fi diff --git a/modules/pacman/functions/pacman-list-disowned b/modules/pacman/functions/pacman-list-disowned index 9c8f56a0e9..c5e84fcf67 100644 --- a/modules/pacman/functions/pacman-list-disowned +++ b/modules/pacman/functions/pacman-list-disowned @@ -8,11 +8,11 @@ # function pacman-list-disowned { -local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$" +local tmp="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pacman-disowned-$$" local db="$tmp/db" local fs="$tmp/fs" -mkdir "$tmp" +mkdir -p "$tmp" trap 'rm -rf "$tmp"' EXIT pacman --quiet --query --list | sort --unique > "$db" diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 8f097f6cac..1b5e665761 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -42,11 +42,12 @@ fi if is-darwin; then # Perl is slow; cache its output. - cache_file="${TMPDIR:-/tmp}/prezto-perl-cache.$UID.zsh" + cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/perl-cache.zsh" perl_path="$HOME/Library/Perl/5.12" if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then if [[ "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" || ! -s "$cache_file" ]]; then + mkdir -p "$cache_file:h" perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file" fi diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 809ab406e9..8193fd34ac 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -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}}/" \ diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index 08edce5772..b9567d4635 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -14,10 +14,10 @@ fi _ssh_dir="$HOME/.ssh" # Set the path to the environment file if not set by another module. -_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env.$UID}" +_ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}" # Set the path to the persistent authentication socket. -_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock.$UID" +_ssh_agent_sock="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock" # Start ssh-agent if not started. if [[ ! -S "$SSH_AUTH_SOCK" ]]; then @@ -26,12 +26,14 @@ if [[ ! -S "$SSH_AUTH_SOCK" ]]; then # Start ssh-agent if not started. if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then + mkdir -p "$_ssh_agent_env:h" eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")" fi fi # Create a persistent SSH authentication socket. if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then + mkdir -p "$_ssh_agent_sock:h" ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock" export SSH_AUTH_SOCK="$_ssh_agent_sock" fi diff --git a/runcoms/zlogin b/runcoms/zlogin index 9ea97929c2..ac4d3422a2 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -8,7 +8,7 @@ # Execute code that does not affect the current session in the background. { # Compile the completion dump to increase startup speed. - zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" + zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then zcompile "$zcompdump" fi From 20a78c04e5e07d61f6b96443ebbb8cb75fe2464d Mon Sep 17 00:00:00 2001 From: hidekuro Date: Tue, 30 Jun 2020 02:23:08 +0900 Subject: [PATCH 17/25] Remove `--all` from git alias `glg` (#1853) --- modules/git/alias.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 3076708996..95b2a0d475 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -190,7 +190,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"' alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"' alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"' - alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' + alias glg='git log --topo-order --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' From 2d3763380c180ee961a6486bff62ac76a727e7e3 Mon Sep 17 00:00:00 2001 From: Joost Cassee Date: Mon, 29 Jun 2020 19:25:15 +0200 Subject: [PATCH 18/25] Ask pyenv whether pip exists if installed (#1848) Pyenv will install shims for commands that exist in any interpreter, even if it is not the current one. This means that a command may technically exist, but when executed will tell the user to try a different interpreter. The original check for pip in the Python module can fail for this reason, in particular on Ubuntu 20.04. This change checks with pyenv whether pip really exists in the current interpreter to work around this problem and fixes a bug in pip command detection. --- modules/python/init.zsh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 8193fd34ac..33248bae74 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -147,18 +147,25 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ fi # Load PIP completion. -if (( $#commands[(i)pip(|[23])] )); then - cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pip-cache.zsh" - - # Detect and use one available from among 'pip', 'pip2', 'pip3' variants +# Detect and use one available from among 'pip', 'pip2', 'pip3' variants +if [[ -n "$PYENV_ROOT" ]]; then + for pip in pip{,2,3}; do + pip_command="$(pyenv which "$pip" 2>/dev/null)" + [[ -n "$pip_command" ]] && break + done + unset pip +else pip_command="$commands[(i)pip(|[23])]" +fi +if [[ -n "$pip_command" ]]; then + cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pip-cache.zsh" 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 \ + "$pip_command" completion --zsh \ | sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \ >! "$cache_file" \ 2> /dev/null @@ -166,8 +173,9 @@ if (( $#commands[(i)pip(|[23])] )); then source "$cache_file" - unset cache_file pip_command + unset cache_file fi +unset pip_command # Load conda into the shell session, if requested zstyle -T ':prezto:module:python' conda-init From a132c1007a8aa602218383c7a9952f9c6b9c2e0d Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 30 Jun 2020 01:26:36 +0800 Subject: [PATCH 19/25] git-info: use tab as separator for splitting ahead_and_behind (#902) The current implementation is not tamper-proof against a modified IFS. See discussion in https://github.com/sorin-ionescu/prezto/pull/902 for details. --- modules/git/functions/git-info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index fe8ca2acd9..20c284b08c 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -275,7 +275,7 @@ function git-info { # Format ahead. if [[ -n "$ahead_format" ]]; then - ahead="$ahead_and_behind[(w)1]" + ahead="$ahead_and_behind[(pws:\t:)1]" if (( ahead > 0 )); then zformat -f ahead_formatted "$ahead_format" "A:$ahead" fi @@ -283,7 +283,7 @@ function git-info { # Format behind. if [[ -n "$behind_format" ]]; then - behind="$ahead_and_behind[(w)2]" + behind="$ahead_and_behind[(pws:\t:)2]" if (( behind > 0 )); then zformat -f behind_formatted "$behind_format" "B:$behind" fi From c21295b27f5f3e549a0fc64c53b15ebdf7becbe1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 6 Jul 2020 17:41:42 +0200 Subject: [PATCH 20/25] prompt: update powerlevel10k submodule to v1.12.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.12.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index 801bfbb294..0c341b6702 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 801bfbb2946b10527e75e77838a3657d78cb92e5 +Subproject commit 0c341b67024642b8f1741920d1ae5d760bc488b0 From 4e7ab4b8b79c9009991f2552b5ee5d7e73abbcba Mon Sep 17 00:00:00 2001 From: Austin Sloane Date: Mon, 20 Jul 2020 16:07:53 -0700 Subject: [PATCH 21/25] utility, helper: add aliases to use with termux terminal emulator (android) (#1859) --- modules/helper/init.zsh | 5 +++++ modules/utility/init.zsh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/modules/helper/init.zsh b/modules/helper/init.zsh index 6e83f89a18..0553556a49 100644 --- a/modules/helper/init.zsh +++ b/modules/helper/init.zsh @@ -49,3 +49,8 @@ function is-bsd { function is-cygwin { [[ "$OSTYPE" == cygwin* ]] } + +# is true on termux (Android) +function is-termux { + [[ "$OSTYPE" == linux-android ]] +} diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index caa0ec8d41..7bb753249e 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -140,6 +140,10 @@ elif is-cygwin; then alias o='cygstart' alias pbcopy='tee > /dev/clipboard' alias pbpaste='cat /dev/clipboard' +elif is-termux; then + alias o='termux-open' + alias pbcopy='termux-clipboard-set' + alias pbpaste='termux-clipboard-get' else alias o='xdg-open' From cb8b9ca7462e923e187da46e9ac3f45f55d8bf07 Mon Sep 17 00:00:00 2001 From: kwgchi Date: Tue, 21 Jul 2020 08:08:54 +0900 Subject: [PATCH 22/25] README: fix small grammatical error (#1857) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 552784bae7..45ef61ce40 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Updating Run `zprezto-update` to automatically check if there is an update to zprezto. If there are no file conflicts, zprezto and its submodules will be -automatically updated. If there are conflicts you will instructed to go into +automatically updated. If there are conflicts you will be instructed to go into the `$ZPREZTODIR` directory and resolve them yourself. To pull the latest changes and update submodules manually: From 685da200d72bd574c7e1ca82bb102f3e717e4580 Mon Sep 17 00:00:00 2001 From: Yasuharu Iida Date: Thu, 23 Jul 2020 02:28:53 +0900 Subject: [PATCH 23/25] completion: bump version to tags/0.32.0 (#1856) --- modules/completion/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/external b/modules/completion/external index cf565254e2..ed4ff5384b 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit cf565254e26bb7ce03f51889e9a29953b955b1fb +Subproject commit ed4ff5384b03aa775a57d4c9588c88850026b0b3 From e9197234cfd051effa75fa98344f845e1d818972 Mon Sep 17 00:00:00 2001 From: Olaf Conradi Date: Mon, 27 Jul 2020 21:49:40 +0200 Subject: [PATCH 24/25] Add check for empty WORKON_HOME (#1861) When $WORKON_HOME is not set and $ENV_NAME is equal to $PROJECT_ROOT/.venv which contains bin/activate then the code wrongly assumes workon is available. It should execute the second branch to source bin/activate. --- modules/python/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 33248bae74..b878f04978 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -71,7 +71,7 @@ function _python-workon-cwd { if [[ "$ENV_NAME" != "" ]]; then # Activate the environment only if it is not already active if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then - if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then + if [[ -n "$WORKON_HOME" && -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" elif [[ -e "$ENV_NAME/bin/activate" ]]; then source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME" From 38882275b8936218aabec7a7c760514187dd7fe9 Mon Sep 17 00:00:00 2001 From: Matthieu PETIOT Date: Thu, 30 Jul 2020 22:29:59 +0200 Subject: [PATCH 25/25] Add ^_ mapping to undo in viins mode (#1860) This allows to cancel a tab completion, as ^_ in emacs mode. --- modules/editor/init.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 28a2fb24a0..5b411f58a9 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -318,6 +318,7 @@ bindkey -M vicmd "$key_info[Control]X$key_info[Control]E" edit-command-line # Undo/Redo bindkey -M vicmd "u" undo +bindkey -M viins "$key_info[Control]_" undo bindkey -M vicmd "$key_info[Control]R" redo if (( $+widgets[history-incremental-pattern-search-backward] )); then