From 6dd97d15e0303f648ad0a29303a7fe56f43a2c7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Jul 2019 19:04:45 +0200 Subject: [PATCH 01/16] 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 613ffec..5ef0ec4 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 02/16] 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 5ef0ec4..f144979 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 03/16] 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 3a7d66e..28a2fb2 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 + # 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' 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" + 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" - fi - fi + zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY' + editor_info[keymap]="$REPLY" - unset REPLY - zle zle-reset-prompt + 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 + + unset REPLY + zle zle-reset-prompt + fi } zle -N editor-info diff --git a/modules/prompt/README.md b/modules/prompt/README.md index 523c83e..ef32770 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 53613e7..d2d1788 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 0637208..be2a33a 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 4fe132d..1fbaedf 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 3c194fb..2b36ccc 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 70b6a54..d3b33a9 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 b600768..e57aac5 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 447ba1f..4b40bac 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 4f19989..9286967 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 2081961..3a108df 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 f69dcdd..b84011f 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 3d41b3a..cd1725b 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 2df9212..41ac7d0 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 ca39f93..d32bd34 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 04/16] 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 f144979..3fe113f 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 05/16] 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 3fe113f..635b0d7 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 06/16] 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 635b0d7..3090ae6 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 07/16] 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 1e34c4a..35c8690 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 08/16] 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 58f7ba7..95c2b15 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 09/16] 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 3090ae6..5886154 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 10/16] 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 a26f3c9..d1d3373 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 11/16] 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 47c1bc2..ce806ee 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 12/16] 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 4ede366..1c1fb99 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 13/16] 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 d8eea14..1ea66f9 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 14/16] 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 44043f1..e5967f7 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 15/16] 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 951f2a7..af447c1 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 121ea37..91dc87f 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 12848d8..feaa301 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 16/16] 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 fb56d07..5c51855 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