From 7f8b9b829a34900193daf9c46463910b9fb5ccf0 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 12 Nov 2021 08:07:53 -0800 Subject: [PATCH 01/48] general: Correct typo in installation instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves “zsh: bad substitution” --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f46e378c..5479721f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ version is **4.3.11**. git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}/.zprezto" ``` - - Configure `$XDG_CONFIG_HOME` and `$ZDOTDIR` in _`${$HOME}/.zshenv`_: + - Configure `$XDG_CONFIG_HOME` and `$ZDOTDIR` in _`$HOME/.zshenv`_: ```sh export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}" From ecaed1cfa7591d2304d7eb5d69b42b54961a7145 Mon Sep 17 00:00:00 2001 From: David Crook Date: Tue, 16 Nov 2021 10:49:33 -0700 Subject: [PATCH 02/48] change polarity of test for BROWSER --- modules/git/functions/git-hub-browse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/functions/git-hub-browse b/modules/git/functions/git-hub-browse index bdeb298b..3451198c 100644 --- a/modules/git/functions/git-hub-browse +++ b/modules/git/functions/git-hub-browse @@ -47,7 +47,7 @@ file="$3" if [[ -n "$url" ]]; then url="$url/tree/$reference/$file" - if [[ -z "$BROWSER" ]]; then + if [[ -n "$BROWSER" ]]; then "$BROWSER" "$url" return 0 else From 7884fb2271d131bb492fafc4eba1c537a821092b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 11 Jan 2022 10:17:21 +0100 Subject: [PATCH 03/48] prompt: update powerlevel10k submodule to v1.16.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.16.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 f5d61840..683a4852 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit f5d61840ae3a4f8c2765e1a67d94d9a96de71601 +Subproject commit 683a485232d75978a79199a305c4fc4843772a77 From d6e1ef5fcf22664dbf47a5be2709e05f1f6f21a1 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 2 Feb 2022 13:54:45 +0100 Subject: [PATCH 04/48] prompt: update powerlevel10k submodule to v1.16.1 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.16.1 --- 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 683a4852..8a676a91 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 683a485232d75978a79199a305c4fc4843772a77 +Subproject commit 8a676a9157d2b0e00e88d06456ac7317f11c0317 From d840f0fc7bb9e604fedef40eff4ed53f4c3c60f6 Mon Sep 17 00:00:00 2001 From: zbirenbaum Date: Thu, 3 Feb 2022 22:08:36 -0500 Subject: [PATCH 05/48] Fix crash on open caused by incorrect conditional in python module --- modules/python/init.zsh | 45 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 91aa6d0a..22b61c3e 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -114,33 +114,34 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \ pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*}) fi + # Optionally activate 'virtualenv' plugin when available. if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then - # Enable 'virtualenv' with 'pyenv'. eval "$(pyenv virtualenv-init - zsh)" - - # Optionally activate 'virtualenvwrapper' plugin when available. - if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then - pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" - fi - else - # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is - # available in '$path'. - if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then - VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] - fi - - virtenv_sources=( - ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} - /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) - ) - if (( $#virtenv_sources )); then - source "$virtenv_sources[1]" - fi - - unset virtenv_sources fi + # Optionally activate 'virtualenvwrapper' plugin when available. + if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then + pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" + fi + unset pyenv_plugins + +else + # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is + # available in '$path'. + if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then + VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] + fi + + virtenv_sources=( + ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} + /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) + ) + if (( $#virtenv_sources )); then + source "$virtenv_sources[1]" + fi + + unset virtenv_sources fi # Load conda into the shell session, if requested. From bf3dfe8c02d074fbf6e29238ce4277287e0d876f Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Mon, 14 Feb 2022 20:55:40 -0500 Subject: [PATCH 06/48] Update Pure prompt to 1.20.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 2e354b80..c25ab93e 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit 2e354b80deae105ea246699c49e65dcd4fe8b759 +Subproject commit c25ab93eca8275144ad1ee9c2167668e550a82f5 From 7ec1ecde3a2b5f195432259bb32934cfd16dd5bc Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 26 Feb 2022 13:26:30 -0600 Subject: [PATCH 07/48] prompt: Update pure submodule to 1.20.1 --- 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 c25ab93e..5b458ba5 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit c25ab93eca8275144ad1ee9c2167668e550a82f5 +Subproject commit 5b458ba5b75f49a8071d53c343f1a23631f7bced From 15150085e6ffc0e46b00cb0809914e41ea08bab4 Mon Sep 17 00:00:00 2001 From: Aaron Kanter Date: Sat, 12 Mar 2022 19:16:35 -0800 Subject: [PATCH 08/48] Only export env variables in zprofile if unset As per [zsh documentation](https://zsh.sourceforge.io/Intro/intro_3.html) environment variables should be expected to be in `.zshenv` and not be overridden in `.zprofile`. This change modifies BROWSER (on darwin systems only), EDITOR, VISUAL, PAGER, LESS, and LESSOPEN to only use zprezto defaults if they were not previously set in the loading order. See: https://github.com/nix-community/home-manager/issues/2739 https://github.com/nix-community/home-manager/issues/2751 --- runcoms/zprofile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/runcoms/zprofile b/runcoms/zprofile index 1cf48bfb..b12367ac 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -9,7 +9,7 @@ # Browser # -if [[ "$OSTYPE" == darwin* ]]; then +if [[ -z "$BROWSER" && "$OSTYPE" == darwin* ]]; then export BROWSER='open' fi @@ -17,9 +17,15 @@ fi # Editors # -export EDITOR='nano' -export VISUAL='nano' -export PAGER='less' +if [[ -z "$EDITOR" ]]; then + export EDITOR='nano' +fi +if [[ -z "$VISUAL" ]]; then + export VISUAL='nano' +fi +if [[ -z "$PAGER" ]]; then + export PAGER='less' +fi # # Language @@ -54,10 +60,12 @@ path=( # Set the default Less options. # Mouse-wheel scrolling has been disabled by -X (disable screen clearing). # Remove -X to enable it. -export LESS='-g -i -M -R -S -w -X -z-4' +if [[ -z "$LESS" ]]; then + export LESS='-g -i -M -R -S -w -X -z-4' +fi # Set the Less input preprocessor. # Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. -if (( $#commands[(i)lesspipe(|.sh)] )); then +if [[ -z "$LESSOPEN" && (( $#commands[(i)lesspipe(|.sh)] )) ]]; then export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" fi From 98d69fc91fac21195601d914c8aee6071aa005e1 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Tue, 29 Mar 2022 18:50:35 -0500 Subject: [PATCH 09/48] zprofile: adjust condition for `LESSOPEN` export Split tests for condition for `export LESSOPEN` separate per convention --- runcoms/zprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runcoms/zprofile b/runcoms/zprofile index b12367ac..5b8b638c 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -66,6 +66,6 @@ fi # Set the Less input preprocessor. # Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. -if [[ -z "$LESSOPEN" && (( $#commands[(i)lesspipe(|.sh)] )) ]]; then +if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" fi From 1ff1099d0588d32511b2ab0cd24e1cf30ebc5236 Mon Sep 17 00:00:00 2001 From: Jim Boulter Date: Sun, 6 Mar 2022 13:23:55 -0800 Subject: [PATCH 10/48] Allow users to set a dirty-branch format --- modules/git/functions/git-info | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index 07f261d4..eca50462 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -417,6 +417,11 @@ function git-info { if (( dirty > 0 )); then zstyle -s ':prezto:module:git:info:dirty' format 'dirty_format' zformat -f dirty_formatted "$dirty_format" "D:$dirty" + # Overwrite branch format to use dirty-branch format + zstyle -s ':prezto:module:git:info:dirty-branch' format 'branch_format' + if [[ -n "$branch" && -n "$branch_format" ]]; then + zformat -f branch_formatted "$branch_format" "b:$branch" + fi else zstyle -s ':prezto:module:git:info:clean' format 'clean_formatted' fi From 3da67271b95a55daca55adec0a624c9113687dce Mon Sep 17 00:00:00 2001 From: Eugen Blattner Date: Fri, 18 Mar 2022 11:43:05 +0100 Subject: [PATCH 11/48] fix: use inflating binaries instead of deflating in unarchive function --- modules/archive/functions/unarchive | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/archive/functions/unarchive b/modules/archive/functions/unarchive index 66c7e35a..d66fef83 100644 --- a/modules/archive/functions/unarchive +++ b/modules/archive/functions/unarchive @@ -34,10 +34,10 @@ fi # here, we check for dropin/multi-threaded replacements # this should eventually be moved to modules/archive/init.zsh # as a global alias -if (( $+commands[pigz] )); then - _gzip_bin='pigz' +if (( $+commands[unpigz] )); then + _gzip_bin='unpigz' else - _gzip_bin='gzip' + _gzip_bin='gunzip' fi if (( $+commands[pixz] )); then @@ -46,12 +46,12 @@ else _xz_bin='xz' fi -if (( $+commands[lbzip2] )); then - _bzip2_bin='lbzip2' -elif (( $+commands[pbzip2] )); then - _bzip2_bin='pbzip2' +if (( $+commands[lbunzip2] )); then + _bzip2_bin='lbunzip2' +elif (( $+commands[pbunzip2] )); then + _bzip2_bin='pbunzip2' else - _bzip2_bin='bzip2' + _bzip2_bin='bunzip2' fi _zstd_bin='zstd' From 2c663313168490d28f607738e962aa45ada0e26b Mon Sep 17 00:00:00 2001 From: Eugen Blattner Date: Tue, 5 Apr 2022 20:48:58 +0200 Subject: [PATCH 12/48] fix: use deflating flag for pixz in unarchive function --- modules/archive/functions/unarchive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/archive/functions/unarchive b/modules/archive/functions/unarchive index d66fef83..3e58b867 100644 --- a/modules/archive/functions/unarchive +++ b/modules/archive/functions/unarchive @@ -41,7 +41,7 @@ else fi if (( $+commands[pixz] )); then - _xz_bin='pixz' + _xz_bin='pixz -d' else _xz_bin='xz' fi From ac1c39d2e1c730f76b0430915e05d349763ba2e1 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 30 Mar 2022 12:22:54 -0500 Subject: [PATCH 13/48] completion: Detect Homebrew prefix internally, not idiomatically For performance reasons, we prefer detecting Homebrew prefix internally instead of the more idiomatic form `brew --prefix`. We attempt looking up $HOMEBREW_PREFIX or $HOMEBREW_REPOSITORY first (in case `brew shellenv` has been sourced-in earlier). Else, we look it up by resolving absolute path of $HOMEBREW_REPOSITORY. $HOMEBREW_PREFIX is same as $HOMEBREW_REPOSITORY except when Homebrew is installed in '/usr/local' ($HOMEBREW_REPOSITORY == '/usr/local/Homebrew'). This is usually the case for Intel Macs. This should work for most standard (and officially documented) Homebrew installations. For implementation details in Homebrew, see: https://github.com/Homebrew/brew/blob/2a850e02d8f2dedcad7164c2f4b95d340a7200bb/bin/brew#L62-L70 Co-authored-by: mattmc3 --- modules/completion/init.zsh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index fc5cfd45..9ba95634 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -14,12 +14,16 @@ fi # Add zsh-completions to $fpath. fpath=(${0:h}/external/src $fpath) -# Add completion for keg-only brewed curl when available. -if (( $+commands[brew] )) \ - && [[ -d "${curl_prefix::="$(brew --prefix 2> /dev/null)"/opt/curl}" ]]; then - fpath=($curl_prefix/share/zsh/site-functions $fpath) +# Add completion for keg-only brewed curl on macOS when available. +if (( $+commands[brew] )); then + brew_prefix=${HOMEBREW_PREFIX:-${HOMEBREW_REPOSITORY:-$commands[brew]:A:h:h}} + # $HOMEBREW_PREFIX defaults to $HOMEBREW_REPOSITORY but is explicitly set to + # /usr/local when $HOMEBREW_REPOSITORY is /usr/local/Homebrew. + # https://github.com/Homebrew/brew/blob/2a850e02d8f2dedcad7164c2f4b95d340a7200bb/bin/brew#L66-L69 + [[ $brew_prefix == '/usr/local/Homebrew' ]] && brew_prefix=$brew_prefix:h + fpath=($brew_prefix/opt/curl/share/zsh/site-functions(/N) $fpath) + unset brew_prefix fi -unset curl_prefix # # Options From c857e809c3aca796ec1dc35a01d5b2c0ae535b90 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 1 Apr 2022 10:51:37 -0500 Subject: [PATCH 14/48] command-not-found: Detect Homebrew repo internally, not idiomatically For performance reasons, we prefer detecting Homebrew prefix internally instead of the more idiomatic form `brew --repository`. We attempt looking up $HOMEBREW_REPOSITORY first (in case `brew shellenv` has been sourced-in earlier). Else, we look it up by resolving absolute path of $HOMEBREW_REPOSITORY. This should work for most standard (and officially documented) Homebrew installations. --- modules/command-not-found/init.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index d81692d8..cf8f64ea 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -7,14 +7,14 @@ # # Load command-not-found on Debian-based distributions. -if [[ -s '/etc/zsh_command_not_found' ]]; then - source '/etc/zsh_command_not_found' +if [[ -s /etc/zsh_command_not_found ]]; then + source /etc/zsh_command_not_found # Load command-not-found on Arch Linux-based distributions. -elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then - source '/usr/share/doc/pkgfile/command-not-found.zsh' +elif [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then + source /usr/share/doc/pkgfile/command-not-found.zsh # Load command-not-found on macOS when Homebrew tap is configured. elif (( $+commands[brew] )) \ - && [[ -s "${hb_cnf_handler::="$(brew --repository 2> /dev/null)"/Library/Taps/homebrew/homebrew-command-not-found/handler.sh}" ]]; then + && [[ -s ${hb_cnf_handler::="${HOMEBREW_REPOSITORY:-$commands[brew]:A:h:h}/Library/Taps/homebrew/homebrew-command-not-found/handler.sh"} ]]; then source "$hb_cnf_handler" unset hb_cnf_handler # Return if requirements are not found. From 3dc3fa7f8c484569a721724fa13c77cecd1dd923 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 1 Apr 2022 15:40:01 -0500 Subject: [PATCH 15/48] zprofile: Expand the default list of well known paths Two additional sets of paths are now added to the default list of well known paths: '$HOME/{bin,sbin}' and '/opt/{homebrew,local}/{bin,sbin}'. - '$HOME/{bin,sbin}': Most users have custom scripts in '$HOME/bin' anyway, we might as well honor those. '$HOME/sbin' is not really common, but we can keep it for consistency. - '/opt/{homebrew,local}/{bin,sbin}': With Homebrew changing default installation location in macOS on Apple Silicon which will eventually become ubiquitous, we have a good reason to add these paths by default. While at it, we also honor MacPorts installation. In all cases, we add them _iff_ the paths actually exist, not otherwise. This has the side effect of a newly installed program not available immediately in the '$path' in a mint fresh system (because of the fact that '/opt/{homebrew,local}/{bin,sbin}' won't exist initially) until the shell is reloaded. But that's a minor inconvenience to keep the '$path' from getting unnecessarily bloated. --- runcoms/zprofile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runcoms/zprofile b/runcoms/zprofile index 5b8b638c..d2acd311 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -49,7 +49,9 @@ typeset -gU cdpath fpath mailpath path # Set the list of directories that Zsh searches for programs. path=( - /usr/local/{bin,sbin} + $HOME/{,s}bin(N) + /opt/{homebrew,local}/{,s}bin(N) + /usr/local/{,s}bin(N) $path ) From dea85a0740253c0e17fa7eadb067694e11f5451c Mon Sep 17 00:00:00 2001 From: Shea690901 Date: Tue, 5 Apr 2022 20:46:49 +0200 Subject: [PATCH 16/48] feat(module/history): add full configurability While previusly configurable, it was inconsistent with other configuration options and it was missing configurability of in memory / on disc history size. Signed-off-by: Shea690901 --- modules/history/README.md | 29 +++++++++++++++++++++++++++++ modules/history/init.zsh | 10 +++++++--- runcoms/zpreztorc | 13 +++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/modules/history/README.md b/modules/history/README.md index 3806096a..25e429d1 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -38,6 +38,35 @@ Alternately, you can set `HISTFILE` manually to _`${ZDOTDIR:-$HOME}/.zhistory`_. - `history-stat` lists the ten most used commands +## Settings + +### histfile + +Can be configured either by setting HISTFILE manually before loading this +module or by using zstyle: + +```sh +zstyle ':prezto:module:history' histfile "" +``` + +defaults to "${ZDOTDIR:-$HOME}/.zsh_history". + +## histsize + +```sh +zstyle ':prezto:module:history' histsize +``` + +defaults to 10000. + +## savehist + +```sh +zstyle ':prezto:module:history' savehist +``` + +defaults to histsize + ## Authors _The authors of this module should be contacted via the [issue tracker][2]._ diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 3f815c02..1f9a09b4 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -26,9 +26,13 @@ setopt HIST_BEEP # Beep when accessing non-existent history. # Variables # -HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" # 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. +zstyle -s ':prezto:module:history' histfile '_pmh_histfile' || _pmh_histfile="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" +zstyle -s ':prezto:module:history' histsize '_pmh_histsize' || _pmh_histsize=10000 +zstyle -s ':prezto:module:history' savehist '_pmh_savehist' || _pmh_savehist=${_pmh_histsize} +HISTFILE="${_pmh_histfile}" # The path to the history file. +HISTSIZE="${_pmh_histsize}" # The maximum number of events to save in the internal history. +SAVEHIST="${_pmh_savehist}" # The maximum number of events to save in the history file. +unset _pmh_{hist{file,size},savehist} # # Aliases diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index cc6ebb4b..ae68a893 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -83,6 +83,19 @@ zstyle ':prezto:module:editor' key-bindings 'emacs' # Set the command prefix on non-GNU systems. # zstyle ':prezto:module:gnu-utility' prefix 'g' +# +# History +# + +# Set the file to save the history in when an interactive shell exits. +# zstyle ':prezto:module:history' histfile "${ZDOTDIR:-$HOME}/.zsh_history" + +# Set the maximum number of events stored in the internal history list. +# zstyle ':prezto:module:history' histsize 10000 + +# Set the maximum number of history events to save in the history file. +# zstyle ':prezto:module:history' savehist 10000 + # # History Substring Search # From 12df1363cec395526d26c6f2be34e3013413da1e Mon Sep 17 00:00:00 2001 From: Eugen Blattner Date: Mon, 11 Apr 2022 14:21:25 +0200 Subject: [PATCH 17/48] fix: heading level for new hist file settings --- modules/history/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/history/README.md b/modules/history/README.md index 25e429d1..11c6d947 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -51,7 +51,7 @@ zstyle ':prezto:module:history' histfile "" defaults to "${ZDOTDIR:-$HOME}/.zsh_history". -## histsize +### histsize ```sh zstyle ':prezto:module:history' histsize @@ -59,7 +59,7 @@ zstyle ':prezto:module:history' histsize defaults to 10000. -## savehist +### savehist ```sh zstyle ':prezto:module:history' savehist From 3a471a05f99d53a159197d4c47f77d19c9bb4ca9 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 8 Jun 2022 17:17:49 +1000 Subject: [PATCH 18/48] Update docker compose references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker For Mac has broken support for `docker-compose`. Since `docker compose` is a drop in replacement and it Just Works™, this PR converts `docker-compose` to `docker compose` --- modules/docker/alias.zsh | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/docker/alias.zsh b/modules/docker/alias.zsh index cdd9f7c8..12eb2542 100644 --- a/modules/docker/alias.zsh +++ b/modules/docker/alias.zsh @@ -152,26 +152,26 @@ alias dkmv='docker-machine version' alias dkmx='docker-machine stop' # Docker Compose (c) -alias dkc='docker-compose' -alias dkcb='docker-compose build' -alias dkcB='docker-compose build --no-cache' -alias dkcd='docker-compose down' -alias dkce='docker-compose exec' -alias dkck='docker-compose kill' -alias dkcl='docker-compose logs' -alias dkcls='docker-compose ps' -alias dkcp='docker-compose pause' -alias dkcP='docker-compose unpause' -alias dkcpl='docker-compose pull' -alias dkcph='docker-compose push' -alias dkcps='docker-compose ps' -alias dkcr='docker-compose run' -alias dkcR='docker-compose run --rm' -alias dkcrm='docker-compose rm' -alias dkcs='docker-compose start' -alias dkcsc='docker-compose scale' -alias dkcS='docker-compose restart' -alias dkcu='docker-compose up' -alias dkcU='docker-compose up -d' -alias dkcv='docker-compose version' -alias dkcx='docker-compose stop' +alias dkc='docker compose' +alias dkcb='docker compose build' +alias dkcB='docker compose build --no-cache' +alias dkcd='docker compose down' +alias dkce='docker compose exec' +alias dkck='docker compose kill' +alias dkcl='docker compose logs' +alias dkcls='docker compose ps' +alias dkcp='docker compose pause' +alias dkcP='docker compose unpause' +alias dkcpl='docker compose pull' +alias dkcph='docker compose push' +alias dkcps='docker compose ps' +alias dkcr='docker compose run' +alias dkcR='docker compose run --rm' +alias dkcrm='docker compose rm' +alias dkcs='docker compose start' +alias dkcsc='docker compose scale' +alias dkcS='docker compose restart' +alias dkcu='docker compose up' +alias dkcU='docker compose up -d' +alias dkcv='docker compose version' +alias dkcx='docker compose stop' From b2bc66ce9de358cb31c323f8e383d3d303839992 Mon Sep 17 00:00:00 2001 From: Ilkin Bayramli <43158991+ibayramli2001@users.noreply.github.com> Date: Wed, 15 Jun 2022 10:42:21 -0700 Subject: [PATCH 19/48] Add Fig as an installation method to the README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5479721f..7b2efb1d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ and prompt themes. ## Installation +### Manual + Prezto will work with any recent release of Zsh, but the minimum required version is **4.3.11**. @@ -71,6 +73,14 @@ version is **4.3.11**. 05. Open a new Zsh terminal window or tab. +### [Fig](https://fig.io) + +Fig adds apps, shortcuts, and autocomplete to your existing terminal. + +Install `prezto` in just one click. + + + ### Troubleshooting If you are not able to find certain commands after switching to Prezto, modify From 0aef8086b5deeda4681ce12b90df621d53d16b3c Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 21 Jul 2022 12:14:01 -0500 Subject: [PATCH 20/48] completion: Update completion submodule to 0.34.0 --- modules/completion/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/external b/modules/completion/external index 11ad0a45..0331b290 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 11ad0a45ff1695cac00e86c687cce6fa1fd1cdbd +Subproject commit 0331b2908f93556453e45fa5a899aa21e0a7f64d From 3ea20cfbe8d55259016e37a69e4fae7356e322e0 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 3 Aug 2022 15:37:00 -0500 Subject: [PATCH 21/48] utility: Make 'http-serve' handler faster for well known cases In most systems, python2 or python3 command/soft-link would almost always exist. In such cases, we don't need to invoke `python` to detect the version. This should speed things up a bit as well. --- modules/utility/init.zsh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index c6dc3c03..c9015915 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -196,12 +196,14 @@ fi # Serves a directory via HTTP. if (( $#commands[(i)python(|[23])] )); then autoload -Uz is-at-least - if is-at-least 3 ${"$(python --version 2>&1)"[(w)2]}; then - alias http-serve='python -m http.server' - elif (( $+commands[python3] )); then + if (( $+commands[python3] )); then alias http-serve='python3 -m http.server' + elif (( $+commands[python2] )); then + alias http-serve='python2 -m SimpleHTTPServer' + elif is-at-least 3 ${"$(python --version 2>&1)"[(w)2]}; then + alias http-serve='python -m http.server' else - alias http-serve='$commands[(i)python(|2)] -m SimpleHTTPServer' + alias http-serve='python -m SimpleHTTPServer' fi fi From 51c4ff6de4e2d1afd30e52ba19b21b1128fd1ed5 Mon Sep 17 00:00:00 2001 From: Shea690901 Date: Thu, 7 Apr 2022 21:40:04 +0200 Subject: [PATCH 22/48] feat(module/ssh): add globbing for ssh-add param fixes #2000 Signed-off-by: Shea690901 --- modules/ssh/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index b9567d46..f8709979 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -52,9 +52,9 @@ if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then # program specified by SSH_ASKPASS and open an X11 window to read the # passphrase. if [[ -n "$DISPLAY" && -x "$SSH_ASKPASS" ]]; then - ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} < /dev/null 2> /dev/null + ssh-add ${_ssh_identities:+$_ssh_dir/${^~_ssh_identities[@]}} < /dev/null 2> /dev/null else - ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} 2> /dev/null + ssh-add ${_ssh_identities:+$_ssh_dir/${^~_ssh_identities[@]}} 2> /dev/null fi fi From 357ce2ebbf9e6449ea75e6d5f4c7806749e3cfd0 Mon Sep 17 00:00:00 2001 From: Thomas Blaschke Date: Sat, 2 Oct 2021 18:10:02 +0200 Subject: [PATCH 23/48] Add exception for PyCharm terminal emulation Do not autostart tmux if we start a terminal inside PyCharm. Should also work for other JetBrains products. --- 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 5c51855f..2075daa3 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" && "$TERM_PROGRAM" != "vscode" ]] && ( \ +if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && "$TERM_PROGRAM" != "vscode" && "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]] && ( \ ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ ); then From 97f36e9402f6f85820779cc43126b80fbad2c80a Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Sat, 5 Feb 2022 11:22:29 +1100 Subject: [PATCH 24/48] Add `-` alias for `cd -` Taken with love from `oh-my-zsh` --- modules/directory/init.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/directory/init.zsh b/modules/directory/init.zsh index 8abc1e24..c5a01f1d 100644 --- a/modules/directory/init.zsh +++ b/modules/directory/init.zsh @@ -25,5 +25,6 @@ unsetopt CLOBBER # Do not overwrite existing files with > and >>. # Aliases # +alias -- -='cd -' alias d='dirs -v' for index ({1..9}) alias "$index"="cd +${index}"; unset index From ca9012c7763e6372124465e14e8b0dc1d7db4e65 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 25 Oct 2022 15:49:51 -0700 Subject: [PATCH 25/48] Set `EXTENDED_GLOB` in the python module This is needed to find python. It is often already set because a user has the directory or completion module loaded before this, but that's not always true. See extensive debugging / further explanation here: https://github.com/sorin-ionescu/prezto/issues/1949 This does not fully resolve that issue, as there's another enhancement that I'll put up as a separate PR. --- modules/python/init.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 22b61c3e..1c7a9a4e 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -8,6 +8,12 @@ # Indrajit Raychaudhuri # +# +# Options +# + +setopt EXTENDED_GLOB + # Load dependencies. pmodload 'helper' From e3a9583f3370e11a0da1414d3f335eac40c1e922 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 25 Oct 2022 21:24:51 -0700 Subject: [PATCH 26/48] Support `virtualenvwrapper` with / without `pyenv` `virtualenv-init` or `virtualenvwrapper` plugins The desired logic is: For the `pyenv` plugins `virtualenv-init` and `virtualenvwrapper`: 1. If either plugin is present, activate it 2. If `virtualenvwrapper` plugin is not present, then [fallback to standard `virtualenvwrapper`](https://github.com/sorin-ionescu/prezto/pull/1414#issuecomment-320306421). 3. If `virtualenvwrapper` plugin is present, then [don't fallback to standard `virtualenvwrapper`, regardless of whether `virtualenv-init` is present](https://github.com/sorin-ionescu/prezto/pull/1981#issue-1123766676). Previously, if the `virtualenv` command was present but `pyenv` was missing, then the fallback wouldn't be hit. This bug was introduced by https://github.com/sorin-ionescu/prezto/pull/1981/ which ensured that the `pyenv` `virtualenvwrapper` plugin was activated if present, regardless of the presence of the `virtualenv-init` plugin. As an optimization, the check for the `pyenv` plugins are skipped if `pyenv` itself isn't found. Since we only want to fallback if the `pyenv` `virtualenvwrapper` plugin is missing, but that's buried within the `pyenv` logic and we also need to handle when `pyenv` itself is missing, this switches to using a flag variable. I also renamed the `virtualenv_sources` var to `virtualenvwrapper_sources` as `virtualenv` is distinct from `virtualenvwrapper`, so using one name for a var that is really about the other is confusing. Looking at `git blame`, there's a _lot_ of prior art here around trying to support all the permutations of `pyenv` and various plugins: * https://github.com/sorin-ionescu/prezto/issues/1413 * https://github.com/sorin-ionescu/prezto/pull/1414 * https://github.com/sorin-ionescu/prezto/pull/1433 * https://github.com/sorin-ionescu/prezto/pull/1434 So we need to be extremely careful to continue to support all these permutations. Fix https://github.com/sorin-ionescu/prezto/issues/2022 --- modules/python/init.zsh | 56 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 1c7a9a4e..a80a9c47 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -116,38 +116,42 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \ # look for plugins of interest. Scanning shell '$path' isn't enough as they # can exist in 'pyenv' synthesized paths (e.g., '~/.pyenv/plugins') instead. local -a pyenv_plugins + local pyenv_virtualenvwrapper_plugin_found if (( $+commands[pyenv] )); then pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*}) + + # Optionally activate 'virtualenv-init' plugin when available. + if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then + eval "$(pyenv virtualenv-init - zsh)" + fi + + # Optionally activate 'virtualenvwrapper' plugin when available. + if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then + pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" + pyenv_virtualenvwrapper_plugin_found="true" + fi + + unset pyenv_plugins fi - # Optionally activate 'virtualenv' plugin when available. - if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then - eval "$(pyenv virtualenv-init - zsh)" + if [[ $pyenv_virtualenvwrapper_plugin_found != "true" ]]; then + # Fallback to standard 'virtualenvwrapper' if 'python' is available in '$path'. + if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then + VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] + fi + + virtualenvwrapper_sources=( + ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} + /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) + ) + if (( $#virtualenvwrapper_sources )); then + source "$virtualenvwrapper_sources[1]" + fi + + unset virtualenvwrapper_sources fi - # Optionally activate 'virtualenvwrapper' plugin when available. - if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then - pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" - fi - - unset pyenv_plugins - -else - # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is - # available in '$path'. - if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then - VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] - fi - - virtenv_sources=( - ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} - /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) - ) - if (( $#virtenv_sources )); then - source "$virtenv_sources[1]" - fi - - unset virtenv_sources + unset pyenv_virtualenvwrapper_plugin_found fi # Load conda into the shell session, if requested. From e50b93ca882aa58b0119b2e90818c4157e30c794 Mon Sep 17 00:00:00 2001 From: huyz Date: Fri, 23 Dec 2022 00:31:55 -0800 Subject: [PATCH 27/48] Fix zcompile race condition sorin-ionescu/prezto#2028 --- runcoms/zlogin | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runcoms/zlogin b/runcoms/zlogin index ac4d3422..2f834353 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -10,7 +10,10 @@ # Compile the completion dump to increase startup speed. zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then - zcompile "$zcompdump" + if command mkdir "${zcompdump}.zwc.lock" 2>/dev/null; then + zcompile "$zcompdump" + command rmdir "${zcompdump}.zwc.lock" 2>/dev/null + fi fi } &! From a4ca9243109a2a03a844afc93a1d4d3212752f15 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 14 Jan 2023 15:18:03 +0100 Subject: [PATCH 28/48] prompt: update powerlevel10k submodule to v1.17.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.17.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 8a676a91..a066b55f 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 8a676a9157d2b0e00e88d06456ac7317f11c0317 +Subproject commit a066b55f855c8e488d3ea9e26e861bdd5ecd4fe8 From 8be95c9c7e816cb1277f127eb281d5b5408ed22d Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Sat, 28 Jan 2023 21:29:09 -0500 Subject: [PATCH 29/48] Fix osx module manp function --- modules/osx/functions/manp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/osx/functions/manp b/modules/osx/functions/manp index fcb2a026..d31bbc40 100644 --- a/modules/osx/functions/manp +++ b/modules/osx/functions/manp @@ -9,7 +9,7 @@ function manp { local page if (( $# > 0 )); then for page in "$@"; do - man -t "$page" | open -f -a Preview + mandoc -T pdf "$(/usr/bin/man -w $page)" | open -fa Preview done else print 'What manual page do you want?' >&2 From fc444f57e11131b2cad68f474bcf1201cba062a4 Mon Sep 17 00:00:00 2001 From: Julio Batista Silva Date: Tue, 31 Jan 2023 18:02:09 +0100 Subject: [PATCH 30/48] gnu-utility: add awk https://www.gnu.org/software/gawk/ https://formulae.brew.sh/formula/gawk --- modules/gnu-utility/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gnu-utility/init.zsh b/modules/gnu-utility/init.zsh index 85e86050..a8521f0c 100644 --- a/modules/gnu-utility/init.zsh +++ b/modules/gnu-utility/init.zsh @@ -44,8 +44,8 @@ _gnu_utility_cmds=( 'libtool' 'libtoolize' # Miscellaneous - 'egrep' 'fgrep' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' - 'which' + 'awk' 'egrep' 'fgrep' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' + 'units' 'which' ) # Wrap GNU utilities in functions. From da87c79b3a35f5a4a504ea331e9ec52b4f786976 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 12 Apr 2023 22:02:41 -0400 Subject: [PATCH 31/48] Add zstyle to skip aliases for additional modules --- modules/directory/init.zsh | 8 +++-- modules/emacs/init.zsh | 10 +++--- modules/fasd/init.zsh | 6 ++-- modules/history/init.zsh | 6 ++-- modules/homebrew/init.zsh | 32 ++++++++++--------- modules/macports/init.zsh | 16 +++++----- modules/node/init.zsh | 30 +++++++++--------- modules/perl/init.zsh | 64 ++++++++++++++++++++------------------ modules/python/init.zsh | 8 +++-- modules/rails/init.zsh | 30 +++++++++--------- modules/ruby/init.zsh | 38 +++++++++++----------- modules/screen/init.zsh | 10 +++--- modules/tmux/init.zsh | 6 ++-- 13 files changed, 145 insertions(+), 119 deletions(-) diff --git a/modules/directory/init.zsh b/modules/directory/init.zsh index c5a01f1d..caf08d2a 100644 --- a/modules/directory/init.zsh +++ b/modules/directory/init.zsh @@ -25,6 +25,8 @@ unsetopt CLOBBER # Do not overwrite existing files with > and >>. # Aliases # -alias -- -='cd -' -alias d='dirs -v' -for index ({1..9}) alias "$index"="cd +${index}"; unset index +if ! zstyle -t ':prezto:module:directory:alias' skip; then + alias -- -='cd -' + alias d='dirs -v' + for index ({1..9}) alias "$index"="cd +${index}"; unset index +fi diff --git a/modules/emacs/init.zsh b/modules/emacs/init.zsh index 3acc965c..a53285ab 100644 --- a/modules/emacs/init.zsh +++ b/modules/emacs/init.zsh @@ -19,7 +19,9 @@ source "$HOME/.cask/etc/cask_completion.zsh" 2> /dev/null # Aliases # -alias cai='cask install' -alias cau='cask update' -alias caI='cask init' -alias cae='cask exec' +if ! zstyle -t ':prezto:module:emacs:alias' skip; then + alias cai='cask install' + alias cau='cask update' + alias caI='cask init' + alias cae='cask exec' +fi diff --git a/modules/fasd/init.zsh b/modules/fasd/init.zsh index f948789e..bd142f80 100644 --- a/modules/fasd/init.zsh +++ b/modules/fasd/init.zsh @@ -53,5 +53,7 @@ function fasd_cd { # Aliases # -# Changes the current working directory interactively. -alias j='fasd_cd -i' +if ! zstyle -t ':prezto:module:fasd:alias' skip; then + # Changes the current working directory interactively. + alias j='fasd_cd -i' +fi diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 1f9a09b4..3ef52ea4 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -38,8 +38,10 @@ unset _pmh_{hist{file,size},savehist} # Aliases # -# Lists the ten most used commands. -alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" +if ! zstyle -t ':prezto:module:history:alias' skip; then + # Lists the ten most used commands. + alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" +fi if [[ -s "${OLD_HISTFILE::=${HISTFILE:h}/.zhistory}" ]]; then diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 4b0fb86a..78992587 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -29,19 +29,21 @@ 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' -alias brewu='brew upgrade' -alias brewx='brew uninstall' +if ! zstyle -t ':prezto:module:homebrew:alias' skip; then + alias brewc='brew cleanup' + alias brewi='brew install' + alias brewL='brew leaves' + alias brewl='brew list' + alias brewo='brew outdated' + alias brews='brew search' + alias brewu='brew upgrade' + alias brewx='brew uninstall' -# Homebrew Cask -alias caski='brew install --cask' -alias caskl='brew list --cask' -alias casko='brew outdated --cask' -alias casks='brew search --cask' -alias casku='brew upgrade --cask' -alias caskx='brew uninstall --cask' + # Homebrew Cask + alias caski='brew install --cask' + alias caskl='brew list --cask' + alias casko='brew outdated --cask' + alias casks='brew search --cask' + alias casku='brew upgrade --cask' + alias caskx='brew uninstall --cask' +fi diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index 7bf4ab29..1ac3c531 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -28,10 +28,12 @@ path=( # Aliases # -alias portc='sudo port clean --all installed' -alias porti='sudo port install' -alias ports='port search' -alias portU='sudo port selfupdate && sudo port upgrade outdated' -alias portu='sudo port upgrade' -alias portX='sudo port -u uninstall' -alias portx='sudo port uninstall' +if ! zstyle -t ':prezto:module:macports:alias' skip; then + alias portc='sudo port clean --all installed' + alias porti='sudo port install' + alias ports='port search' + alias portU='sudo port selfupdate && sudo port upgrade outdated' + alias portu='sudo port upgrade' + alias portX='sudo port -u uninstall' + alias portx='sudo port uninstall' +fi diff --git a/modules/node/init.zsh b/modules/node/init.zsh index b3591049..0c27764d 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -48,18 +48,20 @@ N_PREFIX="${XDG_CONFIG_HOME:-$HOME/.config}/n" # The path to 'n' cache. # Aliases # -# npm -alias npmi='npm install' -alias npml='npm list' -alias npmo='npm outdated' -alias npmp='npm publish' -alias npmP='npm prune' -alias npmr='npm run' -alias npms='npm search' -alias npmt='npm test' -alias npmu='npm update' -alias npmx='npm uninstall' +if ! zstyle -t ':prezto:module:node:alias' skip; then + # npm + alias npmi='npm install' + alias npml='npm list' + alias npmo='npm outdated' + alias npmp='npm publish' + alias npmP='npm prune' + alias npmr='npm run' + alias npms='npm search' + alias npmt='npm test' + alias npmu='npm update' + alias npmx='npm uninstall' -alias npmci='npm ci' -alias npmcit='npm cit' -alias npmit='npm it' + alias npmci='npm ci' + alias npmcit='npm cit' + alias npmit='npm it' +fi diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 1b5e6657..efadd9ea 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -61,37 +61,39 @@ fi # Aliases # -# General -alias pl='perl' -alias pld='perldoc' -alias ple='perl -wlne' +if ! zstyle -t ':prezto:module:perl:alias' skip; then + # General + alias pl='perl' + alias pld='perldoc' + alias ple='perl -wlne' -# Perlbrew -if (( $+commands[perlbrew] )); then - alias plb='perlbrew' - alias plba='perlbrew available' - alias plbi='perlbrew install' - alias plbl='perlbrew list' - alias plbo='perlbrew off' - alias plbO='perlbrew switch-off' - alias plbs='perlbrew switch' - alias plbu='perlbrew use' - alias plbx='perlbrew uninstall' + # Perlbrew + if (( $+commands[perlbrew] )); then + alias plb='perlbrew' + alias plba='perlbrew available' + alias plbi='perlbrew install' + alias plbl='perlbrew list' + alias plbo='perlbrew off' + alias plbO='perlbrew switch-off' + alias plbs='perlbrew switch' + alias plbu='perlbrew use' + alias plbx='perlbrew uninstall' -elif (( $+commands[plenv] )); then - alias plv='plenv' - alias plvc='plenv commands' - alias plvl='plenv local' - alias plvg='plenv global' - alias plvs='plenv shell' - alias plvi='plenv install' - alias plvu='plenv uninstall' - alias plvr='plenv rehash' - alias plvv='plenv version' - alias plvV='plenv versions' - alias plvw='plenv which' - alias plvW='plenv whence' - alias plvm='plenv list-modules' - alias plvM='plenv migrate-modules' - alias plvI='plenv install-cpanm' + elif (( $+commands[plenv] )); then + alias plv='plenv' + alias plvc='plenv commands' + alias plvl='plenv local' + alias plvg='plenv global' + alias plvs='plenv shell' + alias plvi='plenv install' + alias plvu='plenv uninstall' + alias plvr='plenv rehash' + alias plvv='plenv version' + alias plvV='plenv versions' + alias plvw='plenv which' + alias plvW='plenv whence' + alias plvm='plenv list-modules' + alias plvM='plenv migrate-modules' + alias plvI='plenv install-cpanm' + fi fi diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a80a9c47..02eb52d7 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -171,6 +171,8 @@ fi # Aliases # -alias py='python' -alias py2='python2' -alias py3='python3' +if ! zstyle -t ':prezto:module:python:alias' skip; then + alias py='python' + alias py2='python2' + alias py3='python3' +fi diff --git a/modules/rails/init.zsh b/modules/rails/init.zsh index 44b53e90..ed86372b 100644 --- a/modules/rails/init.zsh +++ b/modules/rails/init.zsh @@ -19,17 +19,19 @@ fi # Aliases # -alias ror='bundle exec rails' -alias rorc='bundle exec rails console' -alias rordc='bundle exec rails dbconsole' -alias rordm='bundle exec rake db:migrate' -alias rordM='bundle exec rake db:migrate db:test:clone' -alias rordr='bundle exec rake db:rollback' -alias rorg='bundle exec rails generate' -alias rorl='tail -f "$(ruby-app-root)/log/development.log"' -alias rorlc='bundle exec rake log:clear' -alias rorp='bundle exec rails plugin' -alias rorr='bundle exec rails runner' -alias rors='bundle exec rails server' -alias rorsd='bundle exec rails server --debugger' -alias rorx='bundle exec rails destroy' +if ! zstyle -t ':prezto:module:rails:alias' skip; then + alias ror='bundle exec rails' + alias rorc='bundle exec rails console' + alias rordc='bundle exec rails dbconsole' + alias rordm='bundle exec rake db:migrate' + alias rordM='bundle exec rake db:migrate db:test:clone' + alias rordr='bundle exec rake db:rollback' + alias rorg='bundle exec rails generate' + alias rorl='tail -f "$(ruby-app-root)/log/development.log"' + alias rorlc='bundle exec rake log:clear' + alias rorp='bundle exec rails plugin' + alias rorr='bundle exec rails runner' + alias rors='bundle exec rails server' + alias rorsd='bundle exec rails server --debugger' + alias rorx='bundle exec rails destroy' +fi diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index cf55bc50..86ab43ce 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -59,23 +59,25 @@ fi # Aliases # -# General -alias rb='ruby' +if ! zstyle -t ':prezto:module:ruby:alias' skip; then + # General + alias rb='ruby' -# Bundler -if (( $+commands[bundle] )); then - alias rbb='bundle' - alias rbbc='bundle clean' - alias rbbe='bundle exec' - alias rbbi='bundle install --path vendor/bundle' - alias rbbl='bundle list' - alias rbbo='bundle open' - alias rbbp='bundle package' - alias rbbu='bundle update' - alias rbbI='rbbi \ - && bundle package \ - && print .bundle >>! .gitignore \ - && print vendor/assets >>! .gitignore \ - && print vendor/bundle >>! .gitignore \ - && print vendor/cache >>! .gitignore' + # Bundler + if (( $+commands[bundle] )); then + alias rbb='bundle' + alias rbbc='bundle clean' + alias rbbe='bundle exec' + alias rbbi='bundle install --path vendor/bundle' + alias rbbl='bundle list' + alias rbbo='bundle open' + alias rbbp='bundle package' + alias rbbu='bundle update' + alias rbbI='rbbi \ + && bundle package \ + && print .bundle >>! .gitignore \ + && print vendor/assets >>! .gitignore \ + && print vendor/bundle >>! .gitignore \ + && print vendor/cache >>! .gitignore' + fi fi diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 0dee1c96..4dea5661 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -36,7 +36,9 @@ fi # Aliases # -alias scr='screen' -alias scrl='screen -list' -alias scrn='screen -U -S' -alias scrr='screen -a -A -U -D -R' +if ! zstyle -t ':prezto:module:screen:alias' skip; then + alias scr='screen' + alias scrl='screen -list' + alias scrn='screen -U -S' + alias scrr='screen -a -A -U -D -R' +fi diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index 2075daa3..17006c82 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -45,5 +45,7 @@ fi # Aliases # -alias tmuxa="tmux $_tmux_iterm_integration new-session -A" -alias tmuxl='tmux list-sessions' +if ! zstyle -t ':prezto:module:tmux:alias' skip; then + alias tmuxa="tmux $_tmux_iterm_integration new-session -A" + alias tmuxl='tmux list-sessions' +fi From 0c364cdd5eae97438d7615259d09af5b6d2f4e65 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 26 Apr 2023 19:25:39 -0500 Subject: [PATCH 32/48] prompt: Update async submodule to 1.8.6 --- 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 bbbc92bd..a66d76f8 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit bbbc92bd01592513a6b7739a45b7911af18acaef +Subproject commit a66d76f8404bd9e7a26037640e6c892cf5871ff4 From f5dff4fe2237def19d392d5ffa9b719b51b47166 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 26 Apr 2023 19:26:09 -0500 Subject: [PATCH 33/48] prompt: Update pure submodule to 1.21.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 5b458ba5..2f13dea4 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit 5b458ba5b75f49a8071d53c343f1a23631f7bced +Subproject commit 2f13dea466466dde1ba844ba5211e7556f4ae2db From e7f75d20bc11093da934fce7e7a722155e1dc018 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 26 Apr 2023 19:40:59 -0500 Subject: [PATCH 34/48] prompt: Remove 'powerlevel9k' deprecation warning 'powerlevel9k' is unsupported and deprecated for 2 years now. It's time to cleanu the deprecation warning message. --- modules/prompt/init.zsh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/modules/prompt/init.zsh b/modules/prompt/init.zsh index 31808837..37bff328 100644 --- a/modules/prompt/init.zsh +++ b/modules/prompt/init.zsh @@ -10,18 +10,8 @@ autoload -Uz promptinit && promptinit # Load the prompt theme. zstyle -a ':prezto:module:prompt' theme 'prompt_argv' -if [[ "$TERM" == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then +if [[ $TERM == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then prompt 'off' -elif [[ "$prompt_argv[1]" == 'powerlevel9k' ]] ; then - < Date: Wed, 26 Apr 2023 19:55:33 -0500 Subject: [PATCH 35/48] history: Remove 'HISTFILE' path relocation warning 'HISTFILE' path relocation was done 2 years ago. It's time to cleanup the warning message. --- modules/history/init.zsh | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 3ef52ea4..084a7ed5 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -42,28 +42,3 @@ if ! zstyle -t ':prezto:module:history:alias' skip; then # Lists the ten most used commands. alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" fi - -if [[ -s "${OLD_HISTFILE::=${HISTFILE:h}/.zhistory}" ]]; then - - # New 'HISTFILE' doesn't exist yet, rename legacy one if available and notify. - if [[ ! -s "$HISTFILE" ]]; then - < Date: Wed, 26 Apr 2023 21:11:09 -0500 Subject: [PATCH 36/48] python: Expand Python command pattern per convention Use `(i)python[0-9.]#` as subscript for commands associative array, following the convention [1] of detection python more exhaustively. [1] https://github.com/zsh-users/zsh/blob/858b8de3d70fe76a3637c281bc2c8e3a6d961a2c/Completion/Unix/Command/_python#L1 --- modules/python/init.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 02eb52d7..ce2fc693 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -50,7 +50,7 @@ fi unset local_pyenv # Return if requirements are not found. -if (( ! $#commands[(i)python[23]#] && ! $+functions[pyenv] && ! $+commands[conda] )); then +if (( ! $+commands[(i)python[0-9.]#] && ! $+functions[pyenv] && ! $+commands[conda] )); then return 1 fi @@ -136,8 +136,8 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \ if [[ $pyenv_virtualenvwrapper_plugin_found != "true" ]]; then # Fallback to standard 'virtualenvwrapper' if 'python' is available in '$path'. - if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then - VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] + if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $+commands[(i)python[0-9.]#] )); then + VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[0-9.]#] fi virtualenvwrapper_sources=( From f7cb1fee1b5d45df07d141c1f10d9286f98fb8de Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 27 Apr 2023 13:21:16 -0500 Subject: [PATCH 37/48] gnu-utility: Remove now obsolete egrep and fgrep These were marked deprecated for a while and has now been marked obsolete since gnu-grep 3.8 [1]. They have been removed from POSIX as well [2]. [1] https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html#tag_20_55_18 --- modules/gnu-utility/init.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/gnu-utility/init.zsh b/modules/gnu-utility/init.zsh index a8521f0c..2cfbf2fa 100644 --- a/modules/gnu-utility/init.zsh +++ b/modules/gnu-utility/init.zsh @@ -44,8 +44,7 @@ _gnu_utility_cmds=( 'libtool' 'libtoolize' # Miscellaneous - 'awk' 'egrep' 'fgrep' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' - 'units' 'which' + 'awk' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'which' ) # Wrap GNU utilities in functions. From 3c002f772ef4ba8bd247d695b0429e5c9df6f331 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 4 May 2023 12:08:42 +0200 Subject: [PATCH 38/48] prompt: update powerlevel10k submodule to v1.18.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.18.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 a066b55f..0af598cb 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit a066b55f855c8e488d3ea9e26e861bdd5ecd4fe8 +Subproject commit 0af598cbed78660066f8a8f4465844501ba5695b From e14fdff4cbce3fb70dd641d2234465a5dae44561 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 4 May 2023 20:48:55 -0500 Subject: [PATCH 39/48] history: Remove interim zstyle variables --- modules/history/init.zsh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 084a7ed5..3912c19e 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -26,13 +26,12 @@ setopt HIST_BEEP # Beep when accessing non-existent history. # Variables # -zstyle -s ':prezto:module:history' histfile '_pmh_histfile' || _pmh_histfile="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" -zstyle -s ':prezto:module:history' histsize '_pmh_histsize' || _pmh_histsize=10000 -zstyle -s ':prezto:module:history' savehist '_pmh_savehist' || _pmh_savehist=${_pmh_histsize} -HISTFILE="${_pmh_histfile}" # The path to the history file. -HISTSIZE="${_pmh_histsize}" # The maximum number of events to save in the internal history. -SAVEHIST="${_pmh_savehist}" # The maximum number of events to save in the history file. -unset _pmh_{hist{file,size},savehist} +zstyle -s ':prezto:module:history' histfile 'HISTFILE' \ + || HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" # The path to the history file. +zstyle -s ':prezto:module:history' histsize 'HISTSIZE' \ + || HISTSIZE=10000 # The maximum number of events to save in the internal history. +zstyle -s ':prezto:module:history' savehist 'SAVEHIST' \ + || SAVEHIST=$HISTSIZE # The maximum number of events to save in the history file. # # Aliases From 5ca892d6af50bedb1dd930e03bbe6b3511e976d3 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 4 May 2023 22:02:29 -0500 Subject: [PATCH 40/48] history: Reformat inline comments --- modules/history/init.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 3912c19e..069dc2f1 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -10,17 +10,17 @@ # Options # -setopt BANG_HIST # Treat the '!' character specially during expansion. -setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. -setopt SHARE_HISTORY # Share history between all sessions. -setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. -setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. -setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. -setopt HIST_FIND_NO_DUPS # Do not display a previously found event. -setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. -setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. -setopt HIST_VERIFY # Do not execute immediately upon history expansion. -setopt HIST_BEEP # Beep when accessing non-existent history. +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. +setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a previously found event. +setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. +setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. +setopt HIST_VERIFY # Do not execute immediately upon history expansion. +setopt HIST_BEEP # Beep when accessing non-existent history. # # Variables From 8ee9d1bbfe3b82d73a611fd01d7a3a53b1a97bb6 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 4 May 2023 22:21:48 -0500 Subject: [PATCH 41/48] general: Documentation update for zstyle based alias skipping support Add documentation to surface the `zstyle` based alias skipping. --- modules/directory/README.md | 7 +++++++ modules/emacs/README.md | 7 +++++++ modules/fasd/README.md | 7 +++++++ modules/history/README.md | 7 +++++++ modules/homebrew/README.md | 7 +++++++ modules/macports/README.md | 7 +++++++ modules/node/README.md | 7 +++++++ modules/perl/README.md | 7 +++++++ modules/python/README.md | 7 +++++++ modules/rails/README.md | 7 +++++++ modules/ruby/README.md | 7 +++++++ modules/screen/README.md | 7 +++++++ modules/tmux/README.md | 7 +++++++ 13 files changed, 91 insertions(+) diff --git a/modules/directory/README.md b/modules/directory/README.md index 86953a47..8603d9f6 100644 --- a/modules/directory/README.md +++ b/modules/directory/README.md @@ -17,6 +17,13 @@ Sets directory options and defines directory aliases. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:directory:alias' skip 'yes' +``` + - `d` prints the contents of the directory stack. - `1 ... 9` changes the directory to the **n** previous one. diff --git a/modules/emacs/README.md b/modules/emacs/README.md index f93304aa..8cf7bfc8 100644 --- a/modules/emacs/README.md +++ b/modules/emacs/README.md @@ -12,6 +12,13 @@ execution of `carton`. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:emacs:alias' skip 'yes' +``` + ### Carton - `cai` installs dependencies. diff --git a/modules/fasd/README.md b/modules/fasd/README.md index 1958a739..04f9693a 100644 --- a/modules/fasd/README.md +++ b/modules/fasd/README.md @@ -19,6 +19,13 @@ instead of the bundled version. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:fasd:alias' skip 'yes' +``` + - `j` changes the current working directory interactively. ## Completion diff --git a/modules/history/README.md b/modules/history/README.md index 11c6d947..51e6e8ca 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -36,6 +36,13 @@ Alternately, you can set `HISTFILE` manually to _`${ZDOTDIR:-$HOME}/.zhistory`_. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:history:alias' skip 'yes' +``` + - `history-stat` lists the ten most used commands ## Settings diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 1875e08d..77d8f377 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -12,6 +12,13 @@ brew shellenv ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:homebrew:alias' skip 'yes' +``` + ### Homebrew Core - `brewc` cleans outdated brews and their cached archives. diff --git a/modules/macports/README.md b/modules/macports/README.md index ba6143b5..15963b33 100644 --- a/modules/macports/README.md +++ b/modules/macports/README.md @@ -4,6 +4,13 @@ Defines MacPorts aliases and adds MacPorts directories to path variables. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:macports:alias' skip 'yes' +``` + - `portc` cleans the files used to build ports. - `porti` installs a port. - `ports` searches for a port. diff --git a/modules/node/README.md b/modules/node/README.md index 6ec0b75c..bc262151 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -29,6 +29,13 @@ _`$XDG_CONFIG_HOME/nvm`_, _`~/.nvm`_, or is installed with homebrew. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:node:alias' skip 'yes' +``` + ### npm - `npmi` install a package. diff --git a/modules/perl/README.md b/modules/perl/README.md index 772d0680..dd594491 100644 --- a/modules/perl/README.md +++ b/modules/perl/README.md @@ -40,6 +40,13 @@ The subcommands of _plenv_ is similar with _rbenv_. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:perl:alias' skip 'yes' +``` + ### General - `pl` is short for `perl`. diff --git a/modules/python/README.md b/modules/python/README.md index 1695fa05..2e3b2eec 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -124,6 +124,13 @@ zstyle ':prezto:module:python:virtualenv' initialize 'no' ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:python:alias' skip 'yes' +``` + - `py` is short for `python`. - `py2` is short for `python2`. - `py3` is short for `python3`. diff --git a/modules/rails/README.md b/modules/rails/README.md index 129627a0..5e230e0e 100644 --- a/modules/rails/README.md +++ b/modules/rails/README.md @@ -4,6 +4,13 @@ Defines [Ruby on Rails][1] aliases. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:rails:alias' skip 'yes' +``` + - `ror` is short for `rails`. - `rorc` starts the Rails console. - `rordc` starts the Rails console connected to the database. diff --git a/modules/ruby/README.md b/modules/ruby/README.md index 97a09f07..fa3d1064 100644 --- a/modules/ruby/README.md +++ b/modules/ruby/README.md @@ -54,6 +54,13 @@ dependencies, with [Bundler][5]. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:ruby:alias' skip 'yes' +``` + ### General - `rb` is short for `ruby`. diff --git a/modules/screen/README.md b/modules/screen/README.md index a1775f7e..b5549510 100644 --- a/modules/screen/README.md +++ b/modules/screen/README.md @@ -24,6 +24,13 @@ zstyle ':prezto:module:screen:auto-start' remote 'yes' ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:screen:alias' skip 'yes' +``` + - `scr` is short for `screen`. - `scrl` lists sessions/socket directory. - `scrn` starts a new session. diff --git a/modules/tmux/README.md b/modules/tmux/README.md index e7ae929d..f6d375b0 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -53,6 +53,13 @@ Read [iTerm2 and tmux Integration][7] for more information. ## Aliases +Aliases are enabled by default. To disable them, add the following to +_`${ZDOTDIR:-$HOME}/.zpreztorc`_. + +```sh +zstyle ':prezto:module:tmux:alias' skip 'yes' +``` + - `tmuxa` attaches or switches to a tmux session. - `tmuxl` lists sessions managed by the tmux server. From 8d00c51900dfce3b2bc1e5bd99bd58f238c5668a Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 4 May 2023 21:36:08 -0500 Subject: [PATCH 42/48] python: Remove pip completion from prezto local pip completion is bundled with Zsh 5.9. Remove it from prezto local to avoid shadowing the bundled completion. --- modules/python/functions/_pip | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 modules/python/functions/_pip diff --git a/modules/python/functions/_pip b/modules/python/functions/_pip deleted file mode 100644 index 4e0ffb80..00000000 --- a/modules/python/functions/_pip +++ /dev/null @@ -1,19 +0,0 @@ -#compdef -P pip[0-9.]# -#autoload - -# -# Pip completion, delegating to pip to do all the completion work. -# -# Authors: -# Indrajit Raychaudhuri -# - -if (( $+commands[$words[1]] )); then - - function _pip_completion { - compadd -- $( COMP_WORDS="$words[*]" COMP_CWORD=$(( CURRENT - 1 )) \ - PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ) - } - _pip_completion "$@" - -fi From c9c716e9c11938a1aff2f30230d4dc1da38dc564 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 23 Jun 2023 07:49:15 +0200 Subject: [PATCH 43/48] prompt: update powerlevel10k submodule to v1.19.0 Release notes: - https://github.com/romkatv/powerlevel10k/releases/tag/v1.19.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 0af598cb..017395a2 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 0af598cbed78660066f8a8f4465844501ba5695b +Subproject commit 017395a266aa15011c09e64e44a1c98ed91c478c From d80e4aa86c83290e91172745cb046846df5d274b Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 11 Sep 2023 21:28:26 -0500 Subject: [PATCH 44/48] prompt: Update pure submodule to 1.22.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 2f13dea4..87e6f5dd 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit 2f13dea466466dde1ba844ba5211e7556f4ae2db +Subproject commit 87e6f5dd4c793f6d980532205aaefe196780606f From 5ac0777191b3c72a8af4f5af1631365a9ad81e9a Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 11 Sep 2023 21:30:42 -0500 Subject: [PATCH 45/48] history-substring-search: Update history-substring-search submodule to 1.1.0 --- modules/history-substring-search/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/history-substring-search/external b/modules/history-substring-search/external index 0f80b8eb..400e58a8 160000 --- a/modules/history-substring-search/external +++ b/modules/history-substring-search/external @@ -1 +1 @@ -Subproject commit 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb +Subproject commit 400e58a87f72ecec14f783fbd29bc6be4ff1641c From 64d46c407a57ead7e2c0e442b9e1815c6d54d9b5 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 11 Sep 2023 21:34:28 -0500 Subject: [PATCH 46/48] completion: Update completion submodule to 0.35.0 --- modules/completion/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/external b/modules/completion/external index 0331b290..67921bc1 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 0331b2908f93556453e45fa5a899aa21e0a7f64d +Subproject commit 67921bc12502c1e7b0f156533fbac2cb51f6943d From 1b0cc0a219875eb16b75221167e9916820a2956a Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 11 Sep 2023 21:51:45 -0500 Subject: [PATCH 47/48] utility: Detect lsd and honor its GNU ls compatibility lsd (LSDeluxe) is a modern GNU compatibile alternative to ls. Detect if it is aliased to ls and honor its GNU ls compatibility. --- modules/utility/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index c9015915..7e2e14ed 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -76,7 +76,7 @@ if zstyle -T ':prezto:module:utility' safe-ops; then fi # ls -if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then +if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*(GNU|lsd) *} ]]; then # GNU Core Utilities if zstyle -T ':prezto:module:utility:ls' dirs-first; then From bd180eec72c3ef28de3e794ebf08a05c640b4eda Mon Sep 17 00:00:00 2001 From: dllud Date: Fri, 19 May 2023 16:41:29 +0100 Subject: [PATCH 48/48] history-substring-search: add fuzzy and unique --- modules/history-substring-search/README.md | 18 ++++++++++++++++++ modules/history-substring-search/init.zsh | 8 ++++++++ runcoms/zpreztorc | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/modules/history-substring-search/README.md b/modules/history-substring-search/README.md index 3a109c55..42919e0c 100644 --- a/modules/history-substring-search/README.md +++ b/modules/history-substring-search/README.md @@ -65,6 +65,24 @@ _`${ZDOTDIR:-$HOME}/.zpreztorc`_: zstyle ':prezto:module:history-substring-search' globbing-flags '' ``` +### Fuzzy search + +To enable fuzzy search add the following line to +`${ZDOTDIR:-$HOME}/.zpreztorc`_: + +```sh +zstyle ':prezto:module:history-substring-search' fuzzy 'yes' +``` + +### Unique results + +To retrieve only unique results (remove duplicates) add the following line to +`${ZDOTDIR:-$HOME}/.zpreztorc`_: + +```sh +zstyle ':prezto:module:history-substring-search' ensure-unique 'yes' +``` + ## Authors _The authors of this module should be contacted via the [issue tracker][5]._ diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 0de78918..d287ae4d 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -38,6 +38,14 @@ if ! zstyle -t ':prezto:module:history-substring-search' color; then unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND} fi +if zstyle -t ':prezto:module:history-substring-search' fuzzy; then + HISTORY_SUBSTRING_SEARCH_FUZZY=1 +fi + +if zstyle -t ':prezto:module:history-substring-search' ensure-unique; then + HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 +fi + # # Key Bindings # diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index ae68a893..2d863c98 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -109,6 +109,12 @@ zstyle ':prezto:module:editor' key-bindings 'emacs' # Set the search globbing flags. # zstyle ':prezto:module:history-substring-search' globbing-flags '' +# Enable fuzzy search +# zstyle ':prezto:module:history-substring-search' fuzzy 'yes' + +# Retrieve only unique results (removes duplicates) +# zstyle ':prezto:module:history-substring-search' ensure-unique 'yes' + # # macOS #