From d22effbf856427b281b455a7419edfdd67aab3ce Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Mon, 11 Feb 2019 19:21:38 -0500 Subject: [PATCH 01/63] editor: allow alt+arrow keys for word movement (#1688) --- modules/editor/init.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 085947ef..3a7d66e6 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -269,9 +269,11 @@ bindkey -d # Emacs Key Bindings # -for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" +for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" \ + "${key_info[Escape]}${key_info[Left]}" bindkey -M emacs "$key" emacs-backward-word -for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" +for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" \ + "${key_info[Escape]}${key_info[Right]}" bindkey -M emacs "$key" emacs-forward-word # Kill to the beginning of the line. From 5d7c990eec21e83c0735f6b8e7d1d669102cbb4f Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sun, 17 Feb 2019 00:31:54 +0100 Subject: [PATCH 02/63] archive: enhance parallel operations --- modules/archive/functions/archive | 14 ++++++++--- modules/archive/functions/unarchive | 36 +++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/modules/archive/functions/archive b/modules/archive/functions/archive index fab409e2..10bbad39 100644 --- a/modules/archive/functions/archive +++ b/modules/archive/functions/archive @@ -8,7 +8,7 @@ # function archive { -local archive_name path_to_archive _gzip_bin _bzip2_bin +local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin if (( $# < 2 )); then cat >&2 <&2 < 0 )); do if [[ ! -s "$1" ]]; then print "$0: file not valid: $1" >&2 @@ -42,15 +66,13 @@ while (( $# > 0 )); do file_path="${1:A}" extract_dir="${file_name:r}" case "$1:l" in - (*.tar.gz|*.tgz) tar xvzf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ - && tar --xz -xvf "$1" \ - || xzcat "$1" | tar xvf - ;; + (*.tar.gz|*.tgz) tar -xvf "$1" --use-compress-program="${_gzip_bin}" ;; + (*.tar.bz2|*.tbz|*.tbz2) tar -xvf "$1" --use-compress-program="${_bzip2_bin}" ;; + (*.tar.xz|*.txz) tar -xvf "$1" --use-compress-program="${_xz_bin}" ;; (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ && tar --lzma -xvf "$1" \ - || lzcat "$1" | tar xvf - ;; - (*.tar) tar xvf "$1" ;; + || lzcat "$1" | tar -xvf - ;; + (*.tar) tar -xvf "$1" ;; (*.gz) gunzip "$1" ;; (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; From b8d7e2cad863959323a4c6452d58cad0af0b84e8 Mon Sep 17 00:00:00 2001 From: monai Date: Sat, 19 Jan 2019 12:54:49 +0200 Subject: [PATCH 03/63] Add zstyle option to disable zsh option CORRECT --- modules/utility/README.md | 6 ++++++ modules/utility/init.zsh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/utility/README.md b/modules/utility/README.md index 3b25b3a7..11794787 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -62,6 +62,12 @@ Aliases - `mysql` - `rm` +To disable all spelling corrections, add the following line to *zpreztorc*: + +```sh +zstyle ':prezto:module:utility' correct 'no' +``` + ### Disabled File Globbing - `bower` diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 6b07bf0f..59a04f93 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -11,7 +11,9 @@ pmodload 'helper' 'spectrum' # Correct commands. -setopt CORRECT +if zstyle -T ':prezto:module:utility' correct; then + setopt CORRECT +fi # # Aliases From 1f4601e44c989b90dc7314b151891fa60a101251 Mon Sep 17 00:00:00 2001 From: Chris Ewald Date: Sun, 17 Mar 2019 21:27:13 -0400 Subject: [PATCH 04/63] Disable node-info output when value is system. This makes the behavior consistent with rbenv and pyenv. --- modules/node/functions/node-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/node/functions/node-info b/modules/node/functions/node-info index 9feca3e1..c43759b7 100644 --- a/modules/node/functions/node-info +++ b/modules/node/functions/node-info @@ -23,7 +23,7 @@ elif (( $+commands[node] )) ; then version="${$(node -v)#v}" fi -if [[ "$version" != (none|) ]]; then +if [[ "$version" != (none|system) ]]; then zstyle -s ':prezto:module:node:info:version' format 'version_format' zformat -f version_formatted "$version_format" "v:$version" node_info[version]="$version_formatted" From bb901dfb7ebd1df7d68e2ca2d6e75b627d270dff Mon Sep 17 00:00:00 2001 From: Toshiki Murayama Date: Tue, 21 May 2019 09:42:03 +0900 Subject: [PATCH 05/63] Update zsh-autosuggestions submodule --- modules/autosuggestions/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index a7f0106b..733abd4a 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60 +Subproject commit 733abd4af0f23f217caa2a303fbef66382d19d6f From ac65e8eb18bed5964508e76719ecb7a66f5c358a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 29 May 2019 22:40:47 +0200 Subject: [PATCH 06/63] Add powerlevel10k theme (#1695) --- .gitmodules | 3 +++ modules/prompt/external/powerlevel10k | 1 + modules/prompt/functions/prompt_powerlevel10k_setup | 1 + 3 files changed, 5 insertions(+) create mode 160000 modules/prompt/external/powerlevel10k create mode 120000 modules/prompt/functions/prompt_powerlevel10k_setup diff --git a/.gitmodules b/.gitmodules index 051f2633..fcc48262 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,3 +28,6 @@ [submodule "modules/prompt/external/powerlevel9k"] path = modules/prompt/external/powerlevel9k url = https://github.com/bhilburn/powerlevel9k.git +[submodule "modules/prompt/external/powerlevel10k"] + path = modules/prompt/external/powerlevel10k + url = https://github.com/romkatv/powerlevel10k.git diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k new file mode 160000 index 00000000..45588cc2 --- /dev/null +++ b/modules/prompt/external/powerlevel10k @@ -0,0 +1 @@ +Subproject commit 45588cc28a132602e334c6ebb8bb876bd85903c4 diff --git a/modules/prompt/functions/prompt_powerlevel10k_setup b/modules/prompt/functions/prompt_powerlevel10k_setup new file mode 120000 index 00000000..8c66c696 --- /dev/null +++ b/modules/prompt/functions/prompt_powerlevel10k_setup @@ -0,0 +1 @@ +../external/powerlevel10k/powerlevel10k.zsh-theme \ No newline at end of file From 1d58546406bc8f13b910141265f67dbe2f08bd5f Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Wed, 29 May 2019 13:42:17 -0700 Subject: [PATCH 07/63] prompt: update powerlevel10k to latest commit --- 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 45588cc2..a4b0fd61 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 45588cc28a132602e334c6ebb8bb876bd85903c4 +Subproject commit a4b0fd6114541c688552305112a9ab9a534e8abf From 09e83ed2829d13b8102af1bf660efbf99e0f896b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 17 Jun 2019 19:49:02 +0200 Subject: [PATCH 08/63] prompt: update powerlevel10k submodule (#1715) --- 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 a4b0fd61..31fdb679 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit a4b0fd6114541c688552305112a9ab9a534e8abf +Subproject commit 31fdb6797ed19f008f25e26e452e297981295410 From e94b6b2078ccd0b289293dc4b996983a96a34681 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 2 Jul 2019 18:23:12 +0200 Subject: [PATCH 09/63] prompt: update powerlevel10k submodule to the latest commit (#1717) A bunch of bug fixes. Most notably romkatv/powerlevel10k#89. --- 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 31fdb679..613ffec4 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 31fdb6797ed19f008f25e26e452e297981295410 +Subproject commit 613ffec4b61fc8c97427a99bcca72808a980645e From 6dd97d15e0303f648ad0a29303a7fe56f43a2c7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Jul 2019 19:04:45 +0200 Subject: [PATCH 10/63] prompt: update powerlevel10k submodule to the latest commit (#1726) Changes include a few bug fixes and a score of new features. --- 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 613ffec4..5ef0ec41 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 613ffec4b61fc8c97427a99bcca72808a980645e +Subproject commit 5ef0ec415eefbc8b4431a6e4b8e2a5e0d299176a From 3ae422a0da0c675f1a53d7a1c079baa6cd87e73f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 24 Jul 2019 20:13:32 +0200 Subject: [PATCH 11/63] prompt: update powerlevel10k submodule to the latest commit (#1727) The last update has picked up a nasty bug in gitstatus that disables all user aliases. This commit fixes it. --- 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 5ef0ec41..f1449791 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 5ef0ec415eefbc8b4431a6e4b8e2a5e0d299176a +Subproject commit f14497918f0a70955f6d227d1e002ad2a3f94cc8 From 5566a9c7927ed1ee166e92f8ecb72aa7a2d0ce09 Mon Sep 17 00:00:00 2001 From: "John P. Neumann" Date: Thu, 25 Jul 2019 17:14:43 -0500 Subject: [PATCH 12/63] Resolves 1641 - Checks whether the prompt is set to be managed or not. (#1723) This is a new variable that will need to be set on all new prompts and is not backwards compatible with custom prompts that are not prezto managed, but use prezto's editor-info functionality. Updated the README.md with additional information for themes. --- modules/editor/init.zsh | 42 ++++++++++--------- modules/prompt/README.md | 16 +++++++ modules/prompt/functions/prompt-pwd | 1 + modules/prompt/functions/prompt_cloud_setup | 4 ++ .../prompt/functions/prompt_damoekri_setup | 4 ++ modules/prompt/functions/prompt_giddie_setup | 4 ++ .../prompt/functions/prompt_kylewest_setup | 4 ++ modules/prompt/functions/prompt_minimal_setup | 4 ++ .../prompt/functions/prompt_nicoulaj_setup | 4 ++ modules/prompt/functions/prompt_paradox_setup | 4 ++ .../prompt/functions/prompt_peepcode_setup | 4 ++ modules/prompt/functions/prompt_skwp_setup | 4 ++ modules/prompt/functions/prompt_smiley_setup | 4 ++ modules/prompt/functions/prompt_sorin_setup | 4 ++ modules/prompt/functions/prompt_steeef_setup | 4 ++ 15 files changed, 88 insertions(+), 19 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 3a7d66e6..28a2fb24 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -91,28 +91,32 @@ function bindkey-all { # Exposes information about the Zsh Line Editor via the $editor_info associative # array. function editor-info { - # Clean up previous $editor_info. - unset editor_info - typeset -gA editor_info - - if [[ "$KEYMAP" == 'vicmd' ]]; then - zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY' - editor_info[keymap]="$REPLY" - else - zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY' - editor_info[keymap]="$REPLY" - - if [[ "$ZLE_STATE" == *overwrite* ]]; then - zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY' - editor_info[overwrite]="$REPLY" + # Ensure that we're going to set the editor-info for prompts that + # are prezto managed and/or compatible. + if zstyle -t ':prezto:module:prompt' managed; then + # Clean up previous $editor_info. + unset editor_info + typeset -gA editor_info + + if [[ "$KEYMAP" == 'vicmd' ]]; then + zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY' + editor_info[keymap]="$REPLY" else - zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY' - editor_info[overwrite]="$REPLY" + zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY' + editor_info[keymap]="$REPLY" + + if [[ "$ZLE_STATE" == *overwrite* ]]; then + zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY' + editor_info[overwrite]="$REPLY" + else + zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY' + editor_info[overwrite]="$REPLY" + fi fi - fi - unset REPLY - zle zle-reset-prompt + unset REPLY + zle zle-reset-prompt + fi } zle -N editor-info diff --git a/modules/prompt/README.md b/modules/prompt/README.md index 523c83e9..ef32770b 100644 --- a/modules/prompt/README.md +++ b/modules/prompt/README.md @@ -43,6 +43,22 @@ A prompt theme is an autoloadable function file with a special name, project, themes **should** be placed in the *modules/prompt/functions* directory. +### Required Variables + +To ensure that your function works with the editor-info module you'll need to +set the following variable: + +``` + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' +``` + +This is to ensure compatibility with outside prompts, while allowing prezto +and prezto-compatible prompts to take full advantage of the editor module. +This should be set in the `prompt_name_setup` function after you've added +any additional hooks with `add-zsh-hook precmd prompt_name_precmd`. See below +for additional information about functions and hooks. + ### Theme Functions There are three theme functions, a setup function, a help function, and diff --git a/modules/prompt/functions/prompt-pwd b/modules/prompt/functions/prompt-pwd index 53613e72..d2d1788f 100644 --- a/modules/prompt/functions/prompt-pwd +++ b/modules/prompt/functions/prompt-pwd @@ -28,3 +28,4 @@ unset current_pwd print "$ret_directory" # } +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_cloud_setup b/modules/prompt/functions/prompt_cloud_setup index 0637208b..be2a33a4 100644 --- a/modules/prompt/functions/prompt_cloud_setup +++ b/modules/prompt/functions/prompt_cloud_setup @@ -104,6 +104,9 @@ function prompt_cloud_setup { # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_cloud_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set git-info parameters. zstyle ':prezto:module:git:info' verbose 'yes' zstyle ':prezto:module:git:info:dirty' format "%%B%F{$secondary_color}]%f%%b %F{yellow}⚡%f" @@ -119,3 +122,4 @@ function prompt_cloud_setup { } prompt_cloud_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_damoekri_setup b/modules/prompt/functions/prompt_damoekri_setup index 4fe132d6..1fbaedfb 100644 --- a/modules/prompt/functions/prompt_damoekri_setup +++ b/modules/prompt/functions/prompt_damoekri_setup @@ -40,6 +40,9 @@ function prompt_damoekri_setup { # Add hook for calling git-info and ruby-info before each command. add-zsh-hook precmd prompt_damoekri_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:keymap:primary' format ' %F{green}»%f' @@ -63,3 +66,4 @@ function prompt_damoekri_setup { } prompt_damoekri_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_giddie_setup b/modules/prompt/functions/prompt_giddie_setup index 3c194fb9..2b36ccc7 100644 --- a/modules/prompt/functions/prompt_giddie_setup +++ b/modules/prompt/functions/prompt_giddie_setup @@ -47,6 +47,9 @@ function prompt_giddie_setup { # Add hook to set up prompt parameters before each command. add-zsh-hook precmd prompt_giddie_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:completing' format '%F{green}...%f' zstyle ':prezto:module:editor:info:keymap:alternate' format '%F{yellow}--- COMMAND ---%f' @@ -74,3 +77,4 @@ function prompt_giddie_setup { } prompt_giddie_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_kylewest_setup b/modules/prompt/functions/prompt_kylewest_setup index 70b6a54a..d3b33a95 100644 --- a/modules/prompt/functions/prompt_kylewest_setup +++ b/modules/prompt/functions/prompt_kylewest_setup @@ -40,6 +40,9 @@ function prompt_kylewest_setup { # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_kylewest_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' zstyle ':prezto:module:editor:info:keymap:primary' format "%B%F{green}❯%f%b" @@ -63,3 +66,4 @@ function prompt_kylewest_setup { } prompt_kylewest_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_minimal_setup b/modules/prompt/functions/prompt_minimal_setup index b600768b..e57aac57 100644 --- a/modules/prompt/functions/prompt_minimal_setup +++ b/modules/prompt/functions/prompt_minimal_setup @@ -32,6 +32,9 @@ function prompt_minimal_setup { # Add hook for calling vcs_info before each command. add-zsh-hook precmd prompt_minimal_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set vcs_info parameters. zstyle ':vcs_info:*' enable bzr git hg svn zstyle ':vcs_info:*' check-for-changes true @@ -57,3 +60,4 @@ function prompt_minimal_preview { } prompt_minimal_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_nicoulaj_setup b/modules/prompt/functions/prompt_nicoulaj_setup index 447ba1f4..4b40bac8 100644 --- a/modules/prompt/functions/prompt_nicoulaj_setup +++ b/modules/prompt/functions/prompt_nicoulaj_setup @@ -35,6 +35,9 @@ function prompt_nicoulaj_setup { # Add hook for calling vcs_info before each command. add-zsh-hook precmd prompt_nicoulaj_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Customizable parameters. local max_path_chars=30 local user_char='❯' @@ -58,3 +61,4 @@ function prompt_nicoulaj_setup { } prompt_nicoulaj_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_paradox_setup b/modules/prompt/functions/prompt_paradox_setup index 4f19989d..9286967f 100644 --- a/modules/prompt/functions/prompt_paradox_setup +++ b/modules/prompt/functions/prompt_paradox_setup @@ -116,6 +116,9 @@ function prompt_paradox_setup { add-zsh-hook preexec prompt_paradox_preexec add-zsh-hook precmd prompt_paradox_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' zstyle ':prezto:module:editor:info:keymap:primary' format '%B%F{blue}❯%f%b' @@ -154,3 +157,4 @@ ${(e)$(prompt_paradox_build_prompt)} } prompt_paradox_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_peepcode_setup b/modules/prompt/functions/prompt_peepcode_setup index 2081961c..3a108df4 100644 --- a/modules/prompt/functions/prompt_peepcode_setup +++ b/modules/prompt/functions/prompt_peepcode_setup @@ -34,6 +34,9 @@ function prompt_peepcode_setup { # Add a hook for calling info functions before each command. add-zsh-hook precmd prompt_peepcode_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set git-info parameters. zstyle ':prezto:module:git:info' verbose 'no' zstyle ':prezto:module:git:info:action' format ' +%s' @@ -83,3 +86,4 @@ function prompt_peepcode_preview { } prompt_peepcode_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_skwp_setup b/modules/prompt/functions/prompt_skwp_setup index f69dcddf..b84011fe 100644 --- a/modules/prompt/functions/prompt_skwp_setup +++ b/modules/prompt/functions/prompt_skwp_setup @@ -36,6 +36,9 @@ function prompt_skwp_setup { # Add hook to set up prompt parameters before each command. add-zsh-hook precmd prompt_skwp_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Use extended color pallete if available. if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then _prompt_skwp_colors=( @@ -73,3 +76,4 @@ function prompt_skwp_setup { } prompt_skwp_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup index 3d41b3af..cd1725bd 100644 --- a/modules/prompt/functions/prompt_smiley_setup +++ b/modules/prompt/functions/prompt_smiley_setup @@ -41,6 +41,9 @@ function prompt_smiley_setup { # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_smiley_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' @@ -63,3 +66,4 @@ function prompt_smiley_setup { } prompt_smiley_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 2df92122..41ac7d01 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -118,6 +118,9 @@ function prompt_sorin_setup { # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_sorin_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Set editor-info parameters. zstyle ':prezto:module:editor:info:completing' format '%B%F{7}...%f%b' zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{1}❯%F{3}❯%F{2}❯%f%b' @@ -176,3 +179,4 @@ function prompt_sorin_preview { } prompt_sorin_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_steeef_setup b/modules/prompt/functions/prompt_steeef_setup index ca39f932..d32bd343 100644 --- a/modules/prompt/functions/prompt_steeef_setup +++ b/modules/prompt/functions/prompt_steeef_setup @@ -41,6 +41,9 @@ function prompt_steeef_setup { # Add hook for calling vcs_info before each command. add-zsh-hook precmd prompt_steeef_precmd + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + # Use extended color pallete if available. if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then _prompt_steeef_colors=( @@ -104,3 +107,4 @@ function prompt_steeef_preview { } prompt_steeef_setup "$@" +# vim: ft=zsh From b01f02aa5c6714430647a4ee854149e9a336270a Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 31 Jul 2019 15:10:06 +0200 Subject: [PATCH 13/63] prompt: update powerlevel10k submodule to the latest commit New feature: Configuration Wizard. Type `p10k configure` to explore the unique styles and features Powerlevel10k has to offer. --- 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 f1449791..3fe113f9 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit f14497918f0a70955f6d227d1e002ad2a3f94cc8 +Subproject commit 3fe113f91d0f819ad33c90608c3f293a1559324a From abb0c7ecb4b4c4a83ee952681cd9de30a11f9058 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 2 Aug 2019 07:11:27 +0200 Subject: [PATCH 14/63] prompt: update powerlevel10k submodule to the latest commit A dozen bug fixes. Most important: - rbenv and a few other segments didn't work if IFS was set to something unusual. - vcs segment couldn't properly apply subsegment style if color overrides used mnemonic names. - the check for .p10k.zsh already being sourced was too strict. --- 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 3fe113f9..635b0d7c 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 3fe113f91d0f819ad33c90608c3f293a1559324a +Subproject commit 635b0d7c99a22d996b5ca43efb56e9ec6b1ebdb4 From a8087e01fbe2eff895ca6c85eddda76ff2ebd883 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 19 Aug 2019 11:30:16 +0200 Subject: [PATCH 15/63] prompt: update powerlevel10k submodule to the latest commit - Several bug fixes. Most notable: - Don't hide command execution time on reset-prompt. - Support prezto with zsh 5.1. - Don't hide nvm prompt when there is no nvm command. - New prompt: ranger. - Add an option to hide rust version when outside of rust project tree. - Add an option to show rvm gemset. --- 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 635b0d7c..3090ae66 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 635b0d7c99a22d996b5ca43efb56e9ec6b1ebdb4 +Subproject commit 3090ae6633aedc50b43524e6c2ce1482b0a15772 From 34948690d575e9bfc9a3836b2f5a8a87c69a4a26 Mon Sep 17 00:00:00 2001 From: Julien Brochet Date: Tue, 13 Aug 2019 16:02:41 +0200 Subject: [PATCH 16/63] syntax-highlighting: update external dependency --- 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 1e34c4aa..35c8690c 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 1e34c4aa0bcbdde5173aab15600784edf0a212fd +Subproject commit 35c8690c0025ceef9584f64da86ced3a72ee32b6 From 8914274ca9f7b997d4a1663e0f290c691772db7f Mon Sep 17 00:00:00 2001 From: pedrosland Date: Mon, 19 Aug 2019 18:30:33 +0100 Subject: [PATCH 17/63] prompt: update zsh-async to fix an infinite loop (#1734) --- modules/prompt/external/async | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/async b/modules/prompt/external/async index 58f7ba70..95c2b157 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit 58f7ba70f05e75802299848e7e31c7d7a7fd0c97 +Subproject commit 95c2b1577f455728ec01cec001a86c216d0af2bd From 8b1a7afd81a97014eb0ac2d3e357e962d5b7625d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 6 Sep 2019 19:08:26 +0200 Subject: [PATCH 18/63] prompt: update powerlevel10k submodule to the latest commit (#1738) - New prompt segment: terraform. - Configuration wizard: - Offer to install Meslo Nerd Font (only on iTerm2 and Termux). - Offer to enable `time` prompt segment. - New style options: round separators, heads and tails. - Reduce the minimum required terminal width to 55 columns. - Several bug fixes. Most notable: - Fix network interface and ip parsing on Linux and WSL. - Disregard auto_name_dirs if it's set. --- 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 3090ae66..5886154b 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 3090ae6633aedc50b43524e6c2ce1482b0a15772 +Subproject commit 5886154bb14965f59d26f349b97e2c5e9104bf93 From 43214f1aed1723ab5b18cd73ce0019b5c6bb9848 Mon Sep 17 00:00:00 2001 From: Shane O'Grady Date: Mon, 9 Sep 2019 17:49:48 -0700 Subject: [PATCH 19/63] history: Permit use of previously set HISTFILE Honor the use of the HISTFILE environment variable, if it's already set. --- modules/history/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/history/init.zsh b/modules/history/init.zsh index a26f3c9f..d1d3373a 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -26,7 +26,7 @@ setopt HIST_BEEP # Beep when accessing non-existent history. # Variables # -HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" # The path to the history file. +HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zhistory}" # The path to the history file. HISTSIZE=10000 # The maximum number of events to save in the internal history. SAVEHIST=10000 # The maximum number of events to save in the history file. From 75940e8ee97fe7fe8b690ca98b76f95f4148a960 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 10 Sep 2019 17:57:42 +0200 Subject: [PATCH 20/63] directory: update docs to clarify it doesn't really set AUTO_NAME_DIRS (#1740) Module `directory` used to set AUTO_NAME_DIRS. This was changed in 73e94b84 but README.md hasn't been updated. This looks like an accidental omission that this commit fixes. --- modules/directory/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/directory/README.md b/modules/directory/README.md index 47c1bc20..ce806eea 100644 --- a/modules/directory/README.md +++ b/modules/directory/README.md @@ -12,7 +12,6 @@ Options - `PUSHD_SILENT` does not print the directory stack after `pushd` or `popd`. - `PUSHD_TO_HOME` pushes to the home directory when no argument is given. - `CDABLE_VARS` changes directory to a path stored in a variable. - - `AUTO_NAME_DIRS` auto adds variable-stored paths to `~` list. - `MULTIOS` writes to multiple descriptors. - `EXTENDED_GLOB` uses extended globbing syntax. - `CLOBBER` does not overwrite existing files with `>` and `>>`. Use `>!` and From 6ae2f39cc12d7102ca207e3bd33e986acce3eac8 Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 15:59:49 +0800 Subject: [PATCH 21/63] ruby: support environment variable RBENV_ROOT --- modules/ruby/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index 4ede3667..1c1fb999 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -15,8 +15,8 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then source "$HOME/.rvm/scripts/rvm" # Load manually installed rbenv into the shell session. -elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then - path=("$HOME/.rbenv/bin" $path) +elif [[ -s "${RBENV_ROOT:=$HOME/.rbenv}/bin/rbenv" ]]; then + path=("${RBENV_ROOT}/bin" $path) eval "$(rbenv init - --no-rehash zsh)" # Load package manager installed rbenv into the shell session. From 61de4d199d145ac35c21d8144942bb533533f51f Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 16:00:34 +0800 Subject: [PATCH 22/63] node: support environment variables NVM_DIR and NODENV_ROOT --- modules/node/init.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index d8eea145..1ea66f9c 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -7,8 +7,8 @@ # # Load manually installed NVM into the shell session. -if [[ -s "$HOME/.nvm/nvm.sh" ]]; then - source "$HOME/.nvm/nvm.sh" +if [[ -s "${NVM_DIR:=$HOME/.nvm}/nvm.sh" ]]; then + source "${NVM_DIR}/nvm.sh" # Load package manager installed NVM into the shell session. elif (( $+commands[brew] )) && \ @@ -17,8 +17,8 @@ elif (( $+commands[brew] )) && \ unset nvm_prefix # Load manually installed nodenv into the shell session. -elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then - path=("$HOME/.nodenv/bin" $path) +elif [[ -s "${NODENV_ROOT:=$HOME/.nodenv}/bin/nodenv" ]]; then + path=("${NODENV_ROOT}/bin" $path) eval "$(nodenv init - --no-rehash zsh)" # Load package manager installed nodenv into the shell session. From f596d5d1d6f7ff4edefd03749e847fdfd0505654 Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 16:02:05 +0800 Subject: [PATCH 23/63] python: improve PYENV_ROOT detection --- modules/python/init.zsh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 44043f1c..e5967f7a 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -8,17 +8,12 @@ # # Load manually installed pyenv into the path -if [[ -n "$PYENV_ROOT" && -s "$PYENV_ROOT/bin/pyenv" ]]; then - path=("$PYENV_ROOT/bin" $path) -elif [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then - path=("$HOME/.pyenv/bin" $path) -fi +if [[ -s "${PYENV_ROOT:=$HOME/.pyenv}/bin/pyenv" ]]; then + path=("${PYENV_ROOT}/bin" $path) + eval "$(pyenv init - --no-rehash zsh)" # Load pyenv into the current python session -if (( $+commands[pyenv] )); then - if [[ -z "$PYENV_ROOT" ]]; then - export PYENV_ROOT=$(pyenv root) - fi +elif (( $+commands[pyenv] )); then eval "$(pyenv init - --no-rehash zsh)" # Prepend PEP 370 per user site packages directory, which defaults to From 75b112bcd0ba3a85e1848d25db571aee6da75995 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Tue, 10 Sep 2019 09:10:31 -0700 Subject: [PATCH 24/63] node, python, ruby: update docs about new envars --- modules/node/README.md | 6 ++++++ modules/python/README.md | 3 +++ modules/ruby/README.md | 3 +++ 3 files changed, 12 insertions(+) diff --git a/modules/node/README.md b/modules/node/README.md index 951f2a74..af447c14 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -10,6 +10,9 @@ nvm [nvm][5] allows for managing multiple, isolated Node.js installations in the home directory. +This will be loaded automatically if nvm is installed in `$NVM_DIR`, +`~/.nvm`, or nvm is installed with homebrew. + nodenv ------ @@ -17,6 +20,9 @@ nodenv Node versions. It's simple and predictable, Just Works, and is rock solid in production. nodenv is forked from the popular [rbenv][7]. +This will be loaded automatically if nodenv is installed in `$NODENV_ROOT`, +`~/.nodenv`, or `nodenv` is on the path. + Functions --------- diff --git a/modules/python/README.md b/modules/python/README.md index 121ea373..91dc87fe 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -35,6 +35,9 @@ execution of `pyenv`. Install Python versions with `pyenv install` into `~/.pyenv/versions`. +This will be loaded automatically if pyenv is installed to `$PYENV_ROOT`, +`~/.pyenv`, or if the `pyenv` command is on the path. + Local Package Installation -------------------------- diff --git a/modules/ruby/README.md b/modules/ruby/README.md index 12848d86..feaa3016 100644 --- a/modules/ruby/README.md +++ b/modules/ruby/README.md @@ -32,6 +32,9 @@ multiple, isolated Ruby installations in the home directory. While it is not as feature rich as RVM, it is not loaded into the shell and is not known to cause conflicts with shell scripts. +This will be loaded automatically if rbenv is installed to `$RBENV_ROOT`, +`~/.rbenv`, or if the `rbenv` command is on the path. + chruby ------ From 9507a0e881ae71528c9a4182e53c62f2896c8d31 Mon Sep 17 00:00:00 2001 From: Robson Roberto Souza Peixoto <124390+robsonpeixoto@users.noreply.github.com> Date: Tue, 10 Sep 2019 13:18:09 -0300 Subject: [PATCH 25/63] tmux: ignore tmux autostart in vscode terminal (#1718) In certain situations VSCODE_PID isn't set any more, so we just need to check TERM_PROGRAM which has existed for a few years already. --- modules/tmux/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index fb56d076..5c51855f 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -23,7 +23,7 @@ if ([[ "$TERM_PROGRAM" = 'iTerm.app' ]] && \ _tmux_iterm_integration='-CC' fi -if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_PID" ]] && ( \ +if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && "$TERM_PROGRAM" != "vscode" ]] && ( \ ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ ); then From 2873885d37e362ae9be8ff4cb93ae36739ac0067 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Sat, 21 Sep 2019 17:29:18 -0700 Subject: [PATCH 26/63] utility: fix safe-ops commands Fixes #1699 --- modules/utility/init.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 59a04f93..a2e5c2bd 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -66,10 +66,10 @@ alias mvi="${aliases[mv]:-mv} -i" alias cpi="${aliases[cp]:-cp} -i" alias lni="${aliases[ln]:-ln} -i" if zstyle -T ':prezto:module:utility' safe-ops; then - alias rm='rmi' - alias mv='mvi' - alias cp='cpi' - alias ln='lni' + alias rm="${aliases[rm]:-rm} -i" + alias mv="${aliases[mv]:-mv} -i" + alias cp="${aliases[cp]:-cp} -i" + alias ln="${aliases[ln]:-ln} -i" fi # ls From 55eb406515ba9add9c5d77a50ca04386d4f02613 Mon Sep 17 00:00:00 2001 From: lambdanerd Date: Fri, 11 Oct 2019 15:15:21 -0500 Subject: [PATCH 27/63] Remove alias for invalid `brew cleanup --force` `brew cleanup --force` produces the following error message: `Error: invalid option: --force`. I can't seem to find any record of this being a valid option for the cleanup command, so either it was deprecated in the stone age or it was a simple mistake. However, there is a `--force` option available for `brew uninstall`, but that's a dicey thing to alias. --- modules/homebrew/init.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 056f1fb5..283bb123 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -27,7 +27,6 @@ fi # Homebrew alias brewc='brew cleanup' -alias brewC='brew cleanup --force' alias brewi='brew install' alias brewl='brew list' alias brewo='brew outdated' From 1bc0da5f489b1f7084e5ac1c4606e89614dfacc4 Mon Sep 17 00:00:00 2001 From: Wouter Overmeire Date: Mon, 14 Oct 2019 16:27:01 +0200 Subject: [PATCH 28/63] Init submodules when using zprezto-update (#1713) --- init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.zsh b/init.zsh index 99254bdb..87f095e5 100644 --- a/init.zsh +++ b/init.zsh @@ -44,7 +44,7 @@ function zprezto-update { printf "There is an update available. Trying to pull.\n\n" if git pull --ff-only; then printf "Syncing submodules\n" - git submodule update --recursive + git submodule update --init --recursive return $? else cannot-fast-forward From 6d65cb4176c75d3ce143393b3ae12356b644c092 Mon Sep 17 00:00:00 2001 From: lambdanerd Date: Thu, 17 Oct 2019 01:44:17 -0500 Subject: [PATCH 29/63] Remove documentation for obsolete `brewC` alias --- modules/homebrew/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 2a37553d..3e27013f 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -18,7 +18,6 @@ Aliases ### Homebrew - `brewc` cleans outdated brews and their cached archives. - - `brewC` cleans outdated brews, including keg-only, and their cached archives. - `brewi` installs a formula. - `brewl` lists installed formulae. - `brewo` lists brews which have an update available. From ed6303c34048fbe0b40de23a648e397e50efeb62 Mon Sep 17 00:00:00 2001 From: lambdanerd Date: Thu, 17 Oct 2019 01:55:40 -0500 Subject: [PATCH 30/63] homebrew: add alias `brewL` --- modules/homebrew/README.md | 1 + modules/homebrew/init.zsh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 3e27013f..1d29871e 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -19,6 +19,7 @@ Aliases - `brewc` cleans outdated brews and their cached archives. - `brewi` installs a formula. + - `brewL` lists installed formulae that are not dependencies of another installed formula. - `brewl` lists installed formulae. - `brewo` lists brews which have an update available. - `brews` searches for a formula. diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 283bb123..9f7e0b46 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -14,7 +14,7 @@ fi # Variables # -# Load standard Homebrew shellenv into the shell session. +# Load standard Homebrew shellenv into the shell session. # Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related # variables as they are already handled in standard zsh configuration. if (( $+commands[brew] )); then @@ -28,6 +28,7 @@ fi # Homebrew alias brewc='brew cleanup' alias brewi='brew install' +alias brewL='brew leaves' alias brewl='brew list' alias brewo='brew outdated' alias brews='brew search' From 0af28e758b953d1f6925e34e3664e4ad23719641 Mon Sep 17 00:00:00 2001 From: romkatv Date: Tue, 5 Nov 2019 10:56:58 +0100 Subject: [PATCH 31/63] prompt: update powerlevel10k submodule to the latest commit (#1757) - New feature: Instant Prompt. - Zsh starts instantly even if zshrc loads dozens of plugins. - Must be explicitly enabled via `p10k configure`. - New prompt segment: azure. - New styles: Pure and Rainbow. - 6 times faster loading (independent of instant prompt). --- 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 5886154b..4586e8d5 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 5886154bb14965f59d26f349b97e2c5e9104bf93 +Subproject commit 4586e8d54c40fb6bd688128101ea5c853e34773b From 2d6205e71404704eecc4f402e5b09d7cbd19bab7 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 10 Nov 2019 09:30:35 +0100 Subject: [PATCH 32/63] prompt: update powerlevel10k submodule to the latest commit (#1761) New feature: Transient Prompt. Demo: https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif Announcement post: https://www.reddit.com/r/zsh/comments/dsh1g3/new_powerlevel10k_feature_transient_prompt --- 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 4586e8d5..e753f415 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 4586e8d54c40fb6bd688128101ea5c853e34773b +Subproject commit e753f4152c950ab6ea368f3da526b7b49180c847 From a5ebde1b171abfc57eeb434c13935ea8dc0e2a22 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 6 Dec 2019 15:52:54 +0100 Subject: [PATCH 33/63] prompt: update powerlevel10k submodule to the latest commit (#1768) - New prompt segments: - gcloud - fvm - vim_shell - midnight_commander - goenv - Many bug fixes and new minor features. --- 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 e753f415..345d0644 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit e753f4152c950ab6ea368f3da526b7b49180c847 +Subproject commit 345d0644a9c1a242ff131bde915bbe234c3dd745 From e86200e7aad9d4ccbabd34222ffcded3f52c6f65 Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Thu, 19 Dec 2019 00:37:51 +0100 Subject: [PATCH 34/63] Allow mapping Ctrl+S and Ctrl+Q shortcuts (#1750) --- modules/environment/init.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index 7ae8c4f6..b01a7ad5 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -38,6 +38,9 @@ setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell. setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. +# Allow mapping Ctrl+S and Ctrl+Q shortcuts +(( $+commands[stty] )) && stty -ixon + # # Jobs # From 7c94154dda2dfcf02515f1caf1e9dfe6d80b0350 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 Dec 2019 00:22:15 +0100 Subject: [PATCH 35/63] environment: apply `stty -ixon` only to tty (#1771) --- modules/environment/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index b01a7ad5..ac762780 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -39,7 +39,7 @@ setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Gar unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. # Allow mapping Ctrl+S and Ctrl+Q shortcuts -(( $+commands[stty] )) && stty -ixon +[[ -n ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY # # Jobs From c6efe8015224fe6dbc10d8f4b1aa52ce5afc9432 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 11 Jan 2020 09:48:45 +0100 Subject: [PATCH 36/63] runcoms: don't raise an error in zlogin when stderr is not a TTY (#1775) The existing code in runcoms/zlogin results in `$?` being equal to `1` when starting a login shell if stderr is not a TTY. For example: zsh -l 2>/dev/null When using a theme that displays error/success status of the last command, the first prompt will show an error. This commit fixes it so that error code is zero after sourcing zlogin (unless something unexpected and bad happens). --- runcoms/zlogin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runcoms/zlogin b/runcoms/zlogin index 16fae45e..9ea97929 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -15,7 +15,7 @@ } &! # Execute code only if STDERR is bound to a TTY. -[[ -o INTERACTIVE && -t 2 ]] && { +if [[ -o INTERACTIVE && -t 2 ]]; then # Print a random, hopefully interesting, adage. if (( $+commands[fortune] )); then @@ -23,4 +23,4 @@ print fi -} >&2 +fi >&2 From a3a51bdf6c485ff60153e80b66915626fcbacd4f Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Mon, 13 Jan 2020 18:49:37 -0500 Subject: [PATCH 37/63] Support pmodule-allow-overrides feature (#1780) --- init.zsh | 8 +++++--- runcoms/zpreztorc | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/init.zsh b/init.zsh index 87f095e5..254ae52c 100644 --- a/init.zsh +++ b/init.zsh @@ -98,15 +98,17 @@ function pmodload { else locations=(${pmodule_dirs:+${^pmodule_dirs}/$pmodule(-/FN)}) if (( ${#locations} > 1 )); then - print "$0: conflicting module locations: $locations" - continue + if ! zstyle -t ':prezto:load' pmodule-allow-overrides 'yes'; then + print "$0: conflicting module locations: $locations" + continue + fi elif (( ${#locations} < 1 )); then print "$0: no such module: $pmodule" continue fi # Grab the full path to this module - pmodule_location=${locations[1]} + pmodule_location=${locations[-1]} # Add functions to $fpath. fpath=(${pmodule_location}/functions(/FN) $fpath) diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index a5490734..9a3c19ae 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -18,6 +18,9 @@ zstyle ':prezto:*:*' color 'yes' # Add additional directories to load prezto modules from # zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib +# Allow module overrides when pmodule-dirs causes module name collisions +# zstyle ':prezto:load' pmodule-allow-overrides 'yes' + # Set the Zsh modules to load (man zshmodules). # zstyle ':prezto:load' zmodule 'attr' 'stat' From 2acaec814fe85e45a59ba9a7c7ce9b9b39a73d3c Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Tue, 14 Jan 2020 09:08:47 -0800 Subject: [PATCH 38/63] autosuggestions: update to v0.6.4 --- modules/autosuggestions/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index 733abd4a..ae315ded 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit 733abd4af0f23f217caa2a303fbef66382d19d6f +Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d From 9ae279e25ad4afed2c069cf537b9984474afe5a4 Mon Sep 17 00:00:00 2001 From: Joost Cassee Date: Wed, 8 Jan 2020 16:26:10 +0100 Subject: [PATCH 39/63] Allow module functions directory to be a symlink The link must still point to a full directory. --- init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.zsh b/init.zsh index 254ae52c..ebae912b 100644 --- a/init.zsh +++ b/init.zsh @@ -111,7 +111,7 @@ function pmodload { pmodule_location=${locations[-1]} # Add functions to $fpath. - fpath=(${pmodule_location}/functions(/FN) $fpath) + fpath=(${pmodule_location}/functions(-/FN) $fpath) function { local pfunction From 1f52b03a4569eaf82a78ed9d0b76a9e21aa6dfee Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 16 Jan 2020 16:45:12 +0100 Subject: [PATCH 40/63] prompt: update powerlevel10k submodule to the latest commit (#1784) - New features: - Show On Command -- Display prompt segments conditional on the command being typed. Demo: https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif - `p10k display` -- Quickly hide or show different parts of prompt. - `p10k-on-*` hooks -- Get notified about prompt-related events. - New prompt segments: - google_app_cred -- Google Application Credentials. - luaenv -- Lua version from https://github.com/cehoffman/luaen. - jenv -- Java version from https://github.com/jenv/jenv. - plenv -- Perl version from https://github.com/tokuhirom/plenv. - nnn -- Shell indicator for https://github.com/jarun/nnn. - Important fixes: - Ctrl-C no longer shortens prompt when used to terminate a zle widget with transient prompt enabled. - Don't print warnings in instant prompt when OMZ is updating. - rust_version now properly recognized rustup overrides. - Smoother rendering when using transient prompt. - New style in `p10k configure`: Lean restricted to 8 colors. --- 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 345d0644..c21961b5 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 345d0644a9c1a242ff131bde915bbe234c3dd745 +Subproject commit c21961b53c137253020aeffca2b132fdd6bcb116 From 7cad349a5aac43d4a7779e9d51bab43007af5902 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 20 Jan 2020 16:29:34 +0100 Subject: [PATCH 42/63] environment: improve the TTY check (#1785) Bug report from @qosmio: https://github.com/sorin-ionescu/prezto/pull/1771#issuecomment-575596417 I'm unable to reproduce it and @qosmio hasn't yet confirmed or disconfirmed whether this fix works. It's a good idea to change the code this way in either case. (As I mentioned in #1771, this `stty -ixon` call may have been added by mistake. It doesn't do what the comment suggest and is at least as likely to be harming users as helping them.) --- modules/environment/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index ac762780..836a6cd4 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -39,7 +39,7 @@ setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Gar unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. # Allow mapping Ctrl+S and Ctrl+Q shortcuts -[[ -n ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY +[[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY # # Jobs From 66b9ea7d44740be0d8185b4623398f27fed8104d Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Mon, 20 Jan 2020 07:50:42 -0800 Subject: [PATCH 43/63] Update documentation - Fix an old link to the wrong issue tracker - Add documentation to the history module about migration from oh-my-zsh Closes #1766 --- modules/editor/README.md | 2 +- modules/history/README.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/editor/README.md b/modules/editor/README.md index d5280c45..7035635b 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -106,4 +106,4 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) -[1]: https://github.com/sorin-ionescu/oh-my-zsh/issues +[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/history/README.md b/modules/history/README.md index a5a4acb1..1a03bd95 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -3,6 +3,10 @@ History Sets [history][1] options and defines history aliases. +**Note:** If you are migrating from oh-my-zsh and want to keep your history, you +will either need to set HISTFILE manually to `$HOME/.zsh_history` or rename +`~/.zsh_history` to ~/.zhistory`. + Options ------- From 4bcbe2ee68f6e9c969efea3e6b8dc013876482ed Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 2 Feb 2020 17:29:08 +0100 Subject: [PATCH 44/63] prompt: update powerlevel10k submodule to v1.1 ==[ Changes since the last release ]== - Complete documentation overhaul. Powerlevel10k documentation is no longer embarrassing (still no reference though; coming "soon"). - Worker pool and recursive globber have been rewritten for better performance and simpler code. Performance improvements (large speedup means an improvement in big-O and at least 2x in typical configurations): - +15% prompt speedup across the board. - Large prompt speedup for several rarely used prompt segments (disk_usage, ram, etc.). - Large prompt speedup for a few prompt segments on macOS (battery, swap, etc.). - Large prompt speedup when many prompt segments are active simultaneously. - Large prompt speedup when filesystem is slow. - New prompt segments: nix_shell and timewarrior. Both enabled by default. - Configuration wizard: - Many new options for Pure style (color scheme, number of lines, etc.) - Several new options for 8-color version of Pure style. - Better support for terminals with less than 256 colors. - Lean, Classic and Rainbow style configs now have disk_usage and swap prompt segments (disabled by default). - POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER now contains 'oc'. - New parameters: - POWERLEVEL9K_LEGACY_ICON_SPACING=true makes spaces around icons appear just like in powerlevel9k. - When in a vcs repo, POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=true removes directory prefix that precedes repo root. - P9K_KUBECONTEXT_USER can now be used in kubecontext format. - POWERLEVEL9K_GOENV_SOURCES -- the same as POWERLEVEL9K_RBENV_SOURCES but or go. - POWERLEVEL9K_TERRAFORM_CLASSES -- the same as POWERLEVEL9K_AWS_CLASSES but for terraform. - Bug fixes: - Configuration wizard now correctly follows symlinks when modifying ~/.zshrc and ~/.p10k.zsh. - ram prompt segment now works on WSL. - Powerlevel10k now correctly works with zsh-you-should-use in hardcore mode. - POWERLEVEL9K_PUBLIC_IP_HOST now points to a host that actually works. - Instant prompt no longer prints nonsensical "entry=" in rare circumstances. - Misc: - Config templates no longer work with POWERLEVEL9K_VISUAL_IDENTIFIER='' defined after them. - Powerlevel10k now detects when Antigen corrupts its source and emits an appropriate error message. - Command line parser now understands 'tabbed'. - Remove all references to romkatv/dotfiles-public. Fonts are now hosted in romkatv/powerlevel10k-media together with all images and animations. ==[ Build time dependencies ]== - https://github.com/romkatv/gitstatus/tree/edb99aa7b86d10ad0a1cfe25135b57c8031d82ad - https://github.com/romkatv/libgit2/tree/75be63625a0de418ec3551306362ee1e21034039 - https://opensource.apple.com/tarballs/libiconv/libiconv-51.200.6.tar.gz --- 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 c21961b5..9d9c5061 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit c21961b53c137253020aeffca2b132fdd6bcb116 +Subproject commit 9d9c50611da19044370ee759e593ccadbad32a6a From e9f281cd6f62983f44faaae0816866d13bc1474e Mon Sep 17 00:00:00 2001 From: Federico Frenguelli Date: Tue, 11 Feb 2020 08:48:26 +0100 Subject: [PATCH 45/63] Updated prompt pure to version 1.11.0 --- modules/prompt/external/pure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/pure b/modules/prompt/external/pure index 7aade5fc..2e354b80 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit 7aade5fca2acae3f10e260d0c076af6356da9dc6 +Subproject commit 2e354b80deae105ea246699c49e65dcd4fe8b759 From 92e6b37f73c221ebf0d8ba7a7d5bd7c2ef63e67f Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 26 Feb 2020 18:19:53 +0100 Subject: [PATCH 46/63] prompt: update powerlevel10k submodule to v1.2.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.2.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 9d9c5061..cb3f58d2 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 9d9c50611da19044370ee759e593ccadbad32a6a +Subproject commit cb3f58d21f643d26d71f520d61a592816cca3edf From 94f9e44f3f970357d47e669410ed444db3074360 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 2 Mar 2020 09:27:40 +0100 Subject: [PATCH 47/63] use $TTY instead of $(tty); it's faster and more reliable `tty` command infers the current TTY from file descriptor 0. `$TTY` gives current TTY directly. The latter works even when file descriptor 0 is redirected. It's also over 1000 times faster. --- modules/gpg/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index 7976fd7d..4498b7b0 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -26,7 +26,7 @@ if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; fi # Inform gpg-agent of the current TTY for user prompts. -export GPG_TTY="$(tty)" +export GPG_TTY=$TTY # Integrate with the SSH module. if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then From d955fbdeb729ed038ffa7af16c1cf82dd68aff1e Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 6 Mar 2020 17:40:32 +0100 Subject: [PATCH 48/63] 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 cb3f58d2..7306efb9 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 49/63] 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 7306efb9..d53355cd 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 50/63] 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 35c8690c..932e29a0 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 51/63] 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 c1c78ca2..7863528a 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 328bed4f..6e83f89a 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 9f7e0b46..6605426f 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 d55744a8..943ff5ba 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 f7871ca7..2b74d3ad 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 b7a79479..50e9b64f 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 e5967f7a..a7e8b6e8 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 b3010ede..f2eb8913 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 a2e5c2bd..caa0ec8d 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 52/63] 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 d53355cd..6a0e7523 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 53/63] 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 7863528a..cb768641 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 943ff5ba..7bf4ab29 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 2b74d3ad..62f21943 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 50e9b64f..8f097f6c 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 a7e8b6e8..809ab406 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 f2eb8913..79432c12 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 54/63] 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 41ac7d01..a7d341ee 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 55/63] 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 6605426f..fb050425 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 56/63] Use shallow clone for powerlevel9k and powerlevel10k submodules (#1819) --- .gitmodules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitmodules b/.gitmodules index fcc48262..547effa3 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 57/63] 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 fb050425..bfa667c0 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 58/63] 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 6a0e7523..7c4b0f36 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 59/63] 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 d3ee3a11..0de78918 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 60/63] [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 89ba5587..30767089 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 61/63] 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 7c4b0f36..c713ded9 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 62/63] 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 c713ded9..801bfbb2 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 63/63] 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 f3d7ea62..35884ce6 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 07acf13b..4cf46fa9 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 37babd8e..f948789e 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 4498b7b0..a3b37ba3 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 1ea66f9c..6fb68f30 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 9c8f56a0..c5e84fcf 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 8f097f6c..1b5e6657 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 809ab406..8193fd34 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 08edce57..b9567d46 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 9ea97929..ac4d3422 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