Merge upstream/master

This commit is contained in:
Daniel Carrillo 2022-04-09 18:14:53 +02:00
commit 1431e4e8c2
7 changed files with 67 additions and 15 deletions

View File

@ -41,7 +41,7 @@ else
fi
if (( $+commands[pixz] )); then
_xz_bin='pixz'
_xz_bin='pixz -d'
else
_xz_bin='xz'
fi

View File

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

View File

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

View File

@ -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 "<file_name>"
```
defaults to "${ZDOTDIR:-$HOME}/.zsh_history".
## histsize
```sh
zstyle ':prezto:module:history' histsize <number>
```
defaults to 10000.
## savehist
```sh
zstyle ':prezto:module:history' savehist <number>
```
defaults to histsize
## Authors
_The authors of this module should be contacted via the [issue tracker][2]._

View File

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

View File

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

View File

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