From f2042a29cc7613e8f797044948b0238916b2a234 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Thu, 9 Aug 2018 15:25:30 -0300 Subject: [PATCH 01/72] Update submodules (#1615) This updates the submodules for autosuggestions, completion, syntax-highlighting and the prompts async, powerlevel9k and pure. All submodules that have TAGs/Releases were updated to their latest TAG/release, except for syntax-highlighting because it's latest release/TAG is from more than one year ago, and the project seems to be well maintained but without releases. --- modules/autosuggestions/external | 2 +- modules/completion/external | 2 +- modules/prompt/external/async | 2 +- modules/prompt/external/powerlevel9k | 2 +- modules/prompt/external/pure | 2 +- modules/syntax-highlighting/external | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index 15931f04ff..d7c796719e 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit 15931f04ffac91a2f9a1a044b6b3ee4050751064 +Subproject commit d7c796719e6352666f7a9c94da9ddaed10f3217d diff --git a/modules/completion/external b/modules/completion/external index 2a30b05a5c..7ec52769d3 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 2a30b05a5cf724a2d1c4c140c302dbf93f6aa6f6 +Subproject commit 7ec52769d3a0dd505d33d857511866d2b90d0eec diff --git a/modules/prompt/external/async b/modules/prompt/external/async index b001fa529a..da48ccb0e2 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit b001fa529a874fbe8bd22a9d4526153138645289 +Subproject commit da48ccb0e2ade777a10decfe214b5433d990d0d9 diff --git a/modules/prompt/external/powerlevel9k b/modules/prompt/external/powerlevel9k index 17c069d25a..d031b3e035 160000 --- a/modules/prompt/external/powerlevel9k +++ b/modules/prompt/external/powerlevel9k @@ -1 +1 @@ -Subproject commit 17c069d25ac7b24af6b5dc7ecb9597cef881f582 +Subproject commit d031b3e03522d47607173ebda89e7558b622a322 diff --git a/modules/prompt/external/pure b/modules/prompt/external/pure index a95d55cc7d..fa9137ecec 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit a95d55cc7d3a73fc562ac11e23c26113ed6d58cf +Subproject commit fa9137ecec76d23fe76fd6fabe9c2f8ae0de9cf5 diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 434af7b11d..db6cac391b 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 434af7b11dd33641231f1b48b8432e68eb472e46 +Subproject commit db6cac391bee957c20ff3175b2f03c4817253e60 From 66487c95329874019d17920390c3101faa9dead7 Mon Sep 17 00:00:00 2001 From: newtonne Date: Mon, 13 Aug 2018 02:56:21 +0100 Subject: [PATCH 02/72] Correct alphabetical order in zprestorc --- runcoms/zpreztorc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index 28b6005467..a54907344c 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -124,13 +124,6 @@ zstyle ':prezto:module:prompt' theme 'sorin' # return codes. This is not supported by all prompts. # zstyle ':prezto:module:prompt' show-return-val 'yes' -# -# Ruby -# - -# Auto switch the Ruby version on directory change. -# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' - # # Python # @@ -141,6 +134,13 @@ zstyle ':prezto:module:prompt' theme 'sorin' # Automatically initialize virtualenvwrapper if pre-requisites are met. # zstyle ':prezto:module:python:virtualenv' initialize 'yes' +# +# Ruby +# + +# Auto switch the Ruby version on directory change. +# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' + # # Screen # From 7bb7a7cb6fe02cce77ad31e91796f84b1a8f1011 Mon Sep 17 00:00:00 2001 From: Bruce Clounie Date: Sat, 21 Jul 2018 01:06:31 -0600 Subject: [PATCH 03/72] Add explanation for extra git theme symbols in README.md Helps with #1589 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f94cd6ccd..bcbe15914e 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,8 @@ accompanying README files to learn of what is available. 3. Load the theme you like in *~/.zpreztorc* then open a new Zsh terminal window or tab. - ![sorin theme][2] - + ![sorin theme][2] + Note that the 'git' module may be required for special symbols to appear, such as those on the right of the above image. Add `'git'` to the list under `zstyle ':prezto:load' pmodule \ ` in your `.zpreztorc` to enable this module. ### External Modules 1. By default modules will be loaded from */modules* and */contrib*. From dd7a26e219b3340567aeeececcf383cfdb371fa0 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Sat, 15 Sep 2018 12:35:48 -0400 Subject: [PATCH 04/72] [git] Also check "commondir" when looking for a stash (#1620) --- modules/git/functions/git-info | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index a173c20f14..fe8ca2acd9 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -212,10 +212,17 @@ function git-info { # Format stashed. zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format' - if [[ -n "$stashed_format" && -f "$(git-dir)/refs/stash" ]]; then - stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')" - if [[ -n "$stashed" ]]; then - zformat -f stashed_formatted "$stashed_format" "S:$stashed" + if [[ -n "$stashed_format" ]]; then + commondir="" + if [[ -f "$(git-dir)/commondir" ]]; then + commondir="$(<$(git-dir)/commondir)" + [[ "$commondir" =~ ^/ ]] || commondir="$(git-dir)/$commondir" + fi + if [[ -f "$(git-dir)/refs/stash" || ( -n "$commondir" && -f "$commondir/refs/stash" ) ]]; then + stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')" + if [[ -n "$stashed" ]]; then + zformat -f stashed_formatted "$stashed_format" "S:$stashed" + fi fi fi From 2bbf5d0687bf754fff8ab6fcaec70669907aa29b Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 14 Sep 2018 23:40:08 -0500 Subject: [PATCH 05/72] homebrew: Load standard Homebrew environment variables into shell session. However, guard for legacy Homebrew as `brew shellenv` is relatively new. --- modules/homebrew/README.md | 11 ++++++++++- modules/homebrew/init.zsh | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 98a3444c19..1a6df51c6e 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -1,7 +1,16 @@ Homebrew ======== -Defines Homebrew aliases. +Defines Homebrew specific shell environment variables and aliases. + +Environment Variables +--------------------- + +Execute the following to list the environment variables loaded in the shell: + +```sh +brew shellenv +``` Aliases ------- diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index e517c0a5e0..12acf595ac 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -10,6 +10,16 @@ if [[ "$OSTYPE" != (darwin|linux)* ]]; then return 1 fi +# +# Environmental Variables +# + +# Load standard Homebrew shellenv into the shell session. +# `brew shellenv` is relatively new, guard for legacy Homebrew. +if (( $+commands[brew] )); then + eval "$(brew shellenv 2> /dev/null)" +fi + # # Aliases # From ad861d3b45190053deba73392b128805f37b06d1 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 15 Sep 2018 01:45:57 -0500 Subject: [PATCH 06/72] homebrew: Replace deprecated casks with their brew counterpart Homebrew has deprecated `brew cask cleanup` and `brew cask search` in favor of `brew cleanup` and `brew search` respectively. They will stop working on 2018-09-30. Further, `--outdated` has been removed. We should eventually remove the related aliases, but for a while we keep supporting them gracefully with deprecation warning. The documentation has been removed from README.md, however. --- modules/homebrew/README.md | 3 --- modules/homebrew/init.zsh | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 1a6df51c6e..3046f98ebe 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -29,12 +29,9 @@ Aliases ### Homebrew Cask - `cask` is aliased to `brew cask`. - - `caskc` cleans up old cached downloads. - - `caskC` cleans up all cached downloads. - `caski` installs a cask. - `caskl` lists installed casks. - `casko` lists casks which have an update available. - - `casks` searches for a cask. - `caskx` uninstalls a cask. Authors diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 12acf595ac..013344735a 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -36,10 +36,21 @@ alias brewx='brew remove' # Homebrew Cask alias cask='brew cask' -alias caskc='brew cask cleanup --outdated' -alias caskC='brew cask cleanup' +alias caskc='hb_deprecated brew cask cleanup' +alias caskC='hb_deprecated brew cask cleanup' alias caski='brew cask install' alias caskl='brew cask list' alias casko='brew cask outdated' -alias casks='brew cask search' +alias casks='hb_deprecated brew cask search' alias caskx='brew cask uninstall' + +function hb_deprecated { + local cmd="${argv[3]}" + local cmd_args=( ${(@)argv:4} ) + + printf "'brew cask %s' has been deprecated, " "${cmd}" + printf "using 'brew %s' instead\n" "${cmd}" + + cmd_args=( ${(@)argv:4} ) + command brew "${cmd}" ${(@)cmd_args} +} From f366e49c32727d658160ca4ff2ec6d515ace7aa6 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 15 Sep 2018 01:55:46 -0500 Subject: [PATCH 07/72] homebrew: Cleanup homebrew aliases - 'brew upgrade' does 'brew update' by default, no need for explicit call - replace 'brew remove' with 'brew uninstall' for consistency --- modules/homebrew/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 013344735a..cd1e5f72ce 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -31,8 +31,8 @@ alias brewi='brew install' alias brewl='brew list' alias brewo='brew outdated' alias brews='brew search' -alias brewu='brew update && brew upgrade' -alias brewx='brew remove' +alias brewu='brew upgrade' +alias brewx='brew uninstall' # Homebrew Cask alias cask='brew cask' From fbcae356d30928802e8150f4beca7e43f39513e1 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Mon, 17 Sep 2018 17:28:15 -0300 Subject: [PATCH 08/72] Updating submodules For the submodules that have some kind of release (tags), they were updated up to the most recent release. Otherwise, the submodule was updated to the latest commit. --- modules/completion/external | 2 +- modules/prompt/external/async | 2 +- modules/prompt/external/powerlevel9k | 2 +- modules/prompt/external/pure | 2 +- modules/syntax-highlighting/external | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/completion/external b/modules/completion/external index 7ec52769d3..955645c22b 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 7ec52769d3a0dd505d33d857511866d2b90d0eec +Subproject commit 955645c22b29434caefadcb7d541d570d40ae932 diff --git a/modules/prompt/external/async b/modules/prompt/external/async index da48ccb0e2..5248bd85bf 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit da48ccb0e2ade777a10decfe214b5433d990d0d9 +Subproject commit 5248bd85bf2c522ebfa2b8d18ee7bc736d10c791 diff --git a/modules/prompt/external/powerlevel9k b/modules/prompt/external/powerlevel9k index d031b3e035..358c105de7 160000 --- a/modules/prompt/external/powerlevel9k +++ b/modules/prompt/external/powerlevel9k @@ -1 +1 @@ -Subproject commit d031b3e03522d47607173ebda89e7558b622a322 +Subproject commit 358c105de7aa5e8109788adf65c08c44e368d418 diff --git a/modules/prompt/external/pure b/modules/prompt/external/pure index fa9137ecec..7aade5fca2 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit fa9137ecec76d23fe76fd6fabe9c2f8ae0de9cf5 +Subproject commit 7aade5fca2acae3f10e260d0c076af6356da9dc6 diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index db6cac391b..42d396d819 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit db6cac391bee957c20ff3175b2f03c4817253e60 +Subproject commit 42d396d8190b93ae0bb45ed22039589b4840ab82 From ee885d42decf58ba90ddff250bb9c05f66009397 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 28 Sep 2018 14:04:20 -0700 Subject: [PATCH 09/72] python: use pure's magic value for VIRTUAL_ENV_DISABLE_PROMPT Fixes #1627 --- modules/python/init.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 28f671e0cf..f90156fd2d 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -93,8 +93,11 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ # Set the directory where virtual environments are stored. export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}" - # Disable the virtualenv prompt. - export VIRTUAL_ENV_DISABLE_PROMPT=1 + # Disable the virtualenv prompt. Note that we use the magic value used by the + # pure prompt because there's some additional logic in that prompt which tries + # to figure out if a user set this variable and disable the python portion of + # that prompt based on it which is the exact opposite of what we want to do. + export VIRTUAL_ENV_DISABLE_PROMPT=12 # Create a sorted array of available virtualenv related 'pyenv' commands to # look for plugins of interest. Scanning shell '$path' isn't enough as they From e9387a177e04b05dcf4f82e622615ddd32c558db Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 28 Sep 2018 14:24:25 -0700 Subject: [PATCH 10/72] python: respect PYENV_ROOT if already set Fixes #1578 --- modules/python/init.zsh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index f90156fd2d..9796294ccf 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -7,15 +7,18 @@ # Patrick Bos # -# Load manually installed pyenv into the shell session. -if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then +# 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) - export PYENV_ROOT=$(pyenv root) - eval "$(pyenv init - --no-rehash zsh)" +fi -# Load package manager installed pyenv into the shell session. -elif (( $+commands[pyenv] )); then - export PYENV_ROOT=$(pyenv root) +# Load pyenv into the current python session +if (( $+commands[pyenv] )); then + if [[ -z "$PYENV_ROOT" ]]; then + export PYENV_ROOT=$(pyenv root) + fi eval "$(pyenv init - --no-rehash zsh)" # Prepend PEP 370 per user site packages directory, which defaults to @@ -57,7 +60,7 @@ function _python-workon-cwd { local ENV_NAME="" if [[ -f "$PROJECT_ROOT/.venv" ]]; then ENV_NAME="$(cat "$PROJECT_ROOT/.venv")" - elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then + elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]]; then ENV_NAME="$PROJECT_ROOT/.venv" elif [[ "$PROJECT_ROOT" != "." ]]; then ENV_NAME="${PROJECT_ROOT:t}" From 6c46804f418effb65442c6d92f63950f831c281e Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Fri, 28 Sep 2018 14:51:59 -0700 Subject: [PATCH 11/72] environment: only enable bracketed paste on non-dumb terminals Fixes #1552 --- modules/environment/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/environment/init.zsh b/modules/environment/init.zsh index 4f3bbfe35a..7ae8c4f6a6 100644 --- a/modules/environment/init.zsh +++ b/modules/environment/init.zsh @@ -14,7 +14,7 @@ # paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic # which is generally better than url-quote-magic so we load that when possible. autoload -Uz is-at-least -if [[ ${ZSH_VERSION} != 5.1.1 ]]; then +if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then if is-at-least 5.2; then autoload -Uz bracketed-paste-url-magic zle -N bracketed-paste bracketed-paste-url-magic From df4c61861d298880edac1413f386704950fb9f76 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 11 Oct 2018 17:10:35 -0500 Subject: [PATCH 12/72] doc: Bit of copyediting and formatting for consistency and clarification --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bcbe15914e..552784bae7 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,11 @@ version is 4.3.11. done ``` - Note: If you already have any of the given config files, ln will error. In - simple cases you can add `source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"` to - the bottom of your `.zshrc` to load prezto but keep your config intact. For - more complicated setups, it is recommended that you back up your original + Note: If you already have any of the given configuration files, `ln` will + cause error. In simple cases you can load prezto by adding the line + `source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"` to the bottom of your + `.zshrc` and keep the rest of your Zsh configuration intact. For more + complicated setups, it is recommended that you back up your original configs and replace them with the provided prezto runcoms. 4. Set Zsh as your default shell: @@ -88,8 +89,12 @@ accompanying README files to learn of what is available. 3. Load the theme you like in *~/.zpreztorc* then open a new Zsh terminal window or tab. - ![sorin theme][2] - Note that the 'git' module may be required for special symbols to appear, such as those on the right of the above image. Add `'git'` to the list under `zstyle ':prezto:load' pmodule \ ` in your `.zpreztorc` to enable this module. + ![sorin theme][2] + Note that the 'git' module may be required for special symbols to appear, + such as those on the right of the above image. Add `'git'` to the `pmodule` + list (under `zstyle ':prezto:load' pmodule \` in your *~/.zpreztorc*) to + enable this module. + ### External Modules 1. By default modules will be loaded from */modules* and */contrib*. @@ -99,7 +104,7 @@ accompanying README files to learn of what is available. Note that module names need to be unique or they will cause an error when loading. - ```console + ```sh zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib ``` From ff5bd9306e99c5286d4eb85be5ceb1deba5a3c22 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 11 Oct 2018 17:26:38 -0500 Subject: [PATCH 13/72] submodule: Updating submodules 'modules/prompt/external/async' updated to 'v1.7.1' 'modules/syntax-highlighting/external' updated to latest 'master' --- modules/prompt/external/async | 2 +- modules/syntax-highlighting/external | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prompt/external/async b/modules/prompt/external/async index 5248bd85bf..58f7ba70f0 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit 5248bd85bf2c522ebfa2b8d18ee7bc736d10c791 +Subproject commit 58f7ba70f05e75802299848e7e31c7d7a7fd0c97 diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 42d396d819..d6586e2a4f 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 42d396d8190b93ae0bb45ed22039589b4840ab82 +Subproject commit d6586e2a4f54a66808aba3c325a614d5166342f8 From 6f603df7a641fb136b8b168d75e905fef60a00cf Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 12 Oct 2018 03:55:55 -0500 Subject: [PATCH 14/72] general: Miscellaneous documentation updates - Add missing documentation for options and environment variables - Rearrange definition and documentation of 'Options', 'Variables' and 'Aliases' in a consistent order --- modules/completion/README.md | 13 +++++++++++++ modules/completion/init.zsh | 2 +- modules/editor/README.md | 12 +++++++++++- modules/environment/README.md | 34 ++++++++++++++++++++++++++++++++-- modules/history/README.md | 14 +++++++------- modules/history/init.zsh | 16 ++++++++-------- modules/homebrew/README.md | 6 +++--- modules/homebrew/init.zsh | 2 +- modules/rsync/init.zsh | 3 ++- runcoms/README.md | 2 +- 10 files changed, 79 insertions(+), 25 deletions(-) diff --git a/modules/completion/README.md b/modules/completion/README.md index 7efb3d96a8..dc2b9b837a 100644 --- a/modules/completion/README.md +++ b/modules/completion/README.md @@ -6,6 +6,19 @@ the [zsh-completions][1] project. This module must be loaded **after** the *utility* module. +Options +------- + + - `COMPLETE_IN_WORD` complete from both ends of a word. + - `ALWAYS_TO_END` move cursor to the end of a completed word. + - `PATH_DIRS` perform path search even on command names with slashes. + - `AUTO_MENU` show completion menu on a successive tab press. + - `AUTO_LIST` automatically list choices on ambiguous completion. + - `AUTO_PARAM_SLASH` if completed parameter is a directory, add a trailing slash. + - `EXTENDED_GLOB` needed for file modification glob modifiers with compinit. + - `MENU_COMPLETE` do not autoselect the first completion entry. + - `FLOW_CONTROL` disable start/stop characters in shell editor. + Settings -------- diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 48202f3724..07acf13bf3 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -99,7 +99,7 @@ zstyle ':completion:*:history-words' remove-all-dups yes zstyle ':completion:*:history-words' list false zstyle ':completion:*:history-words' menu yes -# Environmental Variables +# Environment Variables zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-} # Populate hostname completion. But allow ignoring custom entries from static diff --git a/modules/editor/README.md b/modules/editor/README.md index c27e8642c0..d5280c45f5 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -1,7 +1,17 @@ Editor ====== -Sets key bindings. +Sets editor specific key bindings options and variables. + +Options +------- + + - `BEEP` beep on error in line editor. + +Variables +--------- + + - `WORDCHARS` treat a given set of characters as part of a word. Settings -------- diff --git a/modules/environment/README.md b/modules/environment/README.md index b0d579bb45..6a5e582c0e 100644 --- a/modules/environment/README.md +++ b/modules/environment/README.md @@ -5,8 +5,38 @@ Sets general shell options and defines environment variables. This module must be loaded first. -Environment Variables ---------------------- +Options +------- + +### General + + - `COMBINING_CHARS` combine zero-length punctuation characters (accents) with + the base character. + - `INTERACTIVE_COMMENTS` enable comments in interactive shell. + - `RC_QUOTES` allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. + - `MAIL_WARNING` don't print a warning message if a mail file has been accessed. + +### Jobs + + - `LONG_LIST_JOBS` list jobs in the long format by default. + - `AUTO_RESUME` attempt to resume existing job before creating a new process. + - `NOTIFY` report status of background jobs immediately. + - `BG_NICE` don't run all background jobs at a lower priority. + - `HUP` don't kill jobs on shell exit. + - `CHECK_JOBS` don't report on jobs when shell exit. + +Variables +--------- + +### Termcap + + - `LESS_TERMCAP_mb` begins blinking. + - `LESS_TERMCAP_md` begins bold. + - `LESS_TERMCAP_me` ends mode. + - `LESS_TERMCAP_se` ends standout-mode. + - `LESS_TERMCAP_so` begins standout-mode. + - `LESS_TERMCAP_ue` ends underline. + - `LESS_TERMCAP_us` begins underline. Contributors ------------ diff --git a/modules/history/README.md b/modules/history/README.md index 3dc9a26423..d020688a56 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -3,13 +3,6 @@ History Sets [history][1] options and defines history aliases. -Variables ---------- - - - `HISTFILE` stores the path to the history file. - - `HISTSIZE` stores the maximum number of events to save in the internal history. - - `SAVEHIST` stores the maximum number of events to save in the history file. - Options ------- @@ -26,6 +19,13 @@ Options - `HIST_VERIFY` does not execute immediately upon history expansion. - `HIST_BEEP` beeps when accessing non-existent history. +Variables +--------- + + - `HISTFILE` stores the path to the history file. + - `HISTSIZE` stores the maximum number of events to save in the internal history. + - `SAVEHIST` stores the maximum number of events to save in the history file. + Aliases ------- diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 31db4c5b3a..db357b0259 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -6,14 +6,6 @@ # Sorin Ionescu # -# -# Variables -# - -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. - # # Options # @@ -31,6 +23,14 @@ setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history setopt HIST_VERIFY # Do not execute immediately upon history expansion. setopt HIST_BEEP # Beep when accessing non-existent history. +# +# Variables +# + +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. + # # Aliases # diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md index 3046f98ebe..2a37553d15 100644 --- a/modules/homebrew/README.md +++ b/modules/homebrew/README.md @@ -1,10 +1,10 @@ Homebrew ======== -Defines Homebrew specific shell environment variables and aliases. +Defines Homebrew specific environment variables and aliases. -Environment Variables ---------------------- +Variables +--------- Execute the following to list the environment variables loaded in the shell: diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index cd1e5f72ce..d078b7ae08 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -11,7 +11,7 @@ if [[ "$OSTYPE" != (darwin|linux)* ]]; then fi # -# Environmental Variables +# Variables # # Load standard Homebrew shellenv into the shell session. diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index a802222fac..3618812fa2 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -14,7 +14,8 @@ fi # Aliases # -_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' +_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive \ + --hard-links --one-file-system' if grep -q 'xattrs' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --acls --xattrs" diff --git a/runcoms/README.md b/runcoms/README.md index 9df890e51a..29d9f8a98d 100644 --- a/runcoms/README.md +++ b/runcoms/README.md @@ -10,7 +10,7 @@ in */etc* by default. User-local configuration files have the same name as their global counterparts but are prefixed with a dot (hidden). Zsh looks for these files in the path -stored in the `$ZDOTDIR` environmental variable. However, if said variable is +stored in the `$ZDOTDIR` environment variable. However, if said variable is not defined, Zsh will use the user's home directory. File Descriptions From 992b9de5050f38cdefee26dc020175506c8469a2 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 12 Oct 2018 10:52:24 -0500 Subject: [PATCH 15/72] doc: More copyediting and formatting for consistency --- modules/archive/README.md | 6 +++--- modules/autosuggestions/README.md | 5 ----- modules/command-not-found/README.md | 7 ++++--- modules/environment/README.md | 14 +++++++------- modules/python/README.md | 8 +++++--- modules/utility/README.md | 7 ++++--- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/modules/archive/README.md b/modules/archive/README.md index 600ff15d0e..c9806ea591 100644 --- a/modules/archive/README.md +++ b/modules/archive/README.md @@ -31,9 +31,9 @@ installed: - *.7z* requires `7za`. - *.deb* requires `ar`, `tar`. -Additionally, if `pigz` and/or `pbzip2` are installed, `archive` will use them over -their traditional counterparts, `gzip` and `bzip2` respectively, to take full advantage -of all available CPU cores for compression. +Additionally, if `pigz` and/or `pbzip2` are installed, `archive` will use them +over their traditional counterparts, `gzip` and `bzip2` respectively, to take +full advantage of all available CPU cores for compression. Alternatives ------------ diff --git a/modules/autosuggestions/README.md b/modules/autosuggestions/README.md index c3e90a4916..48f9852887 100644 --- a/modules/autosuggestions/README.md +++ b/modules/autosuggestions/README.md @@ -1,8 +1,3 @@ -Autosuggestions ---------------- - -Integrates zsh-autosuggestions into Prezto. - Autosuggestions =============== diff --git a/modules/command-not-found/README.md b/modules/command-not-found/README.md index 7775c92621..ee5a94d6d5 100644 --- a/modules/command-not-found/README.md +++ b/modules/command-not-found/README.md @@ -3,11 +3,12 @@ Command-Not-Found When you try to use a command that is not available locally, searches the package manager for a package offering that command and suggests -the proper install command. +the proper install command. -Debian-based and Arch Linux-based distributions use the [`command-not-found`][1] tool. +Debian and Arch Linux based distributions use the [`command-not-found`][1] tool. -macOS uses Homebrew's [`command-not-found` clone][2]. Note that you also need to [follow the instructions to tap the `command-not-found` homebrew repository][3]. +macOS uses Homebrew's [`command-not-found` clone][2]. Note that you also need to +[follow the instructions][3] to tap the `command-not-found` homebrew repository. Authors diff --git a/modules/environment/README.md b/modules/environment/README.md index 6a5e582c0e..15ee95922c 100644 --- a/modules/environment/README.md +++ b/modules/environment/README.md @@ -5,6 +5,13 @@ Sets general shell options and defines environment variables. This module must be loaded first. +Contributors +------------ + +This module **MUST NOT** rely on any command not built in Zsh. + +Non-interactive environment variables should be defined in [`zshenv`][1]. + Options ------- @@ -38,13 +45,6 @@ Variables - `LESS_TERMCAP_ue` ends underline. - `LESS_TERMCAP_us` begins underline. -Contributors ------------- - -This module **MUST NOT** rely on any command not built in Zsh. - -Non-interactive environment variables should be defined in [`zshenv`][1]. - Authors ------- diff --git a/modules/python/README.md b/modules/python/README.md index e7b72c480b..121ea37395 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -6,7 +6,9 @@ Enables local Python and local Python package installation. Settings -------- -This module supports virtual environments from conda and virtualenvwrapper. By default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add the following to *zpreztorc*. +This module supports virtual environments from conda and virtualenvwrapper. By +default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add +the following to *zpreztorc*. ```sh zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on' @@ -52,8 +54,8 @@ virtualenvwrapper [`virtualenvwrapper`][2] is a frontend to the popular [`virtualenv`][3] utility. -`virtualenv` creates isolated Python environments and `virtualenvwrapper` provides -convenient shell functions to create, switch, and manage them. +`virtualenv` creates isolated Python environments and `virtualenvwrapper` +provides convenient shell functions to create, switch, and manage them. ### Usage diff --git a/modules/utility/README.md b/modules/utility/README.md index 84e81f5c28..9ace1ebace 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -8,8 +8,8 @@ Settings ### Highlighting -If you have enabled color globally in *zpreztorc*, you may disable it for certain -commands. +If you have enabled color globally in *zpreztorc*, you may disable it for +certain commands. To disable `ls` color, add the following line to *zpreztorc*; when coloring is disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries. @@ -109,7 +109,8 @@ Aliases ### Resource Usage - - `df` displays free disk space using human readable units (aliases to `pydf`, if installed). + - `df` displays free disk space using human readable units (aliases to `pydf`, + if installed). - `du` displays disk usage using human readable units. - `top` displays information about processes. - `topc` displays information about processes sorted by CPU usage. From 58809b2d21274cf462ca3d597c41e1e4ec509034 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 12 Oct 2018 16:53:46 -0500 Subject: [PATCH 16/72] Update submodule 'history-substring-search' history-substring-search doesn't tag releases anymore and just maintains the master branch -- switching to tracking master instead. --- 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 aae3388491..47a7d416c6 160000 --- a/modules/history-substring-search/external +++ b/modules/history-substring-search/external @@ -1 +1 @@ -Subproject commit aae3388491c2312c4efb2e86bcb999927bb2900e +Subproject commit 47a7d416c652a109f6e8856081abc042b50125f4 From a3753d8f3b09911d064293bdd3c87d98b9ddfc3b Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 13 Oct 2018 23:09:14 -0500 Subject: [PATCH 17/72] prompt/steeef: Add basic support for editor_info and preview --- modules/prompt/functions/prompt_steeef_setup | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/prompt/functions/prompt_steeef_setup b/modules/prompt/functions/prompt_steeef_setup index b241f9aa35..ca39f9321d 100644 --- a/modules/prompt/functions/prompt_steeef_setup +++ b/modules/prompt/functions/prompt_steeef_setup @@ -72,6 +72,9 @@ function prompt_steeef_setup { local unstaged_format="${_prompt_steeef_colors[2]}●%f" local staged_format="${_prompt_steeef_colors[5]}●%f" + # Set editor-info parameters. + zstyle ':prezto:module:editor:info:keymap:primary' format '$' + # Set vcs_info parameters. zstyle ':vcs_info:*' enable bzr git hg svn zstyle ':vcs_info:*:prompt:*' check-for-changes true @@ -87,8 +90,17 @@ function prompt_steeef_setup { # Define prompts. PROMPT=" ${_prompt_steeef_colors[3]}%n%f at ${_prompt_steeef_colors[2]}%m%f in ${_prompt_steeef_colors[5]}%~%f "'${vcs_info_msg_0_}'" -"'$python_info[virtualenv]'"$ " +"'$python_info[virtualenv]${editor_info[keymap]} ' RPROMPT='' } +function prompt_steeef_preview { + local +h PROMPT='' + local +h RPROMPT='' + local +h SPROMPT='' + + editor-info 2> /dev/null + prompt_preview_theme 'steeef' +} + prompt_steeef_setup "$@" From a43093119e8d0e7ebb49e45b9fda069c3c4998fd Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 13 Oct 2018 23:13:16 -0500 Subject: [PATCH 18/72] prompt/minimal: Add support for preview --- modules/prompt/functions/prompt_minimal_setup | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/prompt/functions/prompt_minimal_setup b/modules/prompt/functions/prompt_minimal_setup index 7456ffdb1d..b600768bd0 100644 --- a/modules/prompt/functions/prompt_minimal_setup +++ b/modules/prompt/functions/prompt_minimal_setup @@ -47,4 +47,13 @@ function prompt_minimal_setup { RPROMPT='' } +function prompt_minimal_preview { + local +h PROMPT='' + local +h RPROMPT='' + local +h SPROMPT='' + + editor-info 2> /dev/null + prompt_preview_theme 'minimal' +} + prompt_minimal_setup "$@" From bfe1815cbfb9044cdfc341383ad2d930781d7db8 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 13 Oct 2018 23:16:20 -0500 Subject: [PATCH 19/72] prompt/sorin: Minor cleanup and reordering --- modules/prompt/functions/prompt_sorin_setup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 30e71a9285..14f8858c1c 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -144,16 +144,17 @@ function prompt_sorin_setup { zstyle ':prezto:module:git:info:keys' format \ 'status' '%b %p %c:%s%A%B%S%a%d%m%r%U%u' + # Set python-info parameters. + zstyle ':prezto:module:python:info:virtualenv' format '%f%F{3}(%v)%F{7} ' + # Set up non-zero return value display local show_return="✘ " # Default is to show the return value if zstyle -T ':prezto:module:prompt' show-return-val; then show_return+='%? ' fi - # Set python-info format - zstyle ':prezto:module:python:info:virtualenv' format '%f%F{3}(%v)%F{7} ' - # Get the async worker set up + # Get the async worker set up. _sorin_cur_git_root='' _prompt_sorin_git='' From 1ed5331e84421241c58e9f15795650f9608bf186 Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Mon, 15 Oct 2018 09:56:41 -0300 Subject: [PATCH 20/72] Fix issue #1635. Option to disable GNU ls to group directories first. --- modules/utility/README.md | 6 ++++++ modules/utility/init.zsh | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/utility/README.md b/modules/utility/README.md index 9ace1ebace..3b25b3a75b 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -18,6 +18,12 @@ disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries. zstyle ':prezto:module:utility:ls' color 'no' ``` +To disable GNU coreutils `ls` to list directories grouped first, add the following line to *zpreztorc*: + +```sh +zstyle ':prezto:module:utility:ls' dirs-first 'no' +``` + To disable `diff` highlighting, add the following line to *zpreztorc*: ```sh diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 942090d777..6b07bf0f9e 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -73,7 +73,10 @@ fi # ls if is-callable 'dircolors'; then # GNU Core Utilities - alias ls='ls --group-directories-first' + + if zstyle -T ':prezto:module:utility:ls' dirs-first; then + alias ls="${aliases[ls]:-ls} --group-directories-first" + fi if zstyle -t ':prezto:module:utility:ls' color; then # Call dircolors to define colors if they're missing From e6eea17b12d18775cb26df7f0eddcf4d9b5cc59d Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Thu, 8 Nov 2018 13:02:10 -0200 Subject: [PATCH 21/72] Update submodules Updating to the latest released tags for modules: completetion syntax-highlighting And for agnoster prompt --- modules/completion/external | 2 +- modules/prompt/external/agnoster | 2 +- modules/syntax-highlighting/external | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/completion/external b/modules/completion/external index 955645c22b..8ec8c8c5c6 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 955645c22b29434caefadcb7d541d570d40ae932 +Subproject commit 8ec8c8c5c662c3cb77231b7458ce1975d2f8c967 diff --git a/modules/prompt/external/agnoster b/modules/prompt/external/agnoster index 3ad94b6599..6bba672c78 160000 --- a/modules/prompt/external/agnoster +++ b/modules/prompt/external/agnoster @@ -1 +1 @@ -Subproject commit 3ad94b659910c775a6560c45b1524d23d8c83b09 +Subproject commit 6bba672c7812a76defc3efed9b6369eeee2425dc diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index d6586e2a4f..e900ad8bad 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit d6586e2a4f54a66808aba3c325a614d5166342f8 +Subproject commit e900ad8bad53501689afcb050456400d7a8466e5 From 8bfed017737d69cf3a62813c586467c3aee16bc9 Mon Sep 17 00:00:00 2001 From: "John P. Neumann" Date: Thu, 29 Nov 2018 17:13:23 -0600 Subject: [PATCH 22/72] Resolves #1641 - Roll the pure prompt back from 1.8.0 to 1.7.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 7aade5fca2..fa9137ecec 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit 7aade5fca2acae3f10e260d0c076af6356da9dc6 +Subproject commit fa9137ecec76d23fe76fd6fabe9c2f8ae0de9cf5 From 3de1e24965ae42337287160b155b16b1f054cff2 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Wed, 5 Dec 2018 09:38:07 -0200 Subject: [PATCH 23/72] Update submodules versions --- modules/autosuggestions/external | 2 +- modules/prompt/external/powerlevel9k | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index d7c796719e..a7f0106b31 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit d7c796719e6352666f7a9c94da9ddaed10f3217d +Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60 diff --git a/modules/prompt/external/powerlevel9k b/modules/prompt/external/powerlevel9k index 358c105de7..2f4b15041f 160000 --- a/modules/prompt/external/powerlevel9k +++ b/modules/prompt/external/powerlevel9k @@ -1 +1 @@ -Subproject commit 358c105de7aa5e8109788adf65c08c44e368d418 +Subproject commit 2f4b15041fe31d85dc9ef705b818c3a0e6985da3 From 2286662b807d0edc4436df6277c863ddddb66ce0 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Tue, 31 Jul 2018 20:29:01 -0500 Subject: [PATCH 24/72] command-not-found: Restore idiomatic homebrewed handler loading on MacOS As is the convention in prezto, we cache the command-not-found handler to avoid incurring the performance penalty of loading ruby interpreter on every call. This restores the 'Homebrew way' of loading command-not-found handler. Further, the formally recommended command lookup mechanism in Homebrew (viz., `brew command command-not-found-init`) is ruby based and is super slow. To avoid performance penalty, we `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew. This also reinstates support for custom taps or non-standard Homebrew location. --- modules/command-not-found/init.zsh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index 2c59a4b31d..dc3c2b4ca2 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -12,9 +12,28 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then # 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' -# Load command-not-found on macOS when homebrew tap is configured. -elif [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then - source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' +# Load command-not-found on macOS when Homebrew tap is configured. +# To avoid performance penalty, we do not use Homebrew's ruby based command +# lookup mechanism (viz., `brew command command-not-found-init`) and instead +# `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew. +elif (( $+commands[brew] )); then + cnf_command="$(brew --repository 2> /dev/null)"/Library/Taps/homebrew/homebrew-command-not-found/cmd/brew-command-not-found-init.rb + if [[ -s "$cnf_command" ]]; then + cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh" + + if [[ "$cnf_command" -nt "$cache_file" \ + || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ + || ! -s "$cache_file" ]]; then + # brew command-not-found-init is slow; cache its output. + brew command-not-found-init >! "$cache_file" 2> /dev/null + fi + + source "$cache_file" + + unset cache_file + fi + + unset cnf_command # Return if requirements are not found. else return 1 From 53286ebbdb18e9744182734082713d569ee0880b Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 7 Dec 2018 15:45:06 -0600 Subject: [PATCH 25/72] python: Make cached completion file mangling more reliable While mangling cached completion file, we cannot just assume that `$pip_command` would resolve to `pip` -- it might be `pip2` or `pip3` depending on the relative position in zsh `$commands` array. Thus replace the whole of 'pip*' with 'pip pip2 pip3' for compctl assignment. --- modules/python/init.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 9796294ccf..d78c0dca41 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -160,10 +160,11 @@ if (( $#commands[(i)pip(|[23])] )); then || ! -s "$cache_file" ]]; then # pip is slow; cache its output. And also support 'pip2', 'pip3' variants $pip_command completion --zsh \ - | sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null + | sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null fi source "$cache_file" + unset cache_file pip_command fi From e7fea3343f57461d8f3fa50d1a22b2c8490f9ecd Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 9 Dec 2018 17:16:21 -0600 Subject: [PATCH 26/72] python: Use more apropriate filename for pip completion --- modules/python/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index d78c0dca41..302aff4b66 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -150,7 +150,7 @@ fi # Load PIP completion. if (( $#commands[(i)pip(|[23])] )); then - cache_file="${TMPDIR:-/tmp}/prezto-python-cache.$UID.zsh" + cache_file="${TMPDIR:-/tmp}/prezto-pip-cache.$UID.zsh" # Detect and use one available from among 'pip', 'pip2', 'pip3' variants pip_command="$commands[(i)pip(|[23])]" From a2398fc0454a641b020ee2d96489524bead8f3f9 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 7 Dec 2018 17:08:12 -0600 Subject: [PATCH 27/72] node: Cache completion for additional helpers Add support for npm and additional well-known helper commands --- modules/node/init.zsh | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 0a516f0dfb..75a7ebb499 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -28,18 +28,28 @@ elif (( ! $+commands[node] )); then return 1 fi -# Load NPM completion. -if (( $+commands[npm] )); then - cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh" - - if [[ "$commands[npm]" -nt "$cache_file" \ - || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ! -s "$cache_file" ]]; then - # npm is slow; cache its output. - npm completion >! "$cache_file" 2> /dev/null +# Load NPM and known helper completions. +typeset -A compl_commands=( + npm 'npm completion' + grunt 'grunt --completion=zsh' + gupl 'gulp --completion=zsh' +) + +for compl_command in "${(k)compl_commands[@]}"; do + if (( $+commands[$compl_command] )); then + cache_file="${TMPDIR:-/tmp}/prezto-$compl_command-cache.$UID.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 + command ${=compl_commands[$compl_command]} >! "$cache_file" 2> /dev/null + fi + + source "$cache_file" + + unset cache_file fi +done - source "$cache_file" - - unset cache_file -fi +unset compl_command{s,} From f7456453428a48cbb6d45829711a1fcbb908613e Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Tue, 11 Dec 2018 11:02:37 -0600 Subject: [PATCH 28/72] command-not-found: Support custom Homebrew tap on MacOS Added support for homebrew-command-not-found from a non-default tap --- modules/command-not-found/init.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index dc3c2b4ca2..bcb0dead16 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -17,11 +17,11 @@ elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then # lookup mechanism (viz., `brew command command-not-found-init`) and instead # `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew. elif (( $+commands[brew] )); then - cnf_command="$(brew --repository 2> /dev/null)"/Library/Taps/homebrew/homebrew-command-not-found/cmd/brew-command-not-found-init.rb - if [[ -s "$cnf_command" ]]; then + cnf_command=("$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.NL+0)) + if (( $#cnf_command )); then cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh" - if [[ "$cnf_command" -nt "$cache_file" \ + if [[ "${${(@o)cnf_command}[1]}" -nt "$cache_file" \ || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ || ! -s "$cache_file" ]]; then # brew command-not-found-init is slow; cache its output. From a987c8bc8a142d2792c4d067998959971dbc91fa Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 12 Dec 2018 16:18:58 -0600 Subject: [PATCH 29/72] python: Fix pip compctl file match pattern Make `sed` match more reliable while replacing the whole of 'pip*' with 'pip pip2 pip3' for `compctl` assignment --- modules/python/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 302aff4b66..d61488ed9a 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -160,7 +160,7 @@ if (( $#commands[(i)pip(|[23])] )); then || ! -s "$cache_file" ]]; then # pip is slow; cache its output. And also support 'pip2', 'pip3' variants $pip_command completion --zsh \ - | sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null + | sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip.*|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null fi source "$cache_file" From d45d87b08feb3a0361e0564678e6d7e3a18e3751 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 12 Dec 2018 22:17:16 -0600 Subject: [PATCH 30/72] node: Make nvm lookup mechanism more efficient in homebrewed environment In homebrewed environment, avoid using `brew --prefix nvm` which is ruby based and is super slow. Instead, rely on homebrew standard behavior wherein all installed packages are available in canonical path $(brew --prefix)/opt/ (for nvm it would obviously be `$(brew --prefix)/opt/nvm`). NB: `$(brew --prefix)` (without additional argument) is a simple shell shortcut and doesn't have the same performance impact. --- modules/node/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 75a7ebb499..f452ec5a53 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -11,8 +11,10 @@ if [[ -s "$HOME/.nvm/nvm.sh" ]]; then source "$HOME/.nvm/nvm.sh" # Load package manager installed NVM into the shell session. -elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2> /dev/null)" ]]; then +elif (( $+commands[brew] )) && \ + [[ -d "${nvm_prefix::="$(brew --prefix 2> /dev/null)"/opt/nvm}" ]]; then source "$(brew --prefix nvm)/nvm.sh" + unset nvm_prefix # Load manually installed nodenv into the shell session. elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then From 6a2cc2e14611e7ea5742a49759180772b3fda2a4 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 12 Dec 2018 22:42:02 -0600 Subject: [PATCH 31/72] rsync: Update link to Bombich rsync page again --- modules/rsync/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index 3618812fa2..b3010ede32 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -22,7 +22,7 @@ if grep -q 'xattrs' <(rsync --help 2>&1); then fi # macOS and HFS+ Enhancements -# http://help.bombich.com/kb/overview/credits#opensource +# https://bombich.com/kb/ccc5/credits if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" fi From d275f316ffdd0bbd075afbff677c3e00791fba16 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 12 Dec 2018 23:02:59 -0600 Subject: [PATCH 32/72] syntax-highlighting: Further clarify relative module ordering --- modules/syntax-highlighting/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/syntax-highlighting/README.md b/modules/syntax-highlighting/README.md index 7a28892a46..7a5a30c356 100644 --- a/modules/syntax-highlighting/README.md +++ b/modules/syntax-highlighting/README.md @@ -9,6 +9,9 @@ Additionally, if this module is used in conjunction with the *history-substring-search* module, this module must be loaded **before** the *history-substring-search* module. +To elaborate: The relative order of loading the modules would be +'syntax-highlighting', 'history-substring-search' and 'prompt'. + Contributors ------------ From 39e1a633494e5ba492fe826e0ceb104ad5318ada Mon Sep 17 00:00:00 2001 From: Bruno Oliveira da Silva Date: Thu, 13 Dec 2018 16:43:23 -0200 Subject: [PATCH 33/72] Aliases to digital sign/verify commits and tags (#651) --- modules/git/alias.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index dde5b351c1..4e4f482815 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -68,10 +68,11 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias gcr='git revert' alias gcR='git reset "HEAD^"' alias gcs='git show' + alias gpS='git show --pretty=short --show-signature' alias gcl='git-commit-lost' alias gcy='git cherry -v --abbrev' alias gcY='git cherry -v' - + # Conflict (C) alias gCl='git --no-pager diff --name-only --diff-filter=U' alias gCa='git add $(gCl)' @@ -190,6 +191,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias glg='git log --topo-order --all --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 glS='git log --show-signature' # Merge (m) alias gm='git merge' @@ -255,6 +257,8 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then # Tag (t) alias gt='git tag' alias gtl='git tag -l' + alias gts='git tag -s' + alias gtv='git verify-tag' # Working Copy (w) alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short' From eee3c9c1662914cd2a7f30139396bf96d0200521 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 13 Dec 2018 10:51:56 -0800 Subject: [PATCH 34/72] git: add documentation for new aliases --- modules/git/README.md | 4 ++++ modules/git/alias.zsh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/git/README.md b/modules/git/README.md index a497826267..b5de9f6fbe 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -81,6 +81,7 @@ zstyle ':prezto:module:git:alias' skip 'yes' commits. - `gcR` removes the *HEAD* commit. - `gcs` displays various types of objects. + - `gcsS` displays commits with GPG signature. - `gcl` lists lost commits. - `gcy` displays commits yet to be applied to upstream in the short format. - `gcY` displays commits yet to be applied to upstream. @@ -220,6 +221,7 @@ zstyle ':prezto:module:git:alias' skip 'yes' - `glg` displays the graph log. - `glb` displays the brief commit log. - `glc` displays the commit count for each contributor in descending order. + - `glS` displays the log and checks the validity of signed commits. ### Merge @@ -295,6 +297,8 @@ zstyle ':prezto:module:git:alias' skip 'yes' - `gt` lists tags or creates tag. - `gtl` lists tags matching pattern. + - `gts` creates a signed tag. + - `gtv` validate a signed tag. ### Working directory diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 4e4f482815..89ba558733 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -68,11 +68,11 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then alias gcr='git revert' alias gcR='git reset "HEAD^"' alias gcs='git show' - alias gpS='git show --pretty=short --show-signature' + alias gcsS='git show --pretty=short --show-signature' alias gcl='git-commit-lost' alias gcy='git cherry -v --abbrev' alias gcY='git cherry -v' - + # Conflict (C) alias gCl='git --no-pager diff --name-only --diff-filter=U' alias gCa='git add $(gCl)' From 54dff31b63ea04705cc95200e53dd4e7a67232d6 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 13 Dec 2018 01:14:59 -0600 Subject: [PATCH 35/72] archive: Enhance 'archive' helper to support multi file archive We now allow multiple paths (files/directories) to be archived in one shot. Validation of the target path(s) is now delegated to the actual archive helper. --- modules/archive/functions/archive | 32 +++++++++++++------------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/archive/functions/archive b/modules/archive/functions/archive index 0e3bb616bf..fab409e2c0 100644 --- a/modules/archive/functions/archive +++ b/modules/archive/functions/archive @@ -8,11 +8,11 @@ # function archive { -local archive_name dir_to_archive _gzip_bin _bzip2_bin +local archive_name path_to_archive _gzip_bin _bzip2_bin -if (( $# != 2 )); then +if (( $# < 2 )); then cat >&2 <&2 - return 1 -fi +# let paths be handled by actual archive helper +path_to_archive="${@:2}" # here, we check for dropin/multi-threaded replacements # this should eventually be moved to modules/archive/init.zsh @@ -53,14 +47,14 @@ else fi case "${archive_name}" in - (*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${dir_to_archive}" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${dir_to_archive}" ;; - (*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${dir_to_archive}" ;; - (*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${dir_to_archive}" ;; - (*.tar) tar -cvf "${archive_name}" "${dir_to_archive}" ;; - (*.zip|*.jar) zip -r "${archive_name}" "${dir_to_archive}" ;; - (*.rar) rar a "${archive_name}" "${dir_to_archive}" ;; - (*.7z) 7za a "${archive_name}" "${dir_to_archive}" ;; + (*.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.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}" ;; + (*.rar) rar a "${archive_name}" "${=path_to_archive}" ;; + (*.7z) 7za a "${archive_name}" "${=path_to_archive}" ;; (*.gz) print "\n.gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;; (*.bz2) print "\n.bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;; (*.xz) print "\n.xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;; From 11184084bcd0d67838c420bdd18f3c7922ad4993 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 14 Dec 2018 15:34:42 -0600 Subject: [PATCH 36/72] homebrew: Simplify array assignment No need for nesting array assignment only to flatten it later. --- modules/homebrew/init.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index d078b7ae08..b449bac52b 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -45,12 +45,11 @@ alias casks='hb_deprecated brew cask search' alias caskx='brew cask uninstall' function hb_deprecated { - local cmd="${argv[3]}" - local cmd_args=( ${(@)argv:4} ) + local cmd="${@[3]}" + local cmd_args="${@:4}" printf "'brew cask %s' has been deprecated, " "${cmd}" printf "using 'brew %s' instead\n" "${cmd}" - cmd_args=( ${(@)argv:4} ) - command brew "${cmd}" ${(@)cmd_args} + command brew "${cmd}" "${=cmd_args}" } From 3093f1b966985c834fb698dabbe9a0af805ef940 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 14 Dec 2018 15:40:59 -0600 Subject: [PATCH 37/72] homebrew: Load 'HOMEBREW_' prefixed variables only Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related variables as they are already handled in standard zsh configuration. --- modules/homebrew/init.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index b449bac52b..056f1fb5db 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -14,10 +14,11 @@ fi # Variables # -# Load standard Homebrew shellenv into the shell session. -# `brew shellenv` is relatively new, guard for legacy Homebrew. +# Load standard Homebrew shellenv into the shell session. +# Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related +# variables as they are already handled in standard zsh configuration. if (( $+commands[brew] )); then - eval "$(brew shellenv 2> /dev/null)" + eval "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" fi # From dc8e168d5fab038bc2bd39f97984c111abf5258c Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 14 Dec 2018 20:57:10 -0600 Subject: [PATCH 38/72] command-not-found: Minor reformatting --- modules/command-not-found/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/command-not-found/init.zsh b/modules/command-not-found/init.zsh index bcb0dead16..f3d7ea6287 100644 --- a/modules/command-not-found/init.zsh +++ b/modules/command-not-found/init.zsh @@ -17,7 +17,9 @@ elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then # lookup mechanism (viz., `brew command command-not-found-init`) and instead # `find` it ourselves from `TAP_DIRECTORY` defined internally in Homebrew. elif (( $+commands[brew] )); then - cnf_command=("$(brew --repository 2> /dev/null)"/Library/Taps/*/*/cmd/brew-command-not-found-init(|.rb)(.NL+0)) + cnf_command=( + "$(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" From 9d3e2f0204f2de5a0f04da1e0cdcf63e8afe5add Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 14 Dec 2018 21:32:10 -0600 Subject: [PATCH 39/72] python: Expand compctl matches for pip variants Expand `sed` match for more variants of 'pip*' (pip, pip2, pip3, pip2.7, pip3.7 etc.) for `compctl` assignment --- modules/python/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index d61488ed9a..a8e00b39b8 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -160,7 +160,7 @@ if (( $#commands[(i)pip(|[23])] )); then || ! -s "$cache_file" ]]; then # pip is slow; cache its output. And also support 'pip2', 'pip3' variants $pip_command completion --zsh \ - | sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip.*|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null + | sed -e "s/\(compctl -K [-_[:alnum:]]*\) pip.*/\1 pip(|[23](|.[0-9]))/" >! "$cache_file" 2> /dev/null fi source "$cache_file" From 0e6429da97876c7ce0868966e8a812c29bcba0b3 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Mon, 17 Dec 2018 16:22:33 -0200 Subject: [PATCH 40/72] Remove duplicated information from git module README (#1657) --- modules/git/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/README.md b/modules/git/README.md index b5de9f6fbe..e4425fab22 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -67,7 +67,7 @@ zstyle ':prezto:module:git:alias' skip 'yes' - `gcm` records changes to the repository with the given message. - `gcS` records changes to the repository. (Signed) - `gcSa` stages all modified and deleted files. (Signed) - - `gcSm` records changes to the repository with the given message. (Signed) - `gco` checks out a branch or paths to work tree. + - `gcSm` records changes to the repository with the given message. (Signed) - `gcam` stages all modified and deleted files, and records changes to the repository with the given message. - `gco` checks out a branch or paths to work tree. - `gcO` checks out hunks from the index or the tree interactively. From a338cba805f63f770e9078925bc5c46129e28bde Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 17 Dec 2018 14:10:51 -0600 Subject: [PATCH 41/72] python: Use brace expansion for pip compctl match Just use brace expansion only (and not a mix of brace expansion and path expansion) to expand `sed` match for more variants of 'pip*' (pip, pip2, pip3, pip2.7, pip3.7 etc.) in `compctl` assignment --- modules/python/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a8e00b39b8..44043f1c35 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -160,7 +160,9 @@ if (( $#commands[(i)pip(|[23])] )); then || ! -s "$cache_file" ]]; then # pip is slow; cache its output. And also support 'pip2', 'pip3' variants $pip_command completion --zsh \ - | sed -e "s/\(compctl -K [-_[:alnum:]]*\) pip.*/\1 pip(|[23](|.[0-9]))/" >! "$cache_file" 2> /dev/null + | sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \ + >! "$cache_file" \ + 2> /dev/null fi source "$cache_file" From 4a16d3fa50f6596fe13affd90107d25710c88e43 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Wed, 2 Jan 2019 18:04:07 -0800 Subject: [PATCH 42/72] Fix typo: gupl --> gulp (#1668) --- modules/node/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index f452ec5a53..d8eea1459e 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -34,7 +34,7 @@ fi typeset -A compl_commands=( npm 'npm completion' grunt 'grunt --completion=zsh' - gupl 'gulp --completion=zsh' + gulp 'gulp --completion=zsh' ) for compl_command in "${(k)compl_commands[@]}"; do From 88456ec9b6c0ef4eb18381bca1942474e27336a4 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Mon, 7 Jan 2019 10:41:23 -0200 Subject: [PATCH 43/72] Updating submodules to lastest tags/master commits --- modules/completion/external | 2 +- modules/fasd/external | 2 +- modules/history-substring-search/external | 2 +- modules/prompt/external/pure | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/completion/external b/modules/completion/external index 8ec8c8c5c6..cf565254e2 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 8ec8c8c5c662c3cb77231b7458ce1975d2f8c967 +Subproject commit cf565254e26bb7ce03f51889e9a29953b955b1fb diff --git a/modules/fasd/external b/modules/fasd/external index 90b531a5da..48220241e7 160000 --- a/modules/fasd/external +++ b/modules/fasd/external @@ -1 +1 @@ -Subproject commit 90b531a5daaa545c74c7d98974b54cbdb92659fc +Subproject commit 48220241e764fdf46b075cd7fe723468aaadde58 diff --git a/modules/history-substring-search/external b/modules/history-substring-search/external index 47a7d416c6..aae3388491 160000 --- a/modules/history-substring-search/external +++ b/modules/history-substring-search/external @@ -1 +1 @@ -Subproject commit 47a7d416c652a109f6e8856081abc042b50125f4 +Subproject commit aae3388491c2312c4efb2e86bcb999927bb2900e diff --git a/modules/prompt/external/pure b/modules/prompt/external/pure index fa9137ecec..7aade5fca2 160000 --- a/modules/prompt/external/pure +++ b/modules/prompt/external/pure @@ -1 +1 @@ -Subproject commit fa9137ecec76d23fe76fd6fabe9c2f8ae0de9cf5 +Subproject commit 7aade5fca2acae3f10e260d0c076af6356da9dc6 From ba4063f99e0b2d531a55b375ca92314e3a9a178b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 6 Jan 2019 11:24:34 +0100 Subject: [PATCH 44/72] Remove old prompt tempfile and pid variable This is a leftover of #1385, the temp file and the PID variable is not needed any more. --- modules/prompt/functions/prompt_sorin_setup | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 14f8858c1c..2df92122d0 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -110,8 +110,6 @@ function prompt_sorin_setup { setopt LOCAL_OPTIONS unsetopt XTRACE KSH_ARRAYS prompt_opts=(cr percent sp subst) - _prompt_sorin_precmd_async_pid=0 - _prompt_sorin_precmd_async_data=$(mktemp "${TMPDIR:-/tmp}/sorin-prompt-async-XXXXXXXXXX") # Load required functions. autoload -Uz add-zsh-hook From 777674e07e4f2fd465b273341c639263f379394d Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Mon, 7 Jan 2019 10:42:34 -0200 Subject: [PATCH 45/72] Update syntax-highlighting submodule --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index e900ad8bad..1e34c4aa0b 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit e900ad8bad53501689afcb050456400d7a8466e5 +Subproject commit 1e34c4aa0bcbdde5173aab15600784edf0a212fd From 4abbc5572149baa6a5e7e38393a4b2006f01024f Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Fri, 4 Jan 2019 13:05:37 -0500 Subject: [PATCH 46/72] remove mutually exclusive option --- modules/history/README.md | 5 +++-- modules/history/init.zsh | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/history/README.md b/modules/history/README.md index d020688a56..a5a4acb125 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -8,8 +8,9 @@ Options - `BANG_HIST` treats the **!** character specially during expansion. - `EXTENDED_HISTORY` writes the history file in the *:start:elapsed;command* format. - - `INC_APPEND_HISTORY` writes to the history file immediately, not when the shell exits. - - `SHARE_HISTORY` shares history between all sessions. + - `SHARE_HISTORY` shares history between all sessions. Note that + `SHARE_HISTORY`, `INC_APPEND_HISTORY`, and `INC_APPEND_HISTORY_TIME` are + mutually exclusive. - `HIST_EXPIRE_DUPS_FIRST` expires a duplicate event first when trimming history. - `HIST_IGNORE_DUPS` does not record an event that was just recorded again. - `HIST_IGNORE_ALL_DUPS` deletes an old recorded event if a new event is a duplicate. diff --git a/modules/history/init.zsh b/modules/history/init.zsh index db357b0259..a26f3c9f42 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -12,7 +12,6 @@ setopt BANG_HIST # Treat the '!' character specially during expansion. setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. -setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. 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. From d22effbf856427b281b455a7419edfdd67aab3ce Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Mon, 11 Feb 2019 19:21:38 -0500 Subject: [PATCH 47/72] editor: allow alt+arrow keys for word movement (#1688) --- modules/editor/init.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 085947ef61..3a7d66e6f3 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -269,9 +269,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. From 5d7c990eec21e83c0735f6b8e7d1d669102cbb4f Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sun, 17 Feb 2019 00:31:54 +0100 Subject: [PATCH 48/72] archive: enhance parallel operations --- modules/archive/functions/archive | 14 ++++++++--- modules/archive/functions/unarchive | 36 +++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/modules/archive/functions/archive b/modules/archive/functions/archive index fab409e2c0..10bbad3985 100644 --- a/modules/archive/functions/archive +++ b/modules/archive/functions/archive @@ -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 <&2 < 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" ;; From b8d7e2cad863959323a4c6452d58cad0af0b84e8 Mon Sep 17 00:00:00 2001 From: monai Date: Sat, 19 Jan 2019 12:54:49 +0200 Subject: [PATCH 49/72] Add zstyle option to disable zsh option CORRECT --- modules/utility/README.md | 6 ++++++ modules/utility/init.zsh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/utility/README.md b/modules/utility/README.md index 3b25b3a75b..1179478703 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -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` diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 6b07bf0f9e..59a04f93f7 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -11,7 +11,9 @@ pmodload 'helper' 'spectrum' # Correct commands. -setopt CORRECT +if zstyle -T ':prezto:module:utility' correct; then + setopt CORRECT +fi # # Aliases From 1f4601e44c989b90dc7314b151891fa60a101251 Mon Sep 17 00:00:00 2001 From: Chris Ewald Date: Sun, 17 Mar 2019 21:27:13 -0400 Subject: [PATCH 50/72] Disable node-info output when value is system. This makes the behavior consistent with rbenv and pyenv. --- modules/node/functions/node-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/node/functions/node-info b/modules/node/functions/node-info index 9feca3e16e..c43759b760 100644 --- a/modules/node/functions/node-info +++ b/modules/node/functions/node-info @@ -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" From bb901dfb7ebd1df7d68e2ca2d6e75b627d270dff Mon Sep 17 00:00:00 2001 From: Toshiki Murayama Date: Tue, 21 May 2019 09:42:03 +0900 Subject: [PATCH 51/72] Update zsh-autosuggestions submodule --- modules/autosuggestions/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/autosuggestions/external b/modules/autosuggestions/external index a7f0106b31..733abd4af0 160000 --- a/modules/autosuggestions/external +++ b/modules/autosuggestions/external @@ -1 +1 @@ -Subproject commit a7f0106b31c2538a36cab30428e6ca65d9a2ae60 +Subproject commit 733abd4af0f23f217caa2a303fbef66382d19d6f From ac65e8eb18bed5964508e76719ecb7a66f5c358a Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 29 May 2019 22:40:47 +0200 Subject: [PATCH 52/72] Add powerlevel10k theme (#1695) --- .gitmodules | 3 +++ modules/prompt/external/powerlevel10k | 1 + modules/prompt/functions/prompt_powerlevel10k_setup | 1 + 3 files changed, 5 insertions(+) create mode 160000 modules/prompt/external/powerlevel10k create mode 120000 modules/prompt/functions/prompt_powerlevel10k_setup diff --git a/.gitmodules b/.gitmodules index 051f2633f0..fcc482621e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,3 +28,6 @@ [submodule "modules/prompt/external/powerlevel9k"] path = modules/prompt/external/powerlevel9k url = https://github.com/bhilburn/powerlevel9k.git +[submodule "modules/prompt/external/powerlevel10k"] + path = modules/prompt/external/powerlevel10k + url = https://github.com/romkatv/powerlevel10k.git diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k new file mode 160000 index 0000000000..45588cc28a --- /dev/null +++ b/modules/prompt/external/powerlevel10k @@ -0,0 +1 @@ +Subproject commit 45588cc28a132602e334c6ebb8bb876bd85903c4 diff --git a/modules/prompt/functions/prompt_powerlevel10k_setup b/modules/prompt/functions/prompt_powerlevel10k_setup new file mode 120000 index 0000000000..8c66c69696 --- /dev/null +++ b/modules/prompt/functions/prompt_powerlevel10k_setup @@ -0,0 +1 @@ +../external/powerlevel10k/powerlevel10k.zsh-theme \ No newline at end of file From 1d58546406bc8f13b910141265f67dbe2f08bd5f Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Wed, 29 May 2019 13:42:17 -0700 Subject: [PATCH 53/72] prompt: update powerlevel10k to latest commit --- 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 45588cc28a..a4b0fd6114 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 45588cc28a132602e334c6ebb8bb876bd85903c4 +Subproject commit a4b0fd6114541c688552305112a9ab9a534e8abf From 09e83ed2829d13b8102af1bf660efbf99e0f896b Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 17 Jun 2019 19:49:02 +0200 Subject: [PATCH 54/72] prompt: update powerlevel10k submodule (#1715) --- 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 a4b0fd6114..31fdb6797e 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit a4b0fd6114541c688552305112a9ab9a534e8abf +Subproject commit 31fdb6797ed19f008f25e26e452e297981295410 From e94b6b2078ccd0b289293dc4b996983a96a34681 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 2 Jul 2019 18:23:12 +0200 Subject: [PATCH 55/72] prompt: update powerlevel10k submodule to the latest commit (#1717) A bunch of bug fixes. Most notably romkatv/powerlevel10k#89. --- 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 31fdb6797e..613ffec4b6 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 31fdb6797ed19f008f25e26e452e297981295410 +Subproject commit 613ffec4b61fc8c97427a99bcca72808a980645e From 6dd97d15e0303f648ad0a29303a7fe56f43a2c7c Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 23 Jul 2019 19:04:45 +0200 Subject: [PATCH 56/72] prompt: update powerlevel10k submodule to the latest commit (#1726) Changes include a few bug fixes and a score of new features. --- 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 613ffec4b6..5ef0ec415e 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 613ffec4b61fc8c97427a99bcca72808a980645e +Subproject commit 5ef0ec415eefbc8b4431a6e4b8e2a5e0d299176a From 3ae422a0da0c675f1a53d7a1c079baa6cd87e73f Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 24 Jul 2019 20:13:32 +0200 Subject: [PATCH 57/72] prompt: update powerlevel10k submodule to the latest commit (#1727) The last update has picked up a nasty bug in gitstatus that disables all user aliases. This commit fixes it. --- 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 5ef0ec415e..f14497918f 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 5ef0ec415eefbc8b4431a6e4b8e2a5e0d299176a +Subproject commit f14497918f0a70955f6d227d1e002ad2a3f94cc8 From 5566a9c7927ed1ee166e92f8ecb72aa7a2d0ce09 Mon Sep 17 00:00:00 2001 From: "John P. Neumann" Date: Thu, 25 Jul 2019 17:14:43 -0500 Subject: [PATCH 58/72] Resolves 1641 - Checks whether the prompt is set to be managed or not. (#1723) This is a new variable that will need to be set on all new prompts and is not backwards compatible with custom prompts that are not prezto managed, but use prezto's editor-info functionality. Updated the README.md with additional information for themes. --- modules/editor/init.zsh | 42 ++++++++++--------- modules/prompt/README.md | 16 +++++++ modules/prompt/functions/prompt-pwd | 1 + modules/prompt/functions/prompt_cloud_setup | 4 ++ .../prompt/functions/prompt_damoekri_setup | 4 ++ modules/prompt/functions/prompt_giddie_setup | 4 ++ .../prompt/functions/prompt_kylewest_setup | 4 ++ modules/prompt/functions/prompt_minimal_setup | 4 ++ .../prompt/functions/prompt_nicoulaj_setup | 4 ++ modules/prompt/functions/prompt_paradox_setup | 4 ++ .../prompt/functions/prompt_peepcode_setup | 4 ++ modules/prompt/functions/prompt_skwp_setup | 4 ++ modules/prompt/functions/prompt_smiley_setup | 4 ++ modules/prompt/functions/prompt_sorin_setup | 4 ++ modules/prompt/functions/prompt_steeef_setup | 4 ++ 15 files changed, 88 insertions(+), 19 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 3a7d66e6f3..28a2fb24a0 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -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 - - 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" + # 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:insert' format 'REPLY' - editor_info[overwrite]="$REPLY" + 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" + else + zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY' + editor_info[overwrite]="$REPLY" + fi fi - fi - unset REPLY - zle zle-reset-prompt + unset REPLY + zle zle-reset-prompt + fi } zle -N editor-info diff --git a/modules/prompt/README.md b/modules/prompt/README.md index 523c83e929..ef32770b20 100644 --- a/modules/prompt/README.md +++ b/modules/prompt/README.md @@ -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 diff --git a/modules/prompt/functions/prompt-pwd b/modules/prompt/functions/prompt-pwd index 53613e7292..d2d1788fdf 100644 --- a/modules/prompt/functions/prompt-pwd +++ b/modules/prompt/functions/prompt-pwd @@ -28,3 +28,4 @@ unset current_pwd print "$ret_directory" # } +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_cloud_setup b/modules/prompt/functions/prompt_cloud_setup index 0637208b4e..be2a33a495 100644 --- a/modules/prompt/functions/prompt_cloud_setup +++ b/modules/prompt/functions/prompt_cloud_setup @@ -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 diff --git a/modules/prompt/functions/prompt_damoekri_setup b/modules/prompt/functions/prompt_damoekri_setup index 4fe132d6e1..1fbaedfb03 100644 --- a/modules/prompt/functions/prompt_damoekri_setup +++ b/modules/prompt/functions/prompt_damoekri_setup @@ -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 diff --git a/modules/prompt/functions/prompt_giddie_setup b/modules/prompt/functions/prompt_giddie_setup index 3c194fb9a0..2b36ccc72a 100644 --- a/modules/prompt/functions/prompt_giddie_setup +++ b/modules/prompt/functions/prompt_giddie_setup @@ -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 diff --git a/modules/prompt/functions/prompt_kylewest_setup b/modules/prompt/functions/prompt_kylewest_setup index 70b6a54afe..d3b33a9548 100644 --- a/modules/prompt/functions/prompt_kylewest_setup +++ b/modules/prompt/functions/prompt_kylewest_setup @@ -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 diff --git a/modules/prompt/functions/prompt_minimal_setup b/modules/prompt/functions/prompt_minimal_setup index b600768bd0..e57aac57c1 100644 --- a/modules/prompt/functions/prompt_minimal_setup +++ b/modules/prompt/functions/prompt_minimal_setup @@ -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 diff --git a/modules/prompt/functions/prompt_nicoulaj_setup b/modules/prompt/functions/prompt_nicoulaj_setup index 447ba1f40a..4b40bac8b1 100644 --- a/modules/prompt/functions/prompt_nicoulaj_setup +++ b/modules/prompt/functions/prompt_nicoulaj_setup @@ -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 diff --git a/modules/prompt/functions/prompt_paradox_setup b/modules/prompt/functions/prompt_paradox_setup index 4f19989daf..9286967f9a 100644 --- a/modules/prompt/functions/prompt_paradox_setup +++ b/modules/prompt/functions/prompt_paradox_setup @@ -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 diff --git a/modules/prompt/functions/prompt_peepcode_setup b/modules/prompt/functions/prompt_peepcode_setup index 2081961ca4..3a108df4a6 100644 --- a/modules/prompt/functions/prompt_peepcode_setup +++ b/modules/prompt/functions/prompt_peepcode_setup @@ -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 diff --git a/modules/prompt/functions/prompt_skwp_setup b/modules/prompt/functions/prompt_skwp_setup index f69dcddfe7..b84011fe53 100644 --- a/modules/prompt/functions/prompt_skwp_setup +++ b/modules/prompt/functions/prompt_skwp_setup @@ -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 diff --git a/modules/prompt/functions/prompt_smiley_setup b/modules/prompt/functions/prompt_smiley_setup index 3d41b3af46..cd1725bd05 100644 --- a/modules/prompt/functions/prompt_smiley_setup +++ b/modules/prompt/functions/prompt_smiley_setup @@ -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 diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 2df92122d0..41ac7d0175 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -118,6 +118,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' @@ -176,3 +179,4 @@ function prompt_sorin_preview { } prompt_sorin_setup "$@" +# vim: ft=zsh diff --git a/modules/prompt/functions/prompt_steeef_setup b/modules/prompt/functions/prompt_steeef_setup index ca39f9321d..d32bd343f0 100644 --- a/modules/prompt/functions/prompt_steeef_setup +++ b/modules/prompt/functions/prompt_steeef_setup @@ -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 From b01f02aa5c6714430647a4ee854149e9a336270a Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 31 Jul 2019 15:10:06 +0200 Subject: [PATCH 59/72] prompt: update powerlevel10k submodule to the latest commit New feature: Configuration Wizard. Type `p10k configure` to explore the unique styles and features Powerlevel10k has to offer. --- 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 f14497918f..3fe113f91d 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit f14497918f0a70955f6d227d1e002ad2a3f94cc8 +Subproject commit 3fe113f91d0f819ad33c90608c3f293a1559324a From abb0c7ecb4b4c4a83ee952681cd9de30a11f9058 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 2 Aug 2019 07:11:27 +0200 Subject: [PATCH 60/72] prompt: update powerlevel10k submodule to the latest commit A dozen bug fixes. Most important: - rbenv and a few other segments didn't work if IFS was set to something unusual. - vcs segment couldn't properly apply subsegment style if color overrides used mnemonic names. - the check for .p10k.zsh already being sourced was too strict. --- 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 3fe113f91d..635b0d7c99 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 3fe113f91d0f819ad33c90608c3f293a1559324a +Subproject commit 635b0d7c99a22d996b5ca43efb56e9ec6b1ebdb4 From a8087e01fbe2eff895ca6c85eddda76ff2ebd883 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 19 Aug 2019 11:30:16 +0200 Subject: [PATCH 61/72] prompt: update powerlevel10k submodule to the latest commit - Several bug fixes. Most notable: - Don't hide command execution time on reset-prompt. - Support prezto with zsh 5.1. - Don't hide nvm prompt when there is no nvm command. - New prompt: ranger. - Add an option to hide rust version when outside of rust project tree. - Add an option to show rvm gemset. --- 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 635b0d7c99..3090ae6633 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 635b0d7c99a22d996b5ca43efb56e9ec6b1ebdb4 +Subproject commit 3090ae6633aedc50b43524e6c2ce1482b0a15772 From 34948690d575e9bfc9a3836b2f5a8a87c69a4a26 Mon Sep 17 00:00:00 2001 From: Julien Brochet Date: Tue, 13 Aug 2019 16:02:41 +0200 Subject: [PATCH 62/72] syntax-highlighting: update external dependency --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 1e34c4aa0b..35c8690c00 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 1e34c4aa0bcbdde5173aab15600784edf0a212fd +Subproject commit 35c8690c0025ceef9584f64da86ced3a72ee32b6 From 8914274ca9f7b997d4a1663e0f290c691772db7f Mon Sep 17 00:00:00 2001 From: pedrosland Date: Mon, 19 Aug 2019 18:30:33 +0100 Subject: [PATCH 63/72] prompt: update zsh-async to fix an infinite loop (#1734) --- 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 58f7ba70f0..95c2b1577f 160000 --- a/modules/prompt/external/async +++ b/modules/prompt/external/async @@ -1 +1 @@ -Subproject commit 58f7ba70f05e75802299848e7e31c7d7a7fd0c97 +Subproject commit 95c2b1577f455728ec01cec001a86c216d0af2bd From 8b1a7afd81a97014eb0ac2d3e357e962d5b7625d Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Fri, 6 Sep 2019 19:08:26 +0200 Subject: [PATCH 64/72] prompt: update powerlevel10k submodule to the latest commit (#1738) - New prompt segment: terraform. - Configuration wizard: - Offer to install Meslo Nerd Font (only on iTerm2 and Termux). - Offer to enable `time` prompt segment. - New style options: round separators, heads and tails. - Reduce the minimum required terminal width to 55 columns. - Several bug fixes. Most notable: - Fix network interface and ip parsing on Linux and WSL. - Disregard auto_name_dirs if it's set. --- 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 3090ae6633..5886154bb1 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 3090ae6633aedc50b43524e6c2ce1482b0a15772 +Subproject commit 5886154bb14965f59d26f349b97e2c5e9104bf93 From 43214f1aed1723ab5b18cd73ce0019b5c6bb9848 Mon Sep 17 00:00:00 2001 From: Shane O'Grady Date: Mon, 9 Sep 2019 17:49:48 -0700 Subject: [PATCH 65/72] history: Permit use of previously set HISTFILE Honor the use of the HISTFILE environment variable, if it's already set. --- modules/history/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/history/init.zsh b/modules/history/init.zsh index a26f3c9f42..d1d3373a98 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -26,7 +26,7 @@ setopt 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. From 75940e8ee97fe7fe8b690ca98b76f95f4148a960 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 10 Sep 2019 17:57:42 +0200 Subject: [PATCH 66/72] directory: update docs to clarify it doesn't really set AUTO_NAME_DIRS (#1740) Module `directory` used to set AUTO_NAME_DIRS. This was changed in 73e94b84 but README.md hasn't been updated. This looks like an accidental omission that this commit fixes. --- modules/directory/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/directory/README.md b/modules/directory/README.md index 47c1bc201b..ce806eea12 100644 --- a/modules/directory/README.md +++ b/modules/directory/README.md @@ -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 From 6ae2f39cc12d7102ca207e3bd33e986acce3eac8 Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 15:59:49 +0800 Subject: [PATCH 67/72] ruby: support environment variable RBENV_ROOT --- modules/ruby/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index 4ede36675f..1c1fb999e1 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -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. From 61de4d199d145ac35c21d8144942bb533533f51f Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 16:00:34 +0800 Subject: [PATCH 68/72] node: support environment variables NVM_DIR and NODENV_ROOT --- modules/node/init.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index d8eea1459e..1ea66f9c6c 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -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. From f596d5d1d6f7ff4edefd03749e847fdfd0505654 Mon Sep 17 00:00:00 2001 From: laggardkernel Date: Thu, 25 Apr 2019 16:02:05 +0800 Subject: [PATCH 69/72] python: improve PYENV_ROOT detection --- modules/python/init.zsh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 44043f1c35..e5967f7aa8 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -8,17 +8,12 @@ # # 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 From 75b112bcd0ba3a85e1848d25db571aee6da75995 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Tue, 10 Sep 2019 09:10:31 -0700 Subject: [PATCH 70/72] node, python, ruby: update docs about new envars --- modules/node/README.md | 6 ++++++ modules/python/README.md | 3 +++ modules/ruby/README.md | 3 +++ 3 files changed, 12 insertions(+) diff --git a/modules/node/README.md b/modules/node/README.md index 951f2a7447..af447c1421 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -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 --------- diff --git a/modules/python/README.md b/modules/python/README.md index 121ea37395..91dc87feae 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -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 -------------------------- diff --git a/modules/ruby/README.md b/modules/ruby/README.md index 12848d8649..feaa3016a5 100644 --- a/modules/ruby/README.md +++ b/modules/ruby/README.md @@ -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 ------ From 9507a0e881ae71528c9a4182e53c62f2896c8d31 Mon Sep 17 00:00:00 2001 From: Robson Roberto Souza Peixoto <124390+robsonpeixoto@users.noreply.github.com> Date: Tue, 10 Sep 2019 13:18:09 -0300 Subject: [PATCH 71/72] tmux: ignore tmux autostart in vscode terminal (#1718) In certain situations VSCODE_PID isn't set any more, so we just need to check TERM_PROGRAM which has existed for a few years already. --- 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 fb56d07603..5c51855f2a 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" && -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 From 2873885d37e362ae9be8ff4cb93ae36739ac0067 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Sat, 21 Sep 2019 17:29:18 -0700 Subject: [PATCH 72/72] utility: fix safe-ops commands Fixes #1699 --- modules/utility/init.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 59a04f93f7..a2e5c2bdfe 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -66,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