From 15150085e6ffc0e46b00cb0809914e41ea08bab4 Mon Sep 17 00:00:00 2001 From: Aaron Kanter Date: Sat, 12 Mar 2022 19:16:35 -0800 Subject: [PATCH 1/4] 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 1cf48bf..b12367a 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 2/4] 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 b12367a..5b8b638 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 3/4] 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 07f261d..eca5046 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 4/4] 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 66c7e35..d66fef8 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'