Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (35 commits)
  remove mutually exclusive option
  Update syntax-highlighting submodule
  Remove old prompt tempfile and pid variable
  Updating submodules to lastest tags/master commits
  Fix typo: gupl --> gulp (sorin-ionescu#1668)
  python: Use brace expansion for pip compctl match
  Remove duplicated information from git module README (sorin-ionescu#1657)
  python: Expand compctl matches for pip variants
  command-not-found: Minor reformatting
  homebrew: Load 'HOMEBREW_' prefixed variables only
  homebrew: Simplify array assignment
  archive: Enhance 'archive' helper to support multi file archive
  git: add documentation for new aliases
  Aliases to digital sign/verify commits and tags (sorin-ionescu#651)
  syntax-highlighting: Further clarify relative module ordering
  rsync: Update link to Bombich rsync page again
  node: Make nvm lookup mechanism more efficient in homebrewed environment
  python: Fix pip compctl file match pattern
  command-not-found: Support custom Homebrew tap on MacOS
  node: Cache completion for additional helpers
  ...
  • Loading branch information
mjwestcott committed Feb 3, 2019
2 parents c326ef4 + 4abbc55 commit 78d75f5
Show file tree
Hide file tree
Showing 28 changed files with 234 additions and 107 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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*.
Expand All @@ -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
```

Expand Down
6 changes: 3 additions & 3 deletions modules/archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
32 changes: 13 additions & 19 deletions modules/archive/functions/archive
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
usage: $0 [archive_name.zip] [/path/to/include/into/archive]
usage: $0 [archive_name.zip] [/path/to/include/into/archive ...]
Where 'archive.zip' uses any of the following extensions:
Expand All @@ -28,14 +28,8 @@ fi

# strip the path, just in case one is provided for some reason
archive_name="${1:t}"
# use absolute paths, and follow symlinks
dir_to_archive="${2}"

# if the directory doesn't exist, quit. Nothing to archive
if [[ ! -e "${dir_to_archive}" ]]; then
print "$0: file or directory not valid: ${dir_to_archive}" >&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
Expand All @@ -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" ;;
Expand Down
5 changes: 0 additions & 5 deletions modules/autosuggestions/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
Autosuggestions
---------------

Integrates zsh-autosuggestions into Prezto.

Autosuggestions
===============

Expand Down
7 changes: 4 additions & 3 deletions modules/command-not-found/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 24 additions & 3 deletions modules/command-not-found/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,30 @@ 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/*/*/cmd/brew-command-not-found-init(|.rb)(.N)
)
if (( $#cnf_command )); then
cache_file="${TMPDIR:-/tmp}/prezto-brew-command-not-found-cache.$UID.zsh"

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.
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
Expand Down
13 changes: 13 additions & 0 deletions modules/completion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------

Expand Down
2 changes: 1 addition & 1 deletion modules/completion/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion modules/editor/README.md
Original file line number Diff line number Diff line change
@@ -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
--------
Expand Down
36 changes: 33 additions & 3 deletions modules/environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,46 @@ Sets general shell options and defines environment variables.

This module must be loaded first.

Environment Variables
---------------------

Contributors
------------

This module **MUST NOT** rely on any command not built in Zsh.

Non-interactive environment variables should be defined in [`zshenv`][1].

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.

Authors
-------

Expand Down
6 changes: 5 additions & 1 deletion modules/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions modules/git/alias.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
alias gcr='git revert'
alias gcR='git reset "HEAD^"'
alias gcs='git show'
alias gcsS='git show --pretty=short --show-signature'
alias gcl='git-commit-lost'
alias gcom='git checkout master'
alias gcy='git cherry -v --abbrev'
Expand Down Expand Up @@ -261,6 +262,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'
Expand Down
19 changes: 10 additions & 9 deletions modules/history/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ 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
-------

- `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.
Expand All @@ -26,6 +20,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
-------

Expand Down
17 changes: 8 additions & 9 deletions modules/history/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@
# Sorin Ionescu <[email protected]>
#

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

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.
Expand All @@ -31,6 +22,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
#
Expand Down
Loading

0 comments on commit 78d75f5

Please sign in to comment.