Merge remote-tracking branch 'upstream/master'

This commit is contained in:
J. Morgan Lieberthal 2021-04-18 01:32:47 -06:00
commit 97bad4280c
No known key found for this signature in database
GPG key ID: EFB7E99469668652
63 changed files with 333 additions and 109 deletions

5
.gitmodules vendored
View file

@ -31,3 +31,8 @@
[submodule "modules/autoenv/external"]
path = modules/autoenv/external
url = https://github.com/Tarrasch/zsh-autoenv.git
shallow = true
[submodule "modules/prompt/external/powerlevel10k"]
path = modules/prompt/external/powerlevel10k
url = https://github.com/romkatv/powerlevel10k.git
shallow = true

View file

@ -59,7 +59,7 @@ Updating
Run `zprezto-update` to automatically check if there is an update to zprezto.
If there are no file conflicts, zprezto and its submodules will be
automatically updated. If there are conflicts you will instructed to go into
automatically updated. If there are conflicts you will be instructed to go into
the `$ZPREZTODIR` directory and resolve them yourself.
To pull the latest changes and update submodules manually:

View file

@ -44,7 +44,7 @@ function zprezto-update {
printf "There is an update available. Trying to pull.\n\n"
if git pull --ff-only; then
printf "Syncing submodules\n"
git submodule update --recursive
git submodule update --init --recursive
return $?
else
cannot-fast-forward
@ -98,18 +98,20 @@ function pmodload {
else
locations=(${pmodule_dirs:+${^pmodule_dirs}/$pmodule(-/FN)})
if (( ${#locations} > 1 )); then
print "$0: conflicting module locations: $locations"
continue
if ! zstyle -t ':prezto:load' pmodule-allow-overrides 'yes'; then
print "$0: conflicting module locations: $locations"
continue
fi
elif (( ${#locations} < 1 )); then
print "$0: no such module: $pmodule"
continue
fi
# Grab the full path to this module
pmodule_location=${locations[1]}
pmodule_location=${locations[-1]}
# Add functions to $fpath.
fpath=(${pmodule_location}/functions(/FN) $fpath)
fpath=(${pmodule_location}/functions(-/FN) $fpath)
function {
local pfunction

View file

@ -8,7 +8,7 @@
# function archive {
local archive_name path_to_archive _gzip_bin _bzip2_bin
local archive_name path_to_archive _gzip_bin _bzip2_bin _xz_bin
if (( $# < 2 )); then
cat >&2 <<EOF
@ -40,7 +40,15 @@ else
_gzip_bin='gzip'
fi
if (( $+commands[pbzip2] )); then
if (( $+commands[pixz] )); then
_xz_bin='pixz'
else
_xz_bin='xz'
fi
if (( $+commands[lbzip2] )); then
_bzip2_bin='lbzip2'
elif (( $+commands[pbzip2] )); then
_bzip2_bin='pbzip2'
else
_bzip2_bin='bzip2'
@ -49,7 +57,7 @@ fi
case "${archive_name}" in
(*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${=path_to_archive}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${=path_to_archive}" ;;
(*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${=path_to_archive}" ;;
(*.tar.xz|*.txz) tar -cvf "${archive_name}" --use-compress-program="${_xz_bin}" "${=path_to_archive}" ;;
(*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${=path_to_archive}" ;;
(*.tar) tar -cvf "${archive_name}" "${=path_to_archive}" ;;
(*.zip|*.jar) zip -r "${archive_name}" "${=path_to_archive}" ;;

View file

@ -12,6 +12,7 @@ local success
local file_name
local file_path
local extract_dir
local _gzip_bin _bzip2_bin _xz_bin
if (( $# == 0 )); then
cat >&2 <<EOF
@ -30,6 +31,29 @@ if [[ "$1" == "-r" || "$1" == "--remove" ]]; then
shift
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'
else
_gzip_bin='gzip'
fi
if (( $+commands[pixz] )); then
_xz_bin='pixz'
else
_xz_bin='xz'
fi
if (( $+commands[lbzip2] )); then
_bzip2_bin='lbzip2'
elif (( $+commands[pbzip2] )); then
_bzip2_bin='pbzip2'
else
_bzip2_bin='bzip2'
fi
while (( $# > 0 )); do
if [[ ! -s "$1" ]]; then
print "$0: file not valid: $1" >&2
@ -42,15 +66,13 @@ while (( $# > 0 )); do
file_path="${1:A}"
extract_dir="${file_name:r}"
case "$1:l" in
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
&& tar --xz -xvf "$1" \
|| xzcat "$1" | tar xvf - ;;
(*.tar.gz|*.tgz) tar -xvf "$1" --use-compress-program="${_gzip_bin}" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar -xvf "$1" --use-compress-program="${_bzip2_bin}" ;;
(*.tar.xz|*.txz) tar -xvf "$1" --use-compress-program="${_xz_bin}" ;;
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
|| lzcat "$1" | tar -xvf - ;;
(*.tar) tar -xvf "$1" ;;
(*.gz) gunzip "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;

@ -1 +1 @@
Subproject commit 70f36c007db30a5fe1edf2b63664088b502a729c
Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d

View file

@ -21,11 +21,12 @@ elif (( $+commands[brew] )); then
"$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.N)
)
if (( $#cnf_command )); then
cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh"
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/brew-command-not-found-cache.zsh"
if [[ "${${(@o)cnf_command}[1]}" -nt "$cache_file" \
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|| ! -s "$cache_file" ]]; then
mkdir -p "$cache_file:h"
# brew command-not-found-init is slow; cache its output.
brew command-not-found-init >! "$cache_file" 2> /dev/null
fi

View file

@ -32,13 +32,16 @@ unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.
# cache time of 20 hours, so it should almost always regenerate the first time a
# shell is opened each day.
autoload -Uz compinit
_comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20))
if (( $#_comp_files )); then
compinit -i -C
_comp_path="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump"
# #q expands globs in conditional expressions
if [[ $_comp_path(#qNmh-20) ]]; then
# -C (skip function check) implies -i (skip security check).
compinit -C -d "$_comp_path"
else
compinit -i
mkdir -p "$_comp_path:h"
compinit -i -d "$_comp_path"
fi
unset _comp_files
unset _comp_path
#
# Styles
@ -46,7 +49,7 @@ unset _comp_files
# Use caching to make completion for commands such as dpkg and apt usable.
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache"
zstyle ':completion::complete:*' cache-path "${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompcache"
# Case-insensitive (all), partial-word, and then substring completion.
if zstyle -t ':prezto:module:completion:*' case-sensitive; then

View file

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

View file

@ -108,4 +108,4 @@ Authors
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: https://github.com/sorin-ionescu/oh-my-zsh/issues
[1]: https://github.com/sorin-ionescu/prezto/issues

View file

@ -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
@ -270,9 +274,11 @@ bindkey -d
# Emacs Key Bindings
#
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}"
for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" \
"${key_info[Escape]}${key_info[Left]}"
bindkey -M emacs "$key" emacs-backward-word
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}"
for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" \
"${key_info[Escape]}${key_info[Right]}"
bindkey -M emacs "$key" emacs-forward-word
# Kill to the beginning of the line.
@ -313,6 +319,7 @@ bindkey -M vicmd "$key_info[Control]X$key_info[Control]E" edit-command-line
# Undo/Redo
bindkey -M vicmd "u" undo
bindkey -M viins "$key_info[Control]_" undo
bindkey -M vicmd "$key_info[Control]R" redo
if (( $+widgets[history-incremental-pattern-search-backward] )); then

View file

@ -38,6 +38,9 @@ setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.
# Allow mapping Ctrl+S and Ctrl+Q shortcuts
[[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY
#
# Jobs
#

View file

@ -19,7 +19,7 @@ fi
# Initialization
#
cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh"
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/fasd-cache.zsh"
if [[ "${commands[fasd]}" -nt "$cache_file" \
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|| ! -s "$cache_file" ]]; then
@ -31,6 +31,7 @@ if [[ "${commands[fasd]}" -nt "$cache_file" \
init_args+=(zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)
fi
mkdir -p "$cache_file:h"
# Cache init code.
fasd --init "$init_args[@]" >! "$cache_file" 2> /dev/null
fi

View file

@ -100,7 +100,9 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias gfc='git clone'
alias gfcr='git clone --recurse-submodules'
alias gfm='git pull'
alias gfma='git pull --autostash'
alias gfr='git pull --rebase'
alias gfra='git pull --rebase --autostash'
# Grep (g)
alias gg='git grep'
@ -115,7 +117,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"'
alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"'
alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"'
alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"'
alias glg='git log --topo-order --graph --pretty=format:"${_git_log_oneline_format}"'
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
alias glc='git shortlog --summary --numbered'
alias glog='git log --oneline --decorate --graph'

View file

@ -275,7 +275,7 @@ function git-info {
# Format ahead.
if [[ -n "$ahead_format" ]]; then
ahead="$ahead_and_behind[(w)1]"
ahead="$ahead_and_behind[(pws:\t:)1]"
if (( ahead > 0 )); then
zformat -f ahead_formatted "$ahead_format" "A:$ahead"
fi
@ -283,7 +283,7 @@ function git-info {
# Format behind.
if [[ -n "$behind_format" ]]; then
behind="$ahead_and_behind[(w)2]"
behind="$ahead_and_behind[(pws:\t:)2]"
if (( behind > 0 )); then
zformat -f behind_formatted "$behind_format" "B:$behind"
fi

View file

@ -12,7 +12,7 @@ fi
# Set the default paths to gpg-agent files.
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID"
_gpg_agent_env="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/gpg-agent.env"
# Load environment variables from previous run
source "$_gpg_agent_env" 2> /dev/null
@ -21,12 +21,13 @@ source "$_gpg_agent_env" 2> /dev/null
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
# Start gpg-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
mkdir -p "$_gpg_agent_env:h"
eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")"
fi
fi
# Inform gpg-agent of the current TTY for user prompts.
export GPG_TTY="$(tty)"
export GPG_TTY=$TTY
# Integrate with the SSH module.
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then

View file

@ -10,8 +10,11 @@ if (( ! $+commands[ghc] )); then
return 1
fi
# Load dependencies.
pmodload 'helper'
# Prepend Cabal per user directories to PATH.
if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then
if is-darwin && [[ -d $HOME/Library/Haskell ]]; then
path=($HOME/Library/Haskell/bin(/N) $path)
else
path=($HOME/.cabal/bin(/N) $path)

View file

@ -29,3 +29,28 @@ function coalesce {
done
return 1
}
# is true on MacOS Darwin
function is-darwin {
[[ "$OSTYPE" == darwin* ]]
}
# is true on Linux's
function is-linux {
[[ "$OSTYPE" == linux* ]]
}
# is true on BSD's
function is-bsd {
[[ "$OSTYPE" == *bsd* ]]
}
# is true on Cygwin (Windows)
function is-cygwin {
[[ "$OSTYPE" == cygwin* ]]
}
# is true on termux (Android)
function is-termux {
[[ "$OSTYPE" == linux-android ]]
}

@ -1 +1 @@
Subproject commit d44159b5e87cbdc8fdaa448f09523e12193d7d6d
Subproject commit 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb

View file

@ -10,7 +10,9 @@
pmodload 'editor'
# Source module files.
source "${0:h}/external/zsh-history-substring-search.zsh" || return 1
if (( ! $+functions[history-substring-search-up] )); then
source "${0:h}/external/zsh-history-substring-search.zsh" || return 1
fi
#
# Search

View file

@ -3,6 +3,10 @@ History
Sets [history][1] options and defines history aliases.
**Note:** If you are migrating from oh-my-zsh and want to keep your history, you
will either need to set HISTFILE manually to `$HOME/.zsh_history` or rename
`~/.zsh_history` to ~/.zhistory`.
Options
-------

View file

@ -26,7 +26,7 @@ unsetopt 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.

View file

@ -18,8 +18,8 @@ Aliases
### Homebrew
- `brewc` cleans outdated brews and their cached archives.
- `brewC` cleans outdated brews, including keg-only, and their cached archives.
- `brewi` installs a formula.
- `brewL` lists installed formulae that are not dependencies of another installed formula.
- `brewl` lists installed formulae.
- `brewo` lists brews which have an update available.
- `brews` searches for a formula.

View file

@ -5,8 +5,11 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Load dependencies.
pmodload 'helper'
# Return if requirements are not found.
if [[ "$OSTYPE" != (darwin|linux)* ]]; then
if ! is-darwin && ! is-linux; then
return 1
fi
@ -27,8 +30,8 @@ fi
# Homebrew
alias brewc='brew cleanup'
alias brewC='brew cleanup --force'
alias brewi='brew install'
alias brewL='brew leaves'
alias brewl='brew list'
alias brewo='brew outdated'
alias brews='brew search'

View file

@ -6,8 +6,11 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Load dependencies.
pmodload 'helper'
# Return if requirements are not found.
if [[ "$OSTYPE" != darwin* ]]; then
if ! is-darwin; then
return 1
fi

View file

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

View file

@ -23,7 +23,7 @@ elif (( $+commands[node] )) ; then
version="${$(node -v)#v}"
fi
if [[ "$version" != (none|) ]]; then
if [[ "$version" != (none|system) ]]; then
zstyle -s ':prezto:module:node:info:version' format 'version_format'
zformat -f version_formatted "$version_format" "v:$version"
node_info[version]="$version_formatted"

View file

@ -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.
@ -39,12 +39,13 @@ typeset -A compl_commands=(
for compl_command in "${(k)compl_commands[@]}"; do
if (( $+commands[$compl_command] )); then
cache_file="${TMPDIR:-/tmp}/prezto-$compl_command-cache.$UID.zsh"
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/$compl_command-cache.zsh"
# Completion commands are slow; cache their output if old or missing.
if [[ "$commands[$compl_command]" -nt "$cache_file" \
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|| ! -s "$cache_file" ]]; then
mkdir -p "$cache_file:h"
command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null
fi

View file

@ -5,8 +5,11 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Load dependencies.
pmodload 'helper'
# Return if requirements are not found.
if [[ "$OSTYPE" != darwin* ]]; then
if ! is-darwin; then
return 1
fi

View file

@ -8,11 +8,11 @@
# function pacman-list-disowned {
local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$"
local tmp="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pacman-disowned-$$"
local db="$tmp/db"
local fs="$tmp/fs"
mkdir "$tmp"
mkdir -p "$tmp"
trap 'rm -rf "$tmp"' EXIT
pacman --quiet --query --list | sort --unique > "$db"

View file

@ -10,6 +10,9 @@ if (( ! $+commands[perl] )); then
return 1
fi
# Load dependencies.
pmodload 'helper'
#
# Load Perlbrew or plenv
#
@ -37,13 +40,14 @@ fi
# Local Module Installation
#
if [[ "$OSTYPE" == darwin* ]]; then
if is-darwin; then
# Perl is slow; cache its output.
cache_file="${TMPDIR:-/tmp}/prezto-perl-cache.$UID.zsh"
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/perl-cache.zsh"
perl_path="$HOME/Library/Perl/5.12"
if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
if [[ "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" || ! -s "$cache_file" ]]; then
mkdir -p "$cache_file:h"
perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
fi

View file

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

@ -1 +1 @@
Subproject commit 58f7ba70f05e75802299848e7e31c7d7a7fd0c97
Subproject commit 95c2b1577f455728ec01cec001a86c216d0af2bd

@ -0,0 +1 @@
Subproject commit d26bdcd6010cfe82bc7bab07e4363b40be834cc8

@ -1 +1 @@
Subproject commit 4082418e4feffd876e0f666aa5cfbd7d3360ed16
Subproject commit ff356fa2c7ea745bc4bc56a98632bac55c6c74a1

View file

@ -28,3 +28,4 @@ unset current_pwd
print "$ret_directory"
# }
# vim: ft=zsh

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1 @@
../external/powerlevel10k/powerlevel10k.zsh-theme

View file

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

View file

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

View file

@ -54,6 +54,13 @@ function prompt_sorin_async_callback {
zle && zle reset-prompt
fi
;;
"[async]")
# Code is 1 for corrupted worker output and 2 for dead worker.
if [[ $2 -eq 2 ]]; then
# Our worker died unexpectedly.
typeset -g prompt_prezto_async_init=0
fi
;;
esac
}
@ -118,6 +125,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'

View file

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

View file

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

View file

@ -7,18 +7,16 @@
# Patrick Bos <egpbos@gmail.com>
#
# Load dependencies
pmodload 'helper'
# 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
@ -27,7 +25,7 @@ if (( $+commands[pyenv] )); then
else
if [[ -n "$PYTHONUSERBASE" ]]; then
path=($PYTHONUSERBASE/bin $path)
elif [[ "$OSTYPE" == darwin* ]]; then
elif is-darwin; then
path=($HOME/Library/Python/*/bin(N) $path)
else
# This is subject to change.
@ -73,7 +71,7 @@ function _python-workon-cwd {
if [[ "$ENV_NAME" != "" ]]; then
# Activate the environment only if it is not already active
if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
if [[ -n "$WORKON_HOME" && -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
elif [[ -e "$ENV_NAME/bin/activate" ]]; then
source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
@ -149,17 +147,25 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
fi
# Load PIP completion.
if (( $#commands[(i)pip(|[23])] )); then
cache_file="${TMPDIR:-/tmp}/prezto-pip-cache.$UID.zsh"
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
if [[ -n "$PYENV_ROOT" ]]; then
for pip in pip{,2,3}; do
pip_command="$(pyenv which "$pip" 2>/dev/null)"
[[ -n "$pip_command" ]] && break
done
unset pip
else
pip_command="$commands[(i)pip(|[23])]"
fi
if [[ -n "$pip_command" ]]; then
cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/pip-cache.zsh"
if [[ "$pip_command" -nt "$cache_file" \
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|| ! -s "$cache_file" ]]; then
mkdir -p "$cache_file:h"
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
$pip_command completion --zsh \
"$pip_command" completion --zsh \
| sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \
>! "$cache_file" \
2> /dev/null
@ -167,8 +173,9 @@ if (( $#commands[(i)pip(|[23])] )); then
source "$cache_file"
unset cache_file pip_command
unset cache_file
fi
unset pip_command
# Load conda into the shell session, if requested
zstyle -T ':prezto:module:python' conda-init

View file

@ -10,6 +10,9 @@ if (( ! $+commands[rsync] )); then
return 1
fi
# Load dependencies.
pmodload 'helper'
#
# Aliases
#
@ -23,7 +26,7 @@ fi
# macOS and HFS+ Enhancements
# https://bombich.com/kb/ccc5/credits
if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then
if is-darwin && grep -q 'file-flags' <(rsync --help 2>&1); then
_rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
fi

View file

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

View file

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

View file

@ -72,7 +72,7 @@ Though there are many effects, most terminals support at least bold formatting.
| font-fifth | no-font-fifth |
| font-sixth | no-font-sixth |
| font-seventh | no-font-seventh |
| font-eigth | no-font-eigth |
| font-eighth | no-font-eighth |
| font-ninth | no-font-ninth |
### Plain Text

View file

@ -49,7 +49,7 @@ FX=(
font-fifth "\e[15m" no-font-fifth "\e[10m"
font-sixth "\e[16m" no-font-sixth "\e[10m"
font-seventh "\e[17m" no-font-seventh "\e[10m"
font-eigth "\e[18m" no-font-eigth "\e[10m"
font-eighth "\e[18m" no-font-eighth "\e[10m"
font-ninth "\e[19m" no-font-ninth "\e[10m"
)

View file

@ -14,10 +14,10 @@ fi
_ssh_dir="$HOME/.ssh"
# Set the path to the environment file if not set by another module.
_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env.$UID}"
_ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}"
# Set the path to the persistent authentication socket.
_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock.$UID"
_ssh_agent_sock="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock"
# Start ssh-agent if not started.
if [[ ! -S "$SSH_AUTH_SOCK" ]]; then
@ -26,12 +26,14 @@ if [[ ! -S "$SSH_AUTH_SOCK" ]]; then
# Start ssh-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then
mkdir -p "$_ssh_agent_env:h"
eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")"
fi
fi
# Create a persistent SSH authentication socket.
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
mkdir -p "$_ssh_agent_sock:h"
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
export SSH_AUTH_SOCK="$_ssh_agent_sock"
fi

@ -1 +1 @@
Subproject commit 1e34c4aa0bcbdde5173aab15600784edf0a212fd
Subproject commit 932e29a0c75411cb618f02995b66c0a4a25699bc

View file

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

View file

@ -62,6 +62,12 @@ Aliases
- `mysql`
- `rm`
To disable all spelling corrections, add the following line to *zpreztorc*:
```sh
zstyle ':prezto:module:utility' correct 'no'
```
### Disabled File Globbing
- `bower`

View file

@ -11,7 +11,9 @@
pmodload 'helper' 'spectrum'
# Correct commands.
setopt CORRECT
if zstyle -T ':prezto:module:utility' correct; then
setopt CORRECT
fi
#
# Aliases
@ -64,10 +66,10 @@ alias mvi="${aliases[mv]:-mv} -i"
alias cpi="${aliases[cp]:-cp} -i"
alias lni="${aliases[ln]:-ln} -i"
if zstyle -T ':prezto:module:utility' safe-ops; then
alias rm='rmi'
alias mv='mvi'
alias cp='cpi'
alias ln='lni'
alias rm="${aliases[rm]:-rm} -i"
alias mv="${aliases[mv]:-mv} -i"
alias cp="${aliases[cp]:-cp} -i"
alias ln="${aliases[ln]:-ln} -i"
fi
# ls
@ -132,12 +134,16 @@ if zstyle -t ':prezto:module:utility:grep' color; then
fi
# macOS Everywhere
if [[ "$OSTYPE" == darwin* ]]; then
if is-darwin; then
alias o='open'
elif [[ "$OSTYPE" == cygwin* ]]; then
elif is-cygwin; then
alias o='cygstart'
alias pbcopy='tee > /dev/clipboard'
alias pbpaste='cat /dev/clipboard'
elif is-termux; then
alias o='termux-open'
alias pbcopy='termux-clipboard-set'
alias pbpaste='termux-clipboard-get'
else
alias o='xdg-open'
@ -164,7 +170,7 @@ fi
alias df='df -kh'
alias du='du -kh'
if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then
if is-darwin || is-bsd; then
alias topc='top -o cpu'
alias topm='top -o vsize'
else

View file

@ -1,6 +1,6 @@
{
# Compile the completion dump to increase startup speed.
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump"
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump"
fi
@ -11,3 +11,13 @@
{
tmux -L iterm -f ~/.tmux.skinny.conf start-server &>/dev/null
} &!
# Execute code only if STDERR is bound to a TTY.
if [[ -o INTERACTIVE && -t 2 ]]; then
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
fortune -s
print
fi
fi >&2

View file

@ -18,6 +18,9 @@ zstyle ':prezto:*:*' color 'yes'
# Add additional directories to load prezto modules from
# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib
# Allow module overrides when pmodule-dirs causes module name collisions
# zstyle ':prezto:load' pmodule-allow-overrides 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'zprof' # 'attr' 'stat'