diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/CHANGELOG.md b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/CHANGELOG.md index fc2a1fa..15d65a9 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/CHANGELOG.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.7.0 +- Enable asynchronous mode by default (#498) +- No longer wrap user widgets starting with `autosuggest-` prefix (#496) +- Fix a bug wrapping widgets that modify the buffer (#541) + + ## v0.6.4 - Fix `vi-forward-char` triggering a bell when using it to accept a suggestion (#488) - New configuration option to skip completion suggestions when buffer matches a pattern (#487) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/INSTALL.md b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/INSTALL.md index 9d2915e..7b32af1 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/INSTALL.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/INSTALL.md @@ -3,19 +3,21 @@ * [Packages](#packages) * [Antigen](#antigen) * [Oh My Zsh](#oh-my-zsh) +* [HomeBrew](#homebrew) * [Manual](#manual-git-clone) ## Packages | System | Package | | ------------- | ------------- | +| Alpine Linux | [zsh-autosuggestions](https://pkgs.alpinelinux.org/packages?name=zsh-autosuggestions) | | Debian / Ubuntu | [zsh-autosuggestions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&package=zsh-autosuggestions) | | Fedora / CentOS / RHEL / Scientific Linux | [zsh-autosuggestions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&package=zsh-autosuggestions) | | OpenSUSE / SLE | [zsh-autosuggestions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&package=zsh-autosuggestions) | | Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-autosuggestions](https://www.archlinux.org/packages/zsh-autosuggestions), [zsh-autosuggestions-git](https://aur.archlinux.org/packages/zsh-autosuggestions-git) | | NixOS | [zsh-autosuggestions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh/zsh-autosuggestions/default.nix) | | Void Linux | [zsh-autosuggestions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-autosuggestions/template) | -| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-autosuggestions.rb) | +| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-autosuggestions.rb) | | NetBSD | [pkgsrc](http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-autosuggestions/README.html) | ## Antigen @@ -39,7 +41,25 @@ 2. Add the plugin to the list of plugins for Oh My Zsh to load (inside `~/.zshrc`): ```sh - plugins=(zsh-autosuggestions) + plugins=( + # other plugins... + zsh-autosuggestions + ) + ``` + +3. Start a new terminal session. + +## Homebrew + +1. Install command: + ```sh + brew install zsh-autosuggestions + ``` + +2. To activate the autosuggestions, add the following at the end of your .zshrc: + + ```sh + source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh ``` 3. Start a new terminal session. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/LICENSE b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/LICENSE index ef7cfb6..7ea78cc 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/LICENSE +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2013 Thiago de Arruda -Copyright (c) 2016-2019 Eric Freese +Copyright (c) 2016-2021 Eric Freese Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/Makefile b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/Makefile index f6d13a7..6f5431e 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/Makefile +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/Makefile @@ -1,4 +1,4 @@ -SRC_DIR := ./src +SRC_DIR := ./src SRC_FILES := \ $(SRC_DIR)/config.zsh \ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/README.md b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/README.md index 06d26e3..94e0b58 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/README.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/README.md @@ -53,7 +53,7 @@ For more info, read the Character Highlighting section of the zsh manual: `man z `ZSH_AUTOSUGGEST_STRATEGY` is an array that specifies how suggestions should be generated. The strategies in the array are tried successively until a suggestion is found. There are currently three built-in strategies to choose from: - `history`: Chooses the most recent match from history. -- `completion`: Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module) +- `completion`: Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module, which is included with zsh since 4.0.1) - `match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches the most recently executed command ([more info](src/strategies/match_prev_cmd.zsh)). Note that this strategy won't work as expected with ZSH options that don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`. For example, setting `ZSH_AUTOSUGGEST_STRATEGY=(history completion)` will first try to find a suggestion from your history, but, if it can't find a match, will find a suggestion from the completion engine. @@ -79,9 +79,11 @@ Widgets that modify the buffer and are not found in any of these arrays will fet Set `ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE` to an integer value to disable autosuggestion for large buffers. The default is unset, which means that autosuggestion will be tried for any buffer size. Recommended value is 20. This can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for strings that are too long. -### Enable Asynchronous Mode +### Asynchronous Mode -As of `v0.4.0`, suggestions can be fetched asynchronously. To enable this behavior, set the `ZSH_AUTOSUGGEST_USE_ASYNC` variable (it can be set to anything). +Suggestions are fetched asynchronously by default in zsh versions 5.0.8 and greater. To disable asynchronous suggestions and fetch them synchronously instead, `unset ZSH_AUTOSUGGEST_USE_ASYNC` after sourcing the plugin. + +Alternatively, if you are using a version of zsh older than 5.0.8 and want to enable asynchronous mode, set the `ZSH_AUTOSUGGEST_USE_ASYNC` variable after sourcing the plugin (it can be set to anything). Note that there is [a bug](https://github.com/zsh-users/zsh-autosuggestions/issues/364#issuecomment-481423232) in versions of zsh older than 5.0.8 where ctrl + c will fail to reset the prompt immediately after fetching a suggestion asynchronously. ### Disabling automatic widget re-binding @@ -89,13 +91,13 @@ Set `ZSH_AUTOSUGGEST_MANUAL_REBIND` (it can be set to anything) to disable autom ### Ignoring history suggestions that match a pattern -Set `ZSH_AUTOSUGGEST_HISTORY_IGNORE` to a glob pattern to prevent offering suggestions for history entries that match the pattern. For example, set it to `"cd *"` to never suggest any `cd` commands from history. Or set to `"?(#c50,)"` to never suggest anything 50 characters or longer. +Set `ZSH_AUTOSUGGEST_HISTORY_IGNORE` to a [glob pattern](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Operators) to prevent offering suggestions for history entries that match the pattern. For example, set it to `"cd *"` to never suggest any `cd` commands from history. Or set to `"?(#c50,)"` to never suggest anything 50 characters or longer. **Note:** This only affects the `history` and `match_prev_cmd` suggestion strategies. ### Skipping completion suggestions for certain cases -Set `ZSH_AUTOSUGGEST_COMPLETION_IGNORE` to a glob pattern to prevent offering completion suggestions when the buffer matches that pattern. For example, set it to `"git *"` to disable completion suggestions for git subcommands. +Set `ZSH_AUTOSUGGEST_COMPLETION_IGNORE` to a [glob pattern](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Operators) to prevent offering completion suggestions when the buffer matches that pattern. For example, set it to `"git *"` to disable completion suggestions for git subcommands. **Note:** This only affects the `completion` suggestion strategy. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/VERSION b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/VERSION index 2fc7b36..8b20e48 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/VERSION +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/VERSION @@ -1 +1 @@ -v0.6.4 +v0.7.0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/ZSH_VERSIONS b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/ZSH_VERSIONS index ed7b882..18ed7a6 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/ZSH_VERSIONS +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/ZSH_VERSIONS @@ -14,3 +14,4 @@ 5.5.1 5.6.2 5.7.1 +5.8 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_circleci/config.yml b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_circleci/config.yml deleted file mode 100644 index d95fa98..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_circleci/config.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: 2 -jobs: - build: - parallelism: 4 - shell: /bin/bash --login - docker: - - image: ericfreese/zsh-autosuggestions-test:latest - steps: - - checkout - - run: - name: Running tests - command: | - for v in $(grep "^[^#]" ZSH_VERSIONS | awk "(NR + $CIRCLE_NODE_INDEX) % $CIRCLE_NODE_TOTAL == 0"); do - TEST_ZSH_BIN=zsh-$v make test || exit 1 - done diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_editorconfig b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_editorconfig deleted file mode 100644 index ddabb17..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = tab -indent_size = 4 - -[*.md] -indent_style = space - -[*.rb] -indent_style = space -indent_size = 2 - -[*.yml] -indent_style = space -indent_size = 2 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/HEAD deleted file mode 100644 index cb089cd..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/config b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/config deleted file mode 100644 index 4777825..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = https://github.com/zsh-users/zsh-autosuggestions - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/description b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/description deleted file mode 100644 index 498b267..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_applypatch-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_applypatch-msg.sample deleted file mode 100644 index a5d7b84..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_commit-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_commit-msg.sample deleted file mode 100644 index b58d118..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_fsmonitor-watchman.sample deleted file mode 100644 index e673bb3..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_post-update.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_post-update.sample deleted file mode 100644 index ec17ec1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-applypatch.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-applypatch.sample deleted file mode 100644 index 4142082..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-commit.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-commit.sample deleted file mode 100644 index 6a75641..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-merge-commit.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-merge-commit.sample deleted file mode 100644 index 399eab1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-merge-commit.sample +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git merge" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message to -# stderr if it wants to stop the merge commit. -# -# To enable this hook, rename this file to "pre-merge-commit". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-push.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-push.sample deleted file mode 100644 index 6187dbf..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-rebase.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-rebase.sample deleted file mode 100644 index 6cbef5c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-receive.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-receive.sample deleted file mode 100644 index a1fd29e..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_prepare-commit-msg.sample deleted file mode 100644 index 10fa14c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_update.sample b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_update.sample deleted file mode 100644 index 80ba941..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/hooks/executable_update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/index b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/index deleted file mode 100644 index fd42bb5..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/index and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/info/exclude b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/info/exclude deleted file mode 100644 index a5196d1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/HEAD deleted file mode 100644 index 4f0be8c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 ae315ded4dba10685dbbafbfa2ff3c1aefeb490d Jan Eitzinger 1610815475 +0100 clone: from https://github.com/zsh-users/zsh-autosuggestions diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/heads/master b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/heads/master deleted file mode 100644 index 4f0be8c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 ae315ded4dba10685dbbafbfa2ff3c1aefeb490d Jan Eitzinger 1610815475 +0100 clone: from https://github.com/zsh-users/zsh-autosuggestions diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/remotes/origin/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/remotes/origin/HEAD deleted file mode 100644 index 4f0be8c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 ae315ded4dba10685dbbafbfa2ff3c1aefeb490d Jan Eitzinger 1610815475 +0100 clone: from https://github.com/zsh-users/zsh-autosuggestions diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/info/.keep b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/info/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.idx b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.idx deleted file mode 100644 index 2c2f829..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.idx and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.pack b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.pack deleted file mode 100644 index 3e6a209..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/objects/pack/readonly_pack-d9220fa9e92bd29c294f672dc23c7930c26e4477.pack and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/packed-refs b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/packed-refs deleted file mode 100644 index 288aa64..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/packed-refs +++ /dev/null @@ -1,50 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -eff0894a138f64f2752c0e2f0612055d71b0af4f refs/remotes/origin/develop -b27277e7ff0f877f3189211ccd57da9ebec5e743 refs/remotes/origin/experiments/strategies-by-pattern -767d55eba0355d9ef9270df3ca257a936cf0eac5 refs/remotes/origin/features/background-initialization -36dae44064a7bf088fb1dec74c8463d5b6f3d3c8 refs/remotes/origin/features/hist-words-suggestions -161de32912a3426dc686db38250913227dd91948 refs/remotes/origin/features/redraw-hook -15bcfd712664bb301113761f886718fd3bea7bc2 refs/remotes/origin/fixes/copy-earlier-word -141f497d1751ea7c8f3bd7e4fb0e2e031d6d302b refs/remotes/origin/fixes/kill-multiple-words -4ccfdb2435ea4b82983bf22bb2913c0773992cce refs/remotes/origin/fixes/partial-accept-duplicate-word -9fb96753069b919deaaacb6f659be2339dfeb4d2 refs/remotes/origin/fixes/slow_bracketed_paste_magic -ae315ded4dba10685dbbafbfa2ff3c1aefeb490d refs/remotes/origin/master -20c0ea841bafa78d8fb75c767e780248bfdf11a4 refs/remotes/origin/no-server -5f13490bae58bc42045b2a19fc3e446df75417a5 refs/tags/0.0.1 -7dc9e0f92631d03d289bdcf67530c84e72b18aa3 refs/tags/pre-v0.1.0 -6a4b2b386534461d479155c7f9503b1063800398 refs/tags/v0.1.0 -f154d25fb3b734235bff7d508d885e7db851c4ca refs/tags/v0.1.1 -0ae590729428a0b6aea682a04d74404a124cb909 refs/tags/v0.2.0 -31452887d20069d882e31eafaf46890e6500b4af refs/tags/v0.2.1 -2b449a62f8b6fc69e44db3eaf46c5c36c1853bfa refs/tags/v0.2.10 -ba029e83d0aa2d859d7ac46299462fa5b5a43a68 refs/tags/v0.2.11 -aa859a282dddf97cadce45255fad95930fc3f503 refs/tags/v0.2.12 -2a5791710a9038ad21b9f528e6923f33fe3b8edd refs/tags/v0.2.13 -9d100f4f321000b80b73638a6406e8486c35ce16 refs/tags/v0.2.14 -c761dc81509b137748190d254e8beb6845dedf21 refs/tags/v0.2.15 -0a42f872b84ecdd17b2d4d4e4422f3af8bf8959b refs/tags/v0.2.16 -f0a745576ff69fa608421ee7214d4cd77b43e62f refs/tags/v0.2.17 -011f5420fcc61d1c8fdd7510c4b560b0ca7f6412 refs/tags/v0.2.2 -266437c98a7e3d9b24fa82e6a35d8dc54946f1d2 refs/tags/v0.2.3 -cd71081303287498f940e6158cfce13583d4293f refs/tags/v0.2.4 -76f415bf4360705a819c92787b188ddd813d374c refs/tags/v0.2.5 -3ce1adb55dfb558c7f9b60056356fdb7d3567403 refs/tags/v0.2.6 -45ab49d1f2024f9422ab9eb41178e4d9edf2e91c refs/tags/v0.2.7 -dd9a8789a758966eed6943adad5338b2213df4a2 refs/tags/v0.2.8 -0faa2b6584928a17fef8904e8439d1268729f37a refs/tags/v0.2.9 -1ed9155f89956310eb0cfce59f95e6f3e2ecbcd2 refs/tags/v0.3.0 -87facd9b85630f288433aa0a20a963cffc612ee5 refs/tags/v0.3.1 -cce68de46d37697f561a23c51db629ee2bbd18db refs/tags/v0.3.2 -9cfaf5d3424ceb5fedd2c7e3253f823faae74383 refs/tags/v0.3.3 -2cb6eb6e29852e64a146b0284275ecdc0661b082 refs/tags/v0.4.0 -9f9237ab8a530eeff389161202bbc7283ad6af3e refs/tags/v0.4.1 -15931f04ffac91a2f9a1a044b6b3ee4050751064 refs/tags/v0.4.2 -d7c796719e6352666f7a9c94da9ddaed10f3217d refs/tags/v0.4.3 -a7f0106b31c2538a36cab30428e6ca65d9a2ae60 refs/tags/v0.5.0 -cbf0e24b1863c44606bbdd1edcb1c1b40efbcb55 refs/tags/v0.5.1 -733abd4af0f23f217caa2a303fbef66382d19d6f refs/tags/v0.5.2 -b3b34eab49b8e44f2df93d746640329a45722c0b refs/tags/v0.6.0 -112dd3e3c7d1e038c46a2af92d38f4b9aa2ffb17 refs/tags/v0.6.1 -c80605595c209e4ee60c3d121ab159ebc6d66547 refs/tags/v0.6.2 -146020d9b28c70a5edd93d19bbef9c5cb05d4b62 refs/tags/v0.6.3 -ae315ded4dba10685dbbafbfa2ff3c1aefeb490d refs/tags/v0.6.4 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/heads/master b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/heads/master deleted file mode 100644 index 100da5c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -ae315ded4dba10685dbbafbfa2ff3c1aefeb490d diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/remotes/origin/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/remotes/origin/HEAD deleted file mode 100644 index 6efe28f..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/tags/.keep b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_git/refs/tags/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/bug-report.md b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 7663df6..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -### Describe the bug - - -### To Reproduce -Steps to reproduce the behavior: - - - -```sh -% zsh -df -% source path/to/zsh-autosuggestions.zsh -% ... # what do you do to reproduce? -``` - -### Expected behavior - - -### Screenshots - - -### Desktop - - OS + distribution: - - Zsh version: - - Plugin version: - -### Additional context - diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/feature_request.md b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 5874625..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -### Is your feature request related to a problem? Please describe. - - -### Describe the solution you'd like - - -### Describe alternatives you've considered - - -### Additional context - diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rspec b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rspec deleted file mode 100644 index 43ae203..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rspec +++ /dev/null @@ -1,3 +0,0 @@ ---color ---require spec_helper ---format documentation diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rubocop.yml b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rubocop.yml deleted file mode 100644 index 97facac..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_rubocop.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Rails: -# Enabled: true - -AllCops: - TargetRubyVersion: 2.3 - Include: - - '**/Rakefile' - - '**/config.ru' - - '**/Gemfile' - -Metrics/LineLength: - Max: 120 - -Style/Documentation: - Enabled: false - -Style/DotPosition: - EnforcedStyle: trailing - -Style/FrozenStringLiteralComment: - Enabled: false - -Style/Lambda: - Enabled: false - -Style/MultilineMethodCallIndentation: - EnforcedStyle: indented - -Style/TrailingUnderscoreVariable: - Enabled: false diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_ruby-version b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_ruby-version deleted file mode 100644 index aedc15b..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/dot_ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.3 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/executable_install_test_zsh.sh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/install_test_zsh.sh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/executable_install_test_zsh.sh rename to dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/install_test_zsh.sh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/multi_line_spec.rb b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/multi_line_spec.rb index 4ff2ae1..364780a 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/multi_line_spec.rb +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/multi_line_spec.rb @@ -1,11 +1,6 @@ describe 'a multi-line suggestion' do it 'should be displayed on multiple lines' do - with_history(-> { - session.send_string('echo "') - session.send_keys('enter') - session.send_string('"') - session.send_keys('enter') - }) do + with_history("echo \"\n\"") do session.send_keys('e') wait_for { session.content }.to eq("echo \"\n\"") end diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/options/use_async_spec.rb b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/options/use_async_spec.rb deleted file mode 100644 index 420dcc3..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/options/use_async_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe 'suggestion fetching' do - it 'is performed synchronously' - - context 'when ZSH_AUTOSUGGEST_USE_ASYNC is set' do - it 'is performed asynchronously' - end -end diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/spec_helper.rb b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/spec_helper.rb index cb149ef..dc1abb0 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/spec_helper.rb +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/spec_helper.rb @@ -1,6 +1,7 @@ require 'pry' require 'rspec/wait' require 'terminal_session' +require 'tempfile' RSpec.shared_context 'terminal session' do let(:term_opts) { {} } @@ -21,18 +22,20 @@ RSpec.shared_context 'terminal session' do end def with_history(*commands, &block) - session.run_command('fc -p') + Tempfile.create do |f| + f.write(commands.map{|c| c.gsub("\n", "\\\n")}.join("\n")) + f.flush - commands.each do |c| - c.respond_to?(:call) ? c.call : session.run_command(c) + session.run_command('fc -p') + session.run_command("fc -R #{f.path}") + + session.clear_screen + + yield block + + session.send_keys('C-c') + session.run_command('fc -P') end - - session.clear_screen - - yield block - - session.send_keys('C-c') - session.run_command('fc -P') end end diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/strategies/special_characters_helper.rb b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/strategies/special_characters_helper.rb index 8771861..eb1f0cd 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/strategies/special_characters_helper.rb +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/spec/strategies/special_characters_helper.rb @@ -1,58 +1,71 @@ shared_examples 'special characters' do - describe 'a special character in the buffer' do - it 'should be treated like any other character' do + describe 'a special character in the buffer should be treated like any other character' do + it 'asterisk' do with_history('echo "hello*"', 'echo "hello."') do session.send_string('echo "hello*') wait_for { session.content }.to eq('echo "hello*"') end + end + it 'question mark' do with_history('echo "hello?"', 'echo "hello."') do session.send_string('echo "hello?') wait_for { session.content }.to eq('echo "hello?"') end + end + it 'backslash' do with_history('echo "hello\nworld"') do session.send_string('echo "hello\\') wait_for { session.content }.to eq('echo "hello\nworld"') end + end + it 'double backslash' do with_history('echo "\\\\"') do session.send_string('echo "\\\\') wait_for { session.content }.to eq('echo "\\\\"') end + end + it 'tilde' do with_history('echo ~/foo') do session.send_string('echo ~') wait_for { session.content }.to eq('echo ~/foo') end + end + it 'parentheses' do with_history('echo "$(ls foo)"') do session.send_string('echo "$(') wait_for { session.content }.to eq('echo "$(ls foo)"') end + end + it 'square bracket' do with_history('echo "$history[123]"') do session.send_string('echo "$history[') wait_for { session.content }.to eq('echo "$history[123]"') session.send_string('123]') wait_for { session.content }.to eq('echo "$history[123]"') end + end + it 'octothorpe' do with_history('echo "#yolo"') do session.send_string('echo "#') wait_for { session.content }.to eq('echo "#yolo"') end + end - with_history('echo "#foo"', 'echo $#abc') do - session.send_string('echo "#') - wait_for { session.content }.to eq('echo "#foo"') - end - + it 'caret' do with_history('echo "^A"', 'echo "^B"') do session.send_string('echo "^A') wait_for { session.content }.to eq('echo "^A"') end + end + it 'dash' do with_history('-foo() {}') do session.send_string('-') wait_for { session.content }.to eq('-foo() {}') diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/async.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/async.zsh index 4314e8c..218eb26 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/async.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/async.zsh @@ -44,7 +44,8 @@ _zsh_autosuggest_async_request() { # There's a weird bug here where ^C stops working unless we force a fork # See https://github.com/zsh-users/zsh-autosuggestions/issues/364 - command true + autoload -Uz is-at-least + is-at-least 5.8 || command true # Read the pid from the child process read _ZSH_AUTOSUGGEST_CHILD_PID <&$_ZSH_AUTOSUGGEST_ASYNC_FD diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/bind.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/bind.zsh index fc2da9e..1dde137 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/bind.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/bind.zsh @@ -69,7 +69,7 @@ _zsh_autosuggest_bind_widgets() { ignore_widgets=( .\* _\* - autosuggest-\* + ${_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS/#/autosuggest-} $ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\* $ZSH_AUTOSUGGEST_IGNORE_WIDGETS ) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/start.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/start.zsh index 5991039..5d4ee52 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/start.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/start.zsh @@ -18,6 +18,16 @@ _zsh_autosuggest_start() { _zsh_autosuggest_bind_widgets } +# Mark for auto-loading the functions that we use +autoload -Uz add-zsh-hook is-at-least + +# Automatically enable asynchronous mode in newer versions of zsh. Disable for +# older versions because there is a bug when using async mode where ^C does not +# work immediately after fetching a suggestion. +# See https://github.com/zsh-users/zsh-autosuggestions/issues/364 +if is-at-least 5.0.8; then + typeset -g ZSH_AUTOSUGGEST_USE_ASYNC= +fi + # Start the autosuggestion widgets on the next precmd -autoload -Uz add-zsh-hook add-zsh-hook precmd _zsh_autosuggest_start diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/strategies/completion.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/strategies/completion.zsh index 4290f0c..e2d114c 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/strategies/completion.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/strategies/completion.zsh @@ -45,8 +45,6 @@ _zsh_autosuggest_capture_completion_widget() { zle -N autosuggest-capture-completion _zsh_autosuggest_capture_completion_widget _zsh_autosuggest_capture_setup() { - autoload -Uz is-at-least - # There is a bug in zpty module in older zsh versions by which a # zpty that exits will kill all zpty processes that were forked # before it. Here we set up a zsh exit hook to SIGKILL the zpty diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/widgets.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/widgets.zsh index 8f09792..bd61666 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/widgets.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/src/widgets.zsh @@ -20,7 +20,7 @@ _zsh_autosuggest_enable() { # Toggle suggestions (enable/disable) _zsh_autosuggest_toggle() { - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then + if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then _zsh_autosuggest_enable else _zsh_autosuggest_disable @@ -61,25 +61,14 @@ _zsh_autosuggest_modify() { return $retval fi - # Optimize if manually typing in the suggestion - if (( $#BUFFER > $#orig_buffer )); then - local added=${BUFFER#$orig_buffer} - - # If the string added matches the beginning of the postdisplay - if [[ "$added" = "${orig_postdisplay:0:$#added}" ]]; then - POSTDISPLAY="${orig_postdisplay:$#added}" - return $retval - fi - fi - - # Don't fetch a new suggestion if the buffer hasn't changed - if [[ "$BUFFER" = "$orig_buffer" ]]; then - POSTDISPLAY="$orig_postdisplay" + # Optimize if manually typing in the suggestion or if buffer hasn't changed + if [[ "$BUFFER" = "$orig_buffer"* && "$orig_postdisplay" = "${BUFFER:$#orig_buffer}"* ]]; then + POSTDISPLAY="${orig_postdisplay:$(($#BUFFER - $#orig_buffer))}" return $retval fi # Bail out if suggestions are disabled - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then + if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then return $? fi @@ -205,8 +194,21 @@ _zsh_autosuggest_partial_accept() { } () { + typeset -ga _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS + + _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS=( + clear + fetch + suggest + accept + execute + enable + disable + toggle + ) + local action - for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do + for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS modify partial_accept; do eval "_zsh_autosuggest_widget_$action() { local -i retval @@ -223,12 +225,7 @@ _zsh_autosuggest_partial_accept() { }" done - zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch - zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest - zle -N autosuggest-accept _zsh_autosuggest_widget_accept - zle -N autosuggest-clear _zsh_autosuggest_widget_clear - zle -N autosuggest-execute _zsh_autosuggest_widget_execute - zle -N autosuggest-enable _zsh_autosuggest_widget_enable - zle -N autosuggest-disable _zsh_autosuggest_widget_disable - zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle + for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS; do + zle -N autosuggest-$action _zsh_autosuggest_widget_$action + done } diff --git a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh index a8ef6c4..b19cac7 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh @@ -1,8 +1,8 @@ # Fish-like fast/unobtrusive autosuggestions for zsh. # https://github.com/zsh-users/zsh-autosuggestions -# v0.6.4 +# v0.7.0 # Copyright (c) 2013 Thiago de Arruda -# Copyright (c) 2016-2019 Eric Freese +# Copyright (c) 2016-2021 Eric Freese # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation @@ -199,7 +199,7 @@ _zsh_autosuggest_bind_widgets() { ignore_widgets=( .\* _\* - autosuggest-\* + ${_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS/#/autosuggest-} $ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\* $ZSH_AUTOSUGGEST_IGNORE_WIDGETS ) @@ -282,7 +282,7 @@ _zsh_autosuggest_enable() { # Toggle suggestions (enable/disable) _zsh_autosuggest_toggle() { - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then + if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then _zsh_autosuggest_enable else _zsh_autosuggest_disable @@ -323,25 +323,14 @@ _zsh_autosuggest_modify() { return $retval fi - # Optimize if manually typing in the suggestion - if (( $#BUFFER > $#orig_buffer )); then - local added=${BUFFER#$orig_buffer} - - # If the string added matches the beginning of the postdisplay - if [[ "$added" = "${orig_postdisplay:0:$#added}" ]]; then - POSTDISPLAY="${orig_postdisplay:$#added}" - return $retval - fi - fi - - # Don't fetch a new suggestion if the buffer hasn't changed - if [[ "$BUFFER" = "$orig_buffer" ]]; then - POSTDISPLAY="$orig_postdisplay" + # Optimize if manually typing in the suggestion or if buffer hasn't changed + if [[ "$BUFFER" = "$orig_buffer"* && "$orig_postdisplay" = "${BUFFER:$#orig_buffer}"* ]]; then + POSTDISPLAY="${orig_postdisplay:$(($#BUFFER - $#orig_buffer))}" return $retval fi # Bail out if suggestions are disabled - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then + if (( ${+_ZSH_AUTOSUGGEST_DISABLED} )); then return $? fi @@ -467,8 +456,21 @@ _zsh_autosuggest_partial_accept() { } () { + typeset -ga _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS + + _ZSH_AUTOSUGGEST_BUILTIN_ACTIONS=( + clear + fetch + suggest + accept + execute + enable + disable + toggle + ) + local action - for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do + for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS modify partial_accept; do eval "_zsh_autosuggest_widget_$action() { local -i retval @@ -485,14 +487,9 @@ _zsh_autosuggest_partial_accept() { }" done - zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch - zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest - zle -N autosuggest-accept _zsh_autosuggest_widget_accept - zle -N autosuggest-clear _zsh_autosuggest_widget_clear - zle -N autosuggest-execute _zsh_autosuggest_widget_execute - zle -N autosuggest-enable _zsh_autosuggest_widget_enable - zle -N autosuggest-disable _zsh_autosuggest_widget_disable - zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle + for action in $_ZSH_AUTOSUGGEST_BUILTIN_ACTIONS; do + zle -N autosuggest-$action _zsh_autosuggest_widget_$action + done } #--------------------------------------------------------------------# @@ -541,8 +538,6 @@ _zsh_autosuggest_capture_completion_widget() { zle -N autosuggest-capture-completion _zsh_autosuggest_capture_completion_widget _zsh_autosuggest_capture_setup() { - autoload -Uz is-at-least - # There is a bug in zpty module in older zsh versions by which a # zpty that exits will kill all zpty processes that were forked # before it. Here we set up a zsh exit hook to SIGKILL the zpty @@ -804,7 +799,8 @@ _zsh_autosuggest_async_request() { # There's a weird bug here where ^C stops working unless we force a fork # See https://github.com/zsh-users/zsh-autosuggestions/issues/364 - command true + autoload -Uz is-at-least + is-at-least 5.8 || command true # Read the pid from the child process read _ZSH_AUTOSUGGEST_CHILD_PID <&$_ZSH_AUTOSUGGEST_ASYNC_FD @@ -853,6 +849,16 @@ _zsh_autosuggest_start() { _zsh_autosuggest_bind_widgets } +# Mark for auto-loading the functions that we use +autoload -Uz add-zsh-hook is-at-least + +# Automatically enable asynchronous mode in newer versions of zsh. Disable for +# older versions because there is a bug when using async mode where ^C does not +# work immediately after fetching a suggestion. +# See https://github.com/zsh-users/zsh-autosuggestions/issues/364 +if is-at-least 5.0.8; then + typeset -g ZSH_AUTOSUGGEST_USE_ASYNC= +fi + # Start the autosuggestion widgets on the next precmd -autoload -Uz add-zsh-hook add-zsh-hook precmd _zsh_autosuggest_start diff --git a/dot_oh-my-zsh/custom/plugins/zsh-eza b/dot_oh-my-zsh/custom/plugins/zsh-eza new file mode 160000 index 0000000..d6b0278 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-eza @@ -0,0 +1 @@ +Subproject commit d6b0278517970bdd51cc3e576928125e0794f5bc diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/HACKING.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/HACKING.md index 6fd195c..ddd39a4 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/HACKING.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/HACKING.md @@ -95,5 +95,5 @@ zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-hi IRC channel ----------- -We're on #zsh-syntax-highlighting on freenode. +We're on #zsh-syntax-highlighting on Libera.Chat. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/INSTALL.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/INSTALL.md index 48b724f..2e1286d 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/INSTALL.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/INSTALL.md @@ -3,12 +3,14 @@ How to install ### Using packages +First, install the package: + * Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package] * Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository]) * Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository]) * FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port]) * Gentoo: [app-shells/zsh-syntax-highlighting][gentoo-repository] -* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package] +* Mac OS X / Homebrew: `brew install zsh-syntax-highlighting` ([formula][brew-package]) * NetBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][netbsd-port]) * OpenBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][openbsd-port]) * openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository] @@ -18,11 +20,11 @@ How to install [arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting [AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git -[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-syntax-highlighting.rb +[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-syntax-highlighting.rb [debian-package]: https://packages.debian.org/zsh-syntax-highlighting [fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting [fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting -[freebsd-port]: http://www.freshports.org/textproc/zsh-syntax-highlighting/ +[freebsd-port]: https://www.freshports.org/textproc/zsh-syntax-highlighting/ [gentoo-repository]: https://packages.gentoo.org/packages/app-shells/zsh-syntax-highlighting [netbsd-port]: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/zsh-syntax-highlighting/ [obs-repository]: https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting @@ -32,6 +34,36 @@ How to install See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions) +Second, enable zsh-syntax-highlighting by sourcing the script. Running this command on the terminal will add the source line to the end of your .zshrc: + +* On most Linux distributions (except perhaps NixOS): + + ```zsh + echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc + ``` + +* NetBSD and OpenBSD: + + ```zsh + echo "source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc + ``` + +* Mac OS X / Homebrew: + + ```zsh + echo "source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc + ``` + +Then restart zsh (such as by opening a new instance of your terminal emulator). + + Alternatively, add the `source` command manually **at the end** of your `.zshrc`: + +* On most Linux distributions (except perhaps NixOS): +`source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh` +* NetBSD and OpenBSD: +`source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh` + +Then restart zsh. ### In your ~/.zshrc @@ -75,6 +107,12 @@ This list is incomplete as there are too many Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in your `.zshrc`. +#### [Fig](https://fig.io) + +Click the `Install Plugin` button on the [Fig plugin page][fig-plugin]. + +[fig-plugin]: https://fig.io/plugins/other/zsh-syntax-highlighting + #### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) 1. Clone this repository in oh-my-zsh's plugins directory: @@ -102,15 +140,15 @@ Zsh-syntax-highlighting is included with Prezto. See the Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`. +#### [zinit](https://github.com/zdharma-continuum/zinit) + +Add `zinit light zsh-users/zsh-syntax-highlighting` to the end of your +`.zshrc`. + #### [zplug](https://github.com/zplug/zplug) Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`. -#### [zplugin](https://github.com/psprint/zplugin) - -Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your -`.zshrc`. - ### System-wide installation diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/README.md index 36fbdd7..4768b3d 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/README.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/README.md @@ -5,8 +5,8 @@ zsh-syntax-highlighting [![Build Status][build-status-image]][build-status] *Requirements: zsh 4.3.11+.* -[fish]: http://www.fishshell.com/ -[zsh]: http://www.zsh.org/ +[fish]: https://fishshell.com/ +[zsh]: https://www.zsh.org/ This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an @@ -73,7 +73,7 @@ enough information to allow computing the highlighting correctly.) See issues [#288][i288] and [#415][i415] for details. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting [i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288 [i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/changelog.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/changelog.md index 9230236..8ee5088 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/changelog.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/changelog.md @@ -1,15 +1,24 @@ # Changes in HEAD +- Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection. + [#942] + + +# Changes in 0.8.0 + +This is a stable bugfix and feature release. Major new features and changes include: + + ## Changes fixed as part of the switch to zle-line-pre-redraw The changes in this section were fixed by switching to a `zle-line-pre-redraw`-based implementation. Note: The new implementation will only be used on future zsh releases, -numbered 5.8.0.3 and newer, due to interoperability issues with other plugins +numbered 5.8.1.1 and newer, due to interoperability issues with other plugins (issues #418 and #579). The underlying zsh feature has been available since -zsh 5.2. +zsh 5.3. Whilst under development, the new implementation was known as the "feature/redrawhook" topic branch. @@ -56,6 +65,31 @@ Whilst under development, the new implementation was known as the - Add issue #712 to the previous release's changelog (hereinafter). +- Fix highlighting when using an alias twice inside another alias + [#769, #775] + +- Remove lint warning for `env` followed by a pipe + [#797] + +- Recognize `proxychains` as a precommand + [#814, #914] + +- Honor shwordsplit when expanding parameters + [#687, #818] + +- Skip highlighting when keys are still pending in more cases + [#835] + +- Recognize `grc` as a precommand + +- Recognize `torsocks` and `torift` as precommands + [#898] + +- Recognize `cpulimit` as a precommand + [#897] + +- Recognize `ktrace` as a precommand + # Changes in 0.8.0-alpha1-pre-redrawhook @@ -89,8 +123,8 @@ to issue #418. (#90, part of #245 (feature/redrawhook)) -[zshcompsys-Standard-Styles]: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Standard-Styles -[zshcompsys-Standard-Styles-format]: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#index-format_002c-completion-style +[zshcompsys-Standard-Styles]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles +[zshcompsys-Standard-Styles-format]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-format_002c-completion-style @@ -168,6 +202,8 @@ to issue #418. - Recognize `env` as a precommand (e.g., `env FOO=bar ls`) +- Recognize `ionice` as a precommand + - Recognize `strace` as a precommand - Fix an error message on stderr before every prompt when the `WARN_NESTED_VAR` zsh option is set: @@ -289,7 +325,7 @@ This is a stable release, featuring bugfixes and minor improvements. - The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting]. (79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support) -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting - Possible history expansions in double-quoted strings. (76ea9e1df316) @@ -735,7 +771,7 @@ in this area. ## Developer-visible changes: -- Test harness converted to [TAP](http://testanything.org/tap-specification.html) format +- Test harness converted to [TAP](https://testanything.org/tap-specification.html) format (d99aa58aaaef, et seq) - Run each test in a separate subprocess, isolating them from each other diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters.md index bb72e54..fb64c3a 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters.md @@ -3,19 +3,21 @@ zsh-syntax-highlighting / highlighters Syntax highlighting is done by pluggable highlighters: -* `main` - the base highlighter, and the only one [active by default][1]. -* `brackets` - [matches brackets][2] and parenthesis. -* `pattern` - matches [user-defined patterns][3]. -* `cursor` - matches [the cursor position][4]. -* `root` - highlights the whole command line [if the current user is root][5]. -* `line` - applied to [the whole command line][6]. +* `main` - the base highlighter, and the only one [active by default][main]. +* `brackets` - [matches brackets][brackets] and parenthesis. +* `pattern` - matches [user-defined patterns][pattern]. +* `regexp` - matches [user-defined regular expressions][regexp]. +* `cursor` - matches [the cursor position][cursor]. +* `root` - highlights the whole command line [if the current user is root][root]. +* `line` - applied to [the whole command line][line]. -[1]: highlighters/main.md -[2]: highlighters/brackets.md -[3]: highlighters/pattern.md -[4]: highlighters/cursor.md -[5]: highlighters/root.md -[6]: highlighters/line.md +[main]: highlighters/main.md +[brackets]: highlighters/brackets.md +[pattern]: highlighters/pattern.md +[regexp]: highlighters/regexp.md +[cursor]: highlighters/cursor.md +[root]: highlighters/root.md +[line]: highlighters/line.md Highlighter-independent settings @@ -25,10 +27,10 @@ By default, all command lines are highlighted. However, it is possible to prevent command lines longer than a fixed number of characters from being highlighted by setting the variable `${ZSH_HIGHLIGHT_MAXLENGTH}` to the maximum length (in characters) of command lines to be highlighter. This is useful when -editing very long comand lines (for example, with the [`fned`][fned] utility +editing very long command lines (for example, with the [`fned`][fned] utility function). Example: -[fned]: http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#index-zed +[fned]: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#index-zed ```zsh ZSH_HIGHLIGHT_MAXLENGTH=512 @@ -38,16 +40,14 @@ ZSH_HIGHLIGHT_MAXLENGTH=512 How to activate highlighters ---------------------------- -To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in -`~/.zshrc`, for example: +To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array. +By default `ZSH_HIGHLIGHT_HIGHLIGHTERS` is `(main)`. For example to activate +`brackets`, `pattern`, and `cursor` highlighters, in `~/.zshrc` do: ```zsh -ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) +ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor) ``` -By default, `$ZSH_HIGHLIGHT_HIGHLIGHTERS` is unset and only the `main` -highlighter is active. - How to tweak highlighters ------------------------- @@ -59,7 +59,7 @@ same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting Some highlighters support additional configuration parameters; see each highlighter's documentation for details and examples. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/brackets.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/brackets.md index 8410135..0101699 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/brackets.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/brackets.md @@ -28,4 +28,4 @@ The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/cursor.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/cursor.md index c4f22b8..3f87d42 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/cursor.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/cursor.md @@ -21,4 +21,4 @@ The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/line.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/line.md index 1081fe1..f76639e 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/line.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/line.md @@ -21,4 +21,4 @@ The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/main.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/main.md index cc6186b..4a27653 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/main.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/main.md @@ -116,6 +116,6 @@ of that (new) kind will be highlighted by the style `arg0_$kind`, where `$kind` is the output of `type -w` on the new kind of command word. If that style is not defined, then the style `arg0` will be used instead. -[zshmisc-Simple-Commands-And-Pipelines]: http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines +[zshmisc-Simple-Commands-And-Pipelines]: https://zsh.sourceforge.io/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/pattern.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/pattern.md index e67d79f..ecaa6a7 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/pattern.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/pattern.md @@ -21,4 +21,4 @@ The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/regexp.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/regexp.md index 5c8a89e..8c711a3 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/regexp.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/regexp.md @@ -12,11 +12,44 @@ To use this highlighter, associate regular expressions with styles in the ```zsh typeset -A ZSH_HIGHLIGHT_REGEXP -ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold) +ZSH_HIGHLIGHT_REGEXP+=('^rm .*' fg=red,bold) ``` -This will highlight "sudo" only as a complete word, i.e., "sudo cmd", but not -"sudoedit" +This will highlight lines that start with a call to the `rm` command. + +The regular expressions flavour used is [PCRE][pcresyntax] when the +`RE_MATCH_PCRE` option is set and POSIX Extended Regular Expressions (ERE), +as implemented by the platform's C library, otherwise. For details on the +latter, see [the `zsh/regex` module's documentation][MAN_ZSH_REGEX] and the +`regcomp(3)` and `re_format(7)` manual pages on your system. + +For instance, to highlight `sudo` only as a complete word, i.e., `sudo cmd`, +but not `sudoedit`, one might use: + +* When the `RE_MATCH_PCRE` is set: + + ```zsh + typeset -A ZSH_HIGHLIGHT_REGEXP + ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold) + ``` + +* When the `RE_MATCH_PCRE` is unset, on platforms with GNU `libc` (e.g., many GNU/Linux distributions): + + ```zsh + typeset -A ZSH_HIGHLIGHT_REGEXP + ZSH_HIGHLIGHT_REGEXP+=('\' fg=123,bold) + ``` + +* When the `RE_MATCH_PCRE` is unset, on BSD-based platforms (e.g., macOS): + + ```zsh + typeset -A ZSH_HIGHLIGHT_REGEXP + ZSH_HIGHLIGHT_REGEXP+=('[[:<:]]sudo[[:>:]]' fg=123,bold) + ``` + +Note, however, that PCRE and POSIX ERE have a large common subset: +for instance, the regular expressions `[abc]`, `a*`, and `(a|b)` have the same +meaning in both flavours. The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` @@ -25,6 +58,8 @@ manual page][zshzle-Character-Highlighting]. See also: [regular expressions tutorial][perlretut], zsh regexp operator `=~` in [the `zshmisc(1)` manual page][zshmisc-Conditional-Expressions] -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting -[perlretut]: http://perldoc.perl.org/perlretut.html -[zshmisc-Conditional-Expressions]: http://zsh.sourceforge.net/Doc/Release/Conditional-Expressions.html#Conditional-Expressions +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[perlretut]: https://perldoc.perl.org/perlretut +[zshmisc-Conditional-Expressions]: https://zsh.sourceforge.io/Doc/Release/Conditional-Expressions.html#Conditional-Expressions +[MAN_ZSH_REGEX]: https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fregex-Module +[pcresyntax]: https://www.pcre.org/original/doc/html/pcresyntax.html diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/root.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/root.md index d120d20..8197e4b 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/root.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/docs/highlighters/root.md @@ -22,4 +22,4 @@ The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` manual page][zshzle-Character-Highlighting]. -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting +[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_editorconfig b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_editorconfig deleted file mode 100644 index cda541d..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Top-most editorconfig file - -root = true - -[*] -end_of_line = lf -tab_width = 2 -indent_size = 2 -indent_style = space - -[Makefile] -tab_width = 8 -indent_size = 8 -indent_style = tab - diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/HEAD deleted file mode 100644 index cb089cd..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/config b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/config deleted file mode 100644 index 6aec0c6..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = https://github.com/zsh-users/zsh-syntax-highlighting.git - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/description b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/description deleted file mode 100644 index 498b267..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_applypatch-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_applypatch-msg.sample deleted file mode 100644 index a5d7b84..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_commit-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_commit-msg.sample deleted file mode 100644 index b58d118..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_fsmonitor-watchman.sample deleted file mode 100644 index e673bb3..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_fsmonitor-watchman.sample +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 1) and a time in nanoseconds -# formatted as a string and outputs to stdout all files that have been -# modified since the given time. Paths must be relative to the root of -# the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $time) = @ARGV; - -# Check the hook interface version - -if ($version == 1) { - # convert nanoseconds to seconds - $time = int $time / 1000000000; -} else { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree; -if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $git_work_tree = Win32::GetCwd(); - $git_work_tree =~ tr/\\/\//; -} else { - require Cwd; - $git_work_tree = Cwd::cwd(); -} - -my $retry = 1; - -launch_watchman(); - -sub launch_watchman { - - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $time but were not transient (ie created after - # $time but no longer exist). - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - # - # The category of transient files that we want to ignore will have a - # creation clock (cclock) newer than $time_t value and will also not - # currently exist. - - my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $time, - "fields": ["name"], - "expression": ["not", ["allof", ["since", $time, "cclock"], ["not", "exists"]]] - }] - END - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - my $json_pkg; - eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; - } or do { - require JSON::PP; - $json_pkg = "JSON::PP"; - }; - - my $o = $json_pkg->new->utf8->decode($response); - - if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) { - print STDERR "Adding '$git_work_tree' to watchman's watch list.\n"; - $retry--; - qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - print "/\0"; - eval { launch_watchman() }; - exit 0; - } - - die "Watchman: $o->{error}.\n" . - "Falling back to scanning...\n" if $o->{error}; - - binmode STDOUT, ":utf8"; - local $, = "\0"; - print @{$o->{files}}; -} diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_post-update.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_post-update.sample deleted file mode 100644 index ec17ec1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-applypatch.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-applypatch.sample deleted file mode 100644 index 4142082..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-commit.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-commit.sample deleted file mode 100644 index 6a75641..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-merge-commit.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-merge-commit.sample deleted file mode 100644 index 399eab1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-merge-commit.sample +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git merge" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message to -# stderr if it wants to stop the merge commit. -# -# To enable this hook, rename this file to "pre-merge-commit". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" -: diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-push.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-push.sample deleted file mode 100644 index 6187dbf..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-rebase.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-rebase.sample deleted file mode 100644 index 6cbef5c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-receive.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-receive.sample deleted file mode 100644 index a1fd29e..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_prepare-commit-msg.sample deleted file mode 100644 index 10fa14c..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_update.sample b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_update.sample deleted file mode 100644 index 80ba941..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/hooks/executable_update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to block unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/index b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/index deleted file mode 100644 index 19af502..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/index and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/info/exclude b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/info/exclude deleted file mode 100644 index a5196d1..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/HEAD deleted file mode 100644 index f2d75e6..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0 Jan Eitzinger 1610815503 +0100 clone: from https://github.com/zsh-users/zsh-syntax-highlighting.git diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/heads/master b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/heads/master deleted file mode 100644 index f2d75e6..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0 Jan Eitzinger 1610815503 +0100 clone: from https://github.com/zsh-users/zsh-syntax-highlighting.git diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/remotes/origin/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/remotes/origin/HEAD deleted file mode 100644 index f2d75e6..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0 Jan Eitzinger 1610815503 +0100 clone: from https://github.com/zsh-users/zsh-syntax-highlighting.git diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/info/.keep b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/info/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.idx b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.idx deleted file mode 100644 index 1d48a33..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.idx and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.pack b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.pack deleted file mode 100644 index 5772190..0000000 Binary files a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/objects/pack/readonly_pack-3b0f2680be95ae1519d7d98b632ca6b200e5c4d0.pack and /dev/null differ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/packed-refs b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/packed-refs deleted file mode 100644 index b679aff..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/packed-refs +++ /dev/null @@ -1,30 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -7ac72a57bc7e5cc0ad84ef005d75c39d101b32a0 refs/remotes/origin/0.4.x -eb67c0b84f56f33cd34e3e40fa88c346d20211bc refs/remotes/origin/0.5.x -ffed6e16547596f554b69f33d16b228649dfc142 refs/remotes/origin/feature/redrawhook -023c994cdf00009c3fd7ba99e1900f0c450a6ebb refs/remotes/origin/i652-v1 -5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0 refs/remotes/origin/master -1089e3a40886155c14bd9540e3de5f29a63776a2 refs/remotes/origin/themes -d2715e2cb3294880bbc6a75b91288243054218d0 refs/tags/0.1.0 -bb0d575942760fe483790fe878ea43b1f781e2ca refs/tags/0.1.1 -732b7d6e65c0349ee1d89b698bf9cd8a30c1015d refs/tags/0.1.2 -a0862053f57e3d8d6e0dbc34e55be13d9e4fb668 refs/tags/0.1.3 -dbd27cb30a710809dd070669c331574fdc15b397 refs/tags/0.2.0 -3dc574190071ef59054f6d693132410b37aa3ae4 refs/tags/0.2.1 -fee52920ae0b29e30bf5413151263faed20f5123 refs/tags/0.3.0 -2d792b03bb715b1cd4c550aba48e2ca10be6a447 refs/tags/0.4.0 -c19ee583138ebab416b0d2efafbad7dc9f3f7c4f refs/tags/0.4.1 -c5523c757192c9d9fffde1219c0f8d60f9af9a22 refs/tags/0.5.0 -^15d4587514a3beaa13972093e335bf685b6726a9 -f7a963b078820de3be822c62333f68067efd9a29 refs/tags/0.6.0 -^434af7b11dd33641231f1b48b8432e68eb472e46 -0f26070068b25b97b47693adf87c438c40a0756e refs/tags/0.6.0-rc1 -^dc2673155594f1de815802ca674bc7741ccda60f -3c828bf18302d7c4c2357b688e69f16c6c0dcb18 refs/tags/0.7.0 -^36a3c0f82c23934fbfa924c79453266c4edda5fd -6a18eb874ae1b6d53b940f532eac24c6650918c6 refs/tags/0.7.0-beta1 -^71dc090d02f891a65fee153041dd4332c76c21bc -956d0ebeecddb8c5ceabcb42b8c9be485e622c8d refs/tags/0.7.1 -^932e29a0c75411cb618f02995b66c0a4a25699bc -6b76f34ffc520463084be36e61f04343547778b4 refs/tags/0.8.0-alpha1-pre-redrawhook -^00a5fd11eb9d1c163fb49da5310c8f4b09fb3022 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/heads/master b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/heads/master deleted file mode 100644 index 187d177..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/remotes/origin/HEAD b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/remotes/origin/HEAD deleted file mode 100644 index 6efe28f..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/master diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/tags/.keep b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_git/refs/tags/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitattributes b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitattributes deleted file mode 100644 index 715e624..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitattributes +++ /dev/null @@ -1 +0,0 @@ -.revision-hash export-subst diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_github/workflows/test.yml b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_github/workflows/test.yml deleted file mode 100644 index 8221926..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_github/workflows/test.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: Tests -on: - push: - paths-ignore: - - '**.md' - - '**.png' - pull_request: - paths-ignore: - - '**.md' - - '**.png' - schedule: - - cron: '29 7 * * 1' - -jobs: - test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: - - master - - 5.8 - - 5.7.1 - - 5.7 - - 5.6.2 - - 5.6.1 - - 5.6 - - 5.5.1 - - 5.5 - - 5.4.2 - - 5.4.1 - - 5.4 - - 5.3.1 - - 5.3 - - 5.2 - - 5.1.1 - - 5.1 - - 5.0.8 - - 5.0.7 - - 5.0.6 - - 5.0.5 - - 5.0.4 - - 5.0.3 - - 5.0.2 - - 5.0.1 - - 5.0.0 - - 4.3.17 - - 4.3.16 - - 4.3.15 - - 4.3.14 - - 4.3.13 - - 4.3.12 - - 4.3.11 - container: - image: zshusers/zsh:${{ matrix.version }} - steps: - - uses: actions/checkout@v2 - - run: install_packages bsdmainutils make procps - - run: make test - - notify: - runs-on: ubuntu-latest - needs: test - if: failure() && (github.repository_owner == 'zsh-users') - steps: - - - name: Notify IRC - uses: Gottox/irc-message-action@v1 - with: - channel: '#zsh-syntax-highlighting' - nickname: zsyh-gh-bot - message: '${{ github.ref }} failed tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitignore b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitignore deleted file mode 100644 index 18fa5ec..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.zwc* -.pc/ -docs/all.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_revision-hash b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_revision-hash deleted file mode 100644 index 6828f88..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_revision-hash +++ /dev/null @@ -1 +0,0 @@ -$Format:%H$ diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_version b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_version deleted file mode 100644 index 9fb1210..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/dot_version +++ /dev/null @@ -1 +0,0 @@ -0.8.0-alpha2-dev diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/README.md new file mode 120000 index 0000000..6997bd6 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/README.md @@ -0,0 +1 @@ +../../docs/highlighters/brackets.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/symlink_README.md deleted file mode 100644 index 8937cfa..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/brackets.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/README.md new file mode 120000 index 0000000..70e0c8c --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/README.md @@ -0,0 +1 @@ +../../docs/highlighters/cursor.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/symlink_README.md deleted file mode 100644 index b44bdf7..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/cursor.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/README.md new file mode 120000 index 0000000..052fe20 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/README.md @@ -0,0 +1 @@ +../../docs/highlighters/line.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/symlink_README.md deleted file mode 100644 index c10f1ab..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/line.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/README.md new file mode 120000 index 0000000..0354731 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/README.md @@ -0,0 +1 @@ +../../docs/highlighters/main.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh index 4ea3f34..3ec96d9 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh @@ -254,10 +254,9 @@ _zsh_highlight_main__is_runnable() { _zsh_highlight_main__is_redirection() { # A redirection operator token: # - starts with an optional single-digit number; - # - then, has a '<' or '>' character; - # - is not a process substitution [<(...) or >(...)]. - # - is not a numeric glob <-> - [[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]] && [[ $1 != *'<'*'-'*'>'* ]] + # - is one of the tokens listed in zshmisc(1) + # - however (z) normalizes ! to | + [[ ${1#[0-9]} == (\<|\<\>|(\>|\>\>)(|\|)|\<\<(|-)|\<\<\<|\<\&|\&\<|(\>|\>\>)\&(|\|)|\&(\>|\>\>)(|\||\!)) ]] } # Resolve alias. @@ -349,6 +348,7 @@ _zsh_highlight_highlighter_main_paint() 'noglob' '' # 'time' and 'nocorrect' shouldn't be added here; they're reserved words, not precommands. + # miscellaneous commands 'doas' aCu:Lns # as of OpenBSD's doas(1) dated September 4, 2016 'nice' n: # as of current POSIX spec 'pkexec' '' # doesn't take short options; immune to #121 because it's usually not passed --option flags @@ -362,21 +362,21 @@ _zsh_highlight_highlighter_main_paint() 'env' u:i 'ionice' cn:t:pPu # util-linux 2.33.1-0.1 'strace' IbeaosXPpEuOS:ACdfhikqrtTvVxyDc # strace 4.26-0.2 - - # As of OpenSSH 8.1p1 - 'ssh-agent' aEPt:csDd:k - # suckless-tools v44 - # Argumentless flags that can't be followed by a command: -v - 'tabbed' gnprtTuU:cdfhs - - # moreutils 0.62-1 - 'chronic' :ev - 'ifne' :n - + 'proxychains' f:q # proxychains 4.4.0 + 'torsocks' idq:upaP # Torsocks 2.3.0 + 'torify' idq:upaP # Torsocks 2.3.0 + 'ssh-agent' aEPt:csDd:k # As of OpenSSH 8.1p1 + 'tabbed' gnprtTuU:cdfhs:v # suckless-tools v44 + 'chronic' :ev # moreutils 0.62-1 + 'ifne' :n # moreutils 0.62-1 + 'grc' :se # grc - a "generic colouriser" (that's their spelling, not mine) + 'cpulimit' elp:ivz # cpulimit 0.2 + 'ktrace' fgpt:aBCcdiT ) # Commands that would need to skip one positional argument: # flock # ssh + # _wanted (skip two) if [[ $zsyh_user_options[ignorebraces] == on || ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]; then local right_brace_is_recognised_everywhere=false @@ -476,7 +476,11 @@ _zsh_highlight_main_highlighter__try_expand_parameter() ;; (*) # scalar, presumably - words=( ${(P)MATCH} ) + if [[ $zsyh_user_options[shwordsplit] == on ]]; then + words=( ${(P)=MATCH} ) + else + words=( ${(P)MATCH} ) + fi ;; esac reply=( "${words[@]}" ) @@ -601,16 +605,19 @@ _zsh_highlight_main_highlighter_highlight_list() (( in_alias[1]-- )) # Remove leading 0 entries in_alias=($in_alias[$in_alias[(i)<1->],-1]) - (){ - local alias_name - for alias_name in ${(k)seen_alias[(R)<$#in_alias->]}; do - unset "seen_alias[$alias_name]" - done - } if (( $#in_alias == 0 )); then seen_alias=() # start_pos and end_pos are of the alias (previous $arg) here _zsh_highlight_main_add_region_highlight $start_pos $end_pos $alias_style + else + # We can't unset keys that contain special characters (] \ and some others). + # More details: https://www.zsh.org/workers/43269 + (){ + local alias_name + for alias_name in ${(k)seen_alias[(R)<$#in_alias->]}; do + seen_alias=("${(@kv)seen_alias[(I)^$alias_name]}") + done + } fi fi if (( in_param )); then @@ -648,7 +655,7 @@ _zsh_highlight_main_highlighter_highlight_list() if (( $#in_alias == 0 && in_param == 0 )); then # Compute the new $start_pos and $end_pos, skipping over whitespace in $buf. - [[ "$proc_buf" = (#b)(#s)(([ $'\t']|[\\]$'\n')#)(?|)* ]] + [[ "$proc_buf" = (#b)(#s)(''([ $'\t']|[\\]$'\n')#)(?|)* ]] # The first, outer parenthesis integer offset="${#match[1]}" (( start_pos = end_pos + offset )) @@ -736,7 +743,7 @@ _zsh_highlight_main_highlighter_highlight_list() # Analyse the current word. if _zsh_highlight_main__is_redirection $arg ; then if (( in_redirection == 1 )); then - # Two consecuive redirection operators is an error. + # Two consecutive redirection operators is an error. _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token else in_redirection=2 @@ -890,7 +897,9 @@ _zsh_highlight_main_highlighter_highlight_list() (){ local alias_name for alias_name in ${(k)seen_alias[(R)<$#in_alias->]}; do - unset "seen_alias[$alias_name]" + # We can't unset keys that contain special characters (] \ and some others). + # More details: https://www.zsh.org/workers/43269 + seen_alias=("${(@kv)seen_alias[(I)^$alias_name]}") done } if [[ $arg != '|' && $arg != '|&' ]]; then @@ -916,8 +925,8 @@ _zsh_highlight_main_highlighter_highlight_list() next_word=${next_word//:regular:/} next_word+=':sudo_opt:' next_word+=':start:' - if [[ $arg == 'exec' ]]; then - # To allow "exec 2>&1;" where there's no command word + if [[ $arg == 'exec' || $arg == 'env' ]]; then + # To allow "exec 2>&1;" and "env | grep" where there's no command word next_word+=':regular:' fi else diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/symlink_README.md deleted file mode 100644 index 0645f54..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/main.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-brackets.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-brackets.zsh new file mode 100644 index 0000000..ede6c9a --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-brackets.zsh @@ -0,0 +1,41 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------------------------- +# Copyright (c) 2021 zsh-syntax-highlighting contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions +# and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors +# may be used to endorse or promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------------------------- +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------------------------- + +# Have to use cat here as it must be a command that exists. +# Otherwise, the test would fail with the first token being recognized +# as an "unknown-token". +alias ]=cat + +BUFFER='] /' + +expected_region_highlight=( + '1 1 alias' # ] + '3 3 path' # / +) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/block-assignment-no-command.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/block-assignment-no-command.zsh new file mode 100644 index 0000000..ec52c98 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/block-assignment-no-command.zsh @@ -0,0 +1,38 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------------------------- +# Copyright (c) 2022 zsh-syntax-highlighting contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions +# and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors +# may be used to endorse or promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------------------------- +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------------------------- + +BUFFER=$'{ a=42 }' + +expected_region_highlight=( + '1 1 reserved-word' # { + '3 6 assign' # a=42 + '5 6 default' # 42 + '8 8 reserved word "issue #854"' # } +) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/null-exec2-printenv.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/null-exec2-printenv.zsh new file mode 100644 index 0000000..59a2cef --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/null-exec2-printenv.zsh @@ -0,0 +1,38 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------------------------- +# Copyright (c) 2021 zsh-syntax-highlighting contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions +# and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors +# may be used to endorse or promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------------------------- +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------------------------- + +BUFFER=$'env | grep $needle' + +expected_region_highlight=( + '1 3 precommand' # env + '5 5 commandseparator' # | + '7 10 command' # grep + '12 18 default' # $needle +) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/opt-shwordsplit1.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/opt-shwordsplit1.zsh index 7455785..4a7689b 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/opt-shwordsplit1.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/opt-shwordsplit1.zsh @@ -36,5 +36,5 @@ ed() { command ed "$@" } BUFFER=$'$EDITOR' expected_region_highlight=( - '1 7 function "issue #687"' # $EDITOR + '1 7 function' # $EDITOR ) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-expansion-shwordsplit.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-expansion-shwordsplit.zsh new file mode 100644 index 0000000..0bf6f4c --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-expansion-shwordsplit.zsh @@ -0,0 +1,38 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------------------------- +# Copyright (c) 2021 zsh-syntax-highlighting contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions +# and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors +# may be used to endorse or promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------------------------- +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------------------------- + +setopt sh_word_split +local foo='echo foo' + +BUFFER='$foo' + +expected_region_highlight=( + '1 4 builtin' # $foo +) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-to-global-alias.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-to-global-alias.zsh index cd2283b..63f95da 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-to-global-alias.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/parameter-to-global-alias.zsh @@ -28,12 +28,12 @@ # vim: ft=zsh sw=2 ts=2 et # ------------------------------------------------------------------------------------------------- -if type x >/dev/null; then - skip_test="Test is written on the assumption that 'x' is not a valid command name, but that assumption does not hold" +if type global_alias >/dev/null; then + skip_test="Test is written on the assumption that 'global_alias' is not a valid command name, but that assumption does not hold" return 0 fi -alias -g x=y -local s=x +alias -g global_alias=y +local s=global_alias BUFFER=$'$s' diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/redirection-all.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/redirection-all.zsh new file mode 100644 index 0000000..e8ffb5d --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/test-data/redirection-all.zsh @@ -0,0 +1,95 @@ +#!/usr/bin/env zsh +# ------------------------------------------------------------------------------------------------- +# Copyright (c) 2024 zsh-syntax-highlighting contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions +# and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors +# may be used to endorse or promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------------------------- +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------------------------- + +BUFFER=$': foo 9<>foo >foo 9>foo >|foo >\!foo >>foo >>|foo >>\!foo <<&9 <&- >&- <&p >&p >&foo &>foo >&|foo >&\!foo &>|foo &>\!foo >>&foo &>>foo >>&|foo >>&\!foo &>>|foo &>>\!foo' + +expected_region_highlight=( + '1 1 builtin' # : + '3 3 redirection' # < + '4 6 default' # foo + '8 9 redirection' # 9< + '10 12 default' # foo + '14 15 redirection' # <> + '16 18 default' # foo + '20 22 redirection' # 9<> + '23 25 default' # foo + '27 27 redirection' # > + '28 30 default' # foo + '32 33 redirection' # 9> + '34 36 default' # foo + '38 39 redirection' # >| + '40 42 default' # foo + '44 45 redirection' # >\! + '46 48 default' # foo + '50 51 redirection' # >> + '52 54 default' # foo + '56 58 redirection' # >>| + '59 61 default' # foo + '63 65 redirection' # >>\! + '66 68 default' # foo + '70 72 redirection' # <<< + '73 75 default' # foo + '77 78 redirection' # <& + '79 79 numeric-fd' # 9 + '81 82 redirection' # >& + '83 83 numeric-fd' # 9 + '85 86 redirection' # <& + '87 87 redirection' # - + '89 90 redirection' # >& + '91 91 redirection' # - + '93 94 redirection' # <& + '95 95 redirection' # p + '97 98 redirection' # >& + '99 99 redirection' # p + '101 102 redirection' # >& + '103 105 default' # foo + '107 108 redirection' # &> + '109 111 default' # foo + '113 115 redirection' # >&| + '116 118 default' # foo + '120 122 redirection' # >&\! + '123 125 default' # foo + '127 129 redirection' # &>| + '130 132 default' # foo + '134 136 redirection' # &>\! + '137 139 default' # foo + '141 143 redirection' # >>& + '144 146 default' # foo + '148 150 redirection' # &>> + '151 153 default' # foo + '155 158 redirection' # >>&| + '159 161 default' # foo + '163 166 redirection' # >>&\! + '167 169 default' # foo + '171 174 redirection' # &>>| + '175 177 default' # foo + '179 182 redirection' # &>>\! + '183 185 default' # foo +) diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/README.md new file mode 120000 index 0000000..5ff00e6 --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/README.md @@ -0,0 +1 @@ +../../docs/highlighters/pattern.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/symlink_README.md deleted file mode 100644 index ccc8ce3..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/pattern.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/README.md new file mode 120000 index 0000000..9f2522d --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/README.md @@ -0,0 +1 @@ +../../docs/highlighters/regexp.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/symlink_README.md deleted file mode 100644 index 81d6084..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/regexp.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/README.md new file mode 120000 index 0000000..ca6799d --- /dev/null +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/README.md @@ -0,0 +1 @@ +../../docs/highlighters/root.md \ No newline at end of file diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/symlink_README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/symlink_README.md deleted file mode 100644 index a0583ed..0000000 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/symlink_README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/root.md diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/release.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/release.md index 075f221..f8565e8 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/release.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/release.md @@ -1,5 +1,6 @@ # Release procedure (for developers): +- Ensure every `is-at-least` invocation passes a stable zsh release's version number as the first argument - For minor (A.B.0) releases: - Check whether the release uses any not-yet-released zsh features - Check open issues and outstanding pull requests diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/README.md b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/README.md index cb3d943..eefeb54 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/README.md +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/README.md @@ -104,7 +104,7 @@ By default, the results of all tests will be printed; to show only "interesting" results (tests that failed but were expected to succeed, or vice-versa), run `make quiet-test` (or `make test QUIET=y`). -[TAP]: http://testanything.org/ +[TAP]: https://testanything.org/ Performance test diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_edit-failed-tests b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/edit-failed-tests old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_edit-failed-tests rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/edit-failed-tests diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_generate.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/generate.zsh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_generate.zsh rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/generate.zsh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_tap-colorizer.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/tap-colorizer.zsh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_tap-colorizer.zsh rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/tap-colorizer.zsh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_tap-filter b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/tap-filter old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_tap-filter rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/tap-filter diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-highlighting.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-highlighting.zsh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-highlighting.zsh rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-highlighting.zsh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-perfs.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-perfs.zsh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-perfs.zsh rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-perfs.zsh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-zprof.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-zprof.zsh old mode 100644 new mode 100755 similarity index 100% rename from dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/executable_test-zprof.zsh rename to dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/tests/test-zprof.zsh diff --git a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh index d20dc5b..4295c93 100644 --- a/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +++ b/dot_oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh @@ -73,10 +73,10 @@ _zsh_highlight__is_function_p() { # This function takes a single argument F and returns True iff F denotes the # name of a callable function. A function is callable if it is fully defined # or if it is marked for autoloading and autoloading it at the first call to it -# will succeed. In particular, if a function has been marked for autoloading -# but is not available in $fpath, then this function will return False therefor. +# will succeed. In particular, if F has been marked for autoloading +# but is not available in $fpath, then calling this function on F will return False. # -# See users/21671 http://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=21671 +# See users/21671 https://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=21671 _zsh_highlight__function_callable_p() { if _zsh_highlight__is_function_p "$1" && ! _zsh_highlight__function_is_autoload_stub_p "$1" @@ -100,7 +100,7 @@ _zsh_highlight__function_callable_p() { # ------------------------------------------------------------------------------------------------- # Use workaround for bug in ZSH? -# zsh-users/zsh@48cadf4 http://www.zsh.org/mla/workers//2017/msg00034.html +# zsh-users/zsh@48cadf4 https://www.zsh.org/mla/workers/2017/msg00034.html autoload -Uz is-at-least if is-at-least 5.4; then typeset -g zsh_highlight__pat_static_bug=false @@ -123,7 +123,7 @@ _zsh_highlight() typeset -r ret # $region_highlight should be predefined, either by zle or by the test suite's mock (non-special) array. - (( ${+region_highlight} )) || { + (( ${+region_highlight[@]} )) || { echo >&2 'zsh-syntax-highlighting: error: $region_highlight is not defined' echo >&2 'zsh-syntax-highlighting: (Check whether zsh-syntax-highlighting was installed according to the instructions.)' return $ret @@ -155,15 +155,7 @@ _zsh_highlight() # C structs, so that none of the previous case patterns will match. # # In either case, fall back to a version check. - # - # The memo= feature was added to zsh in commit zsh-5.8-172-gdd6e702ee. - # The version number at the time was 5.8.0.2-dev (see Config/version.mk). - # Therefore, on 5.8.0.3 and newer the memo= feature is available. - # - # On zsh version 5.8.0.2 between the aforementioned commit and the - # first Config/version.mk bump after it (which, at the time of writing, - # is yet to come), this condition will false negative. - if is-at-least 5.8.0.3 $ZSH_VERSION.0.0; then + if is-at-least 5.9; then integer -gr zsh_highlight__memo_feature=1 else integer -gr zsh_highlight__memo_feature=0 @@ -219,7 +211,8 @@ _zsh_highlight() [[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret # Do not highlight if there are pending inputs (copy/paste). - [[ $PENDING -gt 0 ]] && return $ret + (( KEYS_QUEUED_COUNT > 0 )) && return $ret + (( PENDING > 0 )) && return $ret { local cache_place @@ -411,10 +404,7 @@ _zsh_highlight_call_widget() # We check this with a plain version number check, since a functional check, # as done by _zsh_highlight, can only be done from inside a widget # function — a catch-22. -# -# See _zsh_highlight for the magic version number. (The use of 5.8.0.2 -# rather than 5.8.0.3 as in the _zsh_highlight is deliberate.) -if is-at-least 5.8.0.2 $ZSH_VERSION.0.0 && _zsh_highlight__function_callable_p add-zle-hook-widget +if is-at-least 5.9 && _zsh_highlight__function_callable_p add-zle-hook-widget then autoload -U add-zle-hook-widget _zsh_highlight__zle-line-finish() {