aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/zsh-fast-syntax-highlighting/:chroma
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell/zsh-fast-syntax-highlighting/:chroma')
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-alias.ch29
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-autoload.ch104
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch22
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-awk.ch108
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-docker.ch90
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-example.ch120
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-fast-theme.ch40
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-fpath_peq.ch61
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-git.ch945
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-grep.ch89
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-hub.ch51
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-ionice.ch117
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-lab.ch59
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-make.ch105
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-nice.ch138
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-nmcli.ch58
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-node.ch37
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-ogit.ch383
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-perl.ch80
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-precommand.ch17
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-printf.ch86
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-ruby.ch81
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-scp.ch87
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-sh.ch72
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-source.ch75
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-ssh.ch156
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-subcommand.ch25
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-subversion.ch252
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-vim.ch51
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-whatis.ch134
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-which.ch96
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-zplugin.ch348
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/main-chroma.ch453
33 files changed, 0 insertions, 4569 deletions
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-alias.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-alias.ch
deleted file mode 100644
index d581341..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-alias.ch
+++ /dev/null
@@ -1,29 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-local __first_call="$1" __wrd="${2%%=*}" __start_pos="$3" __end_pos="$4"
-
-if (( __first_call )) || [[ "$2" = -* ]]; then
- return 1
-else
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- elif (( $+aliases[(e)$__wrd] )) || (( ${+galiases[(e)$__wrd]} )); then
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- elif (( $+functions[(e)$__wrd] )) || (( $+builtins[(e)$__wrd] )) || (( $+commands[(e)$__wrd] )) || (( $reswords[(Ie)$__wrd] )); then
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- else
- return 1
- fi
- if [[ "$__wrd" != "$2" ]]; then
- return 1
- fi
-fi
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autoload.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autoload.ch
deleted file mode 100644
index 78a8924..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autoload.ch
+++ /dev/null
@@ -1,104 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Tracks autoload command - highlights function names if they exist somewhere
-# in $fpath. Also warns that the autoloaded function is already defined.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars
-integer __idx1 __idx2
-local -a __results __deserialized __noshsplit
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-autoload-counter]=0
- FAST_HIGHLIGHT[chroma-autoload-counter-all]=1
- FAST_HIGHLIGHT[chroma-autoload-message]=""
- #FAST_HIGHLIGHT[chroma-autoload-message-shown]=""
- [[ -z ${FAST_HIGHLIGHT[chroma-autoload-message-shown-at]} ]] && FAST_HIGHLIGHT[chroma-autoload-message-shown-at]=0
- FAST_HIGHLIGHT[chroma-autoload-elements]=""
- __style=${FAST_THEME_NAME}command
-
-} || {
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
- (( FAST_HIGHLIGHT[chroma-autoload-counter-all] += 1, __idx2 = FAST_HIGHLIGHT[chroma-autoload-counter-all] ))
-
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if [[ "$__wrd" = [-+]* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-autoload-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-autoload-counter] ))
-
- if [[ $__wrd != (\$|\"\$)* && $__wrd != (/|\"/|\'/)* && $__wrd != \`* ]]; then
- __results=( ${^fpath}/$__wrd(N) )
- __deserialized=( "${(Q@)${(z@)FAST_HIGHLIGHT[chroma-fpath_peq-elements]}}" )
- __results+=( ${^__deserialized}/$__wrd(N) )
- [[ "${#__results}" -gt 0 ]] && {
- __style=${FAST_THEME_NAME}correct-subtle
- __deserialized=( "${(Q@)${(z@)FAST_HIGHLIGHT[chroma-autoload-elements]}}" )
- [[ -z "${__deserialized[1]}" && ${#__deserialized} -eq 1 ]] && __deserialized=()
- # Cannot use ${abc:+"$abc"} trick with ${~...}, so handle most
- # cases of the possible shwordsplit through an additional array
- __noshsplit=( ${~__wrd} )
- __deserialized+=( "${(j: :)__noshsplit}" )
- FAST_HIGHLIGHT[chroma-autoload-elements]="${(j: :)${(q@)__deserialized}}"
- # Make the function defined for big-loop's *main-type mechanism
- __fast_highlight_main__command_type_cache[${(j: :)__noshsplit}]="function"
- } || __style=${FAST_THEME_NAME}incorrect-subtle
- fi
-
- if (( ${+functions[${(Q)__wrd}]} )); then
- FAST_HIGHLIGHT[chroma-autoload-message]+="Warning: Function ${(Q)__wrd} already defined (e.g. loaded)"$'\n'
- fi
- fi
-
- # Display only when processing last autoload argument
- if (( ${#${(z)BUFFER}} == FAST_HIGHLIGHT[chroma-autoload-counter-all] )); then
- # Display only if already shown message differs or when it timeouts
- if [[ ${FAST_HIGHLIGHT[chroma-autoload-message]} != ${FAST_HIGHLIGHT[chroma-autoload-message-shown]} ||
- $(( EPOCHSECONDS - FAST_HIGHLIGHT[chroma-autoload-message-shown-at] )) -gt 7
- ]]; then
- FAST_HIGHLIGHT[chroma-autoload-message-shown]=${FAST_HIGHLIGHT[chroma-autoload-message]}
- FAST_HIGHLIGHT[chroma-autoload-message-shown-at]=$EPOCHSECONDS
- zle -M "${FAST_HIGHLIGHT[chroma-autoload-message]}"
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above code
-# can do it itself and skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
deleted file mode 100644
index 9687db3..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
+++ /dev/null
@@ -1,22 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-
-if (( __first_call )) || [[ "$__wrd" = -* ]]; then
- return 1
-else
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
- if [[ -d "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr/$__wrd" ]] then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- fi
-fi
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-awk.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-awk.ch
deleted file mode 100644
index 47b3ec7..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-awk.ch
+++ /dev/null
@@ -1,108 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars __val __style2
-integer __idx1 __idx2
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-awk-counter]=0
- FAST_HIGHLIGHT[chroma-awk-f-seen]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- [[ "$__wrd" = "-f" ]] && FAST_HIGHLIGHT[chroma-awk-f-seen]=1
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-awk-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-awk-counter] ))
-
- # First non-option token is the pattern (regex), we will
- # highlight it.
- if (( FAST_HIGHLIGHT[chroma-awk-counter] == 1 && FAST_HIGHLIGHT[chroma-awk-f-seen] == 0 )); then
- if print -r -- "${(Q)__wrd}" | gawk --source 'BEGIN { exit } END { exit 0 }' -f - >/dev/null 2>&1; then
- __style2="${FAST_THEME_NAME}subtle-bg"
- else
- __style2="${FAST_THEME_NAME}incorrect-subtle"
- fi
-
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style2]}")
-
- # Highlight keywords
- FSH_LIST=()
- : "${__wrd//(#m)(BEGIN|END|FIELDWIDTHS|RS|ARGC|ARGV|ENVIRON|NF|NR|IGNORECASE|FILENAME|if|then|else|while|toupper|tolower|function|print|sub)/$(( fsh_sy_h_append($MBEGIN, $MEND) ))}";
- for __val in "${FSH_LIST[@]}" ; do
- [[ ${__wrd[${__val%%;;*}]} = [a-zA-Z0-9_] || ${__wrd[${__val##*;;}+1]} = [a-zA-Z0-9_] ]] && continue
- __idx1=$(( __start_pos + ${__val%%;;*} ))
- __idx2=__idx1+${__val##*;;}-${__val%%;;*}+1
- (( __start=__idx1-${#PREBUFFER}, __end=__idx2-${#PREBUFFER}-1, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}reserved-word]},${FAST_HIGHLIGHT_STYLES[$__style2]}")
- done
-
- # Highlight regex characters
- __chars="*+\\)(\{\}[]^"
- __idx1=__start_pos
- __idx2=__start_pos
- while [[ "$__wrd" = (#b)[^$__chars]#([\\][\\])#((+|\*|\[|\]|\)|\(|\^|\}|\{)|[\\](+|\*|\[|\]|\)|\(|\^|\{|\}))(*) ]]; do
- if [[ -n "${match[3]}" ]]; then
- __idx1+=${mbegin[3]}-1
- __idx2=__idx1+${mend[3]}-${mbegin[3]}+1
- (( __start=__idx1-${#PREBUFFER}, __end=__idx2-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathnum]},${FAST_HIGHLIGHT_STYLES[$__style2]}")
- __idx1=__idx2
- else
- __idx1+=${mbegin[5]}-1
- fi
- __wrd="${match[5]}"
- done
- elif (( FAST_HIGHLIGHT[chroma-awk-counter] >= 2 || FAST_HIGHLIGHT[chroma-awk-f-seen] == 1 )); then
- FAST_HIGHLIGHT[chroma-awk-f-seen]=0
- # Handle paths, etc. normally - just pass-through to the big
- # highlighter (the main FSH highlighter, used before chromas).
- return 1
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-docker.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-docker.ch
deleted file mode 100644
index 0a6a3bb..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-docker.ch
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for command `docker'. It verifies command line, by denoting
-# wrong and good arguments by color. Currently implemented: verification of
-# image IDs passed to: docker image rm <ID>.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-local -a __lines_list
-
-(( __first_call )) && {
- # Called for the first time - new command
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables
- FAST_HIGHLIGHT[chroma-docker-counter]=0
- FAST_HIGHLIGHT[chroma-docker-got-subcommand]=0
- FAST_HIGHLIGHT[chroma-docker-subcommand]=""
- FAST_HIGHLIGHT[chrome-docker-got-msg1]=0
- return 1
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* && ${FAST_HIGHLIGHT[chroma-docker-got-subcommand]} -eq 0 ]]; then
- __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
- else
- if (( FAST_HIGHLIGHT[chroma-docker-got-subcommand] == 0 )); then
- FAST_HIGHLIGHT[chroma-docker-got-subcommand]=1
- FAST_HIGHLIGHT[chroma-docker-subcommand]="$__wrd"
- __style=${FAST_THEME_NAME}subcommand
- (( FAST_HIGHLIGHT[chroma-docker-counter] += 1 ))
- else
- __wrd="${__wrd//\`/x}"
- __arg="${__arg//\`/x}"
- __wrd="${(Q)__wrd}"
- if [[ "${FAST_HIGHLIGHT[chroma-docker-subcommand]}" = "image" ]]; then
- [[ "$__wrd" != -* ]] && {
- (( FAST_HIGHLIGHT[chroma-docker-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-docker-counter] ))
-
- if (( __idx1 == 2 )); then
- __style=${FAST_THEME_NAME}subcommand
- elif (( __idx1 == 3 )); then
- -fast-run-command "docker images -q" chroma-docker-list ""
- [[ -n "${__lines_list[(r)$__wrd]}" ]] && {
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- } || {
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- }
- fi
- } || __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
- else
- return 1
- fi
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array)
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-example.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-example.ch
deleted file mode 100644
index 8814922..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-example.ch
+++ /dev/null
@@ -1,120 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Example chroma function. It colorizes first two arguments as `builtin' style,
-# third and following arguments as `globbing' style. First two arguments may
-# be "strings", they will be passed through to normal higlighter (by returning 1).
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-#
-# Overall functioning is: when command "example" is occured, this function
-# is called with $1 == 1, it ("example") is the first token ($2), then for any
-# following token, this function is called with $1 == 0, until end of command
-# is occured (i.e. till enter is pressed or ";" is put into source, or the
-# command line simply ends).
-#
-# Other tips are:
-# - $CURSOR holds cursor position
-# - $BUFFER holds whole command line buffer
-# - $LBUFFER holds command line buffer that is left from the cursor, i.e. it's a
-# BUFFER substring 1 .. $CURSOR
-# - $RBUFFER is the same as LBUFFER but holds part of BUFFER right to the cursor
-#
-# The function receives $BUFFER but via sequence of tokens, which are shell words,
-# e.g. "a b c" is a shell word, while a b c are 3 shell words.
-#
-# FAST_HIGHLIGHT is a friendly hash array which allows to store strings without
-# creating global parameters (variables). If you need hash, just use it first
-# declaring, under some distinct name like: typeset -gA CHROMA_EXPLE_DICT.
-# Remember to reset the hash and others at __first_call == 1, so that you have
-# a fresh state for new command.
-
-# Keep chroma-takever state meaning: until ;, handle highlighting via chroma.
-# So the below 8192 assignment takes care that next token will be routed to chroma.
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global string variables.
- FAST_HIGHLIGHT[chroma-example-counter]=0
-
- # Set style for region_highlight entry. It is used below in
- # '[[ -n "$__style" ]] ...' line, which adds highlight entry,
- # like "10 12 fg=green", through `reply' array.
- #
- # Could check if command `example' exists and set `unknown-token'
- # style instead of `command'
- __style=${FAST_THEME_NAME}command
-
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- else
- # Count non-option tokens
- (( FAST_HIGHLIGHT[chroma-example-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-example-counter] ))
-
- # Colorize 1..2 as builtin, 3.. as glob
- if (( FAST_HIGHLIGHT[chroma-example-counter] <= 2 )); then
- if [[ "$__wrd" = \"* ]]; then
- # Pass through, fsh main code will do the highlight!
- return 1
- else
- __style=${FAST_THEME_NAME}builtin
- fi
- else
- __style=${FAST_THEME_NAME}globbing
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-# If 1 will be added to __start_pos, this will highlight "oken".
-# If 1 will be subtracted from __end_pos, this will highlight "toke".
-# $PREBUFFER is for specific situations when users does command \<ENTER>
-# i.e. when multi-line command using backslash is entered.
-#
-# This is a common place of adding such entry, but any above code can do
-# it itself (and it does in other chromas) and skip setting __style to
-# this way disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves.
-# _start_pos=$_end_pos advainces pointers in command line buffer.
-#
-# To pass through means to `return 1'. The highlighting of
-# this single token is then done by fast-syntax-highlighting's
-# main code and chroma doesn't have to do anything.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fast-theme.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fast-theme.ch
deleted file mode 100644
index 15bc210..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fast-theme.ch
+++ /dev/null
@@ -1,40 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-local __first_call="$1" __wrd="${(Q)2}" __start_pos="$3" __end_pos="$4"
-local __style
-
-if (( __first_call )); then
- FAST_HIGHLIGHT[chroma-fast-theme-first]=0
- return 1
-elif (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-elif (( ${FAST_HIGHLIGHT[chroma-fast-theme-first]} )) || [[ $__wrd = -* ]]; then
- return 1
-else
- FAST_HIGHLIGHT[chroma-fast-theme-first]=1
-fi
-
-if [[ "$__wrd" = */* || "$__wrd" = (XDG|LOCAL|HOME|OPT):* ]]; then
- __wrd="${${__wrd/(#s)XDG:/${${XDG_CONFIG_HOME:-$HOME/.config}%/}/fsh/}%.ini}.ini"
- __wrd="${${__wrd/(#s)LOCAL://usr/local/share/fsh/}%.ini}.ini"
- __wrd="${${__wrd/(#s)HOME:/$HOME/.fsh/}%.ini}.ini"
- __wrd="${${__wrd/(#s)OPT://opt/local/share/fsh/}%.ini}.ini"
- __wrd=${~__wrd} # allow user to quote ~
-else
- __wrd="$FAST_BASE_DIR/themes/$__wrd.ini"
-fi
-
-if [[ -f $__wrd ]]; then
- __style=${FAST_THEME_NAME}path
-else
- __style=${FAST_THEME_NAME}incorrect-subtle
-fi
-
-(( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fpath_peq.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fpath_peq.ch
deleted file mode 100644
index 072cee3..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-fpath_peq.ch
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# This chroma does a narrow, obscure but prestigious parsing of fpath+=( elem1
-# elem2 ... ) construct to provide *the* *future* contents of $fpath to
-# -autoload.ch, so that it can detect functions in those provided directories
-# `elem1', `elem2', etc. and highlight the functions with `correct-subtle'
-# instead of `incorrect-subtle'. Basically all thit is for command-lines like:
-#
-# % fpath+=( `pwd` ); autoload my-fun-from-PWD
-
-# Keep chroma-takever state meaning: until ; or similar (see $__arg_type below)
-# The 8192 sum takes care that the next token will be routed to this chroma
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local -a deserialized
-
-(( __first_call )) && {
- case $__wrd in
- (fpath=\()
- FAST_HIGHLIGHT[fpath_peq_mode]=1
- ;;
- (fpath+=\()
- FAST_HIGHLIGHT[fpath_peq_mode]=2
- ;;
- (FPATH=)
- FAST_HIGHLIGHT[fpath_peq_mode]=4
- ;;
- (FPATH+=)
- FAST_HIGHLIGHT[fpath_peq_mode]=8
- ;;
- esac
- if (( FAST_HIGHLIGHT[fpath_peq_mode] & 5 )); then
- FAST_HIGHLIGHT[chroma-fpath_peq-elements]="! ${FAST_HIGHLIGHT[chroma-fpath_peq-elements]}"
- fi
- return 1
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- [[ "$__wrd" != ")" ]] && {
- deserialized=( "${(Q@)${(z@)FAST_HIGHLIGHT[chroma-fpath_peq-elements]}}" )
- [[ -z "${deserialized[1]}" && ${#deserialized} -eq 1 ]] && deserialized=()
- # Support ~ and $VAR, for [a-zA-Z_][a-ZA-Z0-9_]# characters in "VAR"
- deserialized+=( "${(Q)${${(j: :)__wrd}//(#b)((\$([0-9]##|[a-zA-Z_][a-zA-Z0-9_]#))|(\$\{([0-9]##|[a-zA-Z_][a-zA-Z0-9_]#)\})|(#s)~)/${(P)${${${${match[1]##\$\{(#c0,1)}%\}}:#\~}:-HOME}}}}" )
- FAST_HIGHLIGHT[chroma-fpath_peq-elements]="${(j: :)${(q@)deserialized}}"
- }
-
- return 1
-}
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-git.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-git.ch
deleted file mode 100644
index bf5fbe5..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-git.ch
+++ /dev/null
@@ -1,945 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for command `git'. It colorizes the part of command
-# line that holds `git' invocation.
-
-(( FAST_HIGHLIGHT[-git.ch-chroma-def] )) && return 1
-
-FAST_HIGHLIGHT[-git.ch-chroma-def]=1
-
-typeset -gA fsh__git__chroma__def
-fsh__git__chroma__def=(
- ##
- ## No subcommand
- ##
- ## {{{
-
- subcmd:NULL "NULL_0_opt"
- NULL_0_opt "(-C|--exec-path=|--git-dir=|--work-tree=|--namespace=|--super-prefix=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || -c
- <<>> __style=\${FAST_THEME_NAME}single-hyphen-option // NO-OP
- <<>> __style=\${FAST_THEME_NAME}optarg-string // NO-OP
- || (--version|--help|--html-path|--man-path|--info-path|-p|--paginate|
- -P|--no-pager|--no-replace-objects|--bare)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
-
- "subcommands" ":::chroma/-git-get-subcommands" # run a function (the :: causes this) and use `reply'
- #"subcommands" "(fetch|pull)" # run a function (the :: causes this) and use `reply'
-
- "subcmd-hook" ":chroma/-git-check-if-alias"
-
- ## }}}
-
- ##
- ## `FETCH'
- ##
- ## {{{
-
- subcmd:fetch "FETCH_MULTIPLE_0_opt^ // FETCH_ALL_0_opt^ // FETCH_0_opt //
- REMOTE_GR_1_arg // REF_#_arg // NO_MATCH_#_opt"
-
- # Special options (^ - has directives, currently - an :add and :del directive)
- "FETCH_MULTIPLE_0_opt^" "
- --multiple
- <<>> __style=\${FAST_THEME_NAME}double-hyphen-option // NO-OP
- || --multiple:add
- <<>> REMOTE_GR_#_arg
- || --multiple:del
- <<>> REMOTE_GR_1_arg // REF_#_arg" # when --multiple is passed, then
- # there is no refspec argument, only remotes-ids
- # follow unlimited # of them, hence the # in the
- # REMOTE_GR_#_arg
-
- # Special options (^ - has directives - an :del-directive)
- "FETCH_ALL_0_opt^" "
- --all
- <<>> __style=\${FAST_THEME_NAME}double-hyphen-option // NO-OP
- || --all:del
- <<>> REMOTE_GR_1_arg // REF_#_arg" # --all can be only followed by options
-
- # FETCH_0_opt. FETCH-options (FETCH is an identifier) at position 0 ->
- # -> before any argument
- FETCH_0_opt "
- (--depth=|--deepen=|--shallow-exclude=|--shallow-since=|--receive-pack=|
- --refmap=|--recurse-submodules=|-j|--jobs=|--submodule-prefix=|
- --recurse-submodules-default=|-o|--server-option=|--upload-pack|
- --negotiation-tip=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (--help|--all|-a|--append|--unshallow|--update-shallow|--dry-run|-f|--force|
- -k|--keep|--multiple|-p|--prune|-n|--no-tags|-t|--tags|--no-recurse-submodules|
- -u|--update-head-ok|-q|--quiet|-v|--verbose|--progress|
- -4|--ipv4|-6|--ipv6)
- <<>> __style=\${FAST_THEME_NAME}single-hyphen-option // NO-OP"
- # Above: note the two <<>>-separated blocks for options that have
- # some arguments – the second pair of action/handler is being
- # run when an option argument is occurred (first one: the option
- # itself). If there is only one <<>>-separated block, then the option
- # is set to be argument-less. The argument is a) -o/--option argument
- # and b) -o/--option=argument.
-
- REMOTE_GR_1_arg "NO-OP // :::chroma/-git-verify-remote-or-group" # This definition is generic, reused later
- "REF_#_arg" "NO-OP // :::chroma/-git-verify-ref" # This too
- "REMOTE_GR_#_arg" "NO-OP // :::chroma/-git-verify-remote-or-group" # and this too
- # The hash `#' above denotes: an argument at any position
- # It will nicely match any following (above the first explicitly
- # numbered ones) arguments passed when using --multiple
-
- # A generic action
- NO_MATCH_\#_opt "* <<>> __style=\${FAST_THEME_NAME}incorrect-subtle // NO-OP"
- NO_MATCH_\#_arg "__style=\${FAST_THEME_NAME}incorrect-subtle // NO-OP"
-
- ## }}}
-
- ##
- ## PUSH
- ##
- ## {{{
-
- subcmd:push "PUSH_0_opt // REMOTE_1_arg // REF_#_arg // NO_MATCH_#_opt"
-
- PUSH_0_opt "
- (--receive-pack=|--exec=|--repo=|--push-option=|--signed=|
- --force-with-lease=|--signed=|--recurse-submodules=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (--help|--all|--mirror|--tags|--follow-tags|--atomic|-n|--dry-run|
- --porcelain|--delete|--tags|--follow-tags|--signed|--no-signed|
- --atomic|--no-atomic|-o|--push-option|--force-with-lease|
- --no-force-with-lease|-f|--force|-u|--set-upstream|--thin|
- --no-thin|-q|--quiet|-v|--verbose|--progress|--no-recurse-submodules|
- --verify|--no-verify|-4|--ipv4|-6|--ipv6)
- <<>> __style=\${FAST_THEME_NAME}single-hyphen-option // NO-OP"
-
- REMOTE_1_arg "NO-OP // :::chroma/-git-verify-remote" # This definition is generic, reused later
-
- ### }}}
-
- ##
- ## PULL
- ##
- ## {{{
-
- subcmd:pull "PULL_0_opt // REMOTE_1_arg // REF_#_arg // NO_MATCH_#_opt"
-
- PULL_0_opt "
- (--recurse-submodules=|-S|--gpg-sign=|--log=|-s|--strategy=|-X|
- --strategy-option=|--rebase=|--depth=|--deepen=|--shallow-exclude=|
- --shallow-since=|--negotiation-tip|--upload-pack|-o|--server-option=|
- --no-recurse-submodules=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (--help|-q|--quiet|-v|--verbose|--progress|--no-recurse-submodules|
- --commit|--no-commit|--edit|--no-edit|--ff|--no-ff|--ff-only|
- --log|--no-log|--signoff|--no-signoff|--stat|-n|--no-stat|--squash|
- --no-squash|--verify-signatures|--no-verify-signatures|--summary|
- --no-summary|--allow-unrelated-histories|-r|--rebase|--no-rebase|
- --autostash|--no-autostash|--all|-a|--append|--unshallow|
- --update-shallow|-f|--force|-k|--keep|--no-tags|-u|--update-head-ok|
- --progress|-4|--ipv4|-6|--ipv6|--recurse-submodules)
- <<>> __style=\${FAST_THEME_NAME}single-hyphen-option // NO-OP"
-
- ## }}}
-
- ##
- ## COMMIT
- ##
- ## {{{
-
- subcmd:commit "COMMIT_#_opt // FILE_#_arg // NO_MATCH_#_opt"
-
- "COMMIT_#_opt" "
- (-m|--message=|-am)
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-action
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-ARG-action
- || (--help|-a|--all|-p|--patch|--reset-author|--short|--branch|
- --porcelain|--long|-z|--null|-s|--signoff|-n|--no-verify|
- --allow-empty|--allow-empty-message|-e|--edit|--no-edit|
- --amend|--no-post-rewrite|-i|--include|-o|--only|--untracked-files|
- -v|--verbose|-q|--quiet|--dry-run|--status|--no-status|--no-gpg-sign)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (-C|--reuse-message=|-c|--reedit-message=|--fixup=|--squash=|
- -F|--file=|--author=|--date=|-t|--template=|--cleanup=|
- -u|--untracked-files=|-S|--gpg-sign=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action"
-
- # A generic action
- "FILE_#_arg" "NO-OP // :::chroma/-git-verify-file"
-
- ## }}}
-
- ##
- ## MERGE
- ##
- ## {{{
-
- subcmd:merge "MERGE_0_opt // COMMIT_#_arg"
- MERGE_0_opt
- "(-m)
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-action
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-ARG-action
- (-S|--gpg-sign=|--log=|-e|--strategy=|-X|--strategy-option=|-F|
- --file)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (--help|--commit|--no-commit|-e|--edit|--no-edit|--ff|--no-ff|--ff-only|
- --log|--no-log|--signoff|--no-signoff|-n|--stat|--no-stat|--squash|
- --no-squash|--verify-signatures|--no-verify-signatures|--summary|
- --no-summary|-q|--quiet|-v|--verbose|--progress|--no-progress|
- --allow-unrelated-histories|--rerere-autoupdate|--no-rerere-autoupdate|
- --abort|--continue)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
- COMMIT_\#_arg "NO-OP // :::chroma/-git-verify-commit"
-
- ## }}}
-
- ##
- ## RESET
- ##
- ## {{{
-
- subcmd:reset "RESET_0_opt^ // RESET_0_opt // RESET_#_arg // NO_MATCH_#_opt"
- "RESET_0_opt^" "
- (--soft|--mixed|--hard|--merge|--keep)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (--soft|--mixed|--hard|--merge|--keep):del
- <<>> RESET_0_opt // RESET_#_arg
- || (--soft|--mixed|--hard|--merge|--keep):add
- <<>> RESET_1_arg // NO_MATCH_#_arg
- "
-
- RESET_0_opt "
- (-q|-p|--patch)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- RESET_1_arg "NO-OP // :::chroma/-git-verify-commit"
-
- "RESET_#_arg" "NO-OP // :::chroma/-git-RESET-verify-commit-or-file"
-
-
- ## }}}
-
- ##
- ## REVERT
- ##
- ## {{{
-
- subcmd:revert "REVERT_SEQUENCER_0_opt^ // REVERT_0_opt // REVERT_#_arg // NO_MATCH_#_opt"
- REVERT_0_opt "
- (-m|--mainline|-S|--gpg-sign=|--strategy=|-X|--strategy-option=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (-e|--edit|--no-edit|-n|--no-commit|-s|--signoff)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- "REVERT_SEQUENCER_0_opt^" "
- (--continue|--quit|--abort)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (--continue|--quit|--abort):del
- <<>> REVERT_0_opt // REVERT_#_arg
- || (--continue|--quit|--abort):add
- <<>> NO_MATCH_#_arg"
-
- "REVERT_#_arg" "NO-OP // :::chroma/-git-verify-commit"
-
- ## }}}
-
- ##
- ## DIFF
- ##
- ## TODO: When a second argument is also a path and it points to a directory, then
- ## git appends the previous file name to it – good to implement this too
- ## {{{
-
- subcmd:diff "DIFF_NO_INDEX_0_opt^ // DIFF_0_opt // COMMIT_FILE_DIR_#_arg // NO_MATCH_#_opt"
-
- "DIFF_NO_INDEX_0_opt^" "
- --no-index
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || --no-index:del
- <<>> COMMIT_FILE_DIR_#_arg
- || --no-index:add
- <<>> FILE_1_arg // FILE_2_arg // NO_MATCH_#_arg"
- DIFF_0_opt "
- (-U|--unified=|--anchored=|--diff-algorithm=|--stat=|--dirstat|
- --submodule=|--color=|--color-moved=|--color-moved-ws=|--word-diff=|
- --word-diff-regex=|--color-words=|--ws-error-highlight=|--abbrev=|
- -B|--break-rewrites=|-M|--find-renames=|-C|--find-copies=|-l|
- --diff-filter=|-S|-G|--find-object=|--relative=|-O|--relative=|
- --inter-hunk-context=|--ignore-submodules=|--src-prefix=|--dst-prefix=|
- --line-prefix=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (-p|--patch|-u|-s|--no-patch|--raw|--patch-with-raw|--indent-heuristic|
- --no-indent-heuristic|--minimal|--patience|--histogram|--stat|
- --compact-summary|--numstat|--shortstat|--dirstat|--summary|
- --patch-with-stat|-z|--name-only|--name-status|--submodule|--no-color|
- --color-moved|--word-diff|--color-words|--no-renames|--check|
- --full-index|--binary|--abbrev|--break-rewrites|--find-renames|
- --find-copies|--find-copies-harder|-D|--pickaxe-all|--pickaxe-regex|
- --irreversible-delete|-R|--relative|-a|--text|--ignore-cr-at-eol|
- --ignore-space-at-eol|-b|--ignore-space-change|-w|--ignore-all-space|
- --ignore-blank-lines|-W|--function-context|--exit-code|--quiet|
- --ext-diff|--no-ext-diff|--textconv|--no-textconv|--ignore-submodules|
- --no-prefix|--ita-invisible-in-index|-1|--base|-2|--ours|-3|--theirs|
- -0|--cached)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- # A generic action
- "COMMIT_FILE_DIR_#_arg" "NO-OP // :::chroma/-git-verify-commit-or-file-or-dir"
-
- # A generic action
- "FILE_1_arg" "NO-OP // :::chroma/-git-verify-file"
-
- # A generic action
- "FILE_2_arg" "NO-OP // :::chroma/-git-verify-file"
-
- ## }}}
-
- ##
- ## ADD
- ##
- ## {{{
-
- subcmd:add "ADD_0_opt // FILE_OR_DIR_#_arg // NO_MATCH_#_opt"
-
- ADD_0_opt "
- --chmod=
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (-v|--verbose|-f|--force|-i|--interactive|-n|--dry-run|
- -p|--patch|-e|--edit|--all|--no-all|-A|--all|--no-all|
- --ignore-removal|--no-ignore-removal|-u|--update|-N|
- --intent-to-add|--refresh|--ignore-errors|--ignore-missing|
- --renormalize|--no-warn-embedded-repo)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- FILE_OR_DIR_#_arg "NO-OP // :::chroma/-git-verify-file-or-dir"
-
- ## }}}
-
- ##
- ## CHECKOUT
- ##
- ## {{{
-
- subcmd:checkout "CHECKOUT_BRANCH_0_opt^ //
- CHECKOUT_0_opt // FILE_OR_DIR_OR_BRANCH_OR_COMMIT_1_arg // FILE_#_arg //
- FILE_#_arg // NO_MATCH_#_opt"
-
- "CHECKOUT_BRANCH_0_opt^" "
- (-b|-B|--orphan)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (-b|-B|--orphan):del
- <<>> FILE_OR_DIR_OR_BRANCH_OR_COMMIT_1_arg // FILE_#_arg // FILE_#_arg
- || (-b|-B|--orphan):add
- <<>> NEW_BRANCH_1_arg // COMMIT_2_arg // NO_MATCH_#_arg"
-
- NEW_BRANCH_1_arg "NO-OP // :::chroma/-git-verify-correct-branch-name"
-
- COMMIT_2_arg "NO-OP // :::chroma/-git-verify-commit"
-
- CHECKOUT_0_opt "
- --conflict=
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (-q|--quiet|--progress|--no-progress|-f|--force|--ours|--theirs|
- -b|-B|-t|--track|--no-track|-l|--detach|--orphan|
- --ignore-skip-worktree-bits|-m|--merge|-p|--patch|
- --ignore-other-worktrees|--no-ignore-other-worktrees)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- # A generic action
- COMMIT_1_arg "NO-OP // :::chroma/-git-verify-commit"
-
- # Unused
- FILE_OR_BRANCH_OR_COMMIT_1_arg "NO-OP // :::chroma/-git-file-or-ubranch-or-commit-verify"
- FILE_OR_DIR_OR_BRANCH_OR_COMMIT_1_arg "NO-OP // :::chroma/-git-file-or-dir-or-ubranch-or-commit-verify"
-
- ## }}}
-
- ##
- ## REMOTE
- ##
- ## {{{
-
- subcmd:remote "REMOTE_0_opt // REMOTE_ADD_1_arg // REMOTE_RENAME_1_arg // REMOTE_REMOVE_1_arg //
- REMOTE_SET_HEAD_1_arg // REMOTE_SET_BRANCHES_1_arg //
- REMOTE_GET_URL_1_arg // REMOTE_SET_URL_1_arg // REMOTE_SHOW_1_arg //
- REMOTE_PRUNE_1_arg // REMOTE_UPDATE_1_arg"
-
- REMOTE_0_opt "(-v|--verbose)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_ADD_1_arg "add ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_ADD_OPTS_1_opt // REMOTE_A_NAME_2_arg //
- REMOTE_A_URL_3_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_RENAME_1_arg "rename ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_2_arg // REMOTE_A_NAME_3_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_REMOVE_1_arg "remove ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_2_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_SET_HEAD_1_arg "set-head ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_2_arg // BRANCH_3_arg //
- REMOTE_SET_HEAD_OPTS_1_opt // REMOTE_SET_HEAD_OPTS_2_opt //
- NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_SET_BRANCHES_1_arg "set-branches ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_SET_BRANCHES_OPTS_1_opt // REMOTE_2_arg //
- BRANCH_#_arg // NO_MATCH_#_opt"
-
- REMOTE_GET_URL_1_arg "get-url ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_GET_URL_OPTS_1_opt // REMOTE_2_arg //
- NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_SET_URL_1_arg "set-url ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_SET_URL_OPTS_1_opt^ //
- REMOTE_2_arg // REMOTE_A_URL_3_arg // REMOTE_A_URL_4_arg //
- NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- REMOTE_SHOW_1_arg "show ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_SHOW_OPTS_1_opt // REMOTE_#_arg // NO_MATCH_#_opt"
-
- REMOTE_PRUNE_1_arg "prune ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_PRUNE_OPTS_1_opt // REMOTE_#_arg // NO_MATCH_#_opt"
-
- REMOTE_UPDATE_1_arg "update ::::: __style=${FAST_THEME_NAME}subcommand // NO-OP <<>>
- add:REMOTE_UPDATE_OPTS_1_opt // REMOTE_GR_#_arg // NO_MATCH_#_opt"
-
- REMOTE_ADD_OPTS_1_opt "
- (-t|-m|--mirror=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (-f|--tags|--no-tags)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_SET_HEAD_OPTS_1_opt "
- (-a|--auto|-d|--delete)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_SET_HEAD_OPTS_2_opt "
- (-a|--auto|-d|--delete)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_SET_BRANCHES_OPTS_1_opt "
- --add
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_GET_URL_OPTS_1_opt "
- (--push|--all)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- "REMOTE_SET_URL_OPTS_1_opt^" "
- --push|--add|--delete
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (--add|--delete):del
- <<>> REMOTE_A_URL_4_arg"
-
- REMOTE_SHOW_OPTS_1_opt "
- -n
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_PRUNE_OPTS_1_opt "
- (-n|--dry-run)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_UPDATE_OPTS_1_opt "
- (-p|--prune)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- REMOTE_A_NAME_2_arg "NO-OP // :::chroma/-git-verify-correct-branch-name"
- REMOTE_A_NAME_3_arg "NO-OP // :::chroma/-git-verify-correct-branch-name"
- REMOTE_A_URL_3_arg "NO-OP // :::chroma/main-chroma-std-verify-url"
- REMOTE_A_URL_4_arg "NO-OP // :::chroma/main-chroma-std-verify-url"
- BRANCH_3_arg "NO-OP // :::chroma/-git-verify-branch"
- BRANCH_\#_arg "NO-OP // :::chroma/-git-verify-branch"
- REMOTE_2_arg "NO-OP // :::chroma/-git-verify-remote"
- REMOTE_\#_arg "NO-OP // :::chroma/-git-verify-remote"
-
- ## }}}
-
- ##
- ## LOG
- ##
-
- subcmd:log "LOG_0_opt // LOG_1_arg // FILE_#_arg // NO_MATCH_#_opt"
-
- LOG_0_opt "
- (--decorate=|--decorate-refs=|--decorate-refs-exclude=|-L|-n|--max-count=|
- --skip=|--since=|--after=|--until=|--before=|--author=|--committer=|
- --grep-reflog=|--grep=|--min-parents=|--max-parents=|--branches=|--tags=|
- --remotes=|--glob=|--exclude=|--no-walk=|--pretty=|--format=|--encoding=|
- --expand-tabs=|--notes=|--show-notes=|--date=|--show-linear-break=|-U|
- --unified=|--anchored=|--diff-algorithm=|--stat=|--dirstat=|--submodule=|
- --color=|--color-moved=|--color-moved-ws=|--word-diff=|--word-diff-regex=|
- --color-words=|--ws-error-highlight=|--abbrev=|-B|--break-rewrites=|-M|
- --find-renames=|-C|--find-copies=|-l|--diff-filter=|-S|-G|--find-object=|
- --relative=|-O|--relative=|--inter-hunk-context=|--ignore-submodules=|
- --src-prefix=|--dst-prefix=|--line-prefix=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
-
- || (--follow|--decorate|--no-decorate|--source|--use-mailmap|--full-diff|
- --log-size|--all-match|--invert-grep|-i|--regexp-ignore-case|--basic-regexp|
- -E|--extended-regexp|-F|--fixed-strings|-P|--perl-regexp|--remove-empty|
- --merges|--no-merges|--no-min-parents|--no-max-parents|--first-parent|
- --not|--all|--branches|--tags|--remotes|--reflog|--single-worktree|
- --ignore-missing|--bisect|--stdin|--cherry-mark|--cherry-pick|--left-only|
- --right-only|--cherry|-g|--walk-reflogs|--merge|--boundary|--simplify-by-decoration|
- --full-history|--dense|--sparse|--simplify-merges|--ancestry-path|--date-order|
- --author-date-order|--topo-order|--reverse|--no-walk|--do-walk|--pretty|
- --abbrev-commit|--no-abbrev-commit|--oneline|--expand-tabs|--no-expand-tabs|
- --notes|--no-notes|--show-notes|--no-standard-notes|--show-signature|
- --relative-date|--parents|--children|--left-right|--graph|--show-linear-break|
- -c|--cc|-m|-r|-t|-p|-u|--patch|-s|--no-patch|--raw|--patch-with-raw|
- --indent-heuristic|--no-indent-heuristic|--minimal|--patience|--histogram|
- --stat|--compact-summary|--numstat|--shortstat|--dirstat|--summary|
- --patch-with-stat|-z|--name-only|--name-status|--submodule|--color|--no-color|
- --color-moved|--word-diff|--color-words|--no-renames|--check|--full-index|
- --binary|--abbrev|--break-rewrites|--find-renames|
- --find-copies|--find-copies-harder|-D|--irreversible-delete|
- --pickaxe-all|--pickaxe-regex|-R|--relative|-a|--text|--ignore-cr-at-eol|
- --ignore-space-at-eol|-b|--ignore-space-change|-w|--ignore-all-space|
- --ignore-blank-lines|-W|--function-context|--ext-diff|--no-ext-diff|
- --textconv|--no-textconv|--ignore-submodules|--no-prefix|
- --ita-invisible-in-index)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- LOG_1_arg "NO-OP // :::chroma/-git-verify-rev-range-or-file"
-
- ##
- ## TAG
- ##
-
- subcmd:tag "TAG_D_0_opt^ // TAG_L_0_opt^ // TAG_V_0_opt^ // TAG_0_opt^"
-
- "TAG_0_opt^" "
- (-u|--local-user=|--cleanup=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || -m
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-action
- <<>> NO-OP // :::chroma/-git-commit-msg-opt-ARG-action
- || (-F|--file)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/-git-verify-file
- || (-a|--annotate|-s|--sign|-f|-e|--edit)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || (-u|--local-user=|--cleanup=|-m|-F|--file|-a|--annotate|-s|--sign|
- -f|-e|--edit):add
- <<>> TAG_NEW_1_arg // COMMIT_2_arg // NO_MATCH_#_arg //
- NO_MATCH_#_opt"
-
- TAG_NEW_1_arg "NO-OP // :::chroma/-git-verify-correct-branch-name"
-
- TAG_1_arg "NO-OP // :::chroma/-git-verify-tag-name"
-
- "TAG_D_0_opt^" "
- (-d)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || -d:add
- <<>> TAG_#_arg // NO_MATCH_#_opt
- || -d:del
- <<>> TAG_0_opt // TAG_NEW_1_arg // COMMIT_2_arg"
-
- "TAG_#_arg" "NO-OP // :::chroma/-git-verify-tag-name"
-
- "TAG_L_0_opt^" "
- (-l)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || -l:add
- <<>> TAG_L_0_opt // TAG_PAT_#_arg // NO_MATCH_#_opt
- || -l:del
- <<>> TAG_0_opt // TAG_NEW_1_arg // COMMIT_2_arg"
-
- "TAG_L_0_opt" "
- (-n|--contains|--no-contains|--points-at|--column=|--sort=|--format=|
- --color=)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action
- || (--column|--no-column|--create-reflog|--merged|--no-merged|--color|-i)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- "TAG_PAT_#_arg" "NO-OP // :::chroma/main-chroma-std-verify-pattern"
-
- "TAG_V_0_opt^" "
- (-v)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- || -v:add
- <<>> TAG_V_0_opt // TAG_#_arg // NO_MATCH_#_opt
- || -v:del
- <<>> TAG_0_opt // TAG_NEW_1_arg // COMMIT_2_arg"
-
- "TAG_V_0_opt" "
- --format=
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-ARG-action"
-
- ##
- ## All remaining subcommands
- ##
- ## {{{
-
- "subcmd:*" "CATCH_ALL_#_opt"
- "CATCH_ALL_#_opt" "* <<>> NO-OP // :::chroma/main-chroma-std-aopt-SEMI-action"
-
- ## }}}
-)
-
-# Called after entering just "git" on the command line
-:chroma/-git-first-call() {
- # Called for the first time - new command
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables
- FAST_HIGHLIGHT[chroma-git-counter]=0
- FAST_HIGHLIGHT[chroma-git-got-subcommand]=0
- FAST_HIGHLIGHT[chroma-git-subcommand]=""
- FAST_HIGHLIGHT[chrome-git-got-msg1]=0
- FAST_HIGHLIGHT[chrome-git-got-anymsg]=0
- FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]=0
- FAST_HIGHLIGHT[chroma-git-checkout-new]=0
- FAST_HIGHLIGHT[chroma-git-fetch-multiple]=0
- FAST_HIGHLIGHT[chroma-git-branch-change]=0
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=0
- FAST_HIGHLIGHT[chroma-git-reset-etc-saw-commit]=0
- FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file]=0
- return 1
-}
-
-:chroma/-git-check-if-alias() {
- local _wrd="$1"
- local -a _result
-
- typeset -ga fsh__chroma__git__aliases
- _result=( ${(M)fsh__chroma__git__aliases[@]:#${_wrd}[[:space:]]##*} )
- :chroma/main-chroma-print "Got is-alias-_result: $_result"
- [[ -n "$_result" ]] && \
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]="${${${_result#* }## ##}%% *}"
-}
-
-# A hook that returns the list of git's
-# available subcommands in $reply
-:chroma/-git-get-subcommands() {
- local __svalue
- integer __ivalue
- LANG=C -fast-run-command "git help -a" chroma-${FAST_HIGHLIGHT[chroma-current]}-subcmd-list "" $(( 15 * 60 ))
- if [[ "${__lines_list[1]}" = See* ]]; then
- # (**)
- # git >= v2.20, the aliases in the `git help -a' command
- __lines_list=( ${${${${(M)__lines_list[@]:#([[:space:]](#c3,3)[a-zA-Z0-9_]*|Command aliases)}##[[:space:]]##}//(#s)Command\ aliases(#e)/Command_aliases}} )
- __svalue="+${__lines_list[(I)Command_aliases]}"
- __lines_list[1,__svalue-1]=( ${(@)__lines_list[1,__svalue-1]%%[[:space:]]##*} )
- else
- # (**)
- # git < v2.20, add aliases through extra code
- __lines_list=( ${(s: :)${(M)__lines_list[@]:# [a-z]*}} )
-
- __svalue=${#__lines_list}
- # This allows to check if the command is an alias - we want to
- # highlight the aliased command just like the target command of
- # the alias
- -fast-run-command "+git config --get-regexp 'alias.*'" chroma-${FAST_HIGHLIGHT[chroma-current]}-alias-list "[[:space:]]#alias." $(( 15 * 60 ))
- fi
-
- __tmp=${#__lines_list}
- typeset -ga fsh__chroma__git__aliases
- fsh__chroma__git__aliases=( ${__lines_list[__svalue+1,__tmp]} )
- [[ ${__lines_list[__svalue]} != "Command_aliases" ]] && (( ++ __svalue, __ivalue=0, 1 )) || (( __ivalue=1 ))
- __lines_list[__svalue,__tmp]=( ${(@)__lines_list[__svalue+__ivalue,__tmp]%%[[:space:]]##*} )
- reply=( "${__lines_list[@]}" )
-}
-
-# A generic handler
-:chroma/-git-verify-remote() {
- local _wrd="$4"
- -fast-run-git-command "git remote" "chroma-git-remotes-$PWD" "" $(( 2 * 60 ))
- [[ -n ${__lines_list[(r)$_wrd]} ]] && {
- __style=${FAST_THEME_NAME}correct-subtle; return 0
- } || {
- [[ $_wrd != *:* ]] && { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
- }
-}
-
-# A generic handler - checks if given ref is correct
-:chroma/-git-verify-ref() {
- local _wrd="$4"
- _wrd="${_wrd%%:*}"
- -fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-refs-$PWD" "refs/heads" $(( 2 * 60 ))
- [[ -n ${__lines_list[(r)$_wrd]} ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
-}
-
-# A generic handler - checks if given remote or group is correct
-:chroma/-git-verify-remote-or-group() {
- :chroma/-git-verify-remote "$@" && return 0
- # The check for a group is to follow below
- integer _start="$2" _end="$3"
- local _scmd="$1" _wrd="$4"
-}
-
-# A generic handler - checks whether the file exists
-:chroma/-git-verify-file() {
- integer _start="$2" _end="$3" __pos __start __end
- local _wrd="$4" bg
-
- [[ -f $_wrd ]] && {
- (( __start=_start, __end=_end, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- bg=${(M)FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]%bg=*}
- ((1))
- } || {
- (( __start=_start, __end=_end, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- bg=${(M)FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]%bg=*}
- }
-
- [[ -n ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} && \
- ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path]} != \
- ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}
- ]] && \
- for (( __pos = 1; __pos <= (_end-_start); __pos++ )) {
- [[ ${_wrd[__pos]} == "/" ]] && {
- [[ ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} = *bg=* ]] && {
- (( __start=_start+__pos-__PBUFLEN, __start >= 0 )) && \
- reply+=("$(( __start - 1 )) $__start ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}")
- ((1))
- } || {
- (( __start=_start+__pos-__PBUFLEN, __start >= 0 )) && \
- reply+=("$(( __start - 1 )) $__start ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}${bg:+,$bg}")
- }
- }
- }
-}
-
-# A generic handler - checks whether the file exists
-:chroma/-git-verify-file-or-dir() {
- integer _start="$2" _end="$3" __pos __start __end retval
- local _wrd="$4" bg
-
- __style=
- [[ -f $_wrd || -d $_wrd ]] && {
- (( __start=_start, __end=_end, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- bg=${(M)FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]%bg=*}
- ((1))
- } || {
- (( __start=_start, __end=_end, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- bg=${(M)FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]%bg=*}
- retval=1
- }
-
- [[ -n ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} && \
- ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path]} != \
- ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}
- ]] && \
- for (( __pos = 1; __pos <= (_end-_start); __pos++ )) {
- [[ ${_wrd[__pos]} == "/" ]] && {
- [[ ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]} = *bg=* ]] && {
- (( __start=_start+__pos-__PBUFLEN, __start >= 0 )) && \
- reply+=("$(( __start - 1 )) $__start ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}")
- ((1))
- } || {
- (( __start=_start+__pos-__PBUFLEN, __start >= 0 )) && \
- reply+=("$(( __start - 1 )) $__start ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path_pathseparator]}${bg:+,$bg}")
- }
- }
- }
- return $retval
-}
-
-:chroma/-git-verify-branch() {
- local _wrd="$4"
- -fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches-$PWD" "refs/heads" $(( 2 * 60 ))
- [[ -n ${__lines_list[(r)$_wrd]} ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
-}
-
-:chroma/-git-verify-also-unfetched-ref() {
- local _wrd="$4"
- -fast-run-git-command "git config --get checkout.defaultRemote" \
- "chroma-git-defaultRemote-$PWD" "" $(( 2 * 60 ))
- local remote="${__lines_list[1]:-origin}"
- -fast-run-git-command "git rev-list --count --no-walk
- --glob=\"refs/remotes/$remote/$_wrd\"" \
- "chroma-git-unfetched-ref-$PWD" "" $(( 2 * 60 ))
-
- (( __lines_list[1] )) && { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
-}
-
-# A generic handler
-:chroma/-git-file-or-ubranch-or-commit-verify() {
- :chroma/-git-verify-commit "$@" && return
- :chroma/-git-verify-file "$@" && return
- :chroma/-git-verify-also-unfetched-ref "$@"
-}
-
-# A generic handler
-:chroma/-git-file-or-dir-or-ubranch-or-commit-verify() {
- :chroma/-git-verify-commit "$@" && return
- :chroma/-git-verify-file-or-dir "$@" && return
- :chroma/-git-verify-also-unfetched-ref "$@"
-}
-
-# A generic handler
-:chroma/-git-verify-correct-branch-name() {
- local _wrd="$4"
- :chroma/-git-verify-commit "$@" && \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 0; }
-
- :chroma/-git-verify-remote "$@" && \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 0; }
-
- [[ "$_wrd" != ./* && "$_wrd" != *..* && "$_wrd" != *[~\^\ $'\t']* &&
- "$_wrd" != */ && "$_wrd" != *.lock && "$_wrd" != *\\* ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
-}
-
-# A generic handler that checks if given commit reference is correct
-:chroma/-git-verify-commit() {
- local _wrd="$4"
- __lines_list=()
- -fast-run-git-command "git rev-parse --verify --quiet \"$_wrd\"" "chroma-git-commits-$PWD-$_wrd" "" $(( 1.5 * 60 ))
- if (( ${#__lines_list} )); then
- __style=${FAST_THEME_NAME}correct-subtle
- return 0
- fi
- __style=${FAST_THEME_NAME}incorrect-subtle
- return 1
-}
-
-# A generic handler that checks if given commit reference
-# is correct or if it's a file that exists
-:chroma/-git-verify-commit-or-file() {
- :chroma/-git-verify-commit "$@" && return
- :chroma/-git-verify-file "$@"
-}
-
-# A generic handler that checks if given commit reference
-# is correct or if it's a file or directives that exists
-:chroma/-git-verify-commit-or-file-or-dir() {
- :chroma/-git-verify-commit "$@" && return
- :chroma/-git-verify-file-or-dir "$@"
-}
-
-# A generic handler that checks if given revision range
-# is correct or if a file of that name exists
-:chroma/-git-verify-rev-range-or-file() {
- local _wrd="$4"
-
- :chroma/-git-verify-commit "$@" && return 0
-
- if [[ "$_wrd" = *..* ]]; then
- (( FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file] )) && {
- :chroma/-git-verify-file "$@" && return 0
- __style=${FAST_THEME_NAME}unknown-token
- return 1
- }
-
- __style=""
- return 0
- fi
-
- :chroma/-git-verify-file "$@" && \
- { FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file]=1; return 0; }
-
- __style=""
- return 1
-}
-
-:chroma/-git-verify-tag-name() {
- local _wrd="$4"
- -fast-run-git-command "git tag" "chroma-git-tags-$PWD" "" $(( 2*60 ))
- [[ -n ${__lines_list[(r)$_wrd]} ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- __style=${FAST_THEME_NAME}incorrect-subtle
-}
-
-# A handler for the commit's -m/--message options.Currently
-# does the same what :chroma/main-chroma-std-aopt-action does
-:chroma/-git-commit-msg-opt-action() {
- :chroma/main-chroma-std-aopt-action "$@"
-}
-
-# A handler for the commit's -m/--message options' argument
-:chroma/-git-commit-msg-opt-ARG-action() {
- integer _start="$2" _end="$3"
- local _scmd="$1" _wrd="$4"
-
- (( __start >= 0 )) || return
-
- # Match the message body in case of an --message= option
- if [[ "$_wrd" = (#b)(--message=)(*) && -n "${match[2]}" ]]; then
- _wrd="${(Q)${match[2]//\`/x}}"
- # highlight --message=>>something<<
- reply+=("$(( __start+10 )) $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}")
- elif [[ "$_wrd" != --message ]]; then
- # highlight the message's body
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}")
- fi
-
- integer length=${FAST_HIGHLIGHT[git-cmsg-len]:-50}
-
- if (( ${#_wrd} > length )); then
- for (( __idx1 = 1, __idx2 = 1; __idx1 <= length; ++ __idx1, ++ __idx2 )); do
- # Use __arg from the fast-highlight-process's scope
- while [[ "${__arg[__idx2]}" != "${_wrd[__idx1]}" ]]; do
- (( ++ __idx2 ))
- (( __idx2 > __asize )) && { __idx2=-1; break; }
- done
- (( __idx2 == -1 )) && break
- done
- if (( __idx2 != -1 )); then
- if [[ -n "${match[1]}" ]]; then
- reply+=("$(( __start+__idx2 )) $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- else
- reply+=("$(( __start+__idx2-1 )) $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- fi
- fi
-}
-
-# A RESET handler
-# TODO: differentiate tree-ish from commit
-:chroma/-git-RESET-verify-commit-or-file() {
- :chroma/-git-verify-commit "$@" && {
- :chroma/-git-verify-file "$@" && {
- # TODO: with -p/--patch, the <paths> are optional,
- # and this argument will be taken as a commit in a
- # specific circumstances
- FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file]=1
- return 0
- }
-
- (( FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file] ||
- FAST_HIGHLIGHT[chroma-git-reset-etc-saw-commit] )) && \
- { __style=${FAST_THEME_NAME}unknown-token; return 1; }
-
- FAST_HIGHLIGHT[chroma-git-reset-etc-saw-commit]=1
-
- __style=${FAST_THEME_NAME}correct-subtle
-
- return 0
- }
-
- :chroma/-git-verify-file "$@" && \
- { FAST_HIGHLIGHT[chroma-git-reset-etc-saw-file]=1; return 0; }
-
- return 1
-}
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-grep.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-grep.ch
deleted file mode 100644
index 54309bf..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-grep.ch
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars
-integer __idx1 __idx2
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-grep-counter]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-grep-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-grep-counter] ))
-
- # First non-option token is the pattern (regex), we will
- # highlight it.
- if (( FAST_HIGHLIGHT[chroma-grep-counter] == 1 )); then
- [[ "$__wrd" = \"* ]] && __style=${FAST_THEME_NAME}double-quoted-argument
- [[ "$__wrd" = \'* ]] && __style=${FAST_THEME_NAME}single-quoted-argument
- [[ "$__wrd" = \$\'* ]] && __style=${FAST_THEME_NAME}dollar-quoted-argument
- [[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
- __style=""
-
- __chars="*+\\)([]^\$"
- __idx1=__start_pos
- __idx2=__start_pos
- while [[ "$__wrd" = (#b)[^$__chars]#([\\][\\])#((+|\*|\[|\]|\)|\(|\^|\$)|[\\](+|\*|\[|\]|\)|\(|\^|\$))(*) ]]; do
- if [[ -n "${match[3]}" ]]; then
- __idx1+=${mbegin[3]}-1
- __idx2=__idx1+${mend[3]}-${mbegin[3]}+1
- (( __start=__idx1-${#PREBUFFER}, __end=__idx2-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-operator]}")
- __idx1=__idx2
- else
- __idx1+=${mbegin[5]}-1
- fi
- __wrd="${match[5]}"
- done
- elif (( FAST_HIGHLIGHT[chroma-grep-counter] == 2 )); then
- # Handle paths, etc. normally - just pass-through to the big
- # highlighter (the main FSH highlighter, used before chromas).
- return 1
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-hub.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-hub.ch
deleted file mode 100644
index 466d2e5..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-hub.ch
+++ /dev/null
@@ -1,51 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-
-if (( __first_call )); then
- chroma/-git.ch $*
- return 1
-fi
-[[ "$__arg_type" = 3 ]] && return 2
-
-if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-fi
-
-if [[ "$__wrd" != -* ]] && (( FAST_HIGHLIGHT[chroma-git-got-subcommand] == 0 )); then
- -fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
- # Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
- __lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
-
- if (( ${#__lines_list} > 0 )); then
- # (*)
- # First remove alias name (#*[[:space:]]) and the space after it, then
- # remove any leading spaces from what's left (##[[:space:]]##), then
- # remove everything except the first word that's in the left line
- # (%%[[:space:]]##*, i.e.: "everything from right side up to any space")
- FAST_HIGHLIGHT[chroma-git-subcommand]="${${${__lines_list[1]#*[[:space:]]}##[[:space:]]##}%%[[:space:]]##*}"
- else
- FAST_HIGHLIGHT[chroma-git-subcommand]="$__wrd"
- fi
- if [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "browse" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "ci-status" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "compare" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "create" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "delete" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "fork" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "issue" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "pr" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "pull-request" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "release" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "sync" ]]; then
- FAST_HIGHLIGHT[chroma-git-got-subcommand]=1
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1 ))
- (( this_word = next_word ))
- _start_pos=$4
- return 0
- fi
-fi
-
-chroma/-git.ch $*
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ionice.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ionice.ch
deleted file mode 100644
index f328f83..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ionice.ch
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# -------------------------------------------------------------------------------------------------
-# Copyright (c) 2018 Sebastian Gniazdowski
-# Copyright (C) 2019 by Philippe Troin (F-i-f on GitHub)
-# All rights reserved.
-#
-# The only licensing for this file follows.
-#
-# 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.
-# -------------------------------------------------------------------------------------------------
-
-setopt local_options extendedglob warn_create_global typeset_silent
-
-# Keep chroma-takever state meaning: until ;, handle highlighting via chroma.
-# So the below 8192 assignment takes care that next token will be routed to chroma.
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style option_start=0 option_end=0 number_start=0 number_end=0
-local -a match mbegin mend
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global string variables.
- FAST_HIGHLIGHT[ionice-option-argument]=0
-
- # Set style for region_highlight entry. It is used below in
- # '[[ -n "$__style" ]] ...' line, which adds highlight entry,
- # like "10 12 fg=green", through `reply' array.
- #
- # Could check if command `example' exists and set `unknown-token'
- # style instead of `command'
- __style=${FAST_THEME_NAME}precommand
-
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if (( FAST_HIGHLIGHT[ionice-option-argument] )); then
- (( FAST_HIGHLIGHT[ionice-option-argument] = 0 ))
- [[ $__wrd == [0-9]# ]] && __style=${FAST_THEME_NAME}mathnum || __style=${FAST_THEME_NAME}incorrect-subtle
- else
- case $__wrd in
- --(class(data|)|(u|p(g|))id))
- __style=${FAST_THEME_NAME}double-hyphen-option
- FAST_HIGHLIGHT[ionice-option-argument]=1
- ;;
- -[cnpPu])
- __style=${FAST_THEME_NAME}single-hyphen-option
- FAST_HIGHLIGHT[ionice-option-argument]=1
- ;;
- --*)
- __style=${FAST_THEME_NAME}double-hyphen-option
- ;;
- -*)
- __style=${FAST_THEME_NAME}single-hyphen-option
- ;;
- *)
- this_word=1
- next_word=2
- return 1
- ;;
- esac
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-# If 1 will be added to __start_pos, this will highlight "oken".
-# If 1 will be subtracted from __end_pos, this will highlight "toke".
-# $PREBUFFER is for specific situations when users does command \<ENTER>
-# i.e. when multi-line command using backslash is entered.
-#
-# This is a common place of adding such entry, but any above code can do
-# it itself (and it does in other chromas) and skip setting __style to
-# this way disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves.
-# _start_pos=$_end_pos advainces pointers in command line buffer.
-#
-# To pass through means to `return 1'. The highlighting of
-# this single token is then done by fast-syntax-highlighting's
-# main code and chroma doesn't have to do anything.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-lab.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-lab.ch
deleted file mode 100644
index cf3fc95..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-lab.ch
+++ /dev/null
@@ -1,59 +0,0 @@
-# vim:ft=zsh:et:sw=4
-#
-# The `lab' tool after which this chroma is modeled after:
-# https://github.com/zaquestion/lab
-#
-(( next_word = 2 | 8192 ))
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-
-if (( __first_call )); then
- chroma/-git.ch $*
- return 1
-fi
-[[ "$__arg_type" = 3 ]] && return 2
-
-if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-fi
-
-if [[ "$__wrd" != -* ]] && (( FAST_HIGHLIGHT[chroma-git-got-subcommand] == 0 )); then
- -fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
- # Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
- __lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
-
- if (( ${#__lines_list} > 0 )); then
- # (*)
- # First remove alias name (#*[[:space:]]) and the space after it, then
- # remove any leading spaces from what's left (##[[:space:]]##), then
- # remove everything except the first word that's in the left line
- # (%%[[:space:]]##*, i.e.: "everything from right side up to any space")
- FAST_HIGHLIGHT[chroma-git-subcommand]="${${${__lines_list[1]#*[[:space:]]}##[[:space:]]##}%%[[:space:]]##*}"
- else
- FAST_HIGHLIGHT[chroma-git-subcommand]="$__wrd"
- fi
- if [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "browse" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "ci" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "mr" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "project" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "snippet" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "ci-status" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "compare" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "create" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "delete" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "fork" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "issue" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "pr" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "pull-request" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "release" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "sync" ]]; then
- FAST_HIGHLIGHT[chroma-git-got-subcommand]=1
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1 ))
- (( this_word = next_word ))
- _start_pos=$4
- return 0
- fi
-fi
-
-chroma/-git.ch $*
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-make.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-make.ch
deleted file mode 100644
index 91f7324..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-make.ch
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for command `make'.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-local -a __lines_list reply2
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables.
- FAST_HIGHLIGHT[chroma-make-counter]=0
- FAST_HIGHLIGHT[chroma-make-skip-two]=0
- FAST_HIGHLIGHT[chroma-make-custom-dir]="./"
- FAST_HIGHLIGHT[chroma-make-custom-file]="Makefile"
- FAST_HIGHLIGHT[chroma-make-got-custom-dir-opt]=0
- FAST_HIGHLIGHT[chroma-make-got-custom-file-opt]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* || "$__wrd" = *=* ]]; then
- [[ "$__wrd" = *=* ]] && {
- __style=${FAST_THEME_NAME}variable
- } || {
- __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
- }
-
- if [[ "$__wrd" = (-I|-o|-W) ]]; then
- FAST_HIGHLIGHT[chroma-make-skip-two]=1
- elif [[ "$__wrd" = "-C" ]]; then
- FAST_HIGHLIGHT[chroma-make-got-custom-dir-opt]=1
- elif [[ "$__wrd" = "-f" ]]; then
- FAST_HIGHLIGHT[chroma-make-got-custom-file-opt]=1
- fi
- else
- if (( FAST_HIGHLIGHT[chroma-make-skip-two] )); then
- FAST_HIGHLIGHT[chroma-make-skip-two]=0
- elif (( FAST_HIGHLIGHT[chroma-make-got-custom-dir-opt] )); then
- FAST_HIGHLIGHT[chroma-make-got-custom-dir-opt]=0
- FAST_HIGHLIGHT[chroma-make-custom-dir]="$__wrd"
- elif (( FAST_HIGHLIGHT[chroma-make-got-custom-file-opt] )); then
- FAST_HIGHLIGHT[chroma-make-got-custom-file-opt]=0
- FAST_HIGHLIGHT[chroma-make-custom-file]="$__wrd"
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-make-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-make-counter] ))
- if (( FAST_HIGHLIGHT[chroma-make-counter] == 1 )); then
- __wrd="${__wrd//\`/x}"
- __wrd="${(Q)__wrd}"
-
- if [[ -f "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}" ]] && \
- -fast-make-targets < "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}"
- then
- if [[ "${reply2[(r)$__wrd]}" ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- else
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- fi
- else
- # Pass-through to the big-loop outside
- return 1
- fi
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array)
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nice.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nice.ch
deleted file mode 100644
index 7fa8a94..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nice.ch
+++ /dev/null
@@ -1,138 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# -------------------------------------------------------------------------------------------------
-# Copyright (c) 2018 Sebastian Gniazdowski
-# Copyright (C) 2019 by Philippe Troin (F-i-f on GitHub)
-# All rights reserved.
-#
-# The only licensing for this file follows.
-#
-# 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.
-# -------------------------------------------------------------------------------------------------
-
-setopt local_options extendedglob warn_create_global typeset_silent
-
-# Keep chroma-takever state meaning: until ;, handle highlighting via chroma.
-# So the below 8192 assignment takes care that next token will be routed to chroma.
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style option_start=0 option_end=0 number_start=0 number_end=0
-local -a match mbegin mend
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global string variables.
- FAST_HIGHLIGHT[nice-arg-count]=0
- FAST_HIGHLIGHT[nice-increment-argument]=0
-
- # Set style for region_highlight entry. It is used below in
- # '[[ -n "$__style" ]] ...' line, which adds highlight entry,
- # like "10 12 fg=green", through `reply' array.
- #
- # Could check if command `example' exists and set `unknown-token'
- # style instead of `command'
- __style=${FAST_THEME_NAME}precommand
-
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if (( FAST_HIGHLIGHT[nice-increment-argument] )); then
- (( FAST_HIGHLIGHT[nice-increment-argument] = 0 ))
- [[ $__wrd = (-|+|)[0-9]## ]] \
- && __style=${FAST_THEME_NAME}mathnum \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- else
- case $__wrd in
- -(-|+|)[0-9]##)
- (( option_start = __start_pos-${#PREBUFFER} ,
- option_end = option_start+1 ,
- number_start = option_end ,
- number_end = __end_pos-${#PREBUFFER} ))
- option_style=${FAST_THEME_NAME}single-hyphen-option
- ;;
- (#b)(--adjustment)(=(-|+|)[0-9]#|))
- (( option_start = __start_pos-${#PREBUFFER} ,
- option_end = option_start+mend[1] ))
- option_style=${FAST_THEME_NAME}double-hyphen-option
- [[ -z $match[2] ]] \
- && (( FAST_HIGHLIGHT[nice-increment-argument] = 1 )) \
- || (( option_end += 1 ,
- number_start = option_start+mbegin[2]-mbegin[1]+1 ,
- number_end = __end_pos-${#PREBUFFER} ))
- ;;
- -n)
- __style=${FAST_THEME_NAME}double-hyphen-option
- FAST_HIGHLIGHT[nice-increment-argument]=1
- ;;
- --*)
- __style=${FAST_THEME_NAME}double-hyphen-option
- ;;
- -*)
- __style=${FAST_THEME_NAME}single-hyphen-option
- ;;
- *)
- this_word=1
- next_word=2
- return 1
- ;;
- esac
-
- (( option_start > 0 && option_end )) \
- && reply+=("$option_start $option_end ${FAST_HIGHLIGHT_STYLES[$option_style]}")
- (( number_start > 0 && number_end )) \
- && reply+=("$number_start $number_end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathnum]}")
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-# If 1 will be added to __start_pos, this will highlight "oken".
-# If 1 will be subtracted from __end_pos, this will highlight "toke".
-# $PREBUFFER is for specific situations when users does command \<ENTER>
-# i.e. when multi-line command using backslash is entered.
-#
-# This is a common place of adding such entry, but any above code can do
-# it itself (and it does in other chromas) and skip setting __style to
-# this way disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves.
-# _start_pos=$_end_pos advainces pointers in command line buffer.
-#
-# To pass through means to `return 1'. The highlighting of
-# this single token is then done by fast-syntax-highlighting's
-# main code and chroma doesn't have to do anything.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nmcli.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nmcli.ch
deleted file mode 100644
index be444e5..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-nmcli.ch
+++ /dev/null
@@ -1,58 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-typeset -A subcommands
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4" subcommand
-subcommands=(
- help "_"
- general "help status hostname permissions logging _"
- networking "help on off connectivity _"
- radio "help all wifi wwan _"
- connection "help show up down add modify clone edit delete monitor reload load import export _"
- device "help status show set connect reapply modify disconnect delete monitor wifi lldp _"
- agent "help secret polkit all _"
- monitor "help _"
- _ "_"
-)
-
-if (( __first_call )); then
- FAST_HIGHLIGHT[chroma-nmcli-subcommand-a]=""
- FAST_HIGHLIGHT[chroma-nmcli-subcommand-b]=""
- return 1
-elif (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-elif [[ "$2" = -* ]]; then
- return 1
-elif [[ -z ${FAST_HIGHLIGHT[chroma-nmcli-subcommand-a]} ]]; then
- for subcommand in ${(@k)subcommands}; do
- [[ $subcommand = $__wrd* ]] && break || subcommand="_"
- done
- if [[ $subcommand = _ ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- else
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
- fi
- FAST_HIGHLIGHT[chroma-nmcli-subcommand-a]="$subcommand"
-elif [[ -z ${FAST_HIGHLIGHT[chroma-nmcli-subcommand-b]} ]]; then
- for subcommand in ${(s. .)subcommands[${FAST_HIGHLIGHT[chroma-nmcli-subcommand-a]}]}; do
- [[ "$subcommand" = $__wrd* ]] && break || subcommand="_"
- done
- if [[ $subcommand = _ ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- else
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
- fi
- FAST_HIGHLIGHT[chroma-nmcli-subcommand-b]="$subcommand"
-else
- return 1
-fi
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-node.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-node.ch
deleted file mode 100644
index 65f214c..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-node.ch
+++ /dev/null
@@ -1,37 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-
-if (( __first_call )); then
- FAST_HIGHLIGHT[chroma-node-file]=1
-elif (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-elif [[ "$__wrd" = -- ]]; then
- FAST_HIGHLIGHT[chroma-node-file]=2
-elif (( FAST_HIGHLIGHT[chroma-node-file] != 2 )) && [[ "$__wrd" = -* ]]; then
- if [[ "$__wrd" = -*e* || "$__wrd" = --eval ]]; then
- FAST_HIGHLIGHT[chroma-node-file]=0
- fi
-elif (( FAST_HIGHLIGHT[chroma-node-file] )); then
- if [[ "$__wrd" = debug || "$__wrd" = inspect ]]; then
- __style=${FAST_THEME_NAME}subcommand
- else
- FAST_HIGHLIGHT[chroma-node-file]=0
- if [[ -f ${~__wrd} || -f ${~__wrd}.js || -f ${~__wrd}/index.js ]]; then
- __style=${FAST_THEME_NAME}path
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- fi
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
- (( this_word = next_word ))
- _start_pos=$_end_pos
-
- return 0
-fi
-
-return 1
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ogit.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ogit.ch
deleted file mode 100644
index 06f0d75..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ogit.ch
+++ /dev/null
@@ -1,383 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-# Copyright (c) 2018 plexigras
-#
-# The old chroma function for command `git'. It colorizes the part of command
-# line that holds `git' invocation.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-local -a __lines_list chroma_git_remote_subcommands
-chroma_git_remote_subcommands=(add rename remove set-head set-branches get-url set-url set-url set-url show prune update)
-
-if (( __first_call )); then
- # Called for the first time - new command
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables
- FAST_HIGHLIGHT[chroma-git-counter]=0
- FAST_HIGHLIGHT[chroma-git-got-subcommand]=0
- FAST_HIGHLIGHT[chroma-git-subcommand]=""
- FAST_HIGHLIGHT[chrome-git-got-msg1]=0
- FAST_HIGHLIGHT[chrome-git-got-anymsg]=0
- FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]=0
- FAST_HIGHLIGHT[chroma-git-checkout-new]=0
- FAST_HIGHLIGHT[chroma-git-fetch-multiple]=0
- FAST_HIGHLIGHT[chroma-git-branch-change]=0
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=0
- return 1
-else
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if [[ "$__wrd" = "--" ]]; then
- FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]=1
- __style=${FAST_THEME_NAME}double-hyphen-option
- elif [[ "$__wrd" = -* && ${FAST_HIGHLIGHT[chroma-git-got-subcommand]} -eq 0 ]]; then
- # Options occuring before a subcommand
- if (( FAST_HIGHLIGHT[chroma-git-option-with-argument-active] == 0 )); then
- if [[ "$__wrd" = -[^[:space:]-]#C ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=2
- elif [[ "$__wrd" = -[^[:space:]-]#c ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=1
- fi
- fi
- return 1
- else
- # If at e.g. '>' or destination/source spec (of the redirection)
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- # If at main git option taking argument in a separate word (-C and -c)
- elif (( FAST_HIGHLIGHT[chroma-git-option-with-argument-active] > 0 && \
- 0 == FAST_HIGHLIGHT[chroma-git-got-subcommand] ))
- then
- # Remember the value
- __idx2=${FAST_HIGHLIGHT[chroma-git-option-with-argument-active]}
- # Reset the is-argument mark-field
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=0
-
- (( __idx2 == 2 )) && return 1
- # Other options' args (i.e. arg of -c) aren't routed to the big-loop
- # as they aren't paths and aren't handled in any special way there
- elif (( FAST_HIGHLIGHT[chroma-git-got-subcommand] == 0 )); then
- FAST_HIGHLIGHT[chroma-git-got-subcommand]=1
-
- # Check if the command is an alias - we want to highlight the
- # aliased command just like the target command of the alias
- -fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 10 * 60 ))
- # Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
- __lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
-
- if (( ${#__lines_list} > 0 )); then
- # (*)
- # First remove alias name (#*[[:space:]]) and the space after it, then
- # remove any leading spaces from what's left (##[[:space:]]##), then
- # remove everything except the first word that's in the left line
- # (%%[[:space:]]##*, i.e.: "everything from right side up to any space")
- FAST_HIGHLIGHT[chroma-git-subcommand]="${${${__lines_list[1]#*[[:space:]]}##[[:space:]]##}%%[[:space:]]##*}"
- else
- FAST_HIGHLIGHT[chroma-git-subcommand]="$__wrd"
- fi
- if (( __start_pos >= 0 )); then
- # if subcommand exists
- LANG=C -fast-run-command "git help -a" chroma-git-subcmd-list "" $(( 10 * 60 ))
- # (s: :) will split on every space, but because the expression
- # isn't double-quoted, the empty elements will be eradicated
- # Some further knowledge-base: s-flag is special, it skips
- # empty elements and creates an array (not a concatenated
- # string) even when double-quoted. The normally needed @-flag
- # that logically breaks the concaetnated string back into array
- # in case of double-quoting has additional effect for s-flag:
- # it finally blocks empty-elements eradication.
- if [[ "${__lines_list[1]}" = See* ]]; then
- # (**)
- # git >= v2.20
- __lines_list=( ${(M)${${${(M)__lines_list[@]:# [[:blank:]]#[a-z]*}##[[:blank:]]##}%%[[:blank:]]##*}:#${FAST_HIGHLIGHT[chroma-git-subcommand]}} )
- else
- # (**)
- # git < v2.20
- __lines_list=( ${(M)${(s: :)${(M)__lines_list[@]:# [a-z]*}}:#${FAST_HIGHLIGHT[chroma-git-subcommand]}} )
- fi
-
- # Above we've checked:
- # 1) If given subcommand is an alias (*)
- # 2) If the command, or command pointed by the alias, exists (**)
- # 3) There's little problem, git v2.20 outputs aliases in git help -a,
- # which means that alias will be recognized as correct if it will
- # point at another alias or on itself. That's a minor problem, a
- # TODO for future planned optimization for v2.20 Git
- # 4) Notice that the above situation is better than the previous - the
- # alias is being verified to point to a valid git subcommand
- # That's all that's needed to decide on the correctnes:
- if (( ${#__lines_list} > 0 )); then
- __style=${FAST_THEME_NAME}subcommand
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- fi
- # The counter includes the subcommand itself
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1 ))
- else
- __wrd="${__wrd//\`/x}"
- __arg="${__arg//\`/x}"
- __wrd="${(Q)__wrd}"
- if [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "push" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "pull" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "fetch" ]] \
- && (( ${FAST_HIGHLIGHT[chroma-git-fetch-multiple]} == 0 )); then
- # if not option
- if [[ "$__wrd" != -* || "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" -eq 1 ]]; then
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
- if (( __idx1 == 2 )); then
- -fast-run-git-command "git remote" "chroma-git-remotes" ""
- else
- __wrd="${__wrd%%:*}"
- -fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
- fi
- # if remote/ref exists
- if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- # if ref (__idx1 == 3) does not exist and subcommand is push
- elif (( __idx1 != 2 )) && [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "push" ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- # if not existing remote name, because not an URL (i.e. no colon)
- elif [[ $__idx1 -eq 2 && $__wrd != *:* ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos+${#__wrd}-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- # if option
- else
- if [[ "$__wrd" = "--multiple" && "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "fetch" ]]; then
- FAST_HIGHLIGHT[chroma-git-fetch-multiple]=1
- __style=${FAST_THEME_NAME}double-hyphen-option
- else
- return 1
- fi
- fi
- elif (( ${FAST_HIGHLIGHT[chroma-git-fetch-multiple]} )) \
- && [[ "$__wrd" != -* || "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" -eq 1 ]]; then
- -fast-run-git-command "git remote" "chroma-git-remotes" ""
- if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
- __style=${FAST_THEME_NAME}correct-subtle
- fi
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "commit" ]]; then
- match[1]=""
- match[2]=""
- # if previous argument is -m or current argument is --message=something
- if (( FAST_HIGHLIGHT[chrome-git-got-msg1] == 1 && ! FAST_HIGHLIGHT[chrome-git-got-anymsg] )) \
- || [[ "$__wrd" = (#b)(--message=)(*) && "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" = 0 ]]; then
- FAST_HIGHLIGHT[chrome-git-got-msg1]=0
- FAST_HIGHLIGHT[chrome-git-got-anymsg]=1
- if [[ -n "${match[1]}" ]]; then
- __wrd="${(Q)${match[2]//\`/x}}"
- # highlight (--message=)something
- (( __start=__start_pos-${#PREBUFFER}, __end=__start_pos-${#PREBUFFER}+10, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-hyphen-option]}")
- # highlight --message=(something)
- (( __start=__start_pos-${#PREBUFFER}+10, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}")
- else
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}")
- fi
- local __firstline=${__wrd%%$'\n'*}
- if (( ${#__firstline} > 50 )); then
- for (( __idx1 = 1, __idx2 = 1; __idx1 <= 50; ++ __idx1, ++ __idx2 )); do
- while [[ "${__arg[__idx2]}" != "${__firstline[__idx1]}" ]]; do
- (( ++ __idx2 ))
- (( __idx2 > __asize )) && { __idx2=-1; break; }
- done
- (( __idx2 == -1 )) && break
- done
- if (( __idx2 != -1 )); then
- if [[ -n "${match[1]}" ]]; then
- (( __start=__start_pos-${#PREBUFFER}+__idx2, __end=__end_pos-${#PREBUFFER}-$#__wrd+$#__firstline-1, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- else
- (( __start=__start_pos-${#PREBUFFER}+__idx2-1, __end=__end_pos-${#PREBUFFER}-$#__wrd+$#__firstline-1, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- fi
- fi
- # if before --
- elif [[ "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" = 0 ]]; then
- if [[ "$__wrd" = -[^[:space:]-]#m ]]; then
- FAST_HIGHLIGHT[chrome-git-got-msg1]=1
- __style=${FAST_THEME_NAME}single-hyphen-option
- else
- return 1
- fi
- # if after -- is file
- elif [[ -e "$__wrd" ]]; then
- __style=${FAST_THEME_NAME}path
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "checkout" ]] \
- || [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "revert" ]] \
- || [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "merge" ]] \
- || [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "diff" ]] \
- || [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "reset" ]] \
- || [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "rebase" ]]; then
-
- # if doing `git checkout -b ...'
- if [[ "$__wrd" = -[^[:space:]-]#b && "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "checkout" ]]; then
- FAST_HIGHLIGHT[chroma-git-checkout-new]=1
- __style=${FAST_THEME_NAME}single-hyphen-option
- # if command is not checkout -b something
- elif [[ "${FAST_HIGHLIGHT[chroma-git-checkout-new]}" = 0 ]]; then
- # if not option
- if [[ "$__wrd" != -* || "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" = 1 ]]; then
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
- if (( __idx1 == 2 )) || \
- [[ "$__idx1" = 3 && "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "diff" ]]; then
- # if is ref
- if command git rev-parse --verify --quiet "$__wrd" >/dev/null 2>&1; then
- __style=${FAST_THEME_NAME}correct-subtle
- # if is file and subcommand is checkout or diff
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "checkout" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "reset" \
- || "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "diff" ]] && [[ -e ${~__wrd} ]]; then
- __style=${FAST_THEME_NAME}path
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "checkout" && \
- "1" = "$(command git rev-list --count --no-walk --glob="refs/remotes/${$(git \
- config --get checkout.defaultRemote):-*}/$__wrd")" ]]
- then
- __style=${FAST_THEME_NAME}correct-subtle
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- fi
- # if option
- else
- return 1
- fi
- # if option
- elif [[ "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" = 0 && "$__wrd" = -* ]]; then
- return 1
- fi
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "remote" && "$__wrd" != -* ]]; then
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
- if [[ "$__idx1" = 2 ]]; then
- if (( ${chroma_git_remote_subcommands[(I)$__wrd]} )); then
- FAST_HIGHLIGHT[chroma-git-remote-subcommand]="$__wrd"
- __style=${FAST_THEME_NAME}subcommand
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- elif [[ "$__idx1" = 3 && "$FAST_HIGHLIGHT[chroma-git-remote-subcommand]" = "add" ]]; then
- -fast-run-git-command "git remote" "chroma-git-remotes" ""
- if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- elif [[ "$__idx1" = 3 && -n "$FAST_HIGHLIGHT[chroma-git-remote-subcommand]" ]]; then
- -fast-run-git-command "git remote" "chroma-git-remotes" ""
- if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
- __style=${FAST_THEME_NAME}correct-subtle
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- fi
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "branch" ]]; then
- if [[ "$__wrd" = --delete \
- || "$__wrd" = --edit-description \
- || "$__wrd" = --set-upstream-to=* \
- || "$__wrd" = --unset-upstream \
- || "$__wrd" = -[^[:space:]-]#d \
- || "$__wrd" = -[^[:space:]-]#D ]]; then
- FAST_HIGHLIGHT[chroma-git-branch-change]=1
- return 1
- elif [[ "$__wrd" != -* ]]; then
- -fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
- if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
- __style=${FAST_THEME_NAME}correct-subtle
- elif (( FAST_HIGHLIGHT[chroma-git-branch-change] )); then
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- else
- return 1
- fi
- elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "tag" ]]; then
- if [[ "${FAST_HIGHLIGHT[chroma-git-option-with-argument-active]}" -le 0 ]]; then
- if [[ "$__wrd" = -[^[:space:]-]#(u|m) ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=1
- elif [[ "$__wrd" = -[^[:space:]-]#F ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=2
- elif [[ "$__wrd" = -[^[:space:]-]#d ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=3
- elif [[ "$__wrd" = (--contains|--no-contains|--points-at|--merged|--no-merged) ]]; then
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=4
- fi
- if [[ "$__wrd" != -* ]]; then
- (( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
- if [[ ${FAST_HIGHLIGHT[chroma-git-counter]} -eq 2 ]]; then
- -fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
- -fast-run-git-command "+git tag" "chroma-git-tags" ""
- [[ -n ${__lines_list[(r)$__wrd]} ]] && __style=${FAST_THEME_NAME}incorrect-subtle
- elif [[ ${FAST_HIGHLIGHT[chroma-git-counter]} -eq 3 ]]; then
- fi
- else
- return 1
- fi
- else
- case "${FAST_HIGHLIGHT[chroma-git-option-with-argument-active]}" in
- (1)
- __style=${FAST_THEME_NAME}optarg-string
- ;;
- (2)
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=0
- return 1;
- ;;
- (3)
- -fast-run-git-command "git tag" "chroma-git-tags" ""
- [[ -n ${__lines_list[(r)$__wrd]} ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- (4)
- if git rev-parse --verify --quiet "$__wrd" >/dev/null 2>&1; then
- __style=${FAST_THEME_NAME}correct-subtle
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
- ;;
- esac
- FAST_HIGHLIGHT[chroma-git-option-with-argument-active]=0
- fi
- else
- return 1
- fi
- fi
- fi
-fi
-
-# Add region_highlight entry (via `reply' array)
-if [[ -n "$__style" ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-fi
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-perl.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-perl.ch
deleted file mode 100644
index 49f0ad3..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-perl.ch
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for command `perl'. It highlights code passed to perl
-# with -e option - does syntax check by calling `perl -ce', then highlights
-# as correct or incorrect code.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables.
- FAST_HIGHLIGHT[chrome-perl-got-eswitch]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* && ${FAST_HIGHLIGHT[chroma-perl-got-subcommand]} -eq 0 ]]; then
- __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
-
- if [[ "$__wrd" = "-e" || ("$__wrd" = -*e* && "$__wrd" != --*) ]]; then
- FAST_HIGHLIGHT[chrome-perl-got-eswitch]=1
- fi
- else
- __wrd="${__wrd//\`/x}"
- __arg="${__arg//\`/x}"
- __wrd="${(Q)__wrd}"
- if (( FAST_HIGHLIGHT[chrome-perl-got-eswitch] == 1 )); then
- FAST_HIGHLIGHT[chrome-perl-got-eswitch]=0
- if perl -ce "$__wrd" >/dev/null 2>&1; then
- # Add correct-subtle style
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- else
- # Add incorrect-subtle style
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- else
- # Pass-through to the big-loop outside
- return 1
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array)
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-precommand.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-precommand.ch
deleted file mode 100644
index 7e85a06..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-precommand.ch
+++ /dev/null
@@ -1,17 +0,0 @@
-# vim:ft=zsh:et:sw=4
-
-local __first_call="$1" __start_pos="$3" __end_pos="$4"
-
-[[ "$__arg_type" = 3 ]] && return 2
-
-(( __first_call )) && {
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}precommand]}")
- (( next_word = (next_word & ~2) | 4 | 1 ))
-} || {
- return 1
-}
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-printf.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-printf.ch
deleted file mode 100644
index 89d2789..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-printf.ch
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Highlights the special sequences like "%s" in string passed to `printf'.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __val
-integer __idx1 __idx2
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-printf-counter]=0
- FAST_HIGHLIGHT[chroma-printf-counter-all]=1
- FAST_HIGHLIGHT[chroma-printf-message]=""
- FAST_HIGHLIGHT[chroma-printf-skip-two]=0
- return 1
-# Following call (not first one).
-} || {
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
- (( FAST_HIGHLIGHT[chroma-printf-counter-all] += 1, __idx2 = FAST_HIGHLIGHT[chroma-printf-counter-all] ))
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if [[ "$__wrd" = -* ]]; then
- if [[ "$__wrd" = "-v" ]]; then
- FAST_HIGHLIGHT[chroma-printf-skip-two]=1
- fi
- return 1
- else
- # Count non-option tokens.
- if (( FAST_HIGHLIGHT[chroma-printf-skip-two] )); then
- FAST_HIGHLIGHT[chroma-printf-skip-two]=0
- return 1
- else
- (( FAST_HIGHLIGHT[chroma-printf-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-printf-counter] ))
- if [[ "$__idx1" -eq 1 ]]; then
- [[ "$__wrd" = \"* ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-quoted-argument]}")
- [[ "$__wrd" = \'* ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}single-quoted-argument]}")
- FSH_LIST=() # use fsh_sy_h_append function to write to FSH_LIST
- : "${__wrd//(#m)\%[\#\+\ 0-]#[0-9]#([.][0-9]#)(#c0,1)[diouxXfFeEgGaAcsb]/$(( fsh_sy_h_append($MBEGIN, $MEND) ))}";
- for __val in "${FSH_LIST[@]}" ; do
- __idx1=$(( __start_pos + ${__val%%;;*} ))
- __idx2=__idx1+${__val##*;;}-${__val%%;;*}+1
- (( __start=__idx1-${#PREBUFFER}, __end=__idx2-${#PREBUFFER}-1, __start >= 0 )) && \
- reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathnum]}")
- done
- else
- return 1
- fi
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above code
-# can do it itself and skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ruby.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ruby.ch
deleted file mode 100644
index 3495cc8..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ruby.ch
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for command `ruby'. It highlights code passed to ruby
-# with -e option - does syntax check by calling `ruby -ce', then highlights
-# as correct or incorrect code.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-
-(( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global variables.
- FAST_HIGHLIGHT[chrome-ruby-got-eswitch]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* && ${FAST_HIGHLIGHT[chroma-ruby-got-subcommand]} -eq 0 ]]; then
- __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
-
- if [[ "$__wrd" = "-e" || ("$__wrd" = -*e* && "$__wrd" != --*) ]]; then
- FAST_HIGHLIGHT[chrome-ruby-got-eswitch]=1
- fi
- else
- __wrd="${__wrd//\`/x}"
- __arg="${__arg//\`/x}"
- __wrd="${(Q)__wrd}"
- if (( FAST_HIGHLIGHT[chrome-ruby-got-eswitch] == 1 )); then
- FAST_HIGHLIGHT[chrome-ruby-got-eswitch]=0
- if ruby -ce "$__wrd" >/dev/null 2>&1; then
- # Add correct-subtle style
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
- else
- # Add incorrect-subtle style
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}")
- fi
- else
- # Pass-through to the big-loop outside
- return 1
- fi
- FAST_HIGHLIGHT[chrome-ruby-got-eswitch]=0
- fi
-}
-
-# Add region_highlight entry (via `reply' array)
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-scp.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-scp.ch
deleted file mode 100644
index d162284..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-scp.ch
+++ /dev/null
@@ -1,87 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Tracks scp command and emits message when one tries to pass port to hostspec.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars
-integer __idx1 __idx2
-local -a __results
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-scp-counter]=0
- FAST_HIGHLIGHT[chroma-scp-counter-all]=1
- FAST_HIGHLIGHT[chroma-scp-message]=""
- FAST_HIGHLIGHT[chroma-scp-skip-two]=0
- return 1
-} || {
- (( FAST_HIGHLIGHT[chroma-scp-counter-all] += 1, __idx2 = FAST_HIGHLIGHT[chroma-scp-counter-all] ))
-
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- if [[ "$__wrd" = (-c|-F|-i|-l|-o|-P|-S) ]]; then
- FAST_HIGHLIGHT[chroma-scp-skip-two]=1
- fi
- else
- # Count non-option tokens.
- if (( FAST_HIGHLIGHT[chroma-scp-skip-two] )); then
- FAST_HIGHLIGHT[chroma-scp-skip-two]=0
- else
- (( FAST_HIGHLIGHT[chroma-scp-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-scp-counter] ))
- if [[ "${FAST_HIGHLIGHT[chroma-scp-counter]}" -eq 1 ]]; then
- if [[ "$__arg" = [^:]##:[0-9]## ]]; then
- FAST_HIGHLIGHT[chroma-scp-message]+="Format of hostname incorrect, use -P to pass port number"
- else
- return 1
- fi
- else
- return 1
- fi
- fi
- fi
-
- if (( ${#${(z)BUFFER}} <= FAST_HIGHLIGHT[chroma-scp-counter-all] )); then
- [[ -n "${FAST_HIGHLIGHT[chroma-scp-message]}" ]] && zle -M "${FAST_HIGHLIGHT[chroma-scp-message]}"
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above code
-# can do it itself and skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-sh.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-sh.ch
deleted file mode 100644
index 13c8ded..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-sh.ch
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma function for `sh' shell. It colorizes string passed with -c option.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style
-integer __idx1 __idx2
-local -a __lines_list
-
-(( __first_call )) && {
- # Called for the first time - new command
- FAST_HIGHLIGHT[chrome-git-got-c]=0
- return 1
-} || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- __wrd="${${${(Q)__wrd}#[\"\']}%[\"\']}"
- if [[ "$__wrd" = -* && "$__wrd" != -*c* ]]; then
- __style=${FAST_THEME_NAME}${${${__wrd:#--*}:+single-hyphen-option}:-double-hyphen-option}
- else
- if (( FAST_HIGHLIGHT[chrome-git-got-c] == 1 )); then
- for (( __idx1 = 1, __idx2 = 1; __idx2 <= __asize; ++ __idx1 )); do
- [[ "${__arg[__idx2]}" = "${__wrd[__idx1]}" ]] && break
- while [[ "${__arg[__idx2]}" != "${__wrd[__idx1]}" ]]; do
- (( ++ __idx2 ))
- (( __idx2 > __asize )) && { __idx2=0; break; }
- done
- (( __idx2 == 0 )) && break
- [[ "${__arg[__idx2]}" = "${__wrd[__idx1]}" ]] && break
- done
-
- FAST_HIGHLIGHT[chrome-git-got-c]=0
- (( _start_pos-__PBUFLEN >= 0 )) && \
- -fast-highlight-process "$PREBUFFER" "${__wrd}" "$(( __start_pos + __idx2 - 1 ))"
- elif [[ "$__wrd" = -*c* ]]; then
- FAST_HIGHLIGHT[chrome-git-got-c]=1
- else
- return 1
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array)
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-source.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-source.ch
deleted file mode 100644
index dc27e76..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-source.ch
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma for `source' builtin - verifies if file to be sourced compiles
-# correctly.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars __home=${XDG_CACHE_HOME:-$HOME/.cache}/fsh
-integer __idx1 __idx2
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-src-counter]=0
- __style=${FAST_THEME_NAME}builtin
-
-} || {
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-src-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-src-counter] ))
-
- if (( FAST_HIGHLIGHT[chroma-src-counter] == 1 )); then
- command mkdir -p "$__home"
- command cp -f "${__wrd}" "$__home" 2>/dev/null && {
- zcompile "$__home"/"${__wrd:t}" 2>/dev/null 1>&2 && __style=${FAST_THEME_NAME}correct-subtle || __style=${FAST_THEME_NAME}incorrect-subtle
- }
- elif (( FAST_HIGHLIGHT[chroma-src-counter] == 2 )); then
- # Handle paths, etc. normally - just pass-through to the big
- # highlighter (the main FSH highlighter, used before chromas).
- return 1
- fi
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does) and skip setting __style
-# to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ssh.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ssh.ch
deleted file mode 100644
index 879158f..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-ssh.ch
+++ /dev/null
@@ -1,156 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-# Copyright (C) 2019 by Philippe Troin (F-i-f on GitHub)
-#
-# Tracks ssh command and emits message when one tries to pass port to hostspec.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-emulate -LR zsh
-setopt extended_glob warn_create_global typeset_silent
-
-# This chroma guards that port number isn't passed in hostname (no :{port} occurs).
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style check_port=0 host_start_offset host_style user_style possible_host
-local -a match mbegin mend completions_user completions_host
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-ssh-counter]=0
- FAST_HIGHLIGHT[chroma-ssh-counter-all]=1
- FAST_HIGHLIGHT[chroma-ssh-message]=""
- FAST_HIGHLIGHT[chroma-ssh-skip-two]=0
- return 1
-} || {
- # Following call, i.e. not the first one.
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- (( FAST_HIGHLIGHT[chroma-ssh-counter-all] += 1 ))
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- if [[ "$__wrd" = (-b|-c|-D|-E|-e|-F|-I|-i|-J|-L|-l|-m|-O|-o|-p|Q|R|-S|-W|-w) ]]; then
- FAST_HIGHLIGHT[chroma-ssh-skip-two]=1
- fi
- else
- if (( FAST_HIGHLIGHT[chroma-ssh-skip-two] )); then
- FAST_HIGHLIGHT[chroma-ssh-skip-two]=0
- else
- # Count non-option tokens.
- (( FAST_HIGHLIGHT[chroma-ssh-counter] += 1 ))
- if [[ "${FAST_HIGHLIGHT[chroma-ssh-counter]}" -eq 1 ]]; then
- if [[ $__arg = (#b)(([^@]#)(@)|)(*) ]]
- then
- [[ -n $match[2] ]] \
- && {
- user_style=
- () {
- # Zstyle clobbers reply for sure
- zstyle -a ":completion:*:users" users completions_users
- }
- (( ! $#completions_users )) && completions_users=(${(k)userdirs})
- if (( $#completions_users )); then
- [[ $match[2] = ${~${:-(${(j:|:)completions_users})}} ]] \
- && user_style=${FAST_THEME_NAME}correct-subtle \
- || user_style=${FAST_THEME_NAME}incorrect-subtle
- fi
- [[ -n $user_style ]] \
- && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}-(mend[5]-mend[2]), __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$user_style]}")
- }
- [[ -n $match[3] ]] \
- && (( __start=__start_pos-${#PREBUFFER}+(mbegin[3]-mbegin[1]), __end=__end_pos-${#PREBUFFER}-(mend[5]-mend[3]), __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subtle-separator]}")
-
- host_style=
- case $match[4] in
- (<->|<0-255>.<0-255>.<0-255>.<0-255>)
- host_style=${FAST_THEME_NAME}mathnum
- check_port=1
- ;;
- (([0-9a-fA-F][0-9a-fA-F:]#|)::([0-9a-fA-F:]#[0-9a-fA-F]|)|[0-9a-fA-F]##:[0-9a-fA-F:]#[0-9a-fA-F])
- host_style=${FAST_THEME_NAME}mathnum
- ;;
- (*)
- check_port=1
- ;;
- esac
- possible_host=$match[4]
- (( host_start_offset = mbegin[4] - mbegin[1], host_end_offset = 0 ))
-
- if (( check_port )) && [[ $possible_host = (#b)(*)(:[0-9]##) ]]; then
- (( __start=__start_pos-${#PREBUFFER}+(host_start_offset+mbegin[2]-mbegin[1]), __end=__end_pos-host_end_offset-${#PREBUFFER}, __start >= 0,
- host_end_offset+=mend[2]-mend[1] )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}") \
- && possible_host=$match[1] \
- && FAST_HIGHLIGHT[chroma-ssh-message]+="Format of hostname incorrect, use -p to pass port number"
-
- fi
-
- if [[ -z $host_style ]]; then
- () {
- # Zstyle clobbers reply for sure
- local mbegin mend match reply
- zstyle -a ":completion:*:hosts" hosts completions_host
- }
- (( ! $#completions_host && $+_cache_hosts )) && completions_host=($_cache_hosts[*])
- if (( $#completions_host )); then
- [[ $possible_host = ${~${:-(${(j:|:)completions_host})}} ]] \
- && host_style=${FAST_THEME_NAME}correct-subtle \
- || host_style=${FAST_THEME_NAME}incorrect-subtle
- fi
- fi
-
- [[ -n $host_style ]] \
- && (( __start=__start_pos-${#PREBUFFER}+host_start_offset, __end=__end_pos-${#PREBUFFER}-host_end_offset, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$host_style]}")
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- fi
-
- (( next_word = 1 ))
-
- fi
- fi
- fi
-
- if (( ${#${(z)BUFFER}} <= FAST_HIGHLIGHT[chroma-ssh-counter-all] )); then
- [[ -n "${FAST_HIGHLIGHT[chroma-ssh-message]}" ]] && zle -M "${FAST_HIGHLIGHT[chroma-ssh-message]}"
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above code
-# can do it itself and skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subcommand.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subcommand.ch
deleted file mode 100644
index 0665548..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subcommand.ch
+++ /dev/null
@@ -1,25 +0,0 @@
-# vim:ft=zsh:et:sw=4
-(( next_word = 2 | 8192 ))
-[[ "$__arg_type" = 3 ]] && return 2
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-
-if (( __first_call )); then
- FAST_HIGHLIGHT[chroma-subcommand]=""
- return 1
-elif (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-elif [[ "$2" = -* ]]; then
- return 1
-elif [[ -z "${FAST_HIGHLIGHT[chroma-subcommand]}" ]]; then
- FAST_HIGHLIGHT[chroma-subcommand]="$__wrd"
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}subcommand]}")
-else
- return 1
-fi
-
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subversion.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subversion.ch
deleted file mode 100644
index 57b5674..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-subversion.ch
+++ /dev/null
@@ -1,252 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# -------------------------------------------------------------------------------------------------
-# Copyright (c) 2018 Sebastian Gniazdowski
-# Copyright (C) 2019 by Philippe Troin (F-i-f on GitHub)
-# All rights reserved.
-#
-# The only licensing for this file follows.
-#
-# 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.
-# -------------------------------------------------------------------------------------------------
-
-chroma/-subversion.ch/parse-revision() {
- setopt local_options extendedglob warn_create_global typeset_silent
- local __wrd="$1" __start_pos="$2" __end_pos="$3" __style __start __end
- case $__wrd in
- (r|)[0-9]##) __style=${FAST_THEME_NAME}mathnum ;;
- (HEAD|BASE|COMITTED|PREV)) __style=${FAST_THEME_NAME}correct-subtle ;;
- '{'[^}]##'}') __style=${FAST_THEME_NAME}subtle-bg ;;
- *) __style=${FAST_THEME_NAME}incorrect-subtle ;;
- esac
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-}
-
-chroma/-subversion.ch/parse-target() {
- setopt local_options extendedglob warn_create_global typeset_silent
- local __wrd="$1" __start_pos="$2" __end_pos="$3" __style __start __end
- if [[ $__wrd == *@[^/]# ]]
- then
- local place=${__wrd%@[^/]#}
- local rev=$__wrd[$(($#place+2)),$#__wrd]
- if [[ -e $place ]]; then
- local __style
- [[ -d $place ]] && __style="${FAST_THEME_NAME}path-to-dir" || __style="${FAST_THEME_NAME}path"
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}-$#rev-1, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
- fi
- (( __start=__start_pos-${#PREBUFFER}+$#place, __end=__end_pos-${#PREBUFFER}-$#rev, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-separator]}")
- chroma/-subversion.ch/parse-revision $rev $((__start_pos+$#place+1)) $__end_pos
- else
- return 1
- fi
-}
-
-chroma/-subversion.ch() {
- setopt local_options extendedglob warn_create_global
-
- # Keep chroma-takever state meaning: until ;, handle highlighting via chroma.
- # So the below 8192 assignment takes care that next token will be routed to chroma.
- (( next_word = 2 | 8192 ))
-
- local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
- local __style
- integer __idx1 __idx2
-
- (( __first_call )) && {
- # Called for the first time - new command.
- # FAST_HIGHLIGHT is used because it survives between calls, and
- # allows to use a single global hash only, instead of multiple
- # global string variables.
- FAST_HIGHLIGHT[subversion-command]=$__wrd
- FAST_HIGHLIGHT[subversion-option-argument]=
- FAST_HIGHLIGHT[subversion-subcommand]=
- FAST_HIGHLIGHT[subversion-subcommand-arguments]=0
-
- # Set style for region_highlight entry. It is used below in
- # '[[ -n "$__style" ]] ...' line, which adds highlight entry,
- # like "10 12 fg=green", through `reply' array.
- #
- # Could check if command `example' exists and set `unknown-token'
- # style instead of `command'
- __style=${FAST_THEME_NAME}command
-
- } || {
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- case $FAST_HIGHLIGHT[subversion-command]/$FAST_HIGHLIGHT[subversion-subcommand] in
- svn/)
- case $__wrd in
- --username|-u) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --password|-p) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --config-(dir|option)) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- esac
- ;;
- svn/?*)
- case $__wrd in
- --accept) FAST_HIGHLIGHT[subversion-option-argument]=accept;;
- --change|-c) FAST_HIGHLIGHT[subversion-option-argument]=revision;;
- --changelist|--cl) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --(set-|)depth) FAST_HIGHLIGHT[subversion-option-argument]=depth;;
- --diff(3|)-cmd) FAST_HIGHLIGHT[subversion-option-argument]=cmd;;
- --editor-cmd) FAST_HIGHLIGHT[subversion-option-argument]=cmd;;
- --encoding) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --file) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --limit|-l) FAST_HIGHLIGHT[subversion-option-argument]=number;;
- --message|-m) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --native-eol) FAST_HIGHLIGHT[subversion-option-argument]=eol;;
- --new|--old) FAST_HIGHLIGHT[subversion-option-argument]=target;;
- --revision|-r) FAST_HIGHLIGHT[subversion-option-argument]=revision-pair;;
- --show-revs) FAST_HIGHLIGHT[subversion-option-argument]=show-revs;;
- --strip) FAST_HIGHLIGHT[subversion-option-argument]=number;;
- --with-revprop) FAST_HIGHLIGHT[subversion-option-argument]=revprop;;
- esac
- ;;
- svnadmin/*)
- case $__wrd in
- --config-dir) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --fs-type) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --memory-cache-size|-M) FAST_HIGHLIGHT[subversion-option-argument]=number;;
- --parent-dir) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- --revision|-r) FAST_HIGHLIGHT[subversion-option-argument]=revision-pair;;
- esac
- ;;
- svndumpfilter/*)
- case $__wrd in
- --targets) FAST_HIGHLIGHT[subversion-option-argument]=any;;
- esac
- ;;
- esac
- elif [[ -n $FAST_HIGHLIGHT[subversion-option-argument] ]]; then
- case $FAST_HIGHLIGHT[subversion-option-argument] in
- any)
- FAST_HIGHLIGHT[subversion-option-argument]=
- return 1
- ;;
- accept)
- [[ $__wrd = (p(|ostpone)|e(|dit)|l(|aunch)|base|working|recommended|[mt][cf]|(mine|theirs)-(conflict|full)) ]] \
- && __style=${FAST_THEME_NAME}correct-subtle \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- depth)
- [[ $__wrd = (empty|files|immediates|infinity) ]] \
- && __style=${FAST_THEME_NAME}correct-subtle \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- number)
- [[ $__wrd = [0-9]## ]] \
- && __style=${FAST_THEME_NAME}mathnum \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- eol)
- [[ $__wrd = (CR(|LF)|LF) ]] \
- && __style=${FAST_THEME_NAME}correct-subtle \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- show-revs)
- [[ $__wrd = (merged|eligible) ]] \
- && __style=${FAST_THEME_NAME}correct-subtle \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- ;;
- revision)
- chroma/-subversion.ch/parse-revision $__wrd $__start_pos $__end_pos
- ;;
- revision-pair)
- local -a match mbegin mend
- if [[ $__wrd = (#b)(\{[^}]##\}|[^:]##)(:)(*) ]]; then
- chroma/-subversion.ch/parse-revision $match[1] $__start_pos $(( __end_pos - ( mend[3]-mend[2] ) - 1 ))
- chroma/-subversion.ch/parse-revision $match[3] $(( __start_pos + ( mbegin[3]-mbegin[1] ) )) $__end_pos
- (( __start=__start_pos-${#PREBUFFER}+(mbegin[2]-mbegin[1]), __end=__end_pos-${#PREBUFFER}-(mend[3]-mend[2]), __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}for-loop-separator]}")
- else
- chroma/-subversion.ch/parse-revision $__wrd $__start_pos $__end_pos
- fi
- ;;
- target)
- chroma/-subversion.ch/parse-target $__wrd $__start_pos $__end_pos || return $?
- ;;
- cmd)
- this_word=1
- return 1
- ;;
- esac
- FAST_HIGHLIGHT[subversion-option-argument]=
- elif [[ -z $FAST_HIGHLIGHT[subversion-subcommand] ]]
- then
- FAST_HIGHLIGHT[subversion-subcommand]=$__wrd
- local subcmds
- case $FAST_HIGHLIGHT[subversion-command] in
- svn) subcmds='(add|auth|blame|praise|annotate|ann|cat|changelist|cl|checkout|co|cleanup|commit|ci|copy|cp|delete|del|remove|rm|diff|di|export|help|\?|h|import|info|list|ls|lock|log|merge|mergeinfo|mkdir|move|mv|rename|ren|patch|propdel|pdel|pd|propedit|pedit|pe|propget|pget|pg|proplist|plist|pl|propset|pset|ps|relocate|resolve|resolved|revert|status|stat|st|switch|sw|unlock|update|up|upgrade|x-shelf-diff|x-shelf-drop|x-shelf-list|x-shelves|x-shelf-list-by-paths|x-shelf-log|x-shelf-save|x-shelve|x-unshelve)' ;;
- svnadmin) subcmds="(crashtest|create|delrevprop|deltify|dump|dump-revprops|freeze|help|\?|h|hotcopy|info|list-dblogs|list-unused-dblogs|load|load-revprops|lock|lslocks|lstxns|pack|recover|rmlocks|rmtxns|setlog|setrevprop|setuuid|unlock|upgrade|verify)";;
- svndumpfilter) subcmds='(include|exclude|help|\?)';;
- esac
- [[ $FAST_HIGHLIGHT[subversion-subcommand] = $~subcmds ]] \
- && __style=${FAST_THEME_NAME}subcommand \
- || __style=${FAST_THEME_NAME}incorrect-subtle
- FAST_HIGHLIGHT[subversion-subcommand-arguments]=0
- else
- (( FAST_HIGHLIGHT[subversion-subcommand-arguments]+=1 ))
- if [[ ( $FAST_HIGHLIGHT[subversion-subcommand] == (checkout|co|export|log|merge|switch|sw) && $FAST_HIGHLIGHT[subversion-subcommand-arguments] -eq 1 ) \
- || $FAST_HIGHLIGHT[subversion-subcommand] == (blame|praise|annotate|ann|cat|copy|cp|diff|info|list|ls|mergeinfo) ]]; then
- chroma/-subversion.ch/parse-target $__wrd $__start_pos $__end_pos || return $?
- else
- return 1
- fi
- fi
- }
-
- # Add region_highlight entry (via `reply' array).
- # If 1 will be added to __start_pos, this will highlight "oken".
- # If 1 will be subtracted from __end_pos, this will highlight "toke".
- # $PREBUFFER is for specific situations when users does command \<ENTER>
- # i.e. when multi-line command using backslash is entered.
- #
- # This is a common place of adding such entry, but any above code can do
- # it itself (and it does in other chromas) and skip setting __style to
- # this way disable this code.
- [[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
- # We aren't passing-through, do obligatory things ourselves.
- # _start_pos=$_end_pos advainces pointers in command line buffer.
- #
- # To pass through means to `return 1'. The highlighting of
- # this single token is then done by fast-syntax-highlighting's
- # main code and chroma doesn't have to do anything.
- (( this_word = next_word ))
- _start_pos=$_end_pos
-
- return 0
-
- # vim:ft=zsh:et:sw=4
-}
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-vim.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-vim.ch
deleted file mode 100644
index b3fecd1..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-vim.ch
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Chroma for vim, shows last opened files under prompt.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __chars
-integer __idx1 __idx2
-local -a __viminfo
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- (( ${+commands[vim]} )) && __style=${FAST_THEME_NAME}command || __style=${FAST_THEME_NAME}unknown-token
-
- { __viminfo=( ${(f)"$(<$HOME/.viminfo)"} ); } >> /dev/null
- __viminfo=( "${${(M)__viminfo[@]:#>*}[@]:t}" )
- __viminfo=( "${__viminfo[@]:#COMMIT_EDITMSG}" )
- zle -M "Last opened:"$'\n'"${(F)__viminfo[1,5]}"
-} || {
- # Pass almost everything to big loop
- return 1
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above
-# code can do it itself (and it does, see other chromas) and
-# skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-whatis.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-whatis.ch
deleted file mode 100644
index ce59e8f..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-whatis.ch
+++ /dev/null
@@ -1,134 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018-2019 Sebastian Gniazdowski
-
-(( next_word = 2 | 8192 ))
-local THEFD check __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-
-(( ! ${+FAST_HIGHLIGHT[whatis_chroma_callback_was_ran]} )) && \
- FAST_HIGHLIGHT[whatis_chroma_callback_was_ran]=0
-
-(( ! ${+FAST_HIGHLIGHT[whatis_chroma_zle_-F_have_-w_opt]} )) && {
- is-at-least 5.0.6 && local __res=1 || local __res=0
- FAST_HIGHLIGHT[whatis_chroma_zle_-F_have_-w_opt]="$__res"
-}
-
--fast-whatis-chroma-callback() {
- emulate -L zsh
- setopt extendedglob warncreateglobal typesetsilent
-
- local THEFD="$1" input check=2 nl=$'\n' __wrd __style
-
- -fast-zts-read-all "$THEFD" input
-
- zle -F "$THEFD"
- exec {THEFD}<&-
-
- __wrd="${${input#[^$nl]#$nl}%%$nl*}"
- if [[ "$input" = test* ]]; then
- if [[ "${input%$nl}" = *[^0-9]'0' ]]; then
- if [[ "${input#test$nl}" = *nothing\ appropriate* ]]; then
- FAST_HIGHLIGHT[whatis_chroma_type]=2
- else
- FAST_HIGHLIGHT[whatis_chroma_type]=0
- fi
- else
- FAST_HIGHLIGHT[whatis_chroma_type]=1
- fi
- elif [[ "$input" = type2* ]]; then
- [[ "$input" != *nothing\ appropriate* ]] && check=1 || check=0
- elif [[ "$input" = type1* ]]; then
- [[ "${input%$nl}" = *0 ]] && check=1 || check=0
- fi
-
- if (( check != 2 )); then
- FAST_HIGHLIGHT[whatis-cache-$__wrd]=$check
- if (( check )) then
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}
- elif [[ ${~__wrd} = */* && -e ${~__wrd} ]] then
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path]}
- else
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}
- fi
- local -a start_end
- start_end=( ${(s:/:)${${(M)${${input#type?${nl}[^$nl]#$nl}}#*$nl}%$nl}} )
- (( start_end[1] >= 0 )) && region_highlight+=("$start_end[1] $start_end[2] $__style")
- zle -R
- fi
-
- FAST_HIGHLIGHT[whatis_chroma_callback_was_ran]=1
- return 0
-}
-
-zle -N -- -fast-whatis-chroma-callback
-
-if (( __first_call )) && [[ -z "${FAST_HIGHLIGHT[whatis_chroma_type]}" ]] ;then
- if ! command -v whatis > /dev/null; then
- FAST_HIGHLIGHT[whatis_chroma_type]=0
- return 1
- fi
-
- exec {THEFD}< <(
- print "test"
- LANG=C whatis "osx whatis fallback check"
- print "$?"
- )
- command true # a workaround of Zsh bug
- zle -F ${${FAST_HIGHLIGHT[whatis_chroma_zle_-F_have_-w_opt]:#0}:+-w} "$THEFD" -fast-whatis-chroma-callback
-fi
-
-[[ "$__arg_type" = 3 ]] && return 2
-
-if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
-fi
-
-if (( __first_call )) || [[ "$__wrd" = -* ]]; then
- return 1
-elif (( ! FAST_HIGHLIGHT[whatis_chroma_type] )); then
- # Return 1 (i.e. treat the argument as a path) only if the callback have
- # had a chance to establish the whatis_chroma_type field
- (( FAST_HIGHLIGHT[whatis_chroma_callback_was_ran] )) && return 1
-else
- if [[ -z "${FAST_HIGHLIGHT[whatis-cache-$__wrd]}" ]]; then
- if (( FAST_HIGHLIGHT[whatis_chroma_type] == 2 )); then
- exec {THEFD}< <(
- print "type2"
- print "$__wrd"
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER} ))
- print "$__start/$__end"
- LANG=C whatis "$__wrd" 2>/dev/null
- )
- command true # see above
- zle -F ${${FAST_HIGHLIGHT[whatis_chroma_zle_-F_have_-w_opt]:#0}:+-w} "$THEFD" -fast-whatis-chroma-callback
- else
- exec {THEFD}< <(
- print "type1"
- print "$__wrd"
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER} ))
- print "$__start/$__end"
- LANG=C whatis "$__wrd" &> /dev/null
- print "$?"
- )
- command true
- zle -F ${${FAST_HIGHLIGHT[whatis_chroma_zle_-F_have_-w_opt]:#0}:+-w} "$THEFD" -fast-whatis-chroma-callback
- fi
- else
- check=${FAST_HIGHLIGHT[whatis-cache-$__wrd]}
- if (( check )) then
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}
- elif [[ ${~__wrd} = */* && -e ${~__wrd} ]] then
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}path]}
- elif (( FAST_HIGHLIGHT[whatis_chroma_type] )); then
- __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}incorrect-subtle]}
- fi
- [[ -n "$__style" ]] && \
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
- reply+=("$__start $__end $__style")
- fi
-fi
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4:sts=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-which.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-which.ch
deleted file mode 100644
index 5a5d7b3..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-which.ch
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Outputs (under prompt) result of query done with `which', `type -w',
-# `whence -v', `whereis', `whatis'.
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-#
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg; the token can be eg.: "grep"
-#
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-#
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
-local __style __output __chars
-integer __idx1 __idx2
-local -a __results
-
-# First call, i.e. command starts, i.e. "grep" token etc.
-(( __first_call )) && {
- FAST_HIGHLIGHT[chroma-which-counter]=0
- FAST_HIGHLIGHT[chroma-which-counter-all]=1
- FAST_HIGHLIGHT[chroma-which-message]=""
- FAST_HIGHLIGHT[chroma-which-skip-two]=0
- __style=${FAST_THEME_NAME}command
- __output=""
-
-# Following call (not first one).
-} || {
- (( FAST_HIGHLIGHT[chroma-which-counter-all] += 1, __idx2 = FAST_HIGHLIGHT[chroma-which-counter-all] ))
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- fi
-
- if [[ "$__wrd" = -* ]]; then
- # Detected option, add style for it.
- [[ "$__wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- if [[ "$__wrd" = "-x" ]]; then
- FAST_HIGHLIGHT[chroma-which-skip-two]=1
- fi
- else
- # Count non-option tokens.
- if (( FAST_HIGHLIGHT[chroma-which-skip-two] )); then
- FAST_HIGHLIGHT[chroma-which-skip-two]=0
- else
- (( FAST_HIGHLIGHT[chroma-which-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-which-counter] ))
- if [[ "$__idx1" -eq 1 ]]; then
- __chars="{"
- __output="$(command which "$__wrd" 2>/dev/null)"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"command which: $__output"
- __output="$(builtin which "$__wrd" 2>/dev/null)"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"builtin which: ${${${${__output[1,100]}//$'\n'/;}//$'\t'/ }//$__chars;/$__chars}${__output[101,101]:+...}"
- __output="$(builtin type -w "$__wrd" 2>/dev/null)"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"type -w: $__output"
- __output="$(builtin whence -v "$__wrd" 2>/dev/null)"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"whence -v: $__output"
- __output="$(command whereis "$__wrd" 2>/dev/null)"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"whereis: $__output"
- __output="$(command whatis "$__wrd" 2>/dev/null)"
- __output="${${__output%%$'\n'*}//[[:blank:]]##/ }"
- FAST_HIGHLIGHT[chroma-which-message]+=$'\n'"whatis: $__output"
- fi
- fi
- fi
-
- if (( ${#${(z)BUFFER}} <= FAST_HIGHLIGHT[chroma-which-counter-all] )); then
- [[ -n "${FAST_HIGHLIGHT[chroma-which-message]}" ]] && zle -M "${FAST_HIGHLIGHT[chroma-which-message]#$'\n'}"
- fi
-}
-
-# Add region_highlight entry (via `reply' array).
-#
-# This is a common place of adding such entry, but any above code
-# can do it itself and skip setting __style to disable this code.
-[[ -n "$__style" ]] && (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-
-# We aren't passing-through (no return 1 occured), do obligatory things ourselves.
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-zplugin.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-zplugin.ch
deleted file mode 100644
index 2302da5..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-zplugin.ch
+++ /dev/null
@@ -1,348 +0,0 @@
-# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# Copyright (c) 2018-2019 Sebastian Gniazdowski
-#
-# Chroma function for command `git'. It colorizes the part of command
-# line that holds `git' invocation.
-
-(( FAST_HIGHLIGHT[-zplugin.ch-chroma-def] )) && return 1
-
-FAST_HIGHLIGHT[-zplugin.ch-chroma-def]=1
-
-typeset -gA fsh__zplugin__chroma__def
-fsh__zplugin__chroma__def=(
- ##
- ## No subcommand
- ##
- ## {{{
-
- subcmd:NULL "NULL_0_opt"
- NULL_0_opt "(-help|--help|-h)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- "subcommands" "(help|man|self-update|cd|times|zstatus|load|light|unload|snippet|ls|ice|<ice|specification>|update|status|report|delete|loaded|list|cd|create|edit|glance|stress|changes|recently|clist|completions|cdisable|cname|cenable|cname|creinstall|cuninstall|csearch|compinit|dtrace|dstart|dstop|dunload|dreport|dclear|compile|uncompile|compiled|cdlist|cdreplay|cdclear|srv|recall|env-whitelist|bindkeys|module)"
-
- ## }}}
-
- # Generic actions
- NO_MATCH_\#_opt "* <<>> __style=\${FAST_THEME_NAME}incorrect-subtle // NO-OP"
- NO_MATCH_\#_arg "__style=\${FAST_THEME_NAME}incorrect-subtle // NO-OP"
-
-
- ##
- ## `ice'
- ##
- ## {{{
-
- subcmd:ice "ICE_#_arg // NO_MATCH_#_opt"
-
- "ICE_#_arg" "NO-OP // :::chroma/-zplugin-check-ice-mod"
-
- ## }}}
-
- ##
- ## `snippet'
- ##
- ## {{{
-
- subcmd:snippet "SNIPPET_0_opt // SNIPPET_1_arg // NO_MATCH_#_opt //
- NO_MATCH_#_arg"
-
- SNIPPET_0_opt "(-f|--command)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- SNIPPET_1_arg "NO-OP // :::chroma/-zplugin-verify-snippet"
-
- ## }}}
-
- ##
- ## `load'
- ##
- ## {{{
-
- "subcmd:(load|light|compile|stress|edit|glance|recall|status|cd|changes)"
- "LOAD_1_arg // LOAD_2_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- LOAD_1_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- LOAD_2_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- ## }}}
-
- ##
- ## `update'
- ##
- ## {{{
-
- subcmd:update "UPDATE_0_opt // LOAD_1_arg // LOAD_2_arg //
- NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- UPDATE_0_opt "
- (--all|-r|--reset|-q|--quiet)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- LOAD_1_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- LOAD_2_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- ## }}}
-
- ##
- ## `light'
- ##
- ## {{{
-
- subcmd:light "LIGHT_0_opt // LOAD_1_arg // LOAD_2_arg // NO_MATCH_#_opt //
- NO_MATCH_#_arg"
-
- LIGHT_0_opt "-b
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- ## }}}
-
- ##
- ## `unload|report'
- ##
- ## {{{
-
- subcmd:"(unload|report)" "UNLOAD_1_arg // UNLOAD_2_arg // NO_MATCH_#_opt //
- NO_MATCH_#_arg"
-
- UNLOAD_1_arg "NO-OP // :::chroma/-zplugin-verify-loaded-plugin"
-
- UNLOAD_2_arg "NO-OP // :::chroma/-zplugin-verify-loaded-plugin"
-
- ## }}}
-
- ##
- ## `delete'
- ##
- ## {{{
-
- "subcmd:delete"
- "DELETE_0_opt // LOAD_1_arg // LOAD_2_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- DELETE_0_opt "
- (--all|--clean|-y|--yes|-q|--quiet)
- <<>> NO-OP // :::chroma/main-chroma-std-aopt-action"
-
- LOAD_1_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- LOAD_2_arg "NO-OP // :::chroma/-zplugin-verify-plugin"
-
- ## }}}
-
- ##
- ## `cenable'
- ##
- ## {{{
-
- subcmd:cenable "COMPLETION_1_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- COMPLETION_1_arg "NO-OP // :::chroma/-zplugin-verify-disabled-completion"
-
- ## }}}
-
- ##
- ## `cdisable'
- ##
- ## {{{
-
- subcmd:cdisable "DISCOMPLETION_1_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- DISCOMPLETION_1_arg "NO-OP // :::chroma/-zplugin-verify-completion"
-
- ## }}}
-
-
- ##
- ## `light'
- ##
- ## {{{
-
- subcmd:uncompile "UNCOMPILE_1_arg // NO_MATCH_#_opt // NO_MATCH_#_arg"
-
- UNCOMPILE_1_arg "NO-OP // :::chroma/-zplugin-verify-compiled-plugin"
-
- ## }}}
-
- ##
- ## `*'
- ##
- ## {{{
-
- "subcmd:*" "CATCH_ALL_#_opt"
- "CATCH_ALL_#_opt" "* <<>> NO-OP // :::chroma/main-chroma-std-aopt-SEMI-action"
-
- ## }}}
-)
-
-#:chroma/-zplugin-first-call() {
- # This is being done in the proper place - in -fast-highlight-process
- #FAST_HIGHLIGHT[chroma-zplugin-ice-elements-svn]=0
-#}
-
-:chroma/-zplugin-verify-plugin() {
- local _scmd="$1" _wrd="$4"
-
- [[ -d "$_wrd" ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; }
-
- typeset -a plugins
- plugins=( "${ZPLGM[PLUGINS_DIR]}"/*(N:t) )
- plugins=( "${plugins[@]//---//}" )
- plugins=( "${plugins[@]:#_local/zplugin}" )
- plugins=( "${plugins[@]:#custom}" )
-
- [[ -n "${plugins[(r)$_wrd]}" ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- return 1
- #__style=${FAST_THEME_NAME}incorrect-subtle
- return 0
-}
-
-:chroma/-zplugin-verify-loaded-plugin() {
- local _scmd="$1" _wrd="$4"
- typeset -a plugins absolute1 absolute2 absolute3 normal
- plugins=( "${ZPLG_REGISTERED_PLUGINS[@]:#_local/zplugin}" )
- normal=( "${plugins[@]:#%*}" )
- absolute1=( "${(M)plugins[@]:#%*}" )
- absolute1=( "${absolute1[@]/\%\/\//%/}" )
- local hm="${HOME%/}"
- absolute2=( "${absolute1[@]/$hm/HOME}" )
- absolute3=( "${absolute1[@]/\%/}" )
- plugins=( $absolute1 $absolute2 $absolute3 $normal )
-
- [[ -n "${plugins[(r)$_wrd]}" ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- return 1
- #__style=${FAST_THEME_NAME}incorrect-subtle
-
- return 0
-}
-
-:chroma/-zplugin-verify-completion() {
- local _scmd="$1" _wrd="$4"
- # Find enabled completions
- typeset -a completions
- completions=( "${ZPLGM[COMPLETIONS_DIR]}"/_*(N:t) )
- completions=( "${completions[@]#_}" )
-
- [[ -n "${completions[(r)${_wrd#_}]}" ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- return 1
-
- return 0
-}
-
-:chroma/-zplugin-verify-disabled-completion() {
- local _scmd="$1" _wrd="$4"
- # Find enabled completions
- typeset -a completions
- completions=( "${ZPLGM[COMPLETIONS_DIR]}"/[^_]*(N:t) )
-
- [[ -n "${completions[(r)${_wrd#_}]}" ]] && \
- __style=${FAST_THEME_NAME}correct-subtle || \
- return 1
-
- return 0
-}
-
-:chroma/-zplugin-verify-compiled-plugin() {
- local _scmd="$1" _wrd="$4"
-
- typeset -a plugins
- plugins=( "${ZPLGM[PLUGINS_DIR]}"/*(N) )
-
- typeset -a show_plugins p matches
- for p in "${plugins[@]}"; do
- matches=( $p/*.zwc(N) )
- if [ "$#matches" -ne "0" ]; then
- p="${p:t}"
- [[ "$p" = (_local---zplugin|custom) ]] && continue
- p="${p//---//}"
- show_plugins+=( "$p" )
- fi
- done
-
- [[ -n "${show_plugins[(r)$_wrd]}" ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- return 1
-}
-
-:chroma/-zplugin-verify-snippet() {
- local _scmd="$1" url="$4" dirname local_dir
- url="${${url#"${url%%[! $'\t']*}"}%/}"
- id_as="${FAST_HIGHLIGHT[chroma-zplugin-ice-elements-id-as]:-${ZPLG_ICE[id-as]:-$url}}"
-
- filename="${${id_as%%\?*}:t}"
- dirname="${${id_as%%\?*}:t}"
- local_dir="${${${id_as%%\?*}:h}/:\/\//--}"
- [[ "$local_dir" = "." ]] && local_dir="" || local_dir="${${${${${local_dir#/}//\//--}//=/--EQ--}//\?/--QM--}//\&/--AMP--}"
- local_dir="${ZPLGM[SNIPPETS_DIR]}${local_dir:+/$local_dir}"
-
- (( ${+ZPLG_ICE[svn]} || ${FAST_HIGHLIGHT[chroma-zplugin-ice-elements-svn]} )) && {
- # TODO: handle the SVN path's specifics
- [[ -d "$local_dir/$dirname" ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- return 1
- } || {
- # TODO: handle the non-SVN path's specifics
- [[ -d "$local_dir/$dirname" ]] && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- return 1
- }
-}
-
-:chroma/-zplugin-check-ice-mod() {
- local _scmd="$1" _wrd="$4"
- [[ "$_wrd" = (svn(\'|\")*|svn) ]] && \
- FAST_HIGHLIGHT[chroma-zplugin-ice-elements-svn]=1
- [[ "$_wrd" = (#b)(id-as(:|)(\'|\")(*)(\'|\")|id-as:(*)|id-as(*)) ]] && \
- FAST_HIGHLIGHT[chroma-zplugin-ice-elements-id-as]="${match[4]}${match[6]}${match[7]}"
-
- # Copy from zplugin-autoload.zsh / -zplg-recall
- local -a ice_order nval_ices ext_val_ices
- ext_val_ices=( ${(@)${(@Ms.|.)ZPLG_EXTS[ice-mods]:#*\'\'*}//\'\'/} )
-
- ice_order=(
- svn proto from teleid bindmap cloneopts id-as depth if wait load
- unload blockf pick bpick src as ver silent lucid notify mv cp
- atinit atclone atload atpull nocd run-atpull has cloneonly make
- service trackbinds multisrc compile nocompile nocompletions
- reset-prompt wrap-track reset sh \!sh bash \!bash ksh \!ksh csh
- \!csh aliases countdown
- # Include all additional ices – after
- # stripping them from the possible: ''
- ${(@s.|.)${ZPLG_EXTS[ice-mods]//\'\'/}}
- )
- nval_ices=(
- blockf silent lucid trackbinds cloneonly nocd run-atpull
- nocompletions sh \!sh bash \!bash ksh \!ksh csh \!csh
- aliases countdown
-
- # Include only those additional ices,
- # don't have the '' in their name, i.e.
- # aren't designed to hold value
- ${(@)${(@s.|.)ZPLG_EXTS[ice-mods]}:#*\'\'*}
-
- # Must be last
- svn
- )
-
- if [[ "$_wrd" = (#b)(${(~j:|:)${ice_order[@]:#(${(~j:|:)nval_ices[@]:#(${(~j:|:)ext_val_ices[@]})})}})(*) ]]; then
- reply+=("$(( __start )) $(( __start+${mend[1]} )) ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-hyphen-option]}")
- reply+=("$(( __start+${mbegin[2]} )) $(( __end )) ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}optarg-string]}")
- -fast-highlight-string
- return 0
- elif [[ "$_wrd" = (#b)(${(~j:|:)nval_ices[@]}) ]]; then
- __style=${FAST_THEME_NAME}single-hyphen-option
- return 0
- else
- __style=${FAST_THEME_NAME}incorrect-subtle
- return 1
- fi
-}
-
-return 0
-
-# vim:ft=zsh:et:sw=4
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/main-chroma.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/main-chroma.ch
deleted file mode 100644
index 842bf8b..0000000
--- a/.config/shell/zsh-fast-syntax-highlighting/:chroma/main-chroma.ch
+++ /dev/null
@@ -1,453 +0,0 @@
-# Copyright (c) 2018 Sebastian Gniazdowski
-#
-# Main chroma function. It allows to create the command-dedicated chromas
-# (like -git.ch) through a definition provided by `chroma_def' array (read
-# from the upper scope).
-#
-# $1 - 0 or 1, denoting if it's first call to the chroma, or following one
-# $2 - the current token, also accessible by $__arg from the above scope -
-# basically a private copy of $__arg
-# $3 - a private copy of $_start_pos, i.e. the position of the token in the
-# command line buffer, used to add region_highlight entry (see man),
-# because Zsh colorizes by *ranges* in command line buffer
-# $4 - a private copy of $_end_pos from the above scope
-#
-
-(( next_word = 2 | 8192 ))
-
-:chroma/main-chroma-print() {
- (( FAST_HIGHLIGHT[DEBUG] )) && print "$@" >> /tmp/fsh-dbg
-}
-
-local __chroma_name="${1#\%}" __first_call="$2" __wrd="$3" __start_pos="$4" __end_pos="$5"
-
-# Not a well formed chroma name
-[[ -z "$__chroma_name" ]] && return 1
-
-# Load the fsh_{name-of-the-chroma}_chroma_def array
-(( !FAST_HIGHLIGHT[-${__chroma_name}.ch-chroma-def] )) && :chroma/-${__chroma_name}.ch
-
-:chroma/main-chroma-print -r -- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-:chroma/main-chroma-print -r -- @@@@@@@ local __chroma_name="${1#\%}" __first_call="$2" __wrd="$3" __start_pos="$4" __end_pos="$5" @@@@@@@
-local __style __entry __value __action __handler __tmp __svalue __hspaces=$'\t ' __nl=$'\n' __ch_def_name
-integer __idx1 __idx2 __start __end __ivalue __have_value=0
-local -a __lines_list __avalue
-local -A map
-map=( "#" "_H" "^" "_D" "*" "_S" )
-
-(( __start=_start_pos-__PBUFLEN, __end=_end_pos-__PBUFLEN ))
-
-# Handler that highlights the options
-:chroma/main-chroma-std-aopt-action() {
- integer _start="$2" _end="$3"
- local _scmd="$1" _wrd="$4"
-
- [[ "$_wrd" = (#b)(--[a-zA-Z0-9_-]##)=(*) ]] && {
- reply+=("$_start $(( _end - mend[2] + mbegin[2] - 1 )) ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-hyphen-option]}")
- } || {
- [[ "$_wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- }
-}
-
-# Handler that highlights the options' arguments
-:chroma/main-chroma-std-aopt-ARG-action() {
- integer _start="$2" _end="$3"
- local _scmd="$1" _wrd="$4"
-
- [[ "$_wrd" = (#b)(--[a-zA-Z0-9_-]##)=(*) ]] && {
- reply+=("$(( _start + 1 + mend[1] )) $_end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}optarg-${${${(M)match[2]:#<->}:+number}:-string}]}")
- } || __style=${FAST_THEME_NAME}optarg-${${${(M)_wrd:#(-|)<->}:+number}:-string}
-}
-
-# This handler also highlights explicit arguments, i.e. --opt=the-explicit-arg
-:chroma/main-chroma-std-aopt-SEMI-action() {
- integer _start="$2" _end="$3"
- local _scmd="$1" _wrd="$4"
-
- [[ "$_wrd" = (#b)(--[a-zA-Z0-9_-]##)=(*) ]] && {
- reply+=("$_start $(( _end - mend[2] + mbegin[2] - 1 )) ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}double-hyphen-option]}")
- reply+=("$(( _start + 1 + mend[1] )) $_end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}optarg-${${${(M)match[2]:#<->}:+number}:-string}]}")
- } || {
- [[ "$_wrd" = --* ]] && __style=${FAST_THEME_NAME}double-hyphen-option || \
- __style=${FAST_THEME_NAME}single-hyphen-option
- }
-}
-
-# A handler which verifies the token as an GIT url
-:chroma/main-chroma-std-verify-url() {
- setopt localoptions extendedglob
- local _wrd="$4"
- integer url_correct=0
- # Correct matches
- # Correct matches
- if [[ "$_wrd" = (#b)(git|http|https|ftp|ftps|file)://([a-zA-Z0-9._~-]##)(:[0-9]##)(#c0,1)(/([a-zA-Z0-9./_~:-]##))(#c0,1) ]]; then
- url_correct=1
- elif [[ "$_wrd" = (#b)rsync://([a-zA-Z0-9._~-]##)(/([a-zA-Z0-9./_~:-]##))(#c0,1) ]]; then
- url_correct=1
- elif [[ "$_wrd" = (#b)ssh://([a-zA-Z0-9._~-]##@)(#c0,1)([a-zA-Z0-9._~-]##)(:[0-9]##)(#c0,1)(/([a-zA-Z0-9./_~:-]##))(#c0,1) ]]; then
- url_correct=1
- elif [[ "$_wrd" = (#b)([a-zA-Z0-9._~-]##@)(#c0,1)([a-zA-Z0-9._~-]##):([a-zA-Z0-9./_~:-](#c0,1)[a-zA-Z0-9._~:-][a-zA-Z0-9./_~:-]#)(#c0,1) ]]; then
- url_correct=1
- elif [[ "$_wrd" = (#b)[[:alnum:]/_~:.-]## ]]; then
- url_correct=1
- fi
-
- (( url_correct )) && \
- { __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
- { __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
-}
-
-# A handler which verifies the token as a shell wildcard
-:chroma/main-chroma-std-verify-pattern() {
- setopt localoptions extendedglob
- local _wrd="$4"
- __style=${FAST_THEME_NAME}globbing-ext
-}
-
-# Creates a hash table for given option set (an *_opt field in the chroma def.)
-:chroma/main-create-OPTION-hash.ch() {
- local __subcmd="$1" __option_set_id="$2" __the_hash_name="$3" __ __e __el __the_hash_name __var_name
- local -a __split __sp __s
-
- :chroma/main-chroma-print -rl "======================" " **## STARTING ##** :chroma/main-##CREATE##-option-HASH.ch // subcmd:$__subcmd // option_set_id:$__option_set_id // h-nam:$__the_hash_name"
- :chroma/main-chroma-print "[D] Got option-set: ${(j:,:)__option_set_id}"
- typeset -gA "$__the_hash_name"
- :chroma/main-chroma-print "[E] __the_hash_name ${__the_hash_name}:[$__option_set_id]"
-
- # Split on ||
- __ch_def_name="fsh__${__chroma_name}__chroma__def[${__option_set_id}]"
- __split=( "${(P@s:||:)__ch_def_name}" )
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && __split=()
- # Remove only leading and trailing whitespace
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
-
- :chroma/main-chroma-print -rl "[F] Got ||-__split: _________" ${${(@)${${__split[@]##[[:space:]]##}[@]//[${__hspaces}]##/ }[@]//[${__nl}]##/$__nl}[@]//(#s)/:::} "_________"
- for __el in $__split; do
- __sp=( "${(@s:<<>>:)__el}" )
- [[ ${#__sp} -eq 1 && -z "${__sp[1]}" ]] && __sp=()
- __sp=( "${__sp[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
-
- :chroma/main-chroma-print -l -- "Processing an ||-part - got <<>>-split: _________" "${${__sp[@]}[@]/(#s)/-\\t}" "_________"
- __e="${__sp[1]}"
- local __e1=${${__e#\(}%\)(:add|:del|)}
- local __e2=${(M)__e##\(*\)(:add|:del)}
- # Split on | with the ( and ) and :add/:del stripped and then append
- # the :add or :del depending on what's on the input line
- __s=()
- for __ in ${(@s:|:)__e1}; do
- __s+=( $__${__e2:+${(M)__e%(:add|:del)}} )
- done
- [[ ${#__s} -eq 1 && -z "${__s[1]}" ]] && __s=()
- __s=( "${__s[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- shift __sp
-
- for __ in $__s; do
- __=${__%\^}
- [[ "$__" = -*:(add|del) ]] && __var_name="${__the_hash_name}[${__}-directive]" || __var_name="${__the_hash_name}[${__}-opt-action]"
- :chroma/main-chroma-print "${(r:70:: :):-${__var_name}} := >>${__sp[1]}${${${#__sp}:#(0|1)}:+ +}<<"
- : ${(P)__var_name::=${__sp[1]}${${${#__sp}:#(0|1)}:+ +}}
-
- if (( ${#__sp} >= 2 )); then
- __var_name="${__the_hash_name}[${__}-opt-arg-action]"
- :chroma/main-chroma-print "${(r:70:: :):-${__var_name}} := >>${__sp[2]}<<}"
- : ${(P)__var_name::=$__sp[2]}
- fi
- done
- done
-}
-
-# Processes given token
-:chroma/main-process-token.ch() {
- local __subcmd="$1" __wrd="$2" __val __var_name __main_hash_name __the_hash_name __i __size
- local -a __splitted __split __added
-
- :chroma/main-chroma-print "\n******************* Starting :chroma/main-process-token <<$__wrd>>// subcmd:${(qq)__subcmd}"
- __main_hash_name="fsh__chroma__main__${${FAST_HIGHLIGHT[chroma-current]//[^a-zA-Z0-9_]/_}//(#b)([\#\^\*])/${map[${match[1]}]}}"
- __var_name="${__main_hash_name}[subcmd:$__subcmd]"
- __splitted=( "${(@s://:P)__var_name}" )
- [[ ${#__splitted} -eq 1 && -z "${__splitted[1]}" ]] && __splitted=()
- __splitted=( "${__splitted[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
-
- :chroma/main-chroma-print -rl -- "[B] MAIN-PROCESS-TOKEN: got [OPTION/ARG-**S-E-T-S**] //-splitted from subcmd:$__subcmd: ${${(j:, :)__splitted}:-EMPTY-SET!}" "----- __splitted\\Deleted: -----" ${${(j:, :)${__splitted[@]:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})}}:-EMPTY-SET (deleted)!} "----- Added\\Deleted: -----" ${${(j:, :)${${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]}:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})}}:-EMPTY-SET (added)!} -----\ Deleted:\ ----- ${(j:, :)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}} >> /tmp/reply
-
- (( ! ${#__splitted} )) && {
- __var_name="${__main_hash_name}[subcmd:*]"
- __splitted=( "${(@s://:P)__var_name}" )
- [[ ${#__splitted} -eq 1 && -z "${__splitted[1]}" ]] && __splitted=()
- __splitted=( "${__splitted[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- (( ! ${#__splitted} )) && return 1
- }
-
- :chroma/main-chroma-print -rl -- "---NO-HASH-CREATE-FROM-NOW-ON---"
-
- if [[ -z "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]}" ]]; then
- :chroma/main-chroma-print -rl -- "-z OPT-WITH-ARG-ACTIVE == true"
- if [[ "$__wrd" = -* ]]; then
- :chroma/main-chroma-print "1st-PATH (-z opt-with-arg-active, non-opt-arg branch, i.e. OPTION BRANCH) [#${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}]"
- for __val in ${__splitted[@]:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})} ${${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]}:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})}; do
- [[ "${__val}" != "${__val%%_([0-9]##|\#)##*}"_${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}_opt(\*|\^|) && "${__val}" != "${__val%%_([0-9]##|\#)*}"_"#"_opt(\*|\^|) ]] && { :chroma/main-chroma-print "DIDN'T MATCH $__val / arg counter:${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}" ; continue; } || :chroma/main-chroma-print "Got candidate: $__val"
- # Create the hash cache-parameter if needed
- __the_hash_name="fsh__chroma__${FAST_HIGHLIGHT[chroma-current]//[^a-zA-Z0-9_]/_}__${__subcmd//[^a-zA-Z0-9_]/_}__${${__val//(#b)([\#\^\*])/${map[${match[1]}]}}//[^a-zA-Z0-9_]/_}"
- [[ "$__val" = *_opt(\*|\^|) && "${(P)+__the_hash_name}" -eq 0 ]] && :chroma/main-create-OPTION-hash.ch "$__subcmd" "$__val" "$__the_hash_name" || :chroma/main-chroma-print "Not creating, the hash already exists..."
- # Try dedicated-entry for the option
- __var_name="${__the_hash_name}[${${${${(M)__wrd#?*=}:+${__wrd%=*}=}:-$__wrd}}-opt-action]"
- __split=( "${(@s://:P)__var_name}" )
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && __split=()
- # If no result, then try with catch-all entry
- (( ! ${#__split} )) && {
- :chroma/main-chroma-print "% no ${(q-)${${${(M)__wrd#?*=}:+${__wrd%=*}=}:-$__wrd}}-opt-action, retrying with *-opt-action" "|__var_name|:$__var_name"
- __var_name="${__the_hash_name}[*-opt-action]"
- __split=( "${(@s://:P)__var_name}" )
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && __split=()
- }
- __svalue="$__var_name"
- # Remove whitespace
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- :chroma/main-chroma-print -l -- "\`$__val' // ${#__split} // $__wrd: (ch.run #${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr]}), deref. of \`$__var_name'"
- if (( ${#__split} )); then
- :chroma/main-chroma-print -l -- "Got split of {\$#__split:$#__split} ${__wrd}-opt-action or *-opt-action" "${${(q-)__split[@]}[@]/(#s)/->\\t}"
- if [[ "${__split[2]}" = *[[:blank:]]+ ]]; then
- :chroma/main-chroma-print "YES handling the value (the OPT.ARGUMENT)! [${__split[2]}]"
- if [[ "$__wrd" = *=* ]]; then
- :chroma/main-chroma-print "The-immediate Arg-Acquiring, of option"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]="${__svalue%-opt-action\]}-opt-arg-action]"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-arg]="${__wrd#*=}"
- __have_value=2
- else
- :chroma/main-chroma-print "Enable Arg-Awaiting, of option"
- :chroma/main-chroma-print "FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]=\"${__svalue%-opt-action\]}-opt-arg-action]\""
- __have_value=0
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]="${__svalue%-opt-action\]}-opt-arg-action]"
- fi
- fi
-
- __action="${__split[1]}"
- __handler="${__split[2]%[[:blank:]]+}"
-
- # Check for directives (like :add)
- if [[ "$__val" = *_opt\^ ]]; then
- __var_name="${__the_hash_name}[${${${${(M)__wrd#?*=}:+${__wrd%=*}=}:-$__wrd}}:add-directive]"
- (( ${(P)+__var_name} )) && __split=( "${(@s://:P)__var_name}" ) || __split=()
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && __split[1]=()
- __ivalue=${#__split}
- __var_name="${__var_name%:add-*}:del-directive]"
- (( ${(P)+__var_name} )) && __split+=( "${(@s://:P)__var_name}" )
- [[ ${#__split} -eq $(( __ivalue + 1 )) && -z "${__split[__ivalue+1]}" ]] && __split[__ivalue+1]=()
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- __tmp=${#__split}
-
- # First: del-directive
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]+="${(j: :)__split[__ivalue+1,__tmp]} "
-
- :chroma/main-chroma-print -rl ":add / :del directives: __ivalue:$__ivalue, THE __SPLIT[#$__tmp]: " "${__split[@]}" "//" "The FAST_HIGHLIGHT[chroma-*deleted-nodes]: " ${=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]} >> /tmp/reply
-
- # Second: add-directive
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]+="${(j: :)__split[1,__ivalue]} "
- fi
- [[ "$__handler" = ::[^[:space:]]* ]] && __handler="${__handler#::}" || __handler=""
- [[ -n "$__handler" && "$__handler" != "NO-OP" ]] && { :chroma/main-chroma-print -rl -- "Running handler(1): $__handler" ; "$__handler" "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]:-NULL}" "$__start" "$__end" "$__wrd"; }
- [[ "$__have_value" -ne 2 && -n "$__action" && "$__action" != "NO-OP" ]] && { :chroma/main-chroma-print -rl "Running action (1): $__action" ; eval "() { $__action; }"; }
- [[ "$__val" != *\* ]] && break
- else
- :chroma/main-chroma-print -rl -- "NO-MATCH ROUTE TAKEN"
- fi
- done
- else
- :chroma/main-chroma-print "1st-PATH-B (-z opt-with-arg-active, non-opt-arg branch, ARGUMENT BRANCH [#${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}]) //// added-nodes: ${=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]}"
- for __val in ${__splitted[@]:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})} ${${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]}:#(${(~j:|:)${(@)=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}})}; do
- [[ "${__val}" != "${__val%%_([0-9]##|\#)*}"_"${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}"_arg(\*|\^|) && "${__val}" != "${__val%%_([0-9]##|\#)*}"_"#"_arg(\*|\^|) ]] && { :chroma/main-chroma-print "Continuing for $__val / arg counter ${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}" ; continue }
- # Create the hash cache-parameter if needed
- __the_hash_name="fsh__chroma__${FAST_HIGHLIGHT[chroma-current]//[^a-zA-Z0-9_]/_}__${__subcmd//[^a-zA-Z0-9_]/_}__${${__val//\#/H}//[^a-zA-Z0-9_]/_}"
- __action="" __handler=""
- :chroma/main-chroma-print "A hit, chosen __val:$__val!"
- __ch_def_name="fsh__${__chroma_name}__chroma__def[$__val]"
- __split=( "${(P@s:<<>>:)__ch_def_name}" )
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
-
- __sp=( "${(@s://:)__split[1]}" )
- __sp=( "${__sp[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- __action="${__sp[1]#*::::: ##}"
-
- # Verify if it's the expected argument
- [[ "${__sp[1]}" = *:::::* && "$__wrd" != ${~${__sp[1]%% ##:::::*}} ]] && \
- { :chroma/main-chroma-print -r "mismatch ${__sp[1]%% ##:::::*} != $__wrd, continuing" ; continue; }
-
- :chroma/main-chroma-print -l -- "Got action record for $__val, i.e. the split:" "${__sp[@]//(#s)/-\t}" "_________"
-
- [[ "${__sp[2]}" = ::[^[:space:]]* ]] && __handler="${__sp[2]#::}" || { [[ -n "$__handler" && "$__handler" != "NO-OP" ]] && :chroma/main-chroma-print "=== Error === In chroma definition: a handler entry ${(q)__sp[2]} without leading \`::'" ; }
- [[ -n "$__handler" && "$__handler" != "NO-OP" ]] && { :chroma/main-chroma-print -rl -- "Running handler(3): $__handler" ; "$__handler" "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]:-NULL}" "$__start" "$__end" "$__wrd"; }
- [[ -n "$__action" && "$__action" != "NO-OP" ]] && { :chroma/main-chroma-print -rl -- "Running action(3): $__action" ; eval "() { $__action; } \"${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]:-NULL}\" \"$__start\" \"$__end\" \"$__wrd\""; }
-
- # Check for argument directives (like :add)
- if (( ${#__split} >= 2 )); then
- for __ in "${(@)__split[2,-1]}"; do
- __splitted=( "${(@s://:)__}" )
- if [[ "${__splitted[1]}" = add:* ]]; then
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]+="${__splitted[1]#add:} ${(j: :)__splitted[2,-1]} "
- elif [[ "${__splitted[1]}" = del:* ]]; then
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]+="${__splitted[1]#del:} ${(j: :)__splitted[2,-1]} "
- fi
- done
- :chroma/main-chroma-print -l "ARGUMENT :add / :del directives: THE __SPLIT[#${#__split}]: " "${__split[@]//(#s)/-\\t}" "//" "The FAST_HIGHLIGHT[chroma-*deleted-nodes]: " ${(@)${=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]}//(#s)/-\\t} "The FAST_HIGHLIGHT[chroma-*added-nodes]: " ${(@)${=FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]}//(#s)/-\\t}
- fi
-
- [[ "$__val" != *\* ]] && break
- done
- fi
- else
- :chroma/main-chroma-print -- "2nd-PATH (-n opt-with-arg-active) NON-EMPTY arg-active:\nThe actual opt-val <<< \$__wrd:$__wrd >>> store (after the \`Arg-Awaiting' in the chroma-run: #$(( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr]-1 )) [current: #$(( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr] ))])"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-arg]="$__wrd"
- __have_value=1
- fi
-
- # Execute the action if not during simulated opt-argument (--opt=...)
- :chroma/main-chroma-print "** BEFORE: \`if (( __have_value ))'"
- if (( __have_value )); then
- :chroma/main-chroma-print "In the \`if (( __have_value ))' [have_value: $__have_value]"
- # Split
- __var_name="${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]}"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]=""
- __split=( "${(@s://:P)__var_name}" )
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && { :chroma/main-chroma-print -rl "NULL at __var_name:$__var_name" ; __split=(); }
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
-
- # Remember 1st level action
- (( __have_value == 2 )) && __value="$__action" || __value=""
-
- if (( ${#__split} )); then
- :chroma/main-chroma-print -l -- "Got //-split (3, for opt-ARG-action, from [$__var_name]):" "${${(q-)__split[@]}[@]/(#s)/+\\t}"
- __action="${__split[1]}"
- __handler="${__split[2]}"
- [[ "$__handler" = ::[^[:space:]]* ]] && __handler="${__handler#::}"
-
- [[ -n "$__handler" && "$__handler" != "NO-OP" ]] && { :chroma/main-chroma-print -rl -- "Running handler(2): $__handler" ; "$__handler" "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]:-NULL}" "$__start" "$__end" "$__wrd"; }
- [[ -n "$__action" && "$__action" != "NO-OP" ]] && { :chroma/main-chroma-print -rl -- "Running action(2): $__action" ; eval "$__action"; }
- :chroma/main-chroma-print -rl -- "The __action value: [$__value]"
- [[ "$__have_value" -eq 2 && -n "$__value" && "$__value" != "NO-OP" ]] && { :chroma/main-chroma-print -rl "Running action (of 1, at 2): $__value" ; eval "$__value"; }
- fi
- fi
- :chroma/main-chroma-print -- "_________ Exiting :chroma/main-process-token.ch $__subcmd / $__wrd _________"
-}
-
-# Iterates over the chroma def. fields and creates initial
-# fields in the fsh__${__chroma_name}__chroma__def hash
-:chroma/-pre_process_chroma_def.ch() {
- local __key __value __ke _val __the_hash_name="$1" __var_name
- local -a __split
-
- :chroma/main-chroma-print -rl -- "Starting PRE_PROCESS for __the_hash_name:$__the_hash_name"
-
- __ch_def_name="fsh__${__chroma_name}__chroma__def[subcommands]"
- local __subcmds="${(P)__ch_def_name}"
- if [[ "$__subcmds" = "::"* ]]; then
- ${__subcmds#::}
- __var_name="${__the_hash_name}[subcommands]"
- : ${(P)__var_name::=(${(j:|:)reply})}
- else
- __var_name="${__the_hash_name}[subcommands]"
- : ${(P)__var_name::=$__subcmds}
- fi
- :chroma/main-chroma-print "Got SUBCOMMANDS: ${(P)__var_name}"
-
- __ch_def_name="fsh__${__chroma_name}__chroma__def[subcmd-hook]"
- local __subcmd_hook="${(P)__ch_def_name}"
- if [[ -n "$__subcmd_hook" ]]; then
- __var_name="${__the_hash_name}[subcmd-hook]"
- : ${(P)__var_name::=$__subcmd_hook}
- fi
-
- __ch_def_name="fsh__${__chroma_name}__chroma__def[(I)subcmd:*]"
- for __key in "${(P@)__ch_def_name}"; do
- __split=( "${(@s:|:)${${__key##subcmd:\((#c0,1)}%\)}}" )
- [[ ${#__split} -eq 1 && -z "${__split[1]}" ]] && __split=()
- __split=( "${__split[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
- for __ke in "${__split[@]}"; do
- __var_name="${__the_hash_name}[subcmd:$__ke]"
- __ch_def_name="fsh__${__chroma_name}__chroma__def[$__key]"
- : ${(P)__var_name::=${(P)__ch_def_name}}
- :chroma/main-chroma-print -rl -- "Storred ${__var_name}=chroma_def[$__key], i.e. = ${(P)__ch_def_name}"
- done
- done
-}
-
-if (( __first_call )); then
- :chroma/-${__chroma_name}-first-call
- FAST_HIGHLIGHT[chroma-current]="$__wrd"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]=0
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-got-subcommand]=0
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]=""
- FAST_HIGHLIGHT[chrome-${FAST_HIGHLIGHT[chroma-current]}-occurred-double-hyphen]=0
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]=""
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-arg]=""
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr]=1
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-added-nodes]=""
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-deleted-nodes]=""
- __the_hash_name="fsh__chroma__main__${${FAST_HIGHLIGHT[chroma-current]//[^a-zA-Z0-9_]/_}//(#b)([\#\^])/${map[${match[1]}]}}"
- (( 0 == ${(P)+__the_hash_name} )) && {
- typeset -gA "$__the_hash_name"
- :chroma/-pre_process_chroma_def.ch "$__the_hash_name"
- } || :chroma/main-chroma-print "...No... [\${+$__the_hash_name} ${(P)+__the_hash_name}]"
- return 1
-else
- (( ++ FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr] ))
- # Following call, i.e. not the first one
-
- # Check if chroma should end – test if token is of type
- # "starts new command", if so pass-through – chroma ends
- [[ "$__arg_type" = 3 ]] && return 2
-
- :chroma/main-chroma-print "== @@ Starting @@ #${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-call-nr]} Main-Chroma-call == // << __WORD:$__wrd >> ## Subcommand: ${${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]}:-NULL} //@@// -n option-with-arg-active:${(q-)FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]}"
- if [[ "$__wrd" = -* || -n "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-option-with-arg-active]}"
- ]]; then
- :chroma/main-chroma-print "## The \`if -*' i.e. \`IF OPTION' MAIN branch"
- :chroma/main-process-token.ch "${${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]}:-NULL}" "$__wrd"
- else
- # If at e.g. '>' or destination/source spec (of the redirection)
- if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
- return 1
- elif (( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-got-subcommand] == 0 )); then
- __the_hash_name="fsh__chroma__main__${${FAST_HIGHLIGHT[chroma-current]//[^a-zA-Z0-9_]/_}//(#b)([\#\^])/${map[${match[1]}]}}"
- __var_name="${__the_hash_name}[subcommands]"
- if [[ "$__wrd" = ${(P)~__var_name} ]]; then
- :chroma/main-chroma-print "GOT-SUBCOMMAND := $__wrd, subcmd verification / OK"
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-got-subcommand]=1
- FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]="$__wrd"
- __var_name="${__the_hash_name}[subcmd-hook]"
- (( ${(P)+__var_name} )) && { :chroma/main-chroma-print -r -- "Running subcmd-hook: ${(P)__var_name}" ; "${(P)__var_name}" "$__wrd"; }
- __style="${FAST_THEME_NAME}subcommand"
- else
- :chroma/main-chroma-print "subcmd verif / NOT OK; Incrementing the COUNTER-ARG ${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]} -> $(( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg] + 1 ))" >> /tmp/fsh-dbg
- (( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg] += 1 ))
- :chroma/main-chroma-print "UNRECOGNIZED ARGUMENT ${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}"
- :chroma/main-process-token.ch "${${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]}:-NULL}" "$__wrd"
- fi
- else
- __wrd="${__wrd//\`/x}"
- __arg="${__arg//\`/x}"
- __wrd="${(Q)__wrd}"
-
- :chroma/main-chroma-print "Incrementing the COUNTER-ARG ${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]} -> $(( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg] + 1 ))"
- (( FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg] += 1 ))
- :chroma/main-chroma-print "ARGUMENT ${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-counter-arg]}"
-
- :chroma/main-chroma-print "ELSE *-got-subcommand == 1 is TRUE"
- :chroma/main-process-token.ch "${FAST_HIGHLIGHT[chroma-${FAST_HIGHLIGHT[chroma-current]}-subcommand]}" "$__wrd"
- fi
- fi
-fi
-
-
-# Add region_highlight entry (via `reply' array)
-if [[ -n "$__style" ]]; then
- (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
- && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[$__style]}")
-fi
-
-# We aren't passing-through, do obligatory things ourselves
-(( this_word = next_word ))
-_start_pos=$_end_pos
-
-return 0
-
-# vim:ft=zsh:et:sw=4