Compare commits

...

5 Commits

Author SHA1 Message Date
Daniel Carrillo fca913eded Merge upstream/master 2022-04-03 13:28:52 +02:00
Eugen Blattner 3da67271b9 fix: use inflating binaries instead of deflating in unarchive function 2022-04-01 13:22:48 -07:00
Jim Boulter 1ff1099d05 Allow users to set a dirty-branch format 2022-04-01 10:36:35 -07:00
Indrajit Raychaudhuri 98d69fc91f zprofile: adjust condition for `LESSOPEN` export
Split tests for condition for `export LESSOPEN` separate per convention
2022-03-29 18:51:27 -05:00
Aaron Kanter 15150085e6 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
2022-03-29 18:44:37 -05:00
3 changed files with 27 additions and 14 deletions

View File

@ -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'

View File

@ -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

View File

@ -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