diff --git a/.tmux.conf b/.tmux.conf index c93098d..c80a6f3 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,1225 +1,26 @@ -# cat << EOF > /dev/null -# https://github.com/gpakosz/.tmux -# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, -# without any warranty. -# Copyright 2012— Gregory Pakosz (@gpakosz). -# /!\ do not edit this file -# instead, override settings in ~/.tmux.conf.local, see README.md +# minimal tmux config +# history +set -g history-limit 100000 -# -- general ------------------------------------------------------------------- +# mouse +set -g mouse on -set -g default-terminal "screen-256color" # colors! -setw -g xterm-keys on -set -s escape-time 10 # faster command sequences -set -sg repeat-time 600 # increase repeat timeout -set -s focus-events on - -set -g prefix2 C-a # GNU-Screen compatible prefix -bind C-a send-prefix -2 - -set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2) +# utf8 / colors +set -g default-terminal "screen-256color" +set -q -g status-utf8 on setw -q -g utf8 on -set -g history-limit 5000 # boost history +# panes retain path +bind - split-window -v -c "#{pane_current_path}" +bind _ split-window -h -c "#{pane_current_path}" -# edit configuration -bind e new-window -n '~/.tmux.conf.local' "sh -c '\${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'" +# shift+arrow window switching +bind -n S-Left previous-window +bind -n S-Right next-window -# reload configuration -bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' - - -# -- display ------------------------------------------------------------------- - -set -g base-index 1 # start windows numbering at 1 -setw -g pane-base-index 1 # make pane numbering consistent with windows - -setw -g automatic-rename on # rename window to reflect current program -set -g renumber-windows on # renumber windows when a window is closed - -set -g set-titles on # set terminal title - -set -g display-panes-time 800 # slightly longer pane indicators display time -set -g display-time 1000 # slightly longer status messages display time - -set -g status-interval 10 # redraw status line every 10 seconds - -# clear both screen and history -bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history - -# activity -set -g monitor-activity on -set -g visual-activity off - - -# -- navigation ---------------------------------------------------------------- - -# create session -bind C-c new-session - -# find session -bind C-f command-prompt -p find-session 'switch-client -t %%' - -# split current window horizontally -bind - split-window -v -# split current window vertically -bind _ split-window -h - -# pane navigation -bind -r h select-pane -L # move left -bind -r j select-pane -D # move down -bind -r k select-pane -U # move up -bind -r l select-pane -R # move right -bind > swap-pane -D # swap current pane with the next one -bind < swap-pane -U # swap current pane with the previous one - -# maximize current pane -bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D' - -# pane resizing -bind -r H resize-pane -L 2 -bind -r J resize-pane -D 2 -bind -r K resize-pane -U 2 -bind -r L resize-pane -R 2 - -# window navigation -unbind n -unbind p -bind -r C-h previous-window # select previous window -bind -r C-l next-window # select next window -bind Tab last-window # move to last active window - -# toggle mouse -bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse" - - -# -- urlview ------------------------------------------------------------------- - -bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}" - - -# -- facebook pathpicker ------------------------------------------------------- - -bind F run "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id}" - - -# -- list choice (tmux < 2.4) -------------------------------------------------- - -# vi-choice is gone in tmux >= 2.4 -run -b 'tmux bind -t vi-choice h tree-collapse 2> /dev/null || true' -run -b 'tmux bind -t vi-choice l tree-expand 2> /dev/null || true' -run -b 'tmux bind -t vi-choice K start-of-list 2> /dev/null || true' -run -b 'tmux bind -t vi-choice J end-of-list 2> /dev/null || true' -run -b 'tmux bind -t vi-choice H tree-collapse-all 2> /dev/null || true' -run -b 'tmux bind -t vi-choice L tree-expand-all 2> /dev/null || true' -run -b 'tmux bind -t vi-choice Escape cancel 2> /dev/null || true' - - -# -- edit mode (tmux < 2.4) ---------------------------------------------------- - -# vi-edit is gone in tmux >= 2.4 -run -b 'tmux bind -ct vi-edit H start-of-line 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit L end-of-line 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit q cancel 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true' - - -# -- copy mode ----------------------------------------------------------------- - -bind Enter copy-mode # enter copy mode - -run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' -run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' -run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' - -# copy to macOS clipboard -if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"' -if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"' -# copy to X11 clipboard -if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"' -if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"' -# copy to Windows clipboard -if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"' -if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"' - - -# -- buffers ------------------------------------------------------------------- - -bind b list-buffers # list paste buffers -bind p paste-buffer # paste from the top paste buffer -bind P choose-buffer # choose which buffer to paste from - - -# -- user defined overrides ---------------------------------------------------- - -if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local' - - -# -- 8< ------------------------------------------------------------------------ - -run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' - - -# EOF -# -# # exit the script if any statement returns a non-true return value -# set -e -# -# unset GREP_OPTIONS -# export LC_NUMERIC=C -# -# if ! printf '' | sed -E 's///' 2>/dev/null; then -# if printf '' | sed -r 's///' 2>/dev/null; then -# sed () { -# n=$#; while [ "$n" -gt 0 ]; do arg=$1; shift; case $arg in -E*) arg=-r${arg#-E};; esac; set -- "$@" "$arg"; n=$(( n - 1 )); done -# command sed "$@" -# } -# fi -# fi -# -# __newline=' -# ' -# -# _is_enabled() { -# ( ([ x"$1" = x"enabled" ] || [ x"$1" = x"true" ] || [ x"$1" = x"yes" ] || [ x"$1" = x"1" ]) && return 0 ) || return 1 -# } -# -# _circled() { -# circled_digits='⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳' -# if [ "$1" -le 20 ] 2>/dev/null; then -# i=$(( $1 + 1 )) -# eval set -- "$circled_digits" -# eval echo "\${$i}" -# else -# echo "$1" -# fi -# } -# -# if command -v perl > /dev/null 2>&1; then -# _decode_unicode_escapes() { -# printf '%s' "$*" | perl -CS -pe 's/(\\u([0-9A-Fa-f]{1,4})|\\U([0-9A-Fa-f]{1,8}))/chr(hex($2.$3))/eg' 2>/dev/null -# } -# elif bash --norc --noprofile -c '[[ ! $BASH_VERSION < 4.2. ]]' > /dev/null 2>&1; then -# _decode_unicode_escapes() { -# bash --norc --noprofile -c "printf '%b' '$*'" -# } -# elif command -v python > /dev/null 2>&1; then -# _decode_unicode_escapes() { -# python -c "import re; import sys; sys.stdout.write(re.sub(r'\\\U([0-9A-Fa-f]{1,8})', lambda match: r'\U%s' % match.group(1).zfill(8), r'$*').encode().decode('unicode-escape', 'ignore'))" -# } -# else -# _decode_unicode_escapes() { -# printf '%b' "$*" -# } -# fi -# -# _maximize_pane() { -# current_session=${1:-$(tmux display -p '#{session_name}')} -# current_pane=${2:-$(tmux display -p '#{pane_id}')} -# -# dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -E -o '^1 %.+maximized.+$' || true) -# restore=$(echo "$dead_panes" | sed -n -E -e "s/^1 $current_pane .+maximized.+'(%[0-9]+)'$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t $current_pane/p" -e "s/^1 (%[0-9]+) .+maximized.+'$current_pane'$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t \1/p" ) -# -# if [ -z "$restore" ]; then -# [ "$(tmux list-panes -t "$current_session:" | wc -l | sed 's/^ *//g')" -eq 1 ] && tmux display "Can't maximize with only one pane" && return -# window=$(tmux new-window -t "$current_session:" -P "exec maximized... 2> /dev/null & tmux setw -t \"$current_session:\" remain-on-exit on; printf \"Pane has been maximized, press + to restore. %s\" '$current_pane'") -# window=${window%.*} -# -# retry=10 -# while [ x"$(tmux list-panes -t "$window" -F '#{session_name}:#{window_index} #{pane_dead}' 2>/dev/null)" != x"$window 1" ] && [ "$retry" -ne 0 ]; do -# sleep 0.05 -# retry=$((retry - 1)) -# done -# if [ "$retry" -eq 0 ]; then -# tmux display 'Unable to maximize pane' -# fi -# -# new_pane=$(tmux display -t "$window" -p '#{pane_id}') -# tmux setw -t "$window" remain-on-exit off \; swap-pane -s "$current_pane" -t "$new_pane" -# else -# $restore || tmux kill-pane -# fi -# } -# -# _toggle_mouse() { -# old=$(tmux show -gv mouse) -# new="" -# -# if [ "$old" = "on" ]; then -# new="off" -# else -# new="on" -# fi -# -# tmux set -g mouse $new \;\ -# display "mouse: $new" -# } -# -# _battery() { -# count=0 -# charge=0 -# uname_s=$(uname -s) -# case "$uname_s" in -# *Darwin*) -# while IFS= read -r line; do -# if [ x"$discharging" != x"true" ]; then -# discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false") -# fi -# percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%') -# charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }') -# count=$((count + 1)) -# done << EOF -# $(pmset -g batt | grep 'InternalBattery') -# EOF -# ;; -# *Linux*) -# while IFS= read -r batpath; do -# grep -i -q device "$batpath/scope" 2> /dev/null && continue -# -# if [ x"$discharging" != x"true" ]; then -# discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false") -# fi -# bat_capacity="$batpath/capacity" -# if [ -r "$bat_capacity" ]; then -# charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + capacity / 100 }') -# else -# bat_energy_full="$batpath/energy_full" -# bat_energy_now="$batpath/energy_now" -# if [ -r "$bat_energy_full" ] && [ -r "$bat_energy_now" ]; then -# charge=$(awk -v charge="$charge" -v energy_now="$(cat "$bat_energy_now")" -v energy_full="$(cat "$bat_energy_full")" 'BEGIN { print charge + energy_now / energy_full }') -# fi -# fi -# count=$((count + 1)) -# done << EOF -# $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*') -# EOF -# ;; -# *CYGWIN*|*MSYS*|*MINGW*) -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# if [ x"$discharging" != x"true" ]; then -# discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }') -# fi -# charge=$(printf '%s' "$line" | awk -v charge="$charge" '{ print charge + $2 / 100 }') -# count=$((count + 1)) -# done << EOF -# $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining | tr -d '\r' | tail -n +2) -# EOF -# ;; -# *OpenBSD*) -# for batid in 0 1 2; do -# sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue -# if [ x"$discharging" != x"true" ]; then -# discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false") -# fi -# if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then -# charge=$(awk -v charge="$charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.amphour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.amphour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }') -# else -# charge=$(awk -v charge="$charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.watthour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.watthour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }') -# fi -# count=$((count + 1)) -# done -# ;; -# esac -# [ "$count" -ne 0 ] && charge=$(awk -v charge="$charge" -v count="$count" 'BEGIN { print charge / count }') -# if [ "$charge" -eq 0 ]; then -# tmux set -ug '@battery_status' \;\ -# set -ug '@battery_bar' \;\ -# set -ug '@battery_hbar' \;\ -# set -ug '@battery_vbar' \;\ -# set -ug '@battery_percentage' -# return -# fi -# -# variables=$(tmux show -gqv '@battery_bar_symbol_full' \;\ -# show -gqv '@battery_bar_symbol_empty' \;\ -# show -gqv '@battery_bar_length' \;\ -# show -gqv '@battery_bar_palette' \;\ -# show -gqv '@battery_hbar_palette' \;\ -# show -gqv '@battery_vbar_palette' \;\ -# show -gqv '@battery_status_charging' \;\ -# show -gqv '@battery_status_discharging') -# # shellcheck disable=SC2086 -# { set -f; IFS="$__newline"; set -- $variables; unset IFS; set +f; } -# -# battery_bar_symbol_full=$1 -# battery_bar_symbol_empty=$2 -# battery_bar_length=$3 -# battery_bar_palette=$4 -# battery_hbar_palette=$5 -# battery_vbar_palette=$6 -# battery_status_charging=$7 -# battery_status_discharging=$8 -# -# if [ x"$battery_bar_length" = x"auto" ]; then -# columns=$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80) -# if [ "$columns" -ge 80 ]; then -# battery_bar_length=10 -# else -# battery_bar_length=5 -# fi -# fi -# -# if [ x"$discharging" = x"true" ]; then -# battery_status="$battery_status_discharging" -# else -# battery_status="$battery_status_charging" -# fi -# -# if echo "$battery_bar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_bar_palette; unset IFS; set +f; } -# palette_style=$1 -# battery_bg=${2:-none} -# [ x"$palette_style" = x"gradient" ] && \ -# palette="196 202 208 214 220 226 190 154 118 82 46" -# [ x"$palette_style" = x"heat" ] && \ -# palette="243 245 247 144 143 142 184 214 208 202 196" -# -# palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }') -# eval set -- "$palette" -# -# full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }") -# battery_bar="#[bg=$battery_bg]" -# # shellcheck disable=SC2046 -# [ "$full" -gt 0 ] && \ -# battery_bar="$battery_bar$(printf "#[fg=colour%s]$battery_bar_symbol_full" $(echo "$palette" | cut -d' ' -f1-"$full"))" -# # shellcheck disable=SC2046 -# empty=$((battery_bar_length - full)) -# # shellcheck disable=SC2046 -# [ "$empty" -gt 0 ] && \ -# battery_bar="$battery_bar$(printf "#[fg=colour%s]$battery_bar_symbol_empty" $(echo "$palette" | cut -d' ' -f$((full + 1))-$((full + empty))))" -# eval battery_bar="$battery_bar#[fg=colour\${$((full == 0 ? 1 : full))}]" -# elif echo "$battery_bar_palette" | grep -q -E '^(([#a-z0-9]{7,9}|none),?){3}$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_bar_palette; unset IFS; set +f; } -# battery_full_fg=$1 -# battery_empty_fg=$2 -# battery_bg=$3 -# -# full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }") -# [ x"$battery_bg" != x"none" ] && \ -# battery_bar="#[bg=$battery_bg]" -# #shellcheck disable=SC2046 -# [ "$full" -gt 0 ] && \ -# battery_bar="$battery_bar#[fg=$battery_full_fg]$(printf "%0.s$battery_bar_symbol_full" $(seq 1 "$full"))" -# empty=$((battery_bar_length - full)) -# #shellcheck disable=SC2046 -# [ "$empty" -gt 0 ] && \ -# battery_bar="$battery_bar#[fg=$battery_empty_fg]$(printf "%0.s$battery_bar_symbol_empty" $(seq 1 "$empty"))" && \ -# battery_bar="$battery_bar#[fg=$battery_empty_fg]" -# fi -# -# if echo "$battery_hbar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_hbar_palette; unset IFS; set +f; } -# palette_style=$1 -# [ x"$palette_style" = x"gradient" ] && \ -# palette="196 202 208 214 220 226 190 154 118 82 46" -# [ x"$palette_style" = x"heat" ] && \ -# palette="233 234 235 237 239 241 243 245 247 144 143 142 184 214 208 202 196" -# -# palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }') -# eval set -- "$palette" -# -# full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }") -# eval battery_hbar_fg="colour\${$((full == 0 ? 1 : full))}" -# elif echo "$battery_hbar_palette" | grep -q -E '^([#a-z0-9]{7,9},?){3}$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_hbar_palette; unset IFS; set +f; } -# -# # shellcheck disable=SC2046 -# eval $(awk "BEGIN { printf \"battery_hbar_fg=$%d\", (($charge) - 0.001) * $# + 1 }") -# fi -# -# eval set -- "▏ ▎ ▍ ▌ ▋ ▊ ▉ █" -# # shellcheck disable=SC2046 -# eval $(awk "BEGIN { printf \"battery_hbar_symbol=$%d\", ($charge) * ($# - 1) + 1 }") -# battery_hbar="#[fg=${battery_hbar_fg?}]${battery_hbar_symbol?}" -# -# if echo "$battery_vbar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_vbar_palette; unset IFS; set +f; } -# palette_style=$1 -# [ x"$palette_style" = x"gradient" ] && \ -# palette="196 202 208 214 220 226 190 154 118 82 46" -# [ x"$palette_style" = x"heat" ] && \ -# palette="233 234 235 237 239 241 243 245 247 144 143 142 184 214 208 202 196" -# -# palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }') -# eval set -- "$palette" -# -# full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }") -# eval battery_vbar_fg="colour\${$((full == 0 ? 1 : full))}" -# elif echo "$battery_vbar_palette" | grep -q -E '^([#a-z0-9]{7,9},?){3}$'; then -# # shellcheck disable=SC2086 -# { set -f; IFS=,; set -- $battery_vbar_palette; unset IFS; set +f; } -# -# # shellcheck disable=SC2046 -# eval $(awk "BEGIN { printf \"battery_vbar_fg=$%d\", (($charge) - 0.001) * $# + 1 }") -# fi -# -# eval set -- "▁ ▂ ▃ ▄ ▅ ▆ ▇ █" -# # shellcheck disable=SC2046 -# eval $(awk "BEGIN { printf \"battery_vbar_symbol=$%d\", ($charge) * ($# - 1) + 1 }") -# battery_vbar="#[fg=${battery_vbar_fg?}]${battery_vbar_symbol?}" -# -# battery_percentage="$(awk "BEGIN { printf \"%.0f%%\", ($charge) * 100 }")" -# -# tmux set -g '@battery_status' "$battery_status" \;\ -# set -g '@battery_bar' "$battery_bar" \;\ -# set -g '@battery_hbar' "$battery_hbar" \;\ -# set -g '@battery_vbar' "$battery_vbar" \;\ -# set -g '@battery_percentage' "$battery_percentage" -# } -# -# _tty_info() { -# tty="${1##/dev/}" -# uname -s | grep -q "CYGWIN" && cygwin=true -# -# if [ x"$cygwin" = x"true" ]; then -# ps -af | tail -n +2 | awk -v tty="$tty" ' -# ((/ssh/ && !/-W/) || !/ssh/) && $4 == tty { -# user[$2] = $1; parent[$2] = $3; child[$3] = $2 -# } -# END { -# for (i in user) -# { -# if (!(i in child) && parent[i] != 1) -# { -# file = "/proc/" i "/cmdline"; getline command < file; close(file) -# gsub(/\0/, " ", command) -# print i, user[i], command -# exit -# } -# } -# } -# ' -# else -# ps -t "$tty" -o user=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -o pid= -o ppid= -o command= | awk ' -# NR > 1 && ((/ssh/ && !/-W/) || !/ssh/) { -# user[$2] = $1; parent[$2] = $3; child[$3] = $2; for (i = 4 ; i <= NF; ++i) command[$2] = i > 4 ? command[$2] FS $i : $i -# } -# END { -# for (i in parent) -# { -# if (!(i in child) && parent[i] != 1) -# { -# print i, user[i], command[i] -# exit -# } -# } -# } -# ' -# fi -# } -# -# _ssh_or_mosh_args() { -# args=$(printf '%s' "$1" | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1=""; print $0; exit }') -# if [ -z "$args" ]; then -# args=$(printf '%s' "$1" | grep 'mosh-client' | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g') -# fi -# -# printf '%s' "$args" -# } -# -# _username() { -# tty=${1:-$(tmux display -p '#{pane_tty}')} -# ssh_only=$2 -# -# tty_info=$(_tty_info "$tty") -# command=$(printf '%s' "$tty_info" | cut -d' ' -f3-) -# -# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command") -# if [ -n "$ssh_or_mosh_args" ]; then -# # shellcheck disable=SC2086 -# username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk 'NR > 2 { exit } ; /^user / { print $2 }') -# # shellcheck disable=SC2086 -# [ -z "$username" ] && username=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" $ssh_or_mosh_args 2>&1 | awk '/^%username% / { print $2; exit }') -# else -# if ! _is_enabled "$ssh_only"; then -# username=$(printf '%s' "$tty_info" | cut -d' ' -f2) -# fi -# fi -# -# printf '%s' "$username" -# } -# -# _hostname() { -# tty=${1:-$(tmux display -p '#{pane_tty}')} -# ssh_only=$2 -# -# tty_info=$(_tty_info "$tty") -# command=$(printf '%s' "$tty_info" | cut -d' ' -f3-) -# -# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command") -# if [ -n "$ssh_or_mosh_args" ]; then -# # shellcheck disable=SC2086 -# hostname=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk 'NR > 2 { exit } ; /^hostname / { print $2 }') -# # shellcheck disable=SC2086 -# [ -z "$hostname" ] && hostname=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%hostname%% %h >&2'" $ssh_or_mosh_args 2>&1 | awk '/^%hostname% / { print $2; exit }') -# #shellcheck disable=SC1004 -# hostname=$(echo "$hostname" | awk '\ -# { \ -# if ($1~/^[0-9.:]+$/) \ -# print $1; \ -# else \ -# split($1, a, ".") ; print a[1] \ -# }') -# else -# if ! _is_enabled "$ssh_only"; then -# hostname=$(command hostname -s) -# fi -# fi -# -# printf '%s' "$hostname" -# } -# -# _root() { -# tty=${1:-$(tmux display -p '#{pane_tty}')} -# username=$(_username "$tty" false) -# -# if [ x"$username" = x"root" ]; then -# tmux show -gqv '@root' -# else -# echo "" -# fi -# } -# -# _uptime() { -# case $(uname -s) in -# *Darwin*) -# boot=$(sysctl -q -n kern.boottime | awk -F'[ ,:]+' '{ print $4 }') -# now=$(date +%s) -# ;; -# *Linux*|*CYGWIN*|*MSYS*|*MINGW*) -# boot=0 -# now=$(cut -d' ' -f1 < /proc/uptime) -# ;; -# *OpenBSD*) -# boot=$(sysctl -n kern.boottime) -# now=$(date +%s) -# esac -# # shellcheck disable=SC1004 -# awk -v boot="$boot" -v now="$now" ' -# BEGIN { -# uptime = now - boot -# y = int(uptime / 31536000) -# dy = int(uptime / 86400) % 365 -# d = int(uptime / 86400) -# h = int(uptime / 3600) % 24 -# m = int(uptime / 60) % 60 -# s = int(uptime) % 60 -# -# system("tmux set -g @uptime_y " y + 0 " \\; " \ -# "set -g @uptime_dy " dy + 0 " \\; " \ -# "set -g @uptime_d " d + 0 " \\; " \ -# "set -g @uptime_h " h + 0 " \\; " \ -# "set -g @uptime_m " m + 0 " \\; " \ -# "set -g @uptime_s " s + 0) -# }' -# } -# -# _loadavg() { -# case $(uname -s) in -# *Darwin*) -# tmux set -g @loadavg "$(sysctl -q -n vm.loadavg | cut -d' ' -f2)" -# ;; -# *Linux*) -# tmux set -g @loadavg "$(cut -d' ' -f1 < /proc/loadavg)" -# ;; -# *OpenBSD*) -# tmux set -g @loadavg "$(sysctl -q -n vm.loadavg | cut -d' ' -f1)" -# ;; -# esac -# } -# -# _split_window() { -# tty=${1:-$(tmux display -p '#{pane_tty}')} -# shift -# -# tty_info=$(_tty_info "$tty") -# command=$(printf '%s' "$tty_info" | cut -d' ' -f3-) -# -# case "$command" in -# *mosh-client*) -# # shellcheck disable=SC2046 -# tmux split-window "$@" mosh $(echo "$command" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/') -# ;; -# *ssh*) -# # shellcheck disable=SC2046 -# tmux split-window "$@" $(echo "$command" | sed -e 's/;/\\;/g') -# ;; -# *) -# tmux split-window "$@" -# esac -# } -# -# _apply_overrides() { -# tmux_conf_theme_24b_colour=${tmux_conf_theme_24b_colour:-false} -# if _is_enabled "$tmux_conf_theme_24b_colour"; then -# case "$TERM" in -# screen-*|tmux-*) -# ;; -# *) -# tmux set-option -ga terminal-overrides ",*256col*:Tc" -# ;; -# esac -# fi -# } -# -# _apply_bindings() { -# line=$(tmux list-keys | grep new-window | head -1) -# prefix=${line%new-window*} -# column=${#prefix} -# -# tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-false} -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') -# if _is_enabled "$tmux_conf_new_window_retain_current_path"; then -# right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-window$/new-window -c "#{pane_current_path}"/g') -# else -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g') -# fi -# eval "tmux $left $right" 2>/dev/null || true -# done << EOF -# $(tmux list-keys 2>/dev/null | grep -E 'new-window(\s+-c\s+"#{pane_current_path}"|$)') -# EOF -# -# tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true} -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') -# if _is_enabled "$tmux_conf_new_pane_retain_current_path"; then -# right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e '/#\{pane_current_path\}/!s/split(-|_)window([ \t]+#\{pane_tty\})?([ \t]+-(h|v))?/& -c "#{pane_current_path}"/g') -# else -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/[ \t]+(-c[ \t]+(\\")?"#\{pane_current_path\}"(\\")?|-c #\{pane_current_path\})//g') -# fi -# eval "tmux $left $right" 2>/dev/null || true -# done << EOF -# $(tmux list-keys 2>/dev/null | grep -E 'split(-|_)window') -# EOF -# -# tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false} -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') -# if _is_enabled "$tmux_conf_new_pane_reconnect_ssh"; then -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e '/_split_window/!s/"/\\"/g' -e 's/split-window([^;]*)/run-shell "cut -c3- ~\/\.tmux\.conf | sh -s _split_window #{pane_tty}\1"/g') -# else -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/\\"/"/g' -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]*)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g') -# fi -# eval "tmux $left $right" 2>/dev/null || true -# done << EOF -# $(tmux list-keys 2>/dev/null | grep -E 'split(-|_)window') -# EOF -# -# tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false} -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') -# if _is_enabled "$tmux_conf_new_session_prompt"; then -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-session$/command-prompt -p new-session \"new-session -s '"'"'%%'"'"'\"/g') -# else -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'| sed -E -e 's/command-prompt -p new-session[^;]+/new-session/g') -# fi -# eval "tmux $left $right" 2>/dev/null || true -# done << EOF -# $(tmux list-keys 2>/dev/null | grep 'new-session') -# EOF -# -# tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false} -# command -v pbcopy > /dev/null 2>&1 && command='pbcopy' -# command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy' -# command -v xsel > /dev/null 2>&1 && command='xsel -i -b' -# ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1' -# command -v clip.exe > /dev/null 2>&1 && command='clip\.exe' -# [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard' -# -# if [ -n "$command" ]; then -# # shellcheck disable=SC2086 -# for table in "" "-t emacs-copy" "-t vi-copy"; do -# line=$(tmux list-keys $table 2>/dev/null | grep -E 'copy-selection|copy-pipe' | head -1) -# [ -z "$line" ] && continue -# prefix=${line%copy-*} -# column=${#prefix} -# -# while IFS= read -r line; do -# [ -z "$line" ] && continue -# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') -# if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-selection(-and-cancel)?$/copy-pipe\1 \"$command\"/g") -# else -# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-pipe(-and-cancel)? \"?$command\"?$/copy-selection\1/g") -# fi -# eval "tmux $left $right" 2>/dev/null || true -# done << EOF -# $(tmux list-keys $table 2>/dev/null | grep -E 'copy-selection|copy-pipe') -# EOF -# done -# fi -# } -# -# _apply_theme() { -# -# # -- panes ------------------------------------------------------------- -# -# tmux_conf_theme_window_fg=${tmux_conf_theme_window_fg:-default} -# tmux_conf_theme_window_bg=${tmux_conf_theme_window_bg:-default} -# tmux_conf_theme_highlight_focused_pane=${tmux_conf_theme_highlight_focused_pane:-false} -# tmux_conf_theme_focused_pane_fg=${tmux_conf_theme_focused_pane_fg:-'default'} # default -# tmux_conf_theme_focused_pane_bg=${tmux_conf_theme_focused_pane_bg:-'#0087d7'} # light blue -# -# # tmux 1.9 doesn't really like set -q -# if tmux show -g -w | grep -q window-style; then -# tmux setw -g window-style "fg=$tmux_conf_theme_window_fg,bg=$tmux_conf_theme_window_bg" -# -# if _is_enabled "$tmux_conf_theme_highlight_focused_pane"; then -# tmux setw -g window-active-style "fg=$tmux_conf_theme_focused_pane_fg,bg=$tmux_conf_theme_focused_pane_bg" -# else -# tmux setw -g window-active-style default -# fi -# fi -# -# tmux_conf_theme_pane_border_style=${tmux_conf_theme_pane_border_style:-thin} -# tmux_conf_theme_pane_border=${tmux_conf_theme_pane_border:-'#444444'} # light gray -# tmux_conf_theme_pane_active_border=${tmux_conf_theme_pane_active_border:-'#00afff'} # light blue -# tmux_conf_theme_pane_border_fg=${tmux_conf_theme_pane_border_fg:-$tmux_conf_theme_pane_border} -# tmux_conf_theme_pane_active_border_fg=${tmux_conf_theme_pane_active_border_fg:-$tmux_conf_theme_pane_active_border} -# case "$tmux_conf_theme_pane_border_style" in -# fat) -# tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-$tmux_conf_theme_pane_border_fg} -# tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-$tmux_conf_theme_pane_active_border_fg} -# ;; -# thin|*) -# tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-'default'} -# tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-'default'} -# ;; -# esac -# tmux setw -g pane-border-style "fg=$tmux_conf_theme_pane_border_fg,bg=$tmux_conf_theme_pane_border_bg" \; set -g pane-active-border-style "fg=$tmux_conf_theme_pane_active_border_fg,bg=$tmux_conf_theme_pane_active_border_bg" -# -# tmux_conf_theme_pane_indicator=${tmux_conf_theme_pane_indicator:-'#00afff'} # light blue -# tmux_conf_theme_pane_active_indicator=${tmux_conf_theme_pane_active_indicator:-'#00afff'} # light blue -# -# tmux set -g display-panes-colour "$tmux_conf_theme_pane_indicator" \; set -g display-panes-active-colour "$tmux_conf_theme_pane_active_indicator" -# -# # -- status line ------------------------------------------------------- -# -# tmux_conf_theme_left_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_main-''}") -# tmux_conf_theme_left_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_sub-'|'}") -# tmux_conf_theme_right_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_main-''}") -# tmux_conf_theme_right_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_sub-'|'}") -# -# tmux_conf_theme_message_fg=${tmux_conf_theme_message_fg:-'#000000'} # black -# tmux_conf_theme_message_bg=${tmux_conf_theme_message_bg:-'#ffff00'} # yellow -# tmux_conf_theme_message_attr=${tmux_conf_theme_message_attr:-'bold'} -# tmux set -g message-style "fg=$tmux_conf_theme_message_fg,bg=$tmux_conf_theme_message_bg,$tmux_conf_theme_message_attr" -# -# tmux_conf_theme_message_command_fg=${tmux_conf_theme_message_command_fg:-'#ffff00'} # yellow -# tmux_conf_theme_message_command_bg=${tmux_conf_theme_message_command_bg:-'#000000'} # black -# tmux_conf_theme_message_command_attr=${tmux_conf_theme_message_command_attr:-'bold'} -# tmux set -g message-command-style "fg=$tmux_conf_theme_message_command_fg,bg=$tmux_conf_theme_message_command_bg,$tmux_conf_theme_message_command_attr" -# -# tmux_conf_theme_mode_fg=${tmux_conf_theme_mode_fg:-'#000000'} # black -# tmux_conf_theme_mode_bg=${tmux_conf_theme_mode_bg:-'#ffff00'} # yellow -# tmux_conf_theme_mode_attr=${tmux_conf_theme_mode_attr:-'bold'} -# tmux setw -g mode-style "fg=$tmux_conf_theme_mode_fg,bg=$tmux_conf_theme_mode_bg,$tmux_conf_theme_mode_attr" -# -# tmux_conf_theme_status_fg=${tmux_conf_theme_status_fg:-'#8a8a8a'} # white -# tmux_conf_theme_status_bg=${tmux_conf_theme_status_bg:-'#080808'} # dark gray -# tmux_conf_theme_status_attr=${tmux_conf_theme_status_attr:-'none'} -# tmux set -g status-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ -# set -g status-left-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ -# set -g status-right-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" -# -# tmux_conf_theme_terminal_title=${tmux_conf_theme_terminal_title:-'#h ❐ #S ● #I #W'} -# -# tmux_conf_theme_terminal_title=$(echo "$tmux_conf_theme_terminal_title" | sed \ -# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \ -# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \ -# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ -# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ -# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ -# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') -# tmux set -g set-titles-string "$(_decode_unicode_escapes "$tmux_conf_theme_terminal_title")" -# -# tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-'#8a8a8a'} # white -# tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-'#080808'} # dark gray -# tmux_conf_theme_window_status_attr=${tmux_conf_theme_window_status_attr:-'none'} -# tmux_conf_theme_window_status_format=${tmux_conf_theme_window_status_format:-'#I #W'} -# -# tmux_conf_theme_window_status_current_fg=${tmux_conf_theme_window_status_current_fg:-'#000000'} # black -# tmux_conf_theme_window_status_current_bg=${tmux_conf_theme_window_status_current_bg:-'#00afff'} # light blue -# tmux_conf_theme_window_status_current_attr=${tmux_conf_theme_window_status_current_attr:-'bold'} -# tmux_conf_theme_window_status_current_format=${tmux_conf_theme_window_status_current_format:-'#I #W'} -# if [ x"$(tmux show -g -v status-justify)" = x"right" ]; then -# tmux_conf_theme_window_status_current_format="#[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_window_status_bg]$tmux_conf_theme_right_separator_main#[fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr] $tmux_conf_theme_window_status_current_format #[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg,none]$tmux_conf_theme_right_separator_main" -# else -# tmux_conf_theme_window_status_current_format="#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg]$tmux_conf_theme_left_separator_main#[fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr] $tmux_conf_theme_window_status_current_format #[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg,none]$tmux_conf_theme_left_separator_main" -# fi -# -# tmux_conf_theme_window_status_format=$(echo "$tmux_conf_theme_window_status_format" | sed \ -# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \ -# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \ -# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ -# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ -# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ -# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') -# tmux_conf_theme_window_status_current_format=$(echo "$tmux_conf_theme_window_status_current_format" | sed \ -# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \ -# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \ -# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ -# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ -# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ -# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') -# -# tmux setw -g window-status-style "fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg,$tmux_conf_theme_window_status_attr" \;\ -# setw -g window-status-format "$(_decode_unicode_escapes "$tmux_conf_theme_window_status_format")" \;\ -# setw -g window-status-current-style "fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr" \;\ -# setw -g window-status-current-format "$(_decode_unicode_escapes "$tmux_conf_theme_window_status_current_format")" -# -# tmux_conf_theme_window_status_activity_fg=${tmux_conf_theme_window_status_activity_fg:-'default'} -# tmux_conf_theme_window_status_activity_bg=${tmux_conf_theme_window_status_activity_bg:-'default'} -# tmux_conf_theme_window_status_activity_attr=${tmux_conf_theme_window_status_activity_attr:-'underscore'} -# tmux setw -g window-status-activity-style "fg=$tmux_conf_theme_window_status_activity_fg,bg=$tmux_conf_theme_window_status_activity_bg,$tmux_conf_theme_window_status_activity_attr" -# -# tmux_conf_theme_window_status_bell_fg=${tmux_conf_theme_window_status_bell_fg:-'#ffff00'} # yellow -# tmux_conf_theme_window_status_bell_bg=${tmux_conf_theme_window_status_bell_bg:-'default'} -# tmux_conf_theme_window_status_bell_attr=${tmux_conf_theme_window_status_bell_attr:-'blink,bold'} -# tmux setw -g window-status-bell-style "fg=$tmux_conf_theme_window_status_bell_fg,bg=$tmux_conf_theme_window_status_bell_bg,$tmux_conf_theme_window_status_bell_attr" -# -# tmux_conf_theme_window_status_last_fg=${tmux_conf_theme_window_status_last_fg:-'#00afff'} # light blue -# tmux_conf_theme_window_status_last_bg=${tmux_conf_theme_window_status_last_bg:-'default'} -# tmux_conf_theme_window_status_last_attr=${tmux_conf_theme_window_status_last_attr:-'none'} -# tmux setw -g window-status-last-style "fg=$tmux_conf_theme_window_status_last_fg,bg=$tmux_conf_theme_window_status_last_bg,$tmux_conf_theme_window_status_last_attr" -# -# # -- indicators -# -# tmux_conf_theme_pairing=${tmux_conf_theme_pairing:-'👓'} # U+1F453 -# tmux_conf_theme_pairing_fg=${tmux_conf_theme_pairing_fg:-'#e4e4e4'} # white -# tmux_conf_theme_pairing_bg=${tmux_conf_theme_pairing_bg:-'none'} -# tmux_conf_theme_pairing_attr=${tmux_conf_theme_pairing_attr:-'none'} -# -# tmux_conf_theme_prefix=${tmux_conf_theme_prefix:-'⌨'} # U+2328 -# tmux_conf_theme_prefix_fg=${tmux_conf_theme_prefix_fg:-'#e4e4e4'} # white -# tmux_conf_theme_prefix_bg=${tmux_conf_theme_prefix_bg:-'none'} -# tmux_conf_theme_prefix_attr=${tmux_conf_theme_prefix_attr:-'none'} -# -# tmux_conf_theme_root=${tmux_conf_theme_root:-'!'} -# tmux_conf_theme_root_fg=${tmux_conf_theme_root_fg:-'none'} -# tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-'none'} -# tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-'bold,blink'} -# -# tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-'🔒'} # U+1F512 -# tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-'none'} -# tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-'none'} -# tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-'none'} -# -# # -- status left style -# -# tmux_conf_theme_status_left=${tmux_conf_theme_status_left-' ❐ #S '} -# tmux_conf_theme_status_left_fg=${tmux_conf_theme_status_left_fg:-'#000000,#e4e4e4,#e4e4e4'} # black, white , white -# tmux_conf_theme_status_left_bg=${tmux_conf_theme_status_left_bg:-'#ffff00,#ff00af,#00afff'} # yellow, pink, white blue -# tmux_conf_theme_status_left_attr=${tmux_conf_theme_status_left_attr:-'bold,none,none'} -# -# tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ -# -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{?session_many_attached,$tmux_conf_theme_pairing,}/g") -# -# tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ -# -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g") -# -# tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") -# -# tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ -# -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") -# -# if [ -n "$tmux_conf_theme_status_left" ]; then -# status_left=$(awk \ -# -v fg_="$tmux_conf_theme_status_left_fg" \ -# -v bg_="$tmux_conf_theme_status_left_bg" \ -# -v attr_="$tmux_conf_theme_status_left_attr" \ -# -v mainsep="$tmux_conf_theme_left_separator_main" \ -# -v subsep="$tmux_conf_theme_left_separator_sub" ' -# function subsplit(s, l, i, a, r) -# { -# l = split(s, a, ",") -# for (i = 1; i <= l; ++i) -# { -# o = split(a[i], _, "(") - 1 -# c = split(a[i], _, ")") - 1 -# open += o - c -# o_ = split(a[i], _, "{") - 1 -# c_ = split(a[i], _, "}") - 1 -# open_ += o_ - c_ -# o__ = split(a[i], _, "[") - 1 -# c__ = split(a[i], _, "]") - 1 -# open__ += o__ - c__ -# -# if (i == l) -# r = sprintf("%s%s", r, a[i]) -# else if (open || open_ || open__) -# r = sprintf("%s%s,", r, a[i]) -# else -# r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep) -# } -# -# gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r) -# return r -# } -# BEGIN { -# FS = "|" -# l1 = split(fg_, fg, ",") -# l2 = split(bg_, bg, ",") -# l3 = split(attr_, attr, ",") -# l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3) -# } -# { -# for (i = j = 1; i <= NF; ++i) -# { -# if (open || open_ || open__) -# printf "|%s", subsplit($i) -# else -# { -# if (i > 1) -# printf "#[fg=%s,bg=%s,none]%s#[fg=%s,bg=%s,%s]%s", bg[j_], bg[j], mainsep, fg[j], bg[j], attr[j], subsplit($i) -# else -# printf "#[fg=%s,bg=%s,%s]%s", fg[j], bg[j], attr[j], subsplit($i) -# } -# -# if (!open && !open_ && !open__) -# { -# j_ = j -# j = j % l + 1 -# } -# } -# printf "#[fg=%s,bg=%s,none]%s", bg[j_], "default", mainsep -# }' << EOF -# $tmux_conf_theme_status_left -# EOF -# ) -# fi -# -# status_left="$status_left " -# -# # -- status right style -# -# tmux_conf_theme_status_right=${tmux_conf_theme_status_right-'#{pairing}#{prefix} #{battery_status} #{battery_bar} #{battery_percentage} , %R , %d %b | #{username} | #{hostname} '} -# tmux_conf_theme_status_right_fg=${tmux_conf_theme_status_right_fg:-'#8a8a8a,#e4e4e4,#000000'} # light gray, white, black -# tmux_conf_theme_status_right_bg=${tmux_conf_theme_status_right_bg:-'#080808,#d70000,#e4e4e4'} # dark gray, red, white -# tmux_conf_theme_status_right_attr=${tmux_conf_theme_status_right_attr:-'none,none,bold'} -# -# tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ -# -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{?session_many_attached,$tmux_conf_theme_pairing,}/g") -# -# tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ -# -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g") -# -# tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") -# -# tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ -# -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") -# -# if [ -n "$tmux_conf_theme_status_right" ]; then -# status_right=$(awk \ -# -v fg_="$tmux_conf_theme_status_right_fg" \ -# -v bg_="$tmux_conf_theme_status_right_bg" \ -# -v attr_="$tmux_conf_theme_status_right_attr" \ -# -v mainsep="$tmux_conf_theme_right_separator_main" \ -# -v subsep="$tmux_conf_theme_right_separator_sub" ' -# function subsplit(s, l, i, a, r) -# { -# l = split(s, a, ",") -# for (i = 1; i <= l; ++i) -# { -# o = split(a[i], _, "(") - 1 -# c = split(a[i], _, ")") - 1 -# open += o - c -# o_ = split(a[i], _, "{") - 1 -# c_ = split(a[i], _, "}") - 1 -# open_ += o_ - c_ -# o__ = split(a[i], _, "[") - 1 -# c__ = split(a[i], _, "]") - 1 -# open__ += o__ - c__ -# -# if (i == l) -# r = sprintf("%s%s", r, a[i]) -# else if (open || open_ || open__) -# r = sprintf("%s%s,", r, a[i]) -# else -# r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep) -# } -# -# gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r) -# return r -# } -# BEGIN { -# FS = "|" -# l1 = split(fg_, fg, ",") -# l2 = split(bg_, bg, ",") -# l3 = split(attr_, attr, ",") -# l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3) -# } -# { -# for (i = j = 1; i <= NF; ++i) -# { -# if (open_ || open || open__) -# printf "|%s", subsplit($i) -# else -# printf "#[fg=%s,bg=%s,none]%s#[fg=%s,bg=%s,%s]%s", bg[j], (i == 1) ? "default" : bg[j_], mainsep, fg[j], bg[j], attr[j], subsplit($i) -# -# if (!open && !open_ && !open__) -# { -# j_ = j -# j = j % l + 1 -# } -# } -# }' << EOF -# $tmux_conf_theme_status_right -# EOF -# ) -# fi -# -# # -- variables -# -# tmux set -g '@root' "$tmux_conf_theme_root" -# -# tmux_conf_battery_bar_symbol_full=${tmux_conf_battery_bar_symbol_full:-'◼'} -# tmux_conf_battery_bar_symbol_empty=${tmux_conf_battery_bar_symbol_empty:-'◻'} -# tmux_conf_battery_bar_length=${tmux_conf_battery_bar_length:-'auto'} -# tmux_conf_battery_bar_palette=${tmux_conf_battery_bar_palette:-'gradient'} -# tmux_conf_battery_hbar_palette=${tmux_conf_battery_hbar_palette:-'gradient'} # red, orange, green -# tmux_conf_battery_vbar_palette=${tmux_conf_battery_vbar_palette:-'gradient'} # red, orange, green -# tmux_conf_battery_status_charging=${tmux_conf_battery_status_charging:-'↑'} # U+2191 -# tmux_conf_battery_status_discharging=${tmux_conf_battery_status_discharging:-'↓'} # U+2193 -# -# case "$status_left $status_right" in -# *'#{battery_status}'*|*'#{battery_bar}'*|*'#{battery_hbar}'*|*'#{battery_vbar}'*|*'#{battery_percentage}'*) -# status_left=$(echo "$status_left" | sed -E \ -# -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \ -# -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \ -# -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \ -# -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \ -# -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g') -# status_right=$(echo "$status_right" | sed -E \ -# -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \ -# -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \ -# -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \ -# -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \ -# -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g') -# -# tmux set -g '@battery_bar_symbol_full' "$(_decode_unicode_escapes "$tmux_conf_battery_bar_symbol_full")" \;\ -# set -g '@battery_bar_symbol_empty' "$(_decode_unicode_escapes "$tmux_conf_battery_bar_symbol_empty")" \;\ -# set -g '@battery_bar_length' "$tmux_conf_battery_bar_length" \;\ -# set -g '@battery_bar_palette' "$tmux_conf_battery_bar_palette" \;\ -# set -g '@battery_hbar_palette' "$tmux_conf_battery_hbar_palette" \;\ -# set -g '@battery_vbar_palette' "$tmux_conf_battery_vbar_palette" \;\ -# set -g '@battery_status_charging' "$(_decode_unicode_escapes "$tmux_conf_battery_status_charging")" \;\ -# set -g '@battery_status_discharging' "$(_decode_unicode_escapes "$tmux_conf_battery_status_discharging")" -# status_right="#(cut -c3- ~/.tmux.conf | sh -s _battery)$status_right" -# ;; -# esac -# -# case "$status_left $status_right" in -# *'#{username}'*|*'#{hostname}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*) -# status_left=$(echo "$status_left" | sed \ -# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ -# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ -# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ -# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') -# status_right=$(echo "$status_right" | sed \ -# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ -# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ -# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ -# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') -# ;; -# esac -# -# case "$status_left $status_right" in -# *'#{uptime_d}'*|*'#{uptime_h}'*|*'#{uptime_m}'*|*'#{uptime_s}'*) -# status_left=$(echo "$status_left" | sed -E \ -# -e 's/#\{(\?)?uptime_y/#\{\1@uptime_y/g' \ -# -e 's/#\{(\?)?uptime_d/#\{\1@uptime_d/g' \ -# -e '/@uptime_y/ s/@uptime_d/@uptime_dy/g' \ -# -e 's/#\{(\?)?uptime_h/#\{\1@uptime_h/g' \ -# -e 's/#\{(\?)?uptime_m/#\{\1@uptime_m/g' \ -# -e 's/#\{(\?)?uptime_s/#\{\1@uptime_s/g') -# status_right=$(echo "$status_right" | sed -E \ -# -e 's/#\{(\?)?uptime_y/#\{\1@uptime_y/g' \ -# -e 's/#\{(\?)?uptime_d/#\{\1@uptime_d/g' \ -# -e '/@uptime_y/ s/@uptime_d/@uptime_dy/g' \ -# -e 's/#\{(\?)?uptime_h/#\{\1@uptime_h/g' \ -# -e 's/#\{(\?)?uptime_m/#\{\1@uptime_m/g' \ -# -e 's/#\{(\?)?uptime_s/#\{\1@uptime_s/g') -# status_right="#(cut -c3- ~/.tmux.conf | sh -s _uptime)$status_right" -# ;; -# esac -# -# case "$status_left $status_right" in -# *'#{loadavg}'*) -# status_left=$(echo "$status_left" | sed -E \ -# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') -# status_right=$(echo "$status_right" | sed -E \ -# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') -# status_right="#(cut -c3- ~/.tmux.conf | sh -s _loadavg)$status_right" -# ;; -# esac -# -# status_left=$(echo "$status_left" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g') -# status_right=$(echo "$status_right" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g') -# -# tmux set -g status-left-length 1000 \; set -g status-left "$(_decode_unicode_escapes "$status_left")" \;\ -# set -g status-right-length 1000 \; set -g status-right "$(_decode_unicode_escapes "$status_right")" -# -# # -- clock ------------------------------------------------------------- -# -# tmux_conf_theme_clock_colour=${tmux_conf_theme_clock_colour:-'#00afff'} # light blue -# tmux_conf_theme_clock_style=${tmux_conf_theme_clock_style:-'24'} -# tmux setw -g clock-mode-colour "$tmux_conf_theme_clock_colour" \;\ -# setw -g clock-mode-style "$tmux_conf_theme_clock_style" -# } -# -# _apply_configuration() { -# -# # see https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard -# if command -v reattach-to-user-namespace > /dev/null 2>&1; then -# default_shell="$(tmux show -gv default-shell)" -# case "$default_shell" in -# *fish) -# tmux set -g default-command "reattach-to-user-namespace -l $default_shell" -# ;; -# *sh) -# tmux set -g default-command "exec $default_shell... 2> /dev/null & reattach-to-user-namespace -l $default_shell" -# ;; -# esac -# fi -# -# _apply_overrides -# _apply_bindings -# _apply_theme -# for name in $(printenv | grep -E -o '^tmux_conf_[^=]+'); do tmux setenv -gu "$name"; done; -# } -# -# _urlview() { -# tmux capture-pane -J -S - -E - -b "urlview-$1" -t "$1" -# tmux split-window "tmux show-buffer -b urlview-$1 | urlview || true; tmux delete-buffer -b urlview-$1" -# } -# -# _fpp() { -# tmux capture-pane -J -S - -E - -b "fpp-$1" -t "$1" -# tmux split-window "tmux show-buffer -b fpp-$1 | fpp || true; tmux delete-buffer -b fpp-$1" -# } -# -# "$@" +# sensible defaults +set -s escape-time 10 +set -g base-index 1 +setw -g pane-base-index 1 +set -g renumber-windows on diff --git a/.tmux.conf.local b/.tmux.conf.local deleted file mode 100644 index 1111746..0000000 --- a/.tmux.conf.local +++ /dev/null @@ -1,301 +0,0 @@ -# https://github.com/gpakosz/.tmux -# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, -# without any warranty. -# Copyright 2012— Gregory Pakosz (@gpakosz). - - -# -- navigation ---------------------------------------------------------------- - -# if you're running tmux within iTerm2 -# - and tmux is 1.9 or 1.9a -# - and iTerm2 is configured to let option key act as +Esc -# - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys -# then uncomment the following line to make Meta + arrow keys mapping work -#set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D" - - -# -- windows & pane creation --------------------------------------------------- - -# new window retains current path, possible values are: -# - true -# - false (default) -tmux_conf_new_window_retain_current_path=false - -# new pane retains current path, possible values are: -# - true (default) -# - false -tmux_conf_new_pane_retain_current_path=true - -# new pane tries to reconnect ssh sessions (experimental), possible values are: -# - true -# - false (default) -tmux_conf_new_pane_reconnect_ssh=false - -# prompt for session name when creating a new session, possible values are: -# - true -# - false (default) -tmux_conf_new_session_prompt=false - - -# -- display ------------------------------------------------------------------- - -# RGB 24-bit colour support (tmux >= 2.2), possible values are: -# - true -# - false (default) -tmux_conf_theme_24b_colour=false - -# window style -tmux_conf_theme_window_fg='default' -tmux_conf_theme_window_bg='default' - -# highlight focused pane (tmux >= 2.1), possible values are: -# - true -# - false (default) -tmux_conf_theme_highlight_focused_pane=false - -# focused pane colours: -tmux_conf_theme_focused_pane_fg='default' -tmux_conf_theme_focused_pane_bg='#0087d7' # light blue - -# pane border style, possible values are: -# - thin (default) -# - fat -tmux_conf_theme_pane_border_style=thin - -# pane borders colours: -tmux_conf_theme_pane_border='#444444' # gray -tmux_conf_theme_pane_active_border='#00afff' # light blue - -# pane indicator colours -tmux_conf_theme_pane_indicator='#00afff' # light blue -tmux_conf_theme_pane_active_indicator='#00afff' # light blue - -# status line style -tmux_conf_theme_message_fg='#000000' # black -tmux_conf_theme_message_bg='#ffff00' # yellow -tmux_conf_theme_message_attr='bold' - -# status line command style ( : Escape) -tmux_conf_theme_message_command_fg='#ffff00' # yellow -tmux_conf_theme_message_command_bg='#000000' # black -tmux_conf_theme_message_command_attr='bold' - -# window modes style -tmux_conf_theme_mode_fg='#000000' # black -tmux_conf_theme_mode_bg='#ffff00' # yellow -tmux_conf_theme_mode_attr='bold' - -# status line style -tmux_conf_theme_status_fg='#8a8a8a' # light gray -tmux_conf_theme_status_bg='#080808' # dark gray -tmux_conf_theme_status_attr='none' - -# terminal title -# - built-in variables are: -# - #{circled_window_index} -# - #{circled_session_name} -# - #{hostname} -# - #{hostname_ssh} -# - #{username} -# - #{username_ssh} -tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W' - -# window status style -# - built-in variables are: -# - #{circled_window_index} -# - #{circled_session_name} -# - #{hostname} -# - #{hostname_ssh} -# - #{username} -# - #{username_ssh} -tmux_conf_theme_window_status_fg='#8a8a8a' # light gray -tmux_conf_theme_window_status_bg='#080808' # dark gray -tmux_conf_theme_window_status_attr='none' -tmux_conf_theme_window_status_format='#I #W' -#tmux_conf_theme_window_status_format='#{circled_window_index} #W' -#tmux_conf_theme_window_status_format='#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}' - -# window current status style -# - built-in variables are: -# - #{circled_window_index} -# - #{circled_session_name} -# - #{hostname} -# - #{hostname_ssh} -# - #{username} -# - #{username_ssh} -tmux_conf_theme_window_status_current_fg='#000000' # black -tmux_conf_theme_window_status_current_bg='#00afff' # light blue -tmux_conf_theme_window_status_current_attr='bold' -tmux_conf_theme_window_status_current_format='#I #W' -#tmux_conf_theme_window_status_current_format='#{circled_window_index} #W' -#tmux_conf_theme_window_status_current_format='#I #W#{?window_zoomed_flag,🔍,}' - -# window activity status style -tmux_conf_theme_window_status_activity_fg='default' -tmux_conf_theme_window_status_activity_bg='default' -tmux_conf_theme_window_status_activity_attr='underscore' - -# window bell status style -tmux_conf_theme_window_status_bell_fg='#ffff00' # yellow -tmux_conf_theme_window_status_bell_bg='default' -tmux_conf_theme_window_status_bell_attr='blink,bold' - -# window last status style -tmux_conf_theme_window_status_last_fg='#00afff' # light blue -tmux_conf_theme_window_status_last_bg='default' -tmux_conf_theme_window_status_last_attr='none' - -# status left/right sections separators -tmux_conf_theme_left_separator_main='' -tmux_conf_theme_left_separator_sub='|' -tmux_conf_theme_right_separator_main='' -tmux_conf_theme_right_separator_sub='|' -#tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline -#tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with -#tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone -#tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md - -# status left/right content: -# - separate main sections with '|' -# - separate subsections with ',' -# - built-in variables are: -# - #{battery_bar} -# - #{battery_hbar} -# - #{battery_percentage} -# - #{battery_status} -# - #{battery_vbar} -# - #{circled_session_name} -# - #{hostname_ssh} -# - #{hostname} -# - #{loadavg} -# - #{pairing} -# - #{prefix} -# - #{root} -# - #{synchronized} -# - #{uptime_y} -# - #{uptime_d} (modulo 365 when #{uptime_y} is used) -# - #{uptime_h} -# - #{uptime_m} -# - #{uptime_s} -# - #{username} -# - #{username_ssh} -tmux_conf_theme_status_left=' ❐ #S ' -tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} ' - -# status left style -tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white -tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff' # yellow, pink, white blue -tmux_conf_theme_status_left_attr='bold,none,none' - -# status right style -tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000' # light gray, white, black -tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4' # dark gray, red, white -tmux_conf_theme_status_right_attr='none,none,bold' - -# pairing indicator -tmux_conf_theme_pairing='👓 ' # U+1F453 -tmux_conf_theme_pairing_fg='none' -tmux_conf_theme_pairing_bg='none' -tmux_conf_theme_pairing_attr='none' - -# prefix indicator -tmux_conf_theme_prefix='⌨ ' # U+2328 -tmux_conf_theme_prefix_fg='none' -tmux_conf_theme_prefix_bg='none' -tmux_conf_theme_prefix_attr='none' - -# root indicator -tmux_conf_theme_root='!' -tmux_conf_theme_root_fg='none' -tmux_conf_theme_root_bg='none' -tmux_conf_theme_root_attr='bold,blink' - -# synchronized indicator -tmux_conf_theme_synchronized='🔒' # U+1F512 -tmux_conf_theme_synchronized_fg='none' -tmux_conf_theme_synchronized_bg='none' -tmux_conf_theme_synchronized_attr='none' - -# battery bar symbols -tmux_conf_battery_bar_symbol_full='◼' -tmux_conf_battery_bar_symbol_empty='◻' -#tmux_conf_battery_bar_symbol_full='♥' -#tmux_conf_battery_bar_symbol_empty='·' - -# battery bar length (in number of symbols), possible values are: -# - auto -# - a number, e.g. 5 -tmux_conf_battery_bar_length='auto' - -# battery bar palette, possible values are: -# - gradient (default) -# - heat -# - 'colour_full_fg,colour_empty_fg,colour_bg' -tmux_conf_battery_bar_palette='gradient' -#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' # red, white, black - -# battery hbar palette, possible values are: -# - gradient (default) -# - heat -# - 'colour_low,colour_half,colour_full' -tmux_conf_battery_hbar_palette='gradient' -#tmux_conf_battery_hbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green - -# battery vbar palette, possible values are: -# - gradient (default) -# - heat -# - 'colour_low,colour_half,colour_full' -tmux_conf_battery_vbar_palette='gradient' -#tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green - -# symbols used to indicate whether battery is charging or discharging -tmux_conf_battery_status_charging='↑' # U+2191 -tmux_conf_battery_status_discharging='↓' # U+2193 -#tmux_conf_battery_status_charging='⚡ ' # U+26A1 -#tmux_conf_battery_status_charging='🔌 ' # U+1F50C -#tmux_conf_battery_status_discharging='🔋 ' # U+1F50B - -# clock style (when you hit + t) -# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right -tmux_conf_theme_clock_colour='#00afff' # light blue -tmux_conf_theme_clock_style='24' - - -# -- clipboard ----------------------------------------------------------------- - -# in copy mode, copying selection also copies to the OS clipboard -# - true -# - false (default) -# on macOS, this requires installing reattach-to-user-namespace, see README.md -# on Linux, this requires xsel or xclip -tmux_conf_copy_to_os_clipboard=false - - -# -- user customizations ------------------------------------------------------- -# this is the place to override or undo settings - -# increase history size -set -g history-limit 100000 - -# start with mouse mode enabled -#set -g mouse on - -# force Vi mode -# really you should export VISUAL or EDITOR environment variable, see manual -#set -g status-keys vi -#set -g mode-keys vi - -# replace C-b by C-a instead of using both prefixes -# set -gu prefix2 -# unbind C-a -# unbind C-b -# set -g prefix C-a -# bind C-a send-prefix - -# move status line to top -#set -g status-position top - - -# Shift arrow to switch windows -bind -n S-Left previous-window -bind -n S-Right next-window \ No newline at end of file diff --git a/.vimrc b/.vimrc index b4cfc1d..c9107f1 100644 --- a/.vimrc +++ b/.vimrc @@ -7,7 +7,6 @@ syntax enable " enable syntax processing set tabstop=4 " number of visual spaces per TAB set softtabstop=4 " number of spaces in tab when editing set expandtab " tabs are spaces -set number " show line numbers set showcmd " show command in bottom bar set cursorline " highlight current line set wildmenu " visual autocomplete for command menu @@ -15,6 +14,11 @@ set lazyredraw " redraw only when we need to. set showmatch " highlight matching [{()}] set incsearch " search as characters are entered set hlsearch " highlight matches +set hidden " switch buffers without saving +set ignorecase smartcase " smart case search +set scrolloff=8 " keep 8 lines visible above/below cursor +set undofile " persistent undo across sessions +set mouse=a " mouse support noremap diff --git a/.zlogin b/.zlogin deleted file mode 120000 index 5765ab0..0000000 --- a/.zlogin +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zlogin \ No newline at end of file diff --git a/.zlogout b/.zlogout deleted file mode 120000 index 8f76c74..0000000 --- a/.zlogout +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zlogout \ No newline at end of file diff --git a/.zprezto/CONTRIBUTING.md b/.zprezto/CONTRIBUTING.md deleted file mode 100644 index f4dc0d6..0000000 --- a/.zprezto/CONTRIBUTING.md +++ /dev/null @@ -1,75 +0,0 @@ -Contributing ------------- - -This project would not exist without all of its users and [contributors][1]. - -If you have ideas on how to make the configuration easier to maintain or -improve its performance, do not hesitate to fork and send pull requests. - -### Issue Reporting - - - Check that the issue has not already been reported. - - Check that the issue has not already been fixed in the latest code. - - Open an issue with a clear title and description in grammatically correct, - complete sentences. - -### Pull Request - - - Read [how to properly contribute to open source projects on GitHub][2]. - - Use a topic branch to easily amend a pull request later, if necessary. - - Write [good commit messages][3]. - - Squash commits on the topic branch before opening a pull request. - - Use the same coding style and spacing. - - Open a [pull request][4] that relates to but one subject with a clear - title and description in grammatically correct, complete sentences. - -#### Code Style - -This project follows the [Google Shell Style Guide][5] when possible. However, -there are a number of additional things to keep in mind. - - - Local variables should be used whenever possible. - - Prefer `zstyle` over environment variables for configuration. - - Prefer (( ... )) over [[ ... ]] for arithmetic expression. - - Use the function keyword to define functions. - - The 80 character hard limit can be waived for readability. - -#### Using an Alternative zprezto Directory - -To work on zprezto without messing with your current configuration: - -```sh -mkdir devel-zprezto -cd devel-zprezto -git clone --recursive https://github.com/sorin-ionescu/prezto.git .zprezto -ZDOTDIR=$(pwd) -echo "Your development ZDOTDIR is $ZDOTDIR" -setopt EXTENDED_GLOB -for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" -done -``` - -Then to start zsh in this development environment you will run: - -```sh -ZDOTDIR=/path/to/devel-zprezto zsh -``` - -#### Modules - - - A *README.md* must be present. - - Large functions must be placed in a *functions* directory. - - Functions that take arguments must have completion. - -#### Themes - - - A screenshots section must be present in the file header. - - The pull request description must have [embedded screenshots][6]. - -[1]: https://github.com/sorin-ionescu/prezto/contributors -[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request -[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[4]: https://help.github.com/articles/using-pull-requests -[5]: https://google.github.io/styleguide/shell.xml -[6]: http://daringfireball.net/projects/markdown/syntax#img diff --git a/.zprezto/LICENSE b/.zprezto/LICENSE deleted file mode 100644 index d417147..0000000 --- a/.zprezto/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009-2011 Robby Russell and contributors -Copyright (c) 2011-2017 Sorin Ionescu and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/.zprezto/README.md b/.zprezto/README.md deleted file mode 100644 index 552784b..0000000 --- a/.zprezto/README.md +++ /dev/null @@ -1,136 +0,0 @@ -Prezto — Instantly Awesome Zsh -============================== - -Prezto is the configuration framework for [Zsh][1]; it enriches the command line -interface environment with sane defaults, aliases, functions, auto completion, -and prompt themes. - -Installation ------------- - -Prezto will work with any recent release of Zsh, but the minimum required -version is 4.3.11. - - 1. Launch Zsh: - - ```console - zsh - ``` - - 2. Clone the repository: - - ```console - git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" - ``` - - 3. Create a new Zsh configuration by copying the Zsh configuration files - provided: - - ```sh - setopt EXTENDED_GLOB - for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" - done - ``` - - Note: If you already have any of the given configuration files, `ln` will - cause error. In simple cases you can load prezto by adding the line - `source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"` to the bottom of your - `.zshrc` and keep the rest of your Zsh configuration intact. For more - complicated setups, it is recommended that you back up your original - configs and replace them with the provided prezto runcoms. - - 4. Set Zsh as your default shell: - - ```console - chsh -s /bin/zsh - ``` - - 5. Open a new Zsh terminal window or tab. - -### Troubleshooting - -If you are not able to find certain commands after switching to *Prezto*, -modify the `PATH` variable in *~/.zprofile* then open a new Zsh terminal -window or tab. - -Updating --------- - -Run `zprezto-update` to automatically check if there is an update to zprezto. -If there are no file conflicts, zprezto and its submodules will be -automatically updated. If there are conflicts you will instructed to go into -the `$ZPREZTODIR` directory and resolve them yourself. - -To pull the latest changes and update submodules manually: - -```console -cd $ZPREZTODIR -git pull -git submodule update --init --recursive -``` - -Usage ------ - -Prezto has many features disabled by default. Read the source code and -accompanying README files to learn of what is available. - -### Modules - - 1. Browse */modules* to see what is available. - 2. Load the modules you need in *~/.zpreztorc* then open a new Zsh terminal - window or tab. - -### Themes - - 1. For a list of themes, type `prompt -l`. - 2. To preview a theme, type `prompt -p name`. - 3. Load the theme you like in *~/.zpreztorc* then open a new Zsh terminal - window or tab. - - ![sorin theme][2] - Note that the 'git' module may be required for special symbols to appear, - such as those on the right of the above image. Add `'git'` to the `pmodule` - list (under `zstyle ':prezto:load' pmodule \` in your *~/.zpreztorc*) to - enable this module. - -### External Modules - - 1. By default modules will be loaded from */modules* and */contrib*. - 2. Additional module directories can be added to the - `:prezto:load:pmodule-dirs` setting in *~/.zpreztorc*. - - Note that module names need to be unique or they will cause an error when - loading. - - ```sh - zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib - ``` - -Customization -------------- - -The project is managed via [Git][3]. It is highly recommended that you fork this -project; so, that you can commit your changes and push them to [GitHub][4] to -not lose them. If you do not know how to use Git, follow this [tutorial][5] and -bookmark this [reference][6]. - -Resources ---------- - -The [Zsh Reference Card][7] and the [zsh-lovers][8] man page are indispensable. - -License -------- - -This project is licensed under the MIT License. - -[1]: http://www.zsh.org -[2]: http://i.imgur.com/nrGV6pg.png "sorin theme" -[3]: http://git-scm.com -[4]: https://github.com -[5]: http://gitimmersion.com -[6]: https://git.github.io/git-reference/ -[7]: http://www.bash2zsh.com/zsh_refcard/refcard.pdf -[8]: http://grml.org/zsh/zsh-lovers.html diff --git a/.zprezto/abra/aliases.zsh b/.zprezto/abra/aliases.zsh deleted file mode 100644 index 3f16963..0000000 --- a/.zprezto/abra/aliases.zsh +++ /dev/null @@ -1,80 +0,0 @@ -alias g="git" -alias a="git add --all :/" -alias b="git branch" -alias c="git commit -am" -alias ch="git checkout" -alias pull="git pull" -alias rb="git reset HEAD --hard" -alias s="git status" -alias st="git stash" - -# alias g5="git5" -# alias e="git5 export" -# alias m="git5 merge --no-ff" -# alias ma="git5 mail -m" -# alias push="git5 submit -xy" -# alias push="git submit -xy" -alias dc="a && c \"dummy comment\"" -# alias dcp="a; dc; git push" - -alias zshconfig="subl ~/.zshrc" -alias zshreload="exec zsh" - -alias tarc="tar cvzf" -# alias rcp="rsync --partial --progress --append --rsh=ssh -r -h" -# alias rmv="rsync --partial --progress --append --rsh=ssh -r -h --remove-sent-files" -# alias rsyncc="rsync -rzPhc" - -alias pythonserve="sudo python -m SimpleHTTPServer 80" - -# replace -alias sg='perl -0pe' - -# alias clbin="curl -F 'clbin=<-' https://clbin.com" - -#alias afs="unmount-abra0; mount-abra0;" - -alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME' -alias .gs='.g status -uno' -alias .gp='.g commit -am "auto" && .g push' - -alias p="perl -pe" -alias p0="perl -0pe" - -alias -g LATEST='*(om[1])' - -#alias f1sql="/google/data/ro/projects/storage/f1/tools/f1-sql" - -#alias t="task" - -#alias revs="ssh abra0 'tail -f -n0 ~/reverse_shell' | tee -a .rem_history| zsh -s" -#alias nika_pop="echo \"afplay ~/tmp/nika.mp3\" > ~/reverse_shell" - -# remote tmux on server -alias tmuxr="tmux new-session -A -s auto" -alias tmuxa="tmux new-session -A -s" - -alias FUNCTION_PRELUDE="setopt LOCAL_OPTIONS PIPE_FAIL XTRACE ERR_RETURN" -alias FUNCTION_PRELUDE_NO_XTRACE="setopt LOCAL_OPTIONS PIPE_FAIL NO_XTRACE ERR_RETURN" - -# pottering recommendation -alias psc="ps xawf -eo pid,user,cgroup,args" - -local arr=( - rsync - --info=PROGRESS2 - --progress - --recursive - --compress - --human-readable - --update - --times - --no-whole-file - --itemize-changes - --stats - --verbose - --links - --no-perms - --chmod=ugo=rwX -) -alias rsync2="$arr" \ No newline at end of file diff --git a/.zprezto/abra/functions.zsh b/.zprezto/abra/functions.zsh deleted file mode 100644 index 0de3b93..0000000 --- a/.zprezto/abra/functions.zsh +++ /dev/null @@ -1,331 +0,0 @@ -# : magic -# ':' just evaluates the given expression -# : "${1:?dirs?}" exits saying "dirs?" if $1 is unset or null -# : "${1:=best}" sets $1 to "best" if $1 is unset or null - -# ${(j:,:)arr} joins arr with commas - - -function reset_facl { - FUNCTION_PRELUDE - - : "${1:?dirs?}" - - # reassign owner to root - chown --recursive "root:root" "${@:1}" - chmod --recursive "u=rwX,g=,o=" "${@:1}" - # clear facl - setfacl --recursive --remove-all "${@:1}" -} - -function add_facl { - FUNCTION_PRELUDE - - : "${1:?user?}" - : "${2:?dirs?}" - - local arr=( - user::rwX - user:${1}:rwX - default:user:${1}:rwX - group::0 - default:group::0 - mask::rwX - default:mask::rwX - other::0 - default:other::0 - ) - - setfacl --recursive --modify "${(j:,:)arr}" "${@:2}" -} - -function is_local { - local HOSTNAME="$(hostname)" - - [[ "$HOSTNAME" =~ '^abra0' || "$HOSTNAME" == "svxf2-osx" ]] -} - -function mount_sshfs { - FUNCTION_PRELUDE - - : "${1:?destination name?}" - - local DESTINATION="$1" - local LOCAL_MOUNT_PATH="/Users/$USER/mount/$1" - - mkdir -p "$LOCAL_MOUNT_PATH" - - if mount | grep "$LOCAL_MOUNT_PATH"; then - umount "$LOCAL_MOUNT_PATH"; - fi - - sshfs \ - -o allow_other \ - -o kernel_cache \ - -o direct_io \ - -o auto_cache \ - -o defer_permissions \ - -o noappledouble \ - -o cache=yes \ - -o Compression=yes \ - -o reconnect \ - -o workaround=rename \ - "$DESTINATION:/" "$LOCAL_MOUNT_PATH" - - # if [[ ! -e "$LOCAL_COMMAND_PIPE_PATH" ]]; then - # echo "Can't find the command pipe" - # return - # fi - - echo "Starting remote command pipe..." - - ssh $DESTINATION " - set -euxo pipefail - - if [[ -e /tmp/sshfs_command_pipe ]]; then - rm /tmp/sshfs_command_pipe - fi - - mkfifo /tmp/sshfs_command_pipe - - tail -f /tmp/sshfs_command_pipe -" | zsh -x -} - -# function sublr { -# FUNCTION_PRELUDE - -# local HOSTNAME=$(hostname) -# local FULL_PATH=$(realpath $1) - -# echo "subl /Users/abra/mount/$HOSTNAME/$FULL_PATH" > /tmp/sshfs_command_pipe -# } - -function cdtmp { - FUNCTION_PRELUDE - - local DATESTR="$(date +%Y_%m_%d_%H_%M_%S)" - local DIR_PATH="${HOME}/tmp/auto_${DATESTR}" - - if [[ -n "$1" ]]; then - local DIR_PATH="${DIR_PATH}_$1" - fi - - if [[ -e "${DIR_PATH}" ]]; then - echo "${DIR_PATH} already exists" - return 1 - fi - - mkcd "${DIR_PATH}" - echo "${DIR_PATH}" -} - -function mkcd { - FUNCTION_PRELUDE_NO_XTRACE - - : "${1:?where?}" - - if [[ -e $1 ]]; then - echo "file exists" - return 1 - fi - - mkdir $1 - - cd $1 -} - -function publish { - FUNCTION_PRELUDE - - rsync2 "$@" "dedi:/var/www/abra.me/list/" -} - -function twitch { - FUNCTION_PRELUDE - - livestreamer "http://www.twitch.tv/${1}" "${${@:2}:-best}" -} - -function save_stream { - FUNCTION_PRELUDE - - local NAME=$1 - - if [[ ! -d $NAME ]]; then - echo ':(' - return 1 - fi - - while true; do - local CURDATE=$(date +"%Y-%m-%d-%H:%M:%S") - livestreamer "https://twitch.tv/$NAME" -o "$NAME/$CURDATE.mp4" || true - sleep 30 - done -} - - -function dcp { - FUNCTION_PRELUDE - - git add --all :/ - - git commit -m "${*:-$(whoami) at $(date)}" - - git push -} - - -function .dcp { - FUNCTION_PRELUDE - - .g add -u - - .g commit -m "${*:-$(whoami) at $(date)}" - - .g push -} - -function strip_tags { - FUNCTION_PRELUDE - - find . -type f -name '*.mp3' \ - | tr '\n' '\0' \ - | xargs -0 -n1 mid3v2 --delete-frames=APIC,TXXX,USLT,TBPM -} - -function levi_beet { - FUNCTION_PRELUDE - - ssh levi -- sudo BEETSDIR=/projects/config/beets -u torrent beet "$@" -} - -function beet_comments { - FUNCTION_PRELUDE - - : "${1:?who?}" - : "${2:?what?}" - - levi_beet modify \'"comments=$2"\' \'"albumartist::$1"\' -} - -function sync_music { - FUNCTION_PRELUDE - - # if ! is_local; then - # echo "Should be local" - # return 1 - # fi - - local MUSIC_DIR="$HOME/music/library" - - mkdir -p "$MUSIC_DIR" - - rsync2 \ - --delete \ - "levi:/projects/music/" \ - "$MUSIC_DIR/" -} - -# function .g-init() { -# git init --bare $HOME/.dotgit -# .g config --local status.showUntrackedFiles no -# .g remote add origin ssh://dedi/root/.dotgit -# git config --global user.name "Your Name" -# git config --global user.email you@example.com -# .g remote add origin ssh://dedi/var/www/git.abra.me/dot.git -# } - - -# make_user() { -# FUNCTION_PRELUDE - -# if is_local; then -# echo "You're local" -# return 1 -# fi - -# adduser --system --shell /bin/zsh --disabled-password $1 || return 1 - -# # wget abra.me/.dotfiles.tar.gz -O /home/$1/.dotfiles.tar.gz -# # tar xf /home/$1/.dotfiles.tar.gz -C /home/$1 -# # chown $1:nogroup -R /home/$1/ -# } - -# function latest() { -# echo -n ("${(@f)$(ls *(om[1,$1]))}") -# } - -function testo { - local A="${@[2,3]}" - ./t.py ${(t)A} "$A" ${A[@]} - unset A - - local A=("$@[2,3]") - ./t.py ${(t)A} "$A" ${A[@]} - unset A - - ./t.py "$@[2,3]" -} -# testo 1 "2 3" 4 - -# shit shit shit s hist h is htisthsi 2018-06-30 -function ffmpeg_timelapse { - FUNCTION_PRELUDE - - local DATE="$1" - - ls "/mnt/a/snaps/$DATE" | wc -l - - ffmpeg \ - -framerate 60 \ - -pattern_type glob -i "/mnt/a/snaps/$DATE/*.jpg" \ - "${@:2}" \ - -y "/mnt/a/tmp/$DATE.mp4" - - mv "/mnt/a/tmp/$DATE.mp4" "/mnt/a/$DATE.mp4" - - rm -rf "/mnt/a/snaps/$DATE" -} - -function ffmpeg_timelapse_today { - local TODAY="$(date '+%Y-%m-%d')" - - ffmpeg_timelapse "$TODAY" -preset ultrafast -crf 20 -} - -function update_.g { - if [[ ! -d "$HOME/.dotgit" ]]; then - # no git to update - return - fi - - # force updating origin to new server - .g remote set-url origin https://gitea.abra.me/svxf/dotfiles.git - - local RES="$(.g pull --no-stat 2>&1)" - - if [[ $? != 0 ]]; then - # something went wrong - return - fi - - # no verbose :( - # if [[ ! $RES =~ "Already up.to.date" ]]; then - # echo "Updated .g" - # echo $RES - # echo "======" - # echo - # zshreload - # fi -} - -function .sh_setup { - echo 'wget abra.me/.sh && chmod +x .sh && ./.sh' -} - -function send_new_torrents { - FUNCTION_PRELUDE - - rsync2 --remove-source-files ~/Downloads/*.torrent(mm-10) levi:/projects/torrent_autoadd/ -} \ No newline at end of file diff --git a/.zprezto/abra/main.zsh b/.zprezto/abra/main.zsh deleted file mode 100644 index a36e2af..0000000 --- a/.zprezto/abra/main.zsh +++ /dev/null @@ -1,8 +0,0 @@ -zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/abra/options.zsh" -zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/abra/aliases.zsh" -zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/abra/functions.zsh" - -zsource_if_exists "$HOME/.iterm2_shell_integration.zsh" - -# update, background+disown -update_.g &! diff --git a/.zprezto/abra/options.zsh b/.zprezto/abra/options.zsh deleted file mode 100644 index 00c14d2..0000000 --- a/.zprezto/abra/options.zsh +++ /dev/null @@ -1,56 +0,0 @@ -# Disable corrections -unsetopt CORRECT -# Now we can pipe to multiple outputs! -setopt MULTIOS -# This makes cd=pushd -setopt AUTO_PUSHD -# This will use named dirs when possible -setopt AUTO_NAME_DIRS -# If we have a glob this will expand it -setopt GLOB_COMPLETE -# use magic (this is default, but it can't hurt!) -setopt ZLE -# setopt NO_HUP -# setopt IGNORE_EOF -# If I could disable Ctrl-s completely I would! -setopt NO_FLOW_CONTROL -# unsetopt normstarsilent - -## Keep echo "station" > station from clobbering station -#setopt NO_CLOBBER -setopt CLOBBER - -# No ! voodoo -unsetopt bang_hist - -# Case insensitive globbing -setopt NO_CASE_GLOB -# Be Reasonable! -setopt NUMERIC_GLOB_SORT -# I don't know why I never set this before. -setopt EXTENDED_GLOB -# hows about arrays be awesome? (that is, frew${cool}frew has frew surrounding all the variables, not just first and last -setopt RC_EXPAND_PARAM -# disable running directory names -unsetopt AUTO_CD - -# return in functions if a command fails -# setopt ERR_RETURN - - - -# Who doesn't want home and end to work? -bindkey '\e[1~' beginning-of-line -bindkey '\e[4~' end-of-line - -bindkey "\eOH" beginning-of-line -bindkey "\eOF" end-of-line - -# modules - -# saves $EPOCHSECONDS -zmodload zsh/datetime -zmodload zsh/mathfunc - -# profiler -# zmodload zsh/zprof diff --git a/.zprezto/abra/prompt_abra_setup.zsh b/.zprezto/abra/prompt_abra_setup.zsh deleted file mode 100644 index efff1ed..0000000 --- a/.zprezto/abra/prompt_abra_setup.zsh +++ /dev/null @@ -1,113 +0,0 @@ -pmodload 'helper' - -# %>dsadsa>dsadsa -- truncation -# %~ -- current dir -# %F{color}...%f -- foreground colors -# %B...%b -- bold -# %(x.a.b) -- if -# ${(l)} -- padding - -# color chart: https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg -# COLOR_PWD='141' -# COLOR_PWD_ROOT='201' -# COLOR_PROMPT_STARTER='85' -# COLOR_TIME='244' -# COLOR_USERNAME='34' -# COLOR_AT='244' -# COLOR_HOSTNAME='162' - -COLOR_PWD='cyan' -COLOR_PWD_ROOT='red' -COLOR_PROMPT_STARTER='green' -COLOR_TIME='green' -COLOR_USERHOSTNAME='blue' -COLOR_DURATION='magenta' - -NEWLINE=$'\n' - -function prompt_abra_precmd { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Get Git repository information. - if [[ -z $NOGIT ]] && (( $+functions[git-info] )); then - git-info || true - fi - - PRE_LENGTH=$(( ${COLUMNS} * 2 / 3 )) - - # take current directory and truncate left so that up to $PRE_LENGTH chars are left - PRE='%${PRE_LENGTH}<...<%~ %<<' - PRE=$(print -P ${PRE}) - PRE=$(print ${(l:${COLUMNS}:)PRE}) - # print -P '%(!.%F{${COLOR_PWD_ROOT}}.%F{${COLOR_PWD}})${PRE}%f' - print -P '%F{${COLOR_PWD}}${PRE}%f' - - if [[ -z $PREEXEC_TIME ]]; then - EXECTIME=0 - else - EXECTIME=$(( EPOCHREALTIME - PREEXEC_TIME )) - fi - - if (( EXECTIME > 5 )); then - SEC=$(( int(rint(EXECTIME % 60)) )) - MIN=$(( int(rint(EXECTIME / 60 % 60)) )) - HOUR=$(( int(rint(EXECTIME / 3600)) )) - - DURATION="$(printf '%02d:%02d:%02d ' $HOUR $MIN $SEC)" - else - DURATION='' - fi -} - -function prompt_abra_preexec { - PREEXEC_TIME=$EPOCHREALTIME -} - -function prompt_abra_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent subst) - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_abra_precmd - add-zsh-hook preexec prompt_abra_preexec - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:action' format ':%%B%F{yellow}%s%f%%b' - zstyle ':prezto:module:git:info:added' format ' %%B%F{green}✚%f%%b' - zstyle ':prezto:module:git:info:ahead' format ' %%B%F{yellow}⬆%f%%b' - zstyle ':prezto:module:git:info:behind' format ' %%B%F{yellow}⬇%f%%b' - zstyle ':prezto:module:git:info:branch' format ':%F{green}%b%f' - zstyle ':prezto:module:git:info:commit' format ':%F{green}%.7c%f' - zstyle ':prezto:module:git:info:deleted' format ' %%B%F{red}✖%f%%b' - zstyle ':prezto:module:git:info:modified' format ' %%B%F{blue}✱%f%%b' - zstyle ':prezto:module:git:info:position' format ':%F{red}%p%f' - zstyle ':prezto:module:git:info:renamed' format ' %%B%F{magenta}➜%f%%b' - zstyle ':prezto:module:git:info:stashed' format ' %%B%F{cyan}✭%f%%b' - zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{yellow}═%f%%b' - zstyle ':prezto:module:git:info:untracked' format ' %%B%F{white}◼%f%%b' - zstyle ':prezto:module:git:info:keys' format \ - 'prompt' '%b ' \ - 'rprompt' '%A%B%S%a%d%m%r%U%u' - - - - PROMPT='' - PROMPT=$PROMPT'${git_info:+${(e)git_info[prompt]}}' - PROMPT=$PROMPT'%(?.%F{$COLOR_PROMPT_STARTER}.%F{red})➤ %f' - - RPROMPT='' - RPROMPT=$RPROMPT'%(?..%F{red}%?%f )' # last command code if nonzero - RPROMPT=$RPROMPT'%B%(!.%F{${COLOR_PWD_ROOT}}.%F{${COLOR_USERHOSTNAME}})%n@%M%f%b' - RPROMPT=$RPROMPT'${git_info[rprompt]} ' - RPROMPT=$RPROMPT'%F{$COLOR_DURATION}$DURATION%f' - RPROMPT=$RPROMPT'%F{$COLOR_TIME}%*%f' -} - -prompt_abra_setup "$@" - diff --git a/.zprezto/init.zsh b/.zprezto/init.zsh deleted file mode 100644 index 99254bd..0000000 --- a/.zprezto/init.zsh +++ /dev/null @@ -1,191 +0,0 @@ -# -# Initializes Prezto. -# -# Authors: -# Sorin Ionescu -# - -# -# Version Check -# - -# Check for the minimum supported version. -min_zsh_version='4.3.11' -if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then - printf "prezto: old shell detected, minimum required: %s\n" "$min_zsh_version" >&2 - return 1 -fi -unset min_zsh_version - -# zprezto convenience updater -# The function is surrounded by ( ) instead of { } so it starts in a subshell -# and won't affect the environment of the calling shell -function zprezto-update { - ( - function cannot-fast-forward { - local STATUS="$1" - [[ -n "${STATUS}" ]] && printf "%s\n" "${STATUS}" - printf "Unable to fast-forward the changes. You can fix this by " - printf "running\ncd '%s' and then\n'git pull' " "${ZPREZTODIR}" - printf "to manually pull and possibly merge in changes\n" - } - cd -q -- "${ZPREZTODIR}" || return 7 - local orig_branch="$(git symbolic-ref HEAD 2> /dev/null | cut -d '/' -f 3)" - if [[ "$orig_branch" == "master" ]]; then - git fetch || return "$?" - local UPSTREAM=$(git rev-parse '@{u}') - local LOCAL=$(git rev-parse HEAD) - local REMOTE=$(git rev-parse "$UPSTREAM") - local BASE=$(git merge-base HEAD "$UPSTREAM") - if [[ $LOCAL == $REMOTE ]]; then - printf "There are no updates.\n" - return 0 - elif [[ $LOCAL == $BASE ]]; then - printf "There is an update available. Trying to pull.\n\n" - if git pull --ff-only; then - printf "Syncing submodules\n" - git submodule update --recursive - return $? - else - cannot-fast-forward - return 1 - fi - elif [[ $REMOTE == $BASE ]]; then - cannot-fast-forward "Commits in master that aren't in upstream." - return 1 - else - cannot-fast-forward "Upstream and local have diverged." - return 1 - fi - else - printf "zprezto install at '%s' is not on the master branch " "${ZPREZTODIR}" - printf "(you're on '%s')\nUnable to automatically update.\n" "${orig_branch}" - return 1 - fi - return 1 - ) -} -# -# Module Loader -# - -# Loads Prezto modules. -function pmodload { - local -a pmodules - local -a pmodule_dirs - local -a locations - local pmodule - local pmodule_location - local pfunction_glob='^([_.]*|prompt_*_setup|README*|*~)(-.N:t)' - - # Load in any additional directories and warn if they don't exist - zstyle -a ':prezto:load' pmodule-dirs 'user_pmodule_dirs' - for user_dir in "$user_pmodule_dirs[@]"; do - if [[ ! -d "$user_dir" ]]; then - echo "$0: Missing user module dir: $user_dir" - fi - done - - pmodule_dirs=("$ZPREZTODIR/modules" "$ZPREZTODIR/contrib" "$user_pmodule_dirs[@]") - - # $argv is overridden in the anonymous function. - pmodules=("$argv[@]") - - # Load Prezto modules. - for pmodule in "$pmodules[@]"; do - if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then - continue - else - locations=(${pmodule_dirs:+${^pmodule_dirs}/$pmodule(-/FN)}) - if (( ${#locations} > 1 )); then - print "$0: conflicting module locations: $locations" - continue - elif (( ${#locations} < 1 )); then - print "$0: no such module: $pmodule" - continue - fi - - # Grab the full path to this module - pmodule_location=${locations[1]} - - # Add functions to $fpath. - fpath=(${pmodule_location}/functions(/FN) $fpath) - - function { - local pfunction - - # Extended globbing is needed for listing autoloadable function directories. - setopt LOCAL_OPTIONS EXTENDED_GLOB - - # Load Prezto functions. - for pfunction in ${pmodule_location}/functions/$~pfunction_glob; do - autoload -Uz "$pfunction" - done - } - - if [[ -s "${pmodule_location}/init.zsh" ]]; then - source "${pmodule_location}/init.zsh" - elif [[ -s "${pmodule_location}/${pmodule}.plugin.zsh" ]]; then - source "${pmodule_location}/${pmodule}.plugin.zsh" - fi - - if (( $? == 0 )); then - zstyle ":prezto:module:$pmodule" loaded 'yes' - else - # Remove the $fpath entry. - fpath[(r)${pmodule_location}/functions]=() - - function { - local pfunction - - # Extended globbing is needed for listing autoloadable function - # directories. - setopt LOCAL_OPTIONS EXTENDED_GLOB - - # Unload Prezto functions. - for pfunction in ${pmodule_location}/functions/$~pfunction_glob; do - unfunction "$pfunction" - done - } - - zstyle ":prezto:module:$pmodule" loaded 'no' - fi - fi - done -} - -# -# Prezto Initialization -# - -# This finds the directory prezto is installed to so plugin managers don't need -# to rely on dirty hacks to force prezto into a directory. Additionally, it -# needs to be done here because inside the pmodload function ${0:h} evaluates to -# the current directory of the shell rather than the prezto dir. -ZPREZTODIR=${0:h} - -# Source the Prezto configuration file. -if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then - source "${ZDOTDIR:-$HOME}/.zpreztorc" -fi - -# Disable color and theme in dumb terminals. -if [[ "$TERM" == 'dumb' ]]; then - zstyle ':prezto:*:*' color 'no' - zstyle ':prezto:module:prompt' theme 'off' -fi - -# Load Zsh modules. -zstyle -a ':prezto:load' zmodule 'zmodules' -for zmodule ("$zmodules[@]") zmodload "zsh/${(z)zmodule}" -unset zmodule{s,} - -# Autoload Zsh functions. -zstyle -a ':prezto:load' zfunction 'zfunctions' -for zfunction ("$zfunctions[@]") autoload -Uz "$zfunction" -unset zfunction{s,} - -# Load Prezto modules. -zstyle -a ':prezto:load' pmodule 'pmodules' -pmodload "$pmodules[@]" -unset pmodules diff --git a/.zprezto/modules/README.md b/.zprezto/modules/README.md deleted file mode 100644 index 1ff4e61..0000000 --- a/.zprezto/modules/README.md +++ /dev/null @@ -1,206 +0,0 @@ -Modules -======= - -Load modules in *zpreztorc*. The order matters. - -```sh -zstyle ':prezto:load' pmodule 'environment' 'terminal' -``` - -Archive -------- - -Provides functions to list and extract archives. - -Autosuggestions ---------------- - -Integrates zsh-autosuggestions into Prezto. - -Command-Not-Found ------------------ - -Loads the command-not-found tool on macOS or Debian-based distributions. - -Completion ----------- - -Loads and configures tab completion and provides additional completions from -the zsh-completions project. - -Directory ---------- - -Sets directory options and defines directory aliases. - -DNF ---- - -Defines dnf aliases. - -Dpkg ----- - -Defines dpkg aliases and functions. - -Editor ------- - -Sets key bindings. - -Emacs ------ - -Enables Emacs dependency management. - -Environment ------------ - -Sets general shell options and defines environment variables. - -Fasd ----- - -Maintains a frequently used file and directory list for fast access. - -Git ---- - -Enhances the Git distributed version control system by providing aliases, -functions and by exposing repository status information to prompts. - -GNU Utility ------------ - -Provides for the interactive use of GNU utilities on non-GNU systems. - -GPG ---- - -Provides for an easier use of GPG by setting up gpg-agent. - -Haskell -------- - -Enables local Haskell package installation. - -Helper ------- - -Provides helper functions for developing modules. - -History -------- - -Sets history options and defines history aliases. - -History Substring Search ------------------------- - -Integrates zsh-history-substring-search into Prezto. - -Homebrew --------- - -Defines Homebrew aliases. - -MacPorts --------- - -Defines MacPorts aliases and adds MacPorts directories to path variables. - -Node.js -------- - -Provides utility functions for Node.js and loads npm completion. - -OCaml ------ - -Initializes OCaml package management. - -OSX ---- - -Defines macOS aliases and functions. - -Pacman ------- - -Provides aliases and functions for the Pacman package manager and frontends. - -Perl ----- - -Enables local Perl module installation on macOS and defines alises. - -Prompt ------- - -Loads prompt themes. - -Python ------- - -Enables local Python and local Python package installation. - -Ruby on Rails -------------- - -Defines Ruby on Rails aliases. - -Rsync ------ - -Defines rsync aliases. - -Ruby ----- - -Configures Ruby local gem installation, loads version managers, and defines -aliases. - -GNU Screen ----------- - -Defines GNU Screen aliases and provides for auto launching it at start-up. - -Spectrum --------- - -Provides for easier use of 256 colors and effects. - -SSH ---- - -Provides for an easier use of SSH by setting up ssh-agent. - -Syntax Highlighting -------------------- - -Integrates zsh-syntax-highlighting into Prezto. - -Terminal --------- - -Sets terminal window and tab titles. - -Tmux ----- - -Defines tmux aliases and provides for auto launching it at start-up. - -Utility -------- - -Defines general aliases and functions. - -Wake-on-LAN ------------ - -This module provides a wrapper around the wakeonlan tool. - -Yum ---- - -Defines yum aliases. diff --git a/.zprezto/modules/archive/README.md b/.zprezto/modules/archive/README.md deleted file mode 100644 index c9806ea..0000000 --- a/.zprezto/modules/archive/README.md +++ /dev/null @@ -1,52 +0,0 @@ -Archive -======= - -Provides functions to create, list, and extract archives. - -Functions ---------- - - - `archive` creates an archive based on the provided archive name. - - `lsarchive` lists the contents of one or more archives. - - `unarchive` extracts the contents of one or more archives. - -Supported Formats ------------------ - -The following archive formats are supported when the required utilities are -installed: - - - *.tar.gz*, *.tgz* require `tar` (optionally `pigz`). - - *.tar.bz2*, *.tbz* require `tar` (optionally `pbzip2`). - - *.tar.xz*, *.txz* require `tar` with *xz* support. - - *.tar.zma*, *.tlz* require `tar` with *lzma* support. - - *.tar* requires `tar`. - - *.gz* requires `gunzip`. - - *.bz2* requires `bunzip2`. - - *.xz* requires `unxz`. - - *.lzma* requires `unlzma`. - - *.Z* requires `uncompress`. - - *.zip*, *.jar* requires `unzip`. - - *.rar* requires `rar` (needed for `archive` support), `unrar` or `lsar` and `unar`. - - *.7z* requires `7za`. - - *.deb* requires `ar`, `tar`. - -Additionally, if `pigz` and/or `pbzip2` are installed, `archive` will use them -over their traditional counterparts, `gzip` and `bzip2` respectively, to take -full advantage of all available CPU cores for compression. - -Alternatives ------------- - -Specifically on macOS, [The Unarchiver][1] provides a similar command line tool -which doesn't depend on a number of other programs being installed. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Matt Hamilton](https://github.com/Eriner) - -[1]: https://theunarchiver.com/command-line diff --git a/.zprezto/modules/archive/functions/_lsarchive b/.zprezto/modules/archive/functions/_lsarchive deleted file mode 100644 index f2cee88..0000000 --- a/.zprezto/modules/archive/functions/_lsarchive +++ /dev/null @@ -1,13 +0,0 @@ -#compdef lsarchive -#autoload - -# -# Completes lsarchive. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '(-v --verbose)'{-v,--remove}'[verbose archive listing]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|jar|rar|7z)(-.)'" && return 0 diff --git a/.zprezto/modules/archive/functions/_unarchive b/.zprezto/modules/archive/functions/_unarchive deleted file mode 100644 index 90e32f1..0000000 --- a/.zprezto/modules/archive/functions/_unarchive +++ /dev/null @@ -1,13 +0,0 @@ -#compdef unarchive -#autoload - -# -# Completes unarchive. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '(-r --remove)'{-r,--remove}'[remove archive]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|jar|rar|7z|deb)(-.)'" && return 0 diff --git a/.zprezto/modules/archive/functions/archive b/.zprezto/modules/archive/functions/archive deleted file mode 100644 index 0e3bb61..0000000 --- a/.zprezto/modules/archive/functions/archive +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env zsh -# -# Creates archive file -# -# Authors: -# Matt Hamilton -# - -# function archive { - -local archive_name dir_to_archive _gzip_bin _bzip2_bin - -if (( $# != 2 )); then - cat >&2 <&2 - return 1 -fi - -# here, we check for dropin/multi-threaded replacements -# this should eventually be moved to modules/archive/init.zsh -# as a global alias -if (( $+commands[pigz] )); then - _gzip_bin='pigz' -else - _gzip_bin='gzip' -fi - -if (( $+commands[pbzip2] )); then - _bzip2_bin='pbzip2' -else - _bzip2_bin='bzip2' -fi - -case "${archive_name}" in - (*.tar.gz|*.tgz) tar -cvf "${archive_name}" --use-compress-program="${_gzip_bin}" "${dir_to_archive}" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar -cvf "${archive_name}" --use-compress-program="${_bzip2_bin}" "${dir_to_archive}" ;; - (*.tar.xz|*.txz) tar -cvJf "${archive_name}" "${dir_to_archive}" ;; - (*.tar.lzma|*.tlz) tar -cvf "${archive_name}" --lzma "${dir_to_archive}" ;; - (*.tar) tar -cvf "${archive_name}" "${dir_to_archive}" ;; - (*.zip|*.jar) zip -r "${archive_name}" "${dir_to_archive}" ;; - (*.rar) rar a "${archive_name}" "${dir_to_archive}" ;; - (*.7z) 7za a "${archive_name}" "${dir_to_archive}" ;; - (*.gz) print "\n.gz is only useful for single files, and does not capture permissions. Use .tar.gz" ;; - (*.bz2) print "\n.bzip2 is only useful for single files, and does not capture permissions. Use .tar.bz2" ;; - (*.xz) print "\n.xz is only useful for single files, and does not capture permissions. Use .tar.xz" ;; - (*.lzma) print "\n.lzma is only useful for single files, and does not capture permissions. Use .tar.lzma" ;; - (*) print "\nunknown archive type for archive: ${archive_name}" ;; -esac - -# } diff --git a/.zprezto/modules/archive/functions/lsarchive b/.zprezto/modules/archive/functions/lsarchive deleted file mode 100644 index 7f892d1..0000000 --- a/.zprezto/modules/archive/functions/lsarchive +++ /dev/null @@ -1,61 +0,0 @@ -# -# Lists the contents of archives. -# -# Authors: -# Sorin Ionescu -# - -# function lsarchive { - -local verbose - -if (( $# == 0 )); then - cat >&2 <. -EOF -fi - -if [[ "$1" == "-v" || "$1" == "--verbose" ]]; then - verbose=0 - shift -fi - -while (( $# > 0 )); do - if [[ ! -s "$1" ]]; then - print "$0: file not valid: $1" >&2 - shift - continue - fi - - case "$1:l" in - (*.tar.gz|*.tgz) tar t${verbose:+v}vzf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar t${verbose:+v}jf "$1" ;; - (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ - && tar --xz -t${verbose:+v}f "$1" \ - || xzcat "$1" | tar t${verbose:+v}f - ;; - (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ - && tar --lzma -t${verbose:+v}f "$1" \ - || lzcat "$1" | tar x${verbose:+v}f - ;; - (*.tar) tar t${verbose:+v}f "$1" ;; - (*.zip|*.jar) unzip -l${verbose:+v} "$1" ;; - (*.rar) ( (( $+commands[unrar] )) \ - && unrar ${${verbose:+v}:-l} "$1" ) \ - || ( (( $+commands[rar] )) \ - && rar ${${verbose:+v}:-l} "$1" ) \ - || lsar ${verbose:+-l} "$1" ;; - (*.7z) 7za l "$1" ;; - (*) - print "$0: cannot list: $1" >&2 - success=1 - ;; - esac - - shift -done - -# } diff --git a/.zprezto/modules/archive/functions/unarchive b/.zprezto/modules/archive/functions/unarchive deleted file mode 100644 index 53a24dd..0000000 --- a/.zprezto/modules/archive/functions/unarchive +++ /dev/null @@ -1,86 +0,0 @@ -# -# Extracts the contents of archives. -# -# Authors: -# Sorin Ionescu -# - -# function unarchive { - -local remove_archive -local success -local file_name -local file_path -local extract_dir - -if (( $# == 0 )); then - cat >&2 <. -EOF -fi - -remove_archive=1 -if [[ "$1" == "-r" || "$1" == "--remove" ]]; then - remove_archive=0 - shift -fi - -while (( $# > 0 )); do - if [[ ! -s "$1" ]]; then - print "$0: file not valid: $1" >&2 - shift - continue - fi - - success=0 - file_name="${1:t}" - file_path="${1:A}" - extract_dir="${file_name:r}" - case "$1:l" in - (*.tar.gz|*.tgz) tar xvzf "$1" ;; - (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; - (*.tar.xz|*.txz) tar --xz --help &> /dev/null \ - && tar --xz -xvf "$1" \ - || xzcat "$1" | tar xvf - ;; - (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \ - && tar --lzma -xvf "$1" \ - || lzcat "$1" | tar xvf - ;; - (*.tar) tar xvf "$1" ;; - (*.gz) gunzip "$1" ;; - (*.bz2) bunzip2 "$1" ;; - (*.xz) unxz "$1" ;; - (*.lzma) unlzma "$1" ;; - (*.Z) uncompress "$1" ;; - (*.zip|*.jar) unzip "$1" -d $extract_dir ;; - (*.rar) ( (( $+commands[unrar] )) \ - && unrar x -ad "$1" ) \ - || ( (( $+commands[rar] )) \ - && rar x -ad "$1" ) \ - || unar -d "$1" ;; - (*.7z) 7za x "$1" ;; - (*.deb) - mkdir -p "$extract_dir/control" - mkdir -p "$extract_dir/data" - cd "$extract_dir"; ar vx "${file_path}" > /dev/null - cd control; tar xvf ../control.tar.* - cd ../data; tar xvf ../data.tar.* - cd ..; rm control.tar.* data.tar.* debian-binary - cd .. - ;; - (*) - print "$0: cannot extract: $1" >&2 - success=1 - ;; - esac - - (( success = $success > 0 ? $success : $? )) - (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" - shift -done - -# } diff --git a/.zprezto/modules/autosuggestions/README.md b/.zprezto/modules/autosuggestions/README.md deleted file mode 100644 index 48f9852..0000000 --- a/.zprezto/modules/autosuggestions/README.md +++ /dev/null @@ -1,61 +0,0 @@ -Autosuggestions -=============== - -Integrates [zsh-autosuggestions][1] into Prezto, which implements the -[Fish shell][2]'s autosuggestions feature, where the user can type in any part -of a previously entered command and Zsh suggests commands as you type based on -history and completions. - -If this module is used in conjunction with the *syntax-highlighting* module, -this module must be loaded **after** the *syntax-highlighting* module. - -If this module is used in conjunction with the *history-substring-search* -module, this module must be loaded **after** the *history-substring-search* -module. - -Contributors ------------- - -New features and bug fixes should be submitted to the [zsh-autosuggestions][1] -project according to its rules and regulations. This module will be synchronized -against it. - -Settings --------- - -### Highlighting - -If colors are enabled, *autosuggestions* will automatically highlight -positive results. - -To enable highlighting for this module only, add the following line to -*zpreztorc*: - -```sh -zstyle ':prezto:module:autosuggestions' color 'yes' -``` - -To set the query found color, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:autosuggestions:color' found '' -``` - -Troubleshooting ---------------- - -### Autosuggestions from previous sessions don't show up - -For autosuggestions from previous shell sessions to work, please make sure you -also have the `history` module enabled. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/tarruda/zsh-autosuggestions -[2]: http://fishshell.com -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/autosuggestions/external/CHANGELOG.md b/.zprezto/modules/autosuggestions/external/CHANGELOG.md deleted file mode 100644 index f017be2..0000000 --- a/.zprezto/modules/autosuggestions/external/CHANGELOG.md +++ /dev/null @@ -1,69 +0,0 @@ -# Changelog - -## v0.4.3 -- Avoid bell when accepting suggestions with `autosuggest-accept` (#228) -- Don't fetch suggestions after [up,down]-line-or-beginning-search (#227, #241) -- We are now running CI against new 5.5.1 version -- Fix partial-accept in vi mode (#188) -- Fix suggestion disappearing on fast movement after switching to `vicmd` mode (#290) -- Fix issue rotating through kill ring with `yank-pop` (#301) -- Fix issue creating new pty for async mode when previous pty is not properly cleaned up (#249) - -## v0.4.2 -- Fix bug in zsh versions older than 5.0.8 (#296) -- Officially support back to zsh v4.3.11 - -## v0.4.1 -- Switch to [[ and (( conditionals instead of [ (#257) -- Avoid warnnestedvar warnings with `typeset -g` (#275) -- Replace tabs with spaces in yaml (#268) -- Clean up and fix escaping of special characters (#267) -- Add `emacs-forward-word` to default list of partial accept widgets (#246) - -## v0.4.0 -- High-level integration tests using RSpec and tmux -- Add continuous integration with Circle CI -- Experimental support for asynchronous suggestions (#170) -- Fix problems with multi-line suggestions (#225) -- Optimize case where manually typing in suggestion -- Avoid wrapping any zle-* widgets (#206) -- Remove support for deprecated options from v0.0.x -- Handle history entries that begin with dashes -- Gracefully handle being sourced multiple times (#126) -- Add enable/disable/toggle widgets to disable/enable suggestions (#219) - - -## v0.3.3 -- Switch from $history array to fc builtin for better performance with large HISTFILEs (#164) -- Fix tilde handling when extended_glob is set (#168) -- Add config option for maximum buffer length to fetch suggestions for (#178) -- Add config option for list of widgets to ignore (#184) -- Don't fetch a new suggestion unless a modification widget actually modifies the buffer (#183) - -## v0.3.2 -- Test runner now supports running specific tests and choosing zsh binary -- Return code from original widget is now correctly passed through (#135) -- Add `vi-add-eol` to list of accept widgets (#143) -- Escapes widget names within evals to fix problems with irregular widget names (#152) -- Plugin now clears suggestion while within a completion menu (#149) -- .plugin file no longer relies on symbolic link support, fixing issues on Windows (#156) - -## v0.3.1 - -- Fixes issue with `vi-next-char` not accepting suggestion (#137). -- Fixes global variable warning when WARN_CREATE_GLOBAL option enabled (#133). -- Split out a separate test file for each widget. - -## v0.3.0 - -- Adds `autosuggest-execute` widget (PR #124). -- Adds concept of suggestion "strategies" for different ways of fetching suggestions. -- Adds "match_prev_cmd" strategy (PR #131). -- Uses git submodules for testing dependencies. -- Lots of test cleanup. -- Various bug fixes for zsh 5.0.x and `sh_word_split` option. - - -## v0.2.17 - -Start of changelog. diff --git a/.zprezto/modules/autosuggestions/external/DESCRIPTION b/.zprezto/modules/autosuggestions/external/DESCRIPTION deleted file mode 100644 index b69200f..0000000 --- a/.zprezto/modules/autosuggestions/external/DESCRIPTION +++ /dev/null @@ -1 +0,0 @@ -Fish-like fast/unobtrusive autosuggestions for zsh. diff --git a/.zprezto/modules/autosuggestions/external/Gemfile b/.zprezto/modules/autosuggestions/external/Gemfile deleted file mode 100644 index 8b5deec..0000000 --- a/.zprezto/modules/autosuggestions/external/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gem 'rspec' -gem 'rspec-wait' -gem 'pry-byebug' diff --git a/.zprezto/modules/autosuggestions/external/Gemfile.lock b/.zprezto/modules/autosuggestions/external/Gemfile.lock deleted file mode 100644 index 63ee778..0000000 --- a/.zprezto/modules/autosuggestions/external/Gemfile.lock +++ /dev/null @@ -1,41 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - byebug (9.0.5) - coderay (1.1.1) - diff-lcs (1.3) - method_source (0.8.2) - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.0) - byebug (~> 9.0) - pry (~> 0.10) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rspec-wait (0.0.9) - rspec (>= 3, < 4) - slop (3.6.0) - -PLATFORMS - ruby - -DEPENDENCIES - pry-byebug - rspec - rspec-wait - -BUNDLED WITH - 1.13.6 diff --git a/.zprezto/modules/autosuggestions/external/INSTALL.md b/.zprezto/modules/autosuggestions/external/INSTALL.md deleted file mode 100644 index 945cec7..0000000 --- a/.zprezto/modules/autosuggestions/external/INSTALL.md +++ /dev/null @@ -1,67 +0,0 @@ -## Installation - -### Manual (Git Clone) - -1. Clone this repository somewhere on your machine. This guide will assume `~/.zsh/zsh-autosuggestions`. - - ```sh - git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions - ``` - -2. Add the following to your `.zshrc`: - - ```sh - source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh - ``` - -3. Start a new terminal session. - -### Oh My Zsh - -1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`) - - ```sh - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions - ``` - -2. Add the plugin to the list of plugins for Oh My Zsh to load: - - ```sh - plugins=(zsh-autosuggestions) - ``` - -3. Start a new terminal session. - -### Arch Linux - -1. Install [`zsh-autosuggestions`](https://www.archlinux.org/packages/community/any/zsh-autosuggestions/) from the `community` repository. - - ```sh - pacman -S zsh-autosuggestions - ``` - - or, to use a package based on the `master` branch, install [`zsh-autosuggestions-git`](https://aur.archlinux.org/packages/zsh-autosuggestions-git/) from the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository). - -2. Add the following to your `.zshrc`: - - ```sh - source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh - ``` - -3. Start a new terminal session. - -### macOS via Homebrew -1. Install the `zsh-autosuggestions` package using [Homebrew](https://brew.sh/). - - ```sh - brew install zsh-autosuggestions - ``` - -2. Add the following to your `.zshrc`: - - ```sh - source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh - ``` - -3. Start a new terminal session. - diff --git a/.zprezto/modules/autosuggestions/external/LICENSE b/.zprezto/modules/autosuggestions/external/LICENSE deleted file mode 100644 index bcbc8b9..0000000 --- a/.zprezto/modules/autosuggestions/external/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda -Copyright (c) 2016-2018 Eric Freese - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/.zprezto/modules/autosuggestions/external/Makefile b/.zprezto/modules/autosuggestions/external/Makefile deleted file mode 100644 index d5d162c..0000000 --- a/.zprezto/modules/autosuggestions/external/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -SRC_DIR := ./src - -SRC_FILES := \ - $(SRC_DIR)/setup.zsh \ - $(SRC_DIR)/config.zsh \ - $(SRC_DIR)/util.zsh \ - $(SRC_DIR)/features.zsh \ - $(SRC_DIR)/bind.zsh \ - $(SRC_DIR)/highlight.zsh \ - $(SRC_DIR)/widgets.zsh \ - $(SRC_DIR)/strategies/*.zsh \ - $(SRC_DIR)/async.zsh \ - $(SRC_DIR)/start.zsh - -HEADER_FILES := \ - DESCRIPTION \ - URL \ - VERSION \ - LICENSE - -PLUGIN_TARGET := zsh-autosuggestions.zsh - -all: $(PLUGIN_TARGET) - -$(PLUGIN_TARGET): $(HEADER_FILES) $(SRC_FILES) - cat $(HEADER_FILES) | sed -e 's/^/# /g' > $@ - cat $(SRC_FILES) >> $@ - -.PHONY: clean -clean: - rm $(PLUGIN_TARGET) - -.PHONY: test -test: all - @test -n "$$TEST_ZSH_BIN" && echo "Testing zsh binary: $(TEST_ZSH_BIN)" || true - bundle exec rspec $(TESTS) diff --git a/.zprezto/modules/autosuggestions/external/README.md b/.zprezto/modules/autosuggestions/external/README.md deleted file mode 100644 index 4ad07d8..0000000 --- a/.zprezto/modules/autosuggestions/external/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# zsh-autosuggestions - -_[Fish](http://fishshell.com/)-like fast/unobtrusive autosuggestions for zsh._ - -It suggests commands as you type, based on command history. - -Requirements: Zsh v4.3.11 or later - -[![CircleCI](https://circleci.com/gh/zsh-users/zsh-autosuggestions.svg?style=svg)](https://circleci.com/gh/zsh-users/zsh-autosuggestions) - - - - -## Installation - -See [INSTALL.md](INSTALL.md). - - -## Usage - -As you type commands, you will see a completion offered after the cursor in a muted gray color. This color can be changed by setting the `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` variable. See [configuration](#configuration). - -If you press the key (`forward-char` widget) or End (`end-of-line` widget) with the cursor at the end of the buffer, it will accept the suggestion, replacing the contents of the command line buffer with the suggestion. - -If you invoke the `forward-word` widget, it will partially accept the suggestion up to the point that the cursor moves to. - - -## Configuration - -You may want to override the default global config variables after sourcing the plugin. Default values of these variables can be found [here](src/config.zsh). - -**Note:** If you are using Oh My Zsh, you can put this configuration in a file in the `$ZSH_CUSTOM` directory. See their comments on [overriding internals](https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals). - - -### Suggestion Highlight Style - -Set `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` to configure the style that the suggestion is shown with. The default is `fg=8`. - - -### Suggestion Strategy - -Set `ZSH_AUTOSUGGEST_STRATEGY` to choose the strategy for generating suggestions. There are currently two to choose from: - -- `default`: Chooses the most recent match. -- `match_prev_cmd`: Chooses the most recent match whose preceding history item matches the most recently executed command ([more info](src/strategies/match_prev_cmd.zsh)). Note that this strategy won't work as expected with ZSH options that don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`. - - -### Widget Mapping - -This plugin works by triggering custom behavior when certain [zle widgets](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Widgets) are invoked. You can add and remove widgets from these arrays to change the behavior of this plugin: - -- `ZSH_AUTOSUGGEST_CLEAR_WIDGETS`: Widgets in this array will clear the suggestion when invoked. -- `ZSH_AUTOSUGGEST_ACCEPT_WIDGETS`: Widgets in this array will accept the suggestion when invoked. -- `ZSH_AUTOSUGGEST_EXECUTE_WIDGETS`: Widgets in this array will execute the suggestion when invoked. -- `ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS`: Widgets in this array will partially accept the suggestion when invoked. -- `ZSH_AUTOSUGGEST_IGNORE_WIDGETS`: Widgets in this array will not trigger any custom behavior. - -Widgets that modify the buffer and are not found in any of these arrays will fetch a new suggestion after they are invoked. - -**Note:** A widget shouldn't belong to more than one of the above arrays. - - -### Disabling suggestion for large buffers - -Set `ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE` to an integer value to disable autosuggestion for large buffers. The default is unset, which means that autosuggestion will be tried for any buffer size. Recommended value is 20. -This can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for too long strings. - -### Enable Asynchronous Mode - -As of `v0.4.0`, suggestions can be fetched asynchronously using the `zsh/zpty` module. To enable this behavior, set the `ZSH_AUTOSUGGEST_USE_ASYNC` variable (it can be set to anything). - - -### Key Bindings - -This plugin provides a few widgets that you can use with `bindkey`: - -1. `autosuggest-accept`: Accepts the current suggestion. -2. `autosuggest-execute`: Accepts and executes the current suggestion. -3. `autosuggest-clear`: Clears the current suggestion. -4. `autosuggest-fetch`: Fetches a suggestion (works even when suggestions are disabled). -5. `autosuggest-disable`: Disables suggestions. -6. `autosuggest-enable`: Re-enables suggestions. -7. `autosuggest-toggle`: Toggles between enabled/disabled suggestions. - -For example, this would bind ctrl + space to accept the current suggestion. - -```sh -bindkey '^ ' autosuggest-accept -``` - - -## Troubleshooting - -If you have a problem, please search through [the list of issues on GitHub](https://github.com/zsh-users/zsh-autosuggestions/issues) to see if someone else has already reported it. - - -### Reporting an Issue - -Before reporting an issue, please try temporarily disabling sections of your configuration and other plugins that may be conflicting with this plugin to isolate the problem. - -When reporting an issue, please include: - -- The smallest, simplest `.zshrc` configuration that will reproduce the problem. See [this comment](https://github.com/zsh-users/zsh-autosuggestions/issues/102#issuecomment-180944764) for a good example of what this means. -- The version of zsh you're using (`zsh --version`) -- Which operating system you're running - - -## Uninstallation - -1. Remove the code referencing this plugin from `~/.zshrc`. - -2. Remove the git repository from your hard drive - - ```sh - rm -rf ~/.zsh/zsh-autosuggestions # Or wherever you installed - ``` - - -## Development - -### Build Process - -Edit the source files in `src/`. Run `make` to build `zsh-autosuggestions.zsh` from those source files. - - -### Pull Requests - -Pull requests are welcome! If you send a pull request, please: - -- Request to merge into the `develop` branch (*NOT* `master`) -- Match the existing coding conventions. -- Include helpful comments to keep the barrier-to-entry low for people new to the project. -- Write tests that cover your code as much as possible. - - -### Testing - -Tests are written in ruby using the [`rspec`](http://rspec.info/) framework. They use [`tmux`](https://tmux.github.io/) to drive a pseudoterminal, sending simulated keystrokes and making assertions on the terminal content. - -Test files live in `spec/`. To run the tests, run `make test`. To run a specific test, run `TESTS=spec/some_spec.rb make test`. You can also specify a `zsh` binary to use by setting the `TEST_ZSH_BIN` environment variable (ex: `TEST_ZSH_BIN=/bin/zsh make test`). - - -## License - -This project is licensed under [MIT license](http://opensource.org/licenses/MIT). -For the full text of the license, see the [LICENSE](LICENSE) file. diff --git a/.zprezto/modules/autosuggestions/external/URL b/.zprezto/modules/autosuggestions/external/URL deleted file mode 100644 index 4e2bd94..0000000 --- a/.zprezto/modules/autosuggestions/external/URL +++ /dev/null @@ -1 +0,0 @@ -https://github.com/zsh-users/zsh-autosuggestions diff --git a/.zprezto/modules/autosuggestions/external/VERSION b/.zprezto/modules/autosuggestions/external/VERSION deleted file mode 100644 index f87d474..0000000 --- a/.zprezto/modules/autosuggestions/external/VERSION +++ /dev/null @@ -1 +0,0 @@ -v0.4.3 diff --git a/.zprezto/modules/autosuggestions/external/circle.yml b/.zprezto/modules/autosuggestions/external/circle.yml deleted file mode 100644 index c804ae1..0000000 --- a/.zprezto/modules/autosuggestions/external/circle.yml +++ /dev/null @@ -1,12 +0,0 @@ -machine: - environment: - ZSH_VERSIONS: zsh-dev/4.3.11 zsh/5.0.2 zsh/5.0.8 zsh/5.1.1 zsh/5.2 zsh/5.3.1 zsh/5.4.2 zsh/5.5.1 - -dependencies: - pre: - - for v in $(echo $ZSH_VERSIONS | awk "{ for (i=$((1+CIRCLE_NODE_INDEX));i<=NF;i+=$CIRCLE_NODE_TOTAL) print \$i }"); do wget https://sourceforge.net/projects/zsh/files/$v/zsh-${v#*/}.tar.gz && tar xzf zsh-${v#*/}.tar.gz && pushd zsh-${v#*/} && ./configure && sudo make install && popd || exit 1; done - -test: - override: - - for v in $(echo $ZSH_VERSIONS | awk "{ for (i=$((1+CIRCLE_NODE_INDEX));i<=NF;i+=$CIRCLE_NODE_TOTAL) print \$i }"); do TEST_ZSH_BIN=/usr/local/bin/zsh-${v#*/} make test || exit 1; done: - parallel: true diff --git a/.zprezto/modules/autosuggestions/external/spec/async_spec.rb b/.zprezto/modules/autosuggestions/external/spec/async_spec.rb deleted file mode 100644 index 0bcbaa1..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/async_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -context 'with asynchronous suggestions enabled' do - let(:options) { ["ZSH_AUTOSUGGEST_USE_ASYNC="] } - - describe '`up-line-or-beginning-search`' do - let(:before_sourcing) do - -> do - session. - run_command('autoload -U up-line-or-beginning-search'). - run_command('zle -N up-line-or-beginning-search'). - send_string('bindkey "'). - send_keys('C-v').send_keys('up'). - send_string('" up-line-or-beginning-search'). - send_keys('enter') - end - end - - it 'should show previous history entries' do - with_history( - 'echo foo', - 'echo bar', - 'echo baz' - ) do - session.clear_screen - 3.times { session.send_keys('up') } - wait_for { session.content }.to eq("echo foo") - end - end - end - - describe 'exiting a subshell' do - it 'should not cause error messages to be printed' do - session.run_command('$(exit)') - - sleep 1 - - expect(session.content).to eq('$(exit)') - end - end -end - - diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/bracketed_paste_magic_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/bracketed_paste_magic_spec.rb deleted file mode 100644 index 64092ad..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/bracketed_paste_magic_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -describe 'pasting using bracketed-paste-magic' do - let(:before_sourcing) do - -> do - session. - run_command('autoload -Uz bracketed-paste-magic'). - run_command('zle -N bracketed-paste bracketed-paste-magic') - end - end - - context 'with suggestions disabled while pasting' do - before do - session. - run_command('bpm_init() { zle autosuggest-disable }'). - run_command('bpm_finish() { zle autosuggest-enable }'). - run_command('zstyle :bracketed-paste-magic paste-init bpm_init'). - run_command('zstyle :bracketed-paste-magic paste-finish bpm_finish') - end - - it 'does not show an incorrect suggestion' do - with_history('echo hello') do - session.paste_string("echo #{'a' * 60}") - sleep 1 - expect(session.content).to eq("echo #{'a' * 60}") - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/client_zpty_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/client_zpty_spec.rb deleted file mode 100644 index 8f1550e..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/client_zpty_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -describe 'a running zpty command' do - let(:before_sourcing) { -> { session.run_command('zmodload zsh/zpty && zpty -b kitty cat') } } - - it 'is not affected by running zsh-autosuggestions' do - sleep 1 # Give a little time for precmd hooks to run - session.run_command('zpty -t kitty; echo $?') - - wait_for { session.content }.to end_with("\n0") - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/rebound_bracket_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/rebound_bracket_spec.rb deleted file mode 100644 index 8b420f0..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/rebound_bracket_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -describe 'rebinding [' do - context 'initialized before sourcing the plugin' do - before do - session.run_command("function [ { $commands[\\[] \"$@\" }") - session.clear_screen - end - - it 'executes the custom behavior and the built-in behavior' do - session.send_string('asdf') - wait_for { session.content }.to eq('asdf') - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/vi_mode_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/vi_mode_spec.rb deleted file mode 100644 index cf471b5..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/vi_mode_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -describe 'when using vi mode' do - let(:before_sourcing) do - -> do - session.run_command('bindkey -v') - end - end - - describe 'moving the cursor after exiting insert mode' do - it 'should not clear the current suggestion' do - with_history('foobar foo') do - session. - send_string('foo'). - send_keys('escape'). - send_keys('h') - - wait_for { session.content }.to eq('foobar foo') - end - end - end - - describe '`vi-forward-word-end`' do - it 'should accept through the end of the current word' do - with_history('foobar foo') do - session. - send_string('foo'). - send_keys('escape'). - send_keys('e'). # vi-forward-word-end - send_keys('a'). # vi-add-next - send_string('baz') - - wait_for { session.content }.to eq('foobarbaz') - end - end - end - - describe '`vi-forward-word`' do - it 'should accept through the first character of the next word' do - with_history('foobar foo') do - session. - send_string('foo'). - send_keys('escape'). - send_keys('w'). # vi-forward-word - send_keys('a'). # vi-add-next - send_string('az') - - wait_for { session.content }.to eq('foobar faz') - end - end - end - - describe '`vi-find-next-char`' do - it 'should accept through the next occurrence of the character' do - with_history('foobar foo') do - session. - send_string('foo'). - send_keys('escape'). - send_keys('f'). # vi-find-next-char - send_keys('o'). - send_keys('a'). # vi-add-next - send_string('b') - - wait_for { session.content }.to eq('foobar fob') - end - end - end -end - diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/wrapped_widget_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/wrapped_widget_spec.rb deleted file mode 100644 index 61dfc2d..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/wrapped_widget_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -describe 'a wrapped widget' do - let(:widget) { 'backward-delete-char' } - - context 'initialized before sourcing the plugin' do - let(:before_sourcing) do - -> do - session. - run_command("_orig_#{widget}() { zle .#{widget} }"). - run_command("zle -N orig-#{widget} _orig_#{widget}"). - run_command("#{widget}-magic() { zle orig-#{widget}; BUFFER+=b }"). - run_command("zle -N #{widget} #{widget}-magic") - end - end - - it 'executes the custom behavior and the built-in behavior' do - with_history('foobar', 'foodar') do - session.send_string('food').send_keys('C-h') - wait_for { session.content }.to eq('foobar') - end - end - end - - context 'initialized after sourcing the plugin' do - before do - session. - run_command("zle -N orig-#{widget} ${widgets[#{widget}]#*:}"). - run_command("#{widget}-magic() { zle orig-#{widget}; BUFFER+=b }"). - run_command("zle -N #{widget} #{widget}-magic"). - clear_screen - end - - it 'executes the custom behavior and the built-in behavior' do - with_history('foobar', 'foodar') do - session.send_string('food').send_keys('C-h') - wait_for { session.content }.to eq('foobar') - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/integrations/zle_input_stack_spec.rb b/.zprezto/modules/autosuggestions/external/spec/integrations/zle_input_stack_spec.rb deleted file mode 100644 index 8a2c990..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/integrations/zle_input_stack_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -describe 'using `zle -U`' do - let(:before_sourcing) do - -> do - session. - run_command('_zsh_autosuggest_strategy_test() { sleep 1; _zsh_autosuggest_strategy_default "$1" }'). - run_command('foo() { zle -U - "echo hello" }; zle -N foo; bindkey ^B foo') - end - end - - let(:options) { ['unset ZSH_AUTOSUGGEST_USE_ASYNC', 'ZSH_AUTOSUGGEST_STRATEGY=test'] } - - # TODO: This is only possible with the $KEYS_QUEUED_COUNT widget parameter, coming soon... - xit 'does not fetch a suggestion for every inserted character' do - session.send_keys('C-b') - wait_for { session.content }.to eq('echo hello') - end - - it 'shows a suggestion when the widget completes' do - with_history('echo hello world') do - session.send_keys('C-b') - wait_for { session.content(esc_seqs: true) }.to match(/\Aecho hello\e\[[0-9]+m world/) - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/kill_ring_spec.rb b/.zprezto/modules/autosuggestions/external/spec/kill_ring_spec.rb deleted file mode 100644 index 4d0178f..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/kill_ring_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -context 'with some items in the kill ring' do - before do - session. - send_string('echo foo'). - send_keys('C-u'). - send_string('echo bar'). - send_keys('C-u') - end - - describe '`yank-pop`' do - it 'should cycle through all items in the kill ring' do - session.send_keys('C-y') - wait_for { session.content }.to eq('echo bar') - - session.send_keys('escape').send_keys('y') - wait_for { session.content }.to eq('echo foo') - - session.send_keys('escape').send_keys('y') - wait_for { session.content }.to eq('echo bar') - end - end -end - diff --git a/.zprezto/modules/autosuggestions/external/spec/multi_line_spec.rb b/.zprezto/modules/autosuggestions/external/spec/multi_line_spec.rb deleted file mode 100644 index 4ff2ae1..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/multi_line_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -describe 'a multi-line suggestion' do - it 'should be displayed on multiple lines' do - with_history(-> { - session.send_string('echo "') - session.send_keys('enter') - session.send_string('"') - session.send_keys('enter') - }) do - session.send_keys('e') - wait_for { session.content }.to eq("echo \"\n\"") - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/async_zpty_name_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/async_zpty_name_spec.rb deleted file mode 100644 index 407ee70..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/async_zpty_name_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -context 'when async suggestions are enabled' do - let(:options) { ["ZSH_AUTOSUGGEST_USE_ASYNC="] } - - describe 'the zpty for async suggestions' do - it 'is created with the default name' do - session.run_command('zpty -t zsh_autosuggest_pty &>/dev/null; echo $?') - wait_for { session.content }.to end_with("\n0") - end - - context 'when ZSH_AUTOSUGGEST_ASYNC_PTY_NAME is set' do - let(:options) { super() + ['ZSH_AUTOSUGGEST_ASYNC_PTY_NAME=foo_pty'] } - - it 'is created with the specified name' do - session.run_command('zpty -t foo_pty &>/dev/null; echo $?') - wait_for { session.content }.to end_with("\n0") - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/buffer_max_size_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/buffer_max_size_spec.rb deleted file mode 100644 index 29ca8bc..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/buffer_max_size_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -describe 'a suggestion' do - let(:term_opts) { { width: 200 } } - let(:long_command) { "echo #{'a' * 100}" } - - around do |example| - with_history(long_command) { example.run } - end - - it 'is provided for any buffer length' do - session.send_string(long_command[0...-1]) - wait_for { session.content }.to eq(long_command) - end - - context 'when ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE is specified' do - let(:buffer_max_size) { 10 } - let(:options) { ["ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=#{buffer_max_size}"] } - - it 'is provided when the buffer is shorter than the specified length' do - session.send_string(long_command[0...(buffer_max_size - 1)]) - wait_for { session.content }.to eq(long_command) - end - - it 'is provided when the buffer is equal to the specified length' do - session.send_string(long_command[0...(buffer_max_size)]) - wait_for { session.content }.to eq(long_command) - end - - it 'is not provided when the buffer is longer than the specified length' - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/highlight_style_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/highlight_style_spec.rb deleted file mode 100644 index a7e39b3..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/highlight_style_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe 'a displayed suggestion' do - it 'is shown in the default style' - - describe 'when ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE is set to a zle_highlight string' do - it 'is shown in the specified style' - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/original_widget_prefix_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/original_widget_prefix_spec.rb deleted file mode 100644 index a4b6e98..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/original_widget_prefix_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe 'an original zle widget' do - context 'is accessible with the default prefix' - - context 'when ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX is set' do - it 'is accessible with the specified prefix' - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/strategy_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/strategy_spec.rb deleted file mode 100644 index c9f01e1..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/strategy_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -describe 'a suggestion for a given prefix' do - let(:options) { ['_zsh_autosuggest_strategy_default() { suggestion="echo foo" }'] } - - it 'is determined by calling the default strategy function' do - session.send_string('e') - wait_for { session.content }.to eq('echo foo') - end - - context 'when ZSH_AUTOSUGGEST_STRATEGY is set' do - let(:options) { [ - '_zsh_autosuggest_strategy_custom() { suggestion="echo foo" }', - 'ZSH_AUTOSUGGEST_STRATEGY=custom' - ] } - - it 'is determined by calling the specified strategy function' do - session.send_string('e') - wait_for { session.content }.to eq('echo foo') - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/use_async_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/use_async_spec.rb deleted file mode 100644 index 420dcc3..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/use_async_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe 'suggestion fetching' do - it 'is performed synchronously' - - context 'when ZSH_AUTOSUGGEST_USE_ASYNC is set' do - it 'is performed asynchronously' - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/options/widget_lists_spec.rb b/.zprezto/modules/autosuggestions/external/spec/options/widget_lists_spec.rb deleted file mode 100644 index c207c0c..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/options/widget_lists_spec.rb +++ /dev/null @@ -1,97 +0,0 @@ -describe 'a zle widget' do - let(:widget) { 'my-widget' } - let(:before_sourcing) { -> { session.run_command("#{widget}() {}; zle -N #{widget}; bindkey ^B #{widget}") } } - - context 'when added to ZSH_AUTOSUGGEST_ACCEPT_WIDGETS' do - let(:options) { ["ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(#{widget})"] } - - it 'accepts the suggestion when invoked' do - with_history('echo hello') do - session.send_string('e') - wait_for { session.content }.to eq('echo hello') - session.send_keys('C-b') - wait_for { session.content(esc_seqs: true) }.to eq('echo hello') - end - end - end - - context 'when added to ZSH_AUTOSUGGEST_CLEAR_WIDGETS' do - let(:options) { ["ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(#{widget})"] } - - it 'clears the suggestion when invoked' do - with_history('echo hello') do - session.send_string('e') - wait_for { session.content }.to eq('echo hello') - session.send_keys('C-b') - wait_for { session.content }.to eq('e') - end - end - end - - context 'when added to ZSH_AUTOSUGGEST_EXECUTE_WIDGETS' do - let(:options) { ["ZSH_AUTOSUGGEST_EXECUTE_WIDGETS+=(#{widget})"] } - - it 'executes the suggestion when invoked' do - with_history('echo hello') do - session.send_string('e') - wait_for { session.content }.to eq('echo hello') - session.send_keys('C-b') - wait_for { session.content }.to end_with("\nhello") - end - end - end - - context 'when added to ZSH_AUTOSUGGEST_IGNORE_WIDGETS' do - let(:options) { ["ZSH_AUTOSUGGEST_IGNORE_WIDGETS=(#{widget})"] } - - it 'should not be wrapped with an autosuggest widget' do - session.run_command("echo $widgets[#{widget}]") - wait_for { session.content }.to end_with("\nuser:#{widget}") - end - end - - context 'that moves the cursor forward' do - before { session.run_command("#{widget}() { zle forward-char }") } - - context 'when added to ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS' do - let(:options) { ["ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=(#{widget})"] } - - it 'accepts the suggestion as far as the cursor is moved when invoked' do - with_history('echo hello') do - session.send_string('e') - wait_for { session.content }.to start_with('echo hello') - session.send_keys('C-b') - wait_for { session.content(esc_seqs: true) }.to match(/\Aec\e\[[0-9]+mho hello/) - end - end - end - end - - context 'that modifies the buffer' do - before { session.run_command("#{widget}() { BUFFER=\"foo\" }") } - - context 'when not added to any of the widget lists' do - it 'modifies the buffer and fetches a new suggestion' do - with_history('foobar') do - session.send_keys('C-b') - wait_for { session.content }.to eq('foobar') - end - end - end - end -end - -describe 'a modification to the widget lists' do - let(:widget) { 'my-widget' } - let(:before_sourcing) { -> { session.run_command("#{widget}() {}; zle -N #{widget}; bindkey ^B #{widget}") } } - before { session.run_command("ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(#{widget})") } - - it 'takes effect on the next cmd line' do - with_history('echo hello') do - session.send_string('e') - wait_for { session.content }.to eq('echo hello') - session.send_keys('C-b') - wait_for { session.content(esc_seqs: true) }.to eq('echo hello') - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/spec_helper.rb b/.zprezto/modules/autosuggestions/external/spec/spec_helper.rb deleted file mode 100644 index 64115d2..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/spec_helper.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'pry' -require 'rspec/wait' -require 'terminal_session' - -RSpec.shared_context 'terminal session' do - let(:term_opts) { {} } - let(:session) { TerminalSession.new(term_opts) } - let(:before_sourcing) { -> {} } - let(:options) { [] } - - around do |example| - before_sourcing.call - - session.run_command((['source zsh-autosuggestions.zsh'] + options).join('; ')) - session.clear_screen - - example.run - - session.destroy - end - - def with_history(*commands, &block) - session.run_command('fc -p') - - commands.each do |c| - c.respond_to?(:call) ? c.call : session.run_command(c) - end - - session.clear_screen - - yield block - - session.send_keys('C-c') - session.run_command('fc -P') - end -end - -RSpec.configure do |config| - config.expect_with :rspec do |expectations| - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - config.mock_with :rspec do |mocks| - mocks.verify_partial_doubles = true - end - - config.wait_timeout = 2 - - config.include_context 'terminal session' -end diff --git a/.zprezto/modules/autosuggestions/external/spec/strategies/default_spec.rb b/.zprezto/modules/autosuggestions/external/spec/strategies/default_spec.rb deleted file mode 100644 index 89321f3..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/strategies/default_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'strategies/special_characters_helper' - -describe 'the default suggestion strategy' do - it 'suggests the last matching history entry' do - with_history('ls foo', 'ls bar', 'echo baz') do - session.send_string('ls') - wait_for { session.content }.to eq('ls bar') - end - end - - include_examples 'special characters' -end diff --git a/.zprezto/modules/autosuggestions/external/spec/strategies/match_prev_cmd_spec.rb b/.zprezto/modules/autosuggestions/external/spec/strategies/match_prev_cmd_spec.rb deleted file mode 100644 index f1596ba..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/strategies/match_prev_cmd_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'strategies/special_characters_helper' - -describe 'the match_prev_cmd strategy' do - let(:options) { ['ZSH_AUTOSUGGEST_STRATEGY=match_prev_cmd'] } - - it 'suggests the last matching history entry after the previous command' do - with_history( - 'echo what', - 'ls foo', - 'echo what', - 'ls bar', - 'ls baz', - 'echo what' - ) do - session.send_string('ls') - wait_for { session.content }.to eq('ls bar') - end - end - - include_examples 'special characters' -end diff --git a/.zprezto/modules/autosuggestions/external/spec/strategies/special_characters_helper.rb b/.zprezto/modules/autosuggestions/external/spec/strategies/special_characters_helper.rb deleted file mode 100644 index 8771861..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/strategies/special_characters_helper.rb +++ /dev/null @@ -1,62 +0,0 @@ -shared_examples 'special characters' do - describe 'a special character in the buffer' do - it 'should be treated like any other character' do - with_history('echo "hello*"', 'echo "hello."') do - session.send_string('echo "hello*') - wait_for { session.content }.to eq('echo "hello*"') - end - - with_history('echo "hello?"', 'echo "hello."') do - session.send_string('echo "hello?') - wait_for { session.content }.to eq('echo "hello?"') - end - - with_history('echo "hello\nworld"') do - session.send_string('echo "hello\\') - wait_for { session.content }.to eq('echo "hello\nworld"') - end - - with_history('echo "\\\\"') do - session.send_string('echo "\\\\') - wait_for { session.content }.to eq('echo "\\\\"') - end - - with_history('echo ~/foo') do - session.send_string('echo ~') - wait_for { session.content }.to eq('echo ~/foo') - end - - with_history('echo "$(ls foo)"') do - session.send_string('echo "$(') - wait_for { session.content }.to eq('echo "$(ls foo)"') - end - - with_history('echo "$history[123]"') do - session.send_string('echo "$history[') - wait_for { session.content }.to eq('echo "$history[123]"') - session.send_string('123]') - wait_for { session.content }.to eq('echo "$history[123]"') - end - - with_history('echo "#yolo"') do - session.send_string('echo "#') - wait_for { session.content }.to eq('echo "#yolo"') - end - - with_history('echo "#foo"', 'echo $#abc') do - session.send_string('echo "#') - wait_for { session.content }.to eq('echo "#foo"') - end - - with_history('echo "^A"', 'echo "^B"') do - session.send_string('echo "^A') - wait_for { session.content }.to eq('echo "^A"') - end - - with_history('-foo() {}') do - session.send_string('-') - wait_for { session.content }.to eq('-foo() {}') - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/terminal_session.rb b/.zprezto/modules/autosuggestions/external/spec/terminal_session.rb deleted file mode 100644 index 2d9468f..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/terminal_session.rb +++ /dev/null @@ -1,95 +0,0 @@ -require 'securerandom' - -class TerminalSession - ZSH_BIN = ENV['TEST_ZSH_BIN'] || 'zsh' - - def initialize(opts = {}) - opts = { - width: 80, - height: 24, - prompt: '', - term: 'xterm-256color', - zsh_bin: ZSH_BIN - }.merge(opts) - - @opts = opts - - cmd="PS1=\"#{opts[:prompt]}\" TERM=#{opts[:term]} #{ZSH_BIN} -f" - tmux_command("new-session -d -x #{opts[:width]} -y #{opts[:height]} '#{cmd}'") - end - - def tmux_socket_name - @tmux_socket_name ||= SecureRandom.hex(6) - end - - def run_command(command) - send_string(command) - send_keys('enter') - - self - end - - def send_string(str) - tmux_command("send-keys -t 0 -l -- '#{str.gsub("'", "\\'")}'") - - self - end - - def send_keys(*keys) - tmux_command("send-keys -t 0 #{keys.join(' ')}") - - self - end - - def paste_string(str) - tmux_command("set-buffer -- '#{str}'") - tmux_command("paste-buffer -dpr -t 0") - - self - end - - def content(esc_seqs: false) - cmd = 'capture-pane -p -t 0' - cmd += ' -e' if esc_seqs - tmux_command(cmd).strip - end - - def clear_screen - send_keys('C-l') - - i = 0 - until content == opts[:prompt] || i > 20 do - sleep(0.1) - i = i + 1 - end - - self - end - - def destroy - tmux_command('kill-session') - end - - def cursor - tmux_command("display-message -t 0 -p '\#{cursor_x},\#{cursor_y}'"). - strip. - split(','). - map(&:to_i) - end - - def attach! - tmux_command('attach-session') - end - - private - - attr_reader :opts - - def tmux_command(cmd) - out = `tmux -u -L #{tmux_socket_name} #{cmd}` - - raise("tmux error running: '#{cmd}'") unless $?.success? - - out - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/widgets/disable_spec.rb b/.zprezto/modules/autosuggestions/external/spec/widgets/disable_spec.rb deleted file mode 100644 index b387a59..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/widgets/disable_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -describe 'the `autosuggest-disable` widget' do - before do - session.run_command('bindkey ^B autosuggest-disable') - end - - it 'disables suggestions and clears the suggestion' do - with_history('echo hello') do - session.send_string('echo') - wait_for { session.content }.to eq('echo hello') - - session.send_keys('C-b') - wait_for { session.content }.to eq('echo') - - session.send_string(' h') - sleep 1 - expect(session.content).to eq('echo h') - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/widgets/enable_spec.rb b/.zprezto/modules/autosuggestions/external/spec/widgets/enable_spec.rb deleted file mode 100644 index 3ad35a8..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/widgets/enable_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -describe 'the `autosuggest-enable` widget' do - before do - session. - run_command('typeset -g _ZSH_AUTOSUGGEST_DISABLED'). - run_command('bindkey ^B autosuggest-enable') - end - - it 'enables suggestions and fetches a suggestion' do - with_history('echo hello') do - session.send_string('e') - sleep 1 - expect(session.content).to eq('e') - - session.send_keys('C-b') - session.send_string('c') - wait_for { session.content }.to eq('echo hello') - end - end - - context 'invoked on an empty buffer' do - it 'does not fetch a suggestion' do - with_history('echo hello') do - session.send_keys('C-b') - sleep 1 - expect(session.content).to eq('') - end - end - end - - context 'invoked on a non-empty buffer' do - it 'fetches a suggestion' do - with_history('echo hello') do - session.send_string('e') - sleep 1 - expect(session.content).to eq('e') - - session.send_keys('C-b') - wait_for { session.content }.to eq('echo hello') - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/widgets/fetch_spec.rb b/.zprezto/modules/autosuggestions/external/spec/widgets/fetch_spec.rb deleted file mode 100644 index eb8f2ba..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/widgets/fetch_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -describe 'the `autosuggest-fetch` widget' do - context 'when suggestions are disabled' do - before do - session. - run_command('bindkey ^B autosuggest-disable'). - run_command('bindkey ^F autosuggest-fetch'). - send_keys('C-b') - end - - it 'will fetch and display a suggestion' do - with_history('echo hello') do - session.send_string('echo h') - sleep 1 - expect(session.content).to eq('echo h') - - session.send_keys('C-f') - wait_for { session.content }.to eq('echo hello') - - session.send_string('e') - wait_for { session.content }.to eq('echo hello') - end - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/spec/widgets/toggle_spec.rb b/.zprezto/modules/autosuggestions/external/spec/widgets/toggle_spec.rb deleted file mode 100644 index 8f9f3c3..0000000 --- a/.zprezto/modules/autosuggestions/external/spec/widgets/toggle_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -describe 'the `autosuggest-toggle` widget' do - before do - session.run_command('bindkey ^B autosuggest-toggle') - end - - it 'toggles suggestions' do - with_history('echo world', 'echo hello') do - session.send_string('echo') - wait_for { session.content }.to eq('echo hello') - - session.send_keys('C-b') - wait_for { session.content }.to eq('echo') - - session.send_string(' h') - sleep 1 - expect(session.content).to eq('echo h') - - session.send_keys('C-b') - wait_for { session.content }.to eq('echo hello') - - session.send_keys('C-h') - session.send_string('w') - wait_for { session.content }.to eq('echo world') - end - end -end diff --git a/.zprezto/modules/autosuggestions/external/src/async.zsh b/.zprezto/modules/autosuggestions/external/src/async.zsh deleted file mode 100644 index 9a0cfaa..0000000 --- a/.zprezto/modules/autosuggestions/external/src/async.zsh +++ /dev/null @@ -1,106 +0,0 @@ - -#--------------------------------------------------------------------# -# Async # -#--------------------------------------------------------------------# - -# Zpty process is spawned running this function -_zsh_autosuggest_async_server() { - emulate -R zsh - - # There is a bug in zpty module (fixed in zsh/master) by which a - # zpty that exits will kill all zpty processes that were forked - # before it. Here we set up a zsh exit hook to SIGKILL the zpty - # process immediately, before it has a chance to kill any other - # zpty processes. - zshexit() { - kill -KILL $$ - sleep 1 # Block for long enough for the signal to come through - } - - # Output only newlines (not carriage return + newline) - stty -onlcr - - # Silence any error messages - exec 2>/dev/null - - local last_pid - - while IFS='' read -r -d $'\0' query; do - # Kill last bg process - kill -KILL $last_pid &>/dev/null - - # Run suggestion search in the background - ( - local suggestion - _zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY "$query" - echo -n -E "$suggestion"$'\0' - ) & - - last_pid=$! - done -} - -_zsh_autosuggest_async_request() { - # Write the query to the zpty process to fetch a suggestion - zpty -w -n $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME "${1}"$'\0' -} - -# Called when new data is ready to be read from the pty -# First arg will be fd ready for reading -# Second arg will be passed in case of error -_zsh_autosuggest_async_response() { - setopt LOCAL_OPTIONS EXTENDED_GLOB - - local suggestion - - zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null - zle autosuggest-suggest -- "${suggestion%%$'\0'##}" -} - -_zsh_autosuggest_async_pty_create() { - # With newer versions of zsh, REPLY stores the fd to read from - typeset -h REPLY - - # If we won't get a fd back from zpty, try to guess it - if (( ! $_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD )); then - integer -l zptyfd - exec {zptyfd}>&1 # Open a new file descriptor (above 10). - exec {zptyfd}>&- # Close it so it's free to be used by zpty. - fi - - # Fork a zpty process running the server function - zpty -b $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME _zsh_autosuggest_async_server - - # Store the fd so we can remove the handler later - if (( REPLY )); then - _ZSH_AUTOSUGGEST_PTY_FD=$REPLY - else - _ZSH_AUTOSUGGEST_PTY_FD=$zptyfd - fi - - # Set up input handler from the zpty - zle -F $_ZSH_AUTOSUGGEST_PTY_FD _zsh_autosuggest_async_response -} - -_zsh_autosuggest_async_pty_destroy() { - # Remove the input handler - zle -F $_ZSH_AUTOSUGGEST_PTY_FD &>/dev/null - - # Destroy the zpty - zpty -d $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME &>/dev/null -} - -_zsh_autosuggest_async_pty_recreate() { - _zsh_autosuggest_async_pty_destroy - _zsh_autosuggest_async_pty_create -} - -_zsh_autosuggest_async_start() { - typeset -g _ZSH_AUTOSUGGEST_PTY_FD - - _zsh_autosuggest_feature_detect_zpty_returns_fd - _zsh_autosuggest_async_pty_recreate - - # We recreate the pty to get a fresh list of history events - add-zsh-hook precmd _zsh_autosuggest_async_pty_recreate -} diff --git a/.zprezto/modules/autosuggestions/external/src/bind.zsh b/.zprezto/modules/autosuggestions/external/src/bind.zsh deleted file mode 100644 index 42a0dd0..0000000 --- a/.zprezto/modules/autosuggestions/external/src/bind.zsh +++ /dev/null @@ -1,118 +0,0 @@ - -#--------------------------------------------------------------------# -# Widget Helpers # -#--------------------------------------------------------------------# - -_zsh_autosuggest_incr_bind_count() { - if ((${+_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]})); then - ((_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]++)) - else - _ZSH_AUTOSUGGEST_BIND_COUNTS[$1]=1 - fi - - typeset -gi bind_count=$_ZSH_AUTOSUGGEST_BIND_COUNTS[$1] -} - -_zsh_autosuggest_get_bind_count() { - if ((${+_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]})); then - typeset -gi bind_count=$_ZSH_AUTOSUGGEST_BIND_COUNTS[$1] - else - typeset -gi bind_count=0 - fi -} - -# Bind a single widget to an autosuggest widget, saving a reference to the original widget -_zsh_autosuggest_bind_widget() { - typeset -gA _ZSH_AUTOSUGGEST_BIND_COUNTS - - local widget=$1 - local autosuggest_action=$2 - local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX - - local -i bind_count - - # Save a reference to the original widget - case $widgets[$widget] in - # Already bound - user:_zsh_autosuggest_(bound|orig)_*);; - - # User-defined widget - user:*) - _zsh_autosuggest_incr_bind_count $widget - zle -N $prefix${bind_count}-$widget ${widgets[$widget]#*:} - ;; - - # Built-in widget - builtin) - _zsh_autosuggest_incr_bind_count $widget - eval "_zsh_autosuggest_orig_${(q)widget}() { zle .${(q)widget} }" - zle -N $prefix${bind_count}-$widget _zsh_autosuggest_orig_$widget - ;; - - # Completion widget - completion:*) - _zsh_autosuggest_incr_bind_count $widget - eval "zle -C $prefix${bind_count}-${(q)widget} ${${(s.:.)widgets[$widget]}[2,3]}" - ;; - esac - - _zsh_autosuggest_get_bind_count $widget - - # Pass the original widget's name explicitly into the autosuggest - # function. Use this passed in widget name to call the original - # widget instead of relying on the $WIDGET variable being set - # correctly. $WIDGET cannot be trusted because other plugins call - # zle without the `-w` flag (e.g. `zle self-insert` instead of - # `zle self-insert -w`). - eval "_zsh_autosuggest_bound_${bind_count}_${(q)widget}() { - _zsh_autosuggest_widget_$autosuggest_action $prefix$bind_count-${(q)widget} \$@ - }" - - # Create the bound widget - zle -N $widget _zsh_autosuggest_bound_${bind_count}_$widget -} - -# Map all configured widgets to the right autosuggest widgets -_zsh_autosuggest_bind_widgets() { - local widget - local ignore_widgets - - ignore_widgets=( - .\* - _\* - zle-\* - autosuggest-\* - $ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\* - $ZSH_AUTOSUGGEST_IGNORE_WIDGETS - ) - - # Find every widget we might want to bind and bind it appropriately - for widget in ${${(f)"$(builtin zle -la)"}:#${(j:|:)~ignore_widgets}}; do - if [[ -n ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget clear - elif [[ -n ${ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget accept - elif [[ -n ${ZSH_AUTOSUGGEST_EXECUTE_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget execute - elif [[ -n ${ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget partial_accept - else - # Assume any unspecified widget might modify the buffer - _zsh_autosuggest_bind_widget $widget modify - fi - done -} - -# Given the name of an original widget and args, invoke it, if it exists -_zsh_autosuggest_invoke_original_widget() { - # Do nothing unless called with at least one arg - (( $# )) || return 0 - - local original_widget_name="$1" - - shift - - if (( ${+widgets[$original_widget_name]} )); then - zle $original_widget_name -- $@ - fi -} diff --git a/.zprezto/modules/autosuggestions/external/src/config.zsh b/.zprezto/modules/autosuggestions/external/src/config.zsh deleted file mode 100644 index 597307f..0000000 --- a/.zprezto/modules/autosuggestions/external/src/config.zsh +++ /dev/null @@ -1,71 +0,0 @@ - -#--------------------------------------------------------------------# -# Global Configuration Variables # -#--------------------------------------------------------------------# - -# Color to use when highlighting suggestion -# Uses format of `region_highlight` -# More info: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Widgets -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' - -# Prefix to use when saving original versions of bound widgets -ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig- - -ZSH_AUTOSUGGEST_STRATEGY=default - -# Widgets that clear the suggestion -ZSH_AUTOSUGGEST_CLEAR_WIDGETS=( - history-search-forward - history-search-backward - history-beginning-search-forward - history-beginning-search-backward - history-substring-search-up - history-substring-search-down - up-line-or-beginning-search - down-line-or-beginning-search - up-line-or-history - down-line-or-history - accept-line -) - -# Widgets that accept the entire suggestion -ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=( - forward-char - end-of-line - vi-forward-char - vi-end-of-line - vi-add-eol -) - -# Widgets that accept the entire suggestion and execute it -ZSH_AUTOSUGGEST_EXECUTE_WIDGETS=( -) - -# Widgets that accept the suggestion as far as the cursor moves -ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=( - forward-word - emacs-forward-word - vi-forward-word - vi-forward-word-end - vi-forward-blank-word - vi-forward-blank-word-end - vi-find-next-char - vi-find-next-char-skip -) - -# Widgets that should be ignored (globbing supported but must be escaped) -ZSH_AUTOSUGGEST_IGNORE_WIDGETS=( - orig-\* - beep - run-help - set-local-history - which-command - yank - yank-pop -) - -# Max size of buffer to trigger autosuggestion. Leave undefined for no upper bound. -ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE= - -# Pty name for calculating autosuggestions asynchronously -ZSH_AUTOSUGGEST_ASYNC_PTY_NAME=zsh_autosuggest_pty diff --git a/.zprezto/modules/autosuggestions/external/src/features.zsh b/.zprezto/modules/autosuggestions/external/src/features.zsh deleted file mode 100644 index 7a5248f..0000000 --- a/.zprezto/modules/autosuggestions/external/src/features.zsh +++ /dev/null @@ -1,19 +0,0 @@ - -#--------------------------------------------------------------------# -# Feature Detection # -#--------------------------------------------------------------------# - -_zsh_autosuggest_feature_detect_zpty_returns_fd() { - typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD - typeset -h REPLY - - zpty zsh_autosuggest_feature_detect '{ zshexit() { kill -KILL $$; sleep 1 } }' - - if (( REPLY )); then - _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1 - else - _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=0 - fi - - zpty -d zsh_autosuggest_feature_detect -} diff --git a/.zprezto/modules/autosuggestions/external/src/highlight.zsh b/.zprezto/modules/autosuggestions/external/src/highlight.zsh deleted file mode 100644 index 273c03d..0000000 --- a/.zprezto/modules/autosuggestions/external/src/highlight.zsh +++ /dev/null @@ -1,26 +0,0 @@ - -#--------------------------------------------------------------------# -# Highlighting # -#--------------------------------------------------------------------# - -# If there was a highlight, remove it -_zsh_autosuggest_highlight_reset() { - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - - if [[ -n "$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT" ]]; then - region_highlight=("${(@)region_highlight:#$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT}") - unset _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - fi -} - -# If there's a suggestion, highlight it -_zsh_autosuggest_highlight_apply() { - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - - if (( $#POSTDISPLAY )); then - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT="$#BUFFER $(($#BUFFER + $#POSTDISPLAY)) $ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" - region_highlight+=("$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT") - else - unset _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - fi -} diff --git a/.zprezto/modules/autosuggestions/external/src/setup.zsh b/.zprezto/modules/autosuggestions/external/src/setup.zsh deleted file mode 100644 index c74489f..0000000 --- a/.zprezto/modules/autosuggestions/external/src/setup.zsh +++ /dev/null @@ -1,10 +0,0 @@ - -#--------------------------------------------------------------------# -# Setup # -#--------------------------------------------------------------------# - -# Precmd hooks for initializing the library and starting pty's -autoload -Uz add-zsh-hook - -# Asynchronous suggestions are generated in a pty -zmodload zsh/zpty diff --git a/.zprezto/modules/autosuggestions/external/src/start.zsh b/.zprezto/modules/autosuggestions/external/src/start.zsh deleted file mode 100644 index 6f48ab6..0000000 --- a/.zprezto/modules/autosuggestions/external/src/start.zsh +++ /dev/null @@ -1,24 +0,0 @@ - -#--------------------------------------------------------------------# -# Start # -#--------------------------------------------------------------------# - -# Start the autosuggestion widgets -_zsh_autosuggest_start() { - add-zsh-hook -d precmd _zsh_autosuggest_start - - _zsh_autosuggest_bind_widgets - - # Re-bind widgets on every precmd to ensure we wrap other wrappers. - # Specifically, highlighting breaks if our widgets are wrapped by - # zsh-syntax-highlighting widgets. This also allows modifications - # to the widget list variables to take effect on the next precmd. - add-zsh-hook precmd _zsh_autosuggest_bind_widgets - - if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then - _zsh_autosuggest_async_start - fi -} - -# Start the autosuggestion widgets on the next precmd -add-zsh-hook precmd _zsh_autosuggest_start diff --git a/.zprezto/modules/autosuggestions/external/src/strategies/default.zsh b/.zprezto/modules/autosuggestions/external/src/strategies/default.zsh deleted file mode 100644 index 0e85fb5..0000000 --- a/.zprezto/modules/autosuggestions/external/src/strategies/default.zsh +++ /dev/null @@ -1,25 +0,0 @@ - -#--------------------------------------------------------------------# -# Default Suggestion Strategy # -#--------------------------------------------------------------------# -# Suggests the most recent history item that matches the given -# prefix. -# - -_zsh_autosuggest_strategy_default() { - # Reset options to defaults and enable LOCAL_OPTIONS - emulate -L zsh - - # Enable globbing flags so that we can use (#m) - setopt EXTENDED_GLOB - - # Escape backslashes and all of the glob operators so we can use - # this string as a pattern to search the $history associative array. - # - (#m) globbing flag enables setting references for match data - # TODO: Use (b) flag when we can drop support for zsh older than v5.0.8 - local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" - - # Get the history items that match - # - (r) subscript flag makes the pattern match on values - typeset -g suggestion="${history[(r)${prefix}*]}" -} diff --git a/.zprezto/modules/autosuggestions/external/src/strategies/match_prev_cmd.zsh b/.zprezto/modules/autosuggestions/external/src/strategies/match_prev_cmd.zsh deleted file mode 100644 index f76d3c1..0000000 --- a/.zprezto/modules/autosuggestions/external/src/strategies/match_prev_cmd.zsh +++ /dev/null @@ -1,59 +0,0 @@ - -#--------------------------------------------------------------------# -# Match Previous Command Suggestion Strategy # -#--------------------------------------------------------------------# -# Suggests the most recent history item that matches the given -# prefix and whose preceding history item also matches the most -# recently executed command. -# -# For example, suppose your history has the following entries: -# - pwd -# - ls foo -# - ls bar -# - pwd -# -# Given the history list above, when you type 'ls', the suggestion -# will be 'ls foo' rather than 'ls bar' because your most recently -# executed command (pwd) was previously followed by 'ls foo'. -# -# Note that this strategy won't work as expected with ZSH options that don't -# preserve the history order such as `HIST_IGNORE_ALL_DUPS` or -# `HIST_EXPIRE_DUPS_FIRST`. - -_zsh_autosuggest_strategy_match_prev_cmd() { - # Reset options to defaults and enable LOCAL_OPTIONS - emulate -L zsh - - # Enable globbing flags so that we can use (#m) - setopt EXTENDED_GLOB - - # TODO: Use (b) flag when we can drop support for zsh older than v5.0.8 - local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" - - # Get all history event numbers that correspond to history - # entries that match pattern $prefix* - local history_match_keys - history_match_keys=(${(k)history[(R)$prefix*]}) - - # By default we use the first history number (most recent history entry) - local histkey="${history_match_keys[1]}" - - # Get the previously executed command - local prev_cmd="$(_zsh_autosuggest_escape_command "${history[$((HISTCMD-1))]}")" - - # Iterate up to the first 200 history event numbers that match $prefix - for key in "${(@)history_match_keys[1,200]}"; do - # Stop if we ran out of history - [[ $key -gt 1 ]] || break - - # See if the history entry preceding the suggestion matches the - # previous command, and use it if it does - if [[ "${history[$((key - 1))]}" == "$prev_cmd" ]]; then - histkey="$key" - break - fi - done - - # Give back the matched history entry - typeset -g suggestion="$history[$histkey]" -} diff --git a/.zprezto/modules/autosuggestions/external/src/util.zsh b/.zprezto/modules/autosuggestions/external/src/util.zsh deleted file mode 100644 index 1f55d36..0000000 --- a/.zprezto/modules/autosuggestions/external/src/util.zsh +++ /dev/null @@ -1,11 +0,0 @@ - -#--------------------------------------------------------------------# -# Utility Functions # -#--------------------------------------------------------------------# - -_zsh_autosuggest_escape_command() { - setopt localoptions EXTENDED_GLOB - - # Escape special chars in the string (requires EXTENDED_GLOB) - echo -E "${1//(#m)[\"\'\\()\[\]|*?~]/\\$MATCH}" -} diff --git a/.zprezto/modules/autosuggestions/external/src/widgets.zsh b/.zprezto/modules/autosuggestions/external/src/widgets.zsh deleted file mode 100644 index 87bb62e..0000000 --- a/.zprezto/modules/autosuggestions/external/src/widgets.zsh +++ /dev/null @@ -1,213 +0,0 @@ - -#--------------------------------------------------------------------# -# Autosuggest Widget Implementations # -#--------------------------------------------------------------------# - -# Disable suggestions -_zsh_autosuggest_disable() { - typeset -g _ZSH_AUTOSUGGEST_DISABLED - _zsh_autosuggest_clear -} - -# Enable suggestions -_zsh_autosuggest_enable() { - unset _ZSH_AUTOSUGGEST_DISABLED - - if (( $#BUFFER )); then - _zsh_autosuggest_fetch - fi -} - -# Toggle suggestions (enable/disable) -_zsh_autosuggest_toggle() { - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then - _zsh_autosuggest_enable - else - _zsh_autosuggest_disable - fi -} - -# Clear the suggestion -_zsh_autosuggest_clear() { - # Remove the suggestion - unset POSTDISPLAY - - _zsh_autosuggest_invoke_original_widget $@ -} - -# Modify the buffer and get a new suggestion -_zsh_autosuggest_modify() { - local -i retval - - # Only available in zsh >= 5.4 - local -i KEYS_QUEUED_COUNT - - # Save the contents of the buffer/postdisplay - local orig_buffer="$BUFFER" - local orig_postdisplay="$POSTDISPLAY" - - # Clear suggestion while waiting for next one - unset POSTDISPLAY - - # Original widget may modify the buffer - _zsh_autosuggest_invoke_original_widget $@ - retval=$? - - # Don't fetch a new suggestion if there's more input to be read immediately - if (( $PENDING > 0 )) || (( $KEYS_QUEUED_COUNT > 0 )); then - POSTDISPLAY="$orig_postdisplay" - return $retval - fi - - # Optimize if manually typing in the suggestion - if (( $#BUFFER > $#orig_buffer )); then - local added=${BUFFER#$orig_buffer} - - # If the string added matches the beginning of the postdisplay - if [[ "$added" = "${orig_postdisplay:0:$#added}" ]]; then - POSTDISPLAY="${orig_postdisplay:$#added}" - return $retval - fi - fi - - # Don't fetch a new suggestion if the buffer hasn't changed - if [[ "$BUFFER" = "$orig_buffer" ]]; then - POSTDISPLAY="$orig_postdisplay" - return $retval - fi - - # Bail out if suggestions are disabled - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then - return $? - fi - - # Get a new suggestion if the buffer is not empty after modification - if (( $#BUFFER > 0 )); then - if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then - _zsh_autosuggest_fetch - fi - fi - - return $retval -} - -# Fetch a new suggestion based on what's currently in the buffer -_zsh_autosuggest_fetch() { - if zpty -t "$ZSH_AUTOSUGGEST_ASYNC_PTY_NAME" &>/dev/null; then - _zsh_autosuggest_async_request "$BUFFER" - else - local suggestion - _zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY "$BUFFER" - _zsh_autosuggest_suggest "$suggestion" - fi -} - -# Offer a suggestion -_zsh_autosuggest_suggest() { - local suggestion="$1" - - if [[ -n "$suggestion" ]] && (( $#BUFFER )); then - POSTDISPLAY="${suggestion#$BUFFER}" - else - unset POSTDISPLAY - fi -} - -# Accept the entire suggestion -_zsh_autosuggest_accept() { - local -i max_cursor_pos=$#BUFFER - - # When vicmd keymap is active, the cursor can't move all the way - # to the end of the buffer - if [[ "$KEYMAP" = "vicmd" ]]; then - max_cursor_pos=$((max_cursor_pos - 1)) - fi - - # Only accept if the cursor is at the end of the buffer - if [[ $CURSOR = $max_cursor_pos ]]; then - # Add the suggestion to the buffer - BUFFER="$BUFFER$POSTDISPLAY" - - # Remove the suggestion - unset POSTDISPLAY - - # Move the cursor to the end of the buffer - CURSOR=${#BUFFER} - fi - - _zsh_autosuggest_invoke_original_widget $@ -} - -# Accept the entire suggestion and execute it -_zsh_autosuggest_execute() { - # Add the suggestion to the buffer - BUFFER="$BUFFER$POSTDISPLAY" - - # Remove the suggestion - unset POSTDISPLAY - - # Call the original `accept-line` to handle syntax highlighting or - # other potential custom behavior - _zsh_autosuggest_invoke_original_widget "accept-line" -} - -# Partially accept the suggestion -_zsh_autosuggest_partial_accept() { - local -i retval cursor_loc - - # Save the contents of the buffer so we can restore later if needed - local original_buffer="$BUFFER" - - # Temporarily accept the suggestion. - BUFFER="$BUFFER$POSTDISPLAY" - - # Original widget moves the cursor - _zsh_autosuggest_invoke_original_widget $@ - retval=$? - - # Normalize cursor location across vi/emacs modes - cursor_loc=$CURSOR - if [[ "$KEYMAP" = "vicmd" ]]; then - cursor_loc=$((cursor_loc + 1)) - fi - - # If we've moved past the end of the original buffer - if (( $cursor_loc > $#original_buffer )); then - # Set POSTDISPLAY to text right of the cursor - POSTDISPLAY="${BUFFER[$(($cursor_loc + 1)),$#BUFFER]}" - - # Clip the buffer at the cursor - BUFFER="${BUFFER[1,$cursor_loc]}" - else - # Restore the original buffer - BUFFER="$original_buffer" - fi - - return $retval -} - -for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do - eval "_zsh_autosuggest_widget_$action() { - local -i retval - - _zsh_autosuggest_highlight_reset - - _zsh_autosuggest_$action \$@ - retval=\$? - - _zsh_autosuggest_highlight_apply - - zle -R - - return \$retval - }" -done - -zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch -zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest -zle -N autosuggest-accept _zsh_autosuggest_widget_accept -zle -N autosuggest-clear _zsh_autosuggest_widget_clear -zle -N autosuggest-execute _zsh_autosuggest_widget_execute -zle -N autosuggest-enable _zsh_autosuggest_widget_enable -zle -N autosuggest-disable _zsh_autosuggest_widget_disable -zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle diff --git a/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.plugin.zsh b/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.plugin.zsh deleted file mode 100644 index 16c2256..0000000 --- a/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -source ${0:A:h}/zsh-autosuggestions.zsh diff --git a/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.zsh b/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.zsh deleted file mode 100644 index 1c3eab5..0000000 --- a/.zprezto/modules/autosuggestions/external/zsh-autosuggestions.zsh +++ /dev/null @@ -1,708 +0,0 @@ -# Fish-like fast/unobtrusive autosuggestions for zsh. -# https://github.com/zsh-users/zsh-autosuggestions -# v0.4.3 -# Copyright (c) 2013 Thiago de Arruda -# Copyright (c) 2016-2018 Eric Freese -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation -# files (the "Software"), to deal in the Software without -# restriction, including without limitation the rights to use, -# copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following -# conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. - -#--------------------------------------------------------------------# -# Setup # -#--------------------------------------------------------------------# - -# Precmd hooks for initializing the library and starting pty's -autoload -Uz add-zsh-hook - -# Asynchronous suggestions are generated in a pty -zmodload zsh/zpty - -#--------------------------------------------------------------------# -# Global Configuration Variables # -#--------------------------------------------------------------------# - -# Color to use when highlighting suggestion -# Uses format of `region_highlight` -# More info: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Widgets -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' - -# Prefix to use when saving original versions of bound widgets -ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig- - -ZSH_AUTOSUGGEST_STRATEGY=default - -# Widgets that clear the suggestion -ZSH_AUTOSUGGEST_CLEAR_WIDGETS=( - history-search-forward - history-search-backward - history-beginning-search-forward - history-beginning-search-backward - history-substring-search-up - history-substring-search-down - up-line-or-beginning-search - down-line-or-beginning-search - up-line-or-history - down-line-or-history - accept-line -) - -# Widgets that accept the entire suggestion -ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=( - forward-char - end-of-line - vi-forward-char - vi-end-of-line - vi-add-eol -) - -# Widgets that accept the entire suggestion and execute it -ZSH_AUTOSUGGEST_EXECUTE_WIDGETS=( -) - -# Widgets that accept the suggestion as far as the cursor moves -ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=( - forward-word - emacs-forward-word - vi-forward-word - vi-forward-word-end - vi-forward-blank-word - vi-forward-blank-word-end - vi-find-next-char - vi-find-next-char-skip -) - -# Widgets that should be ignored (globbing supported but must be escaped) -ZSH_AUTOSUGGEST_IGNORE_WIDGETS=( - orig-\* - beep - run-help - set-local-history - which-command - yank - yank-pop -) - -# Max size of buffer to trigger autosuggestion. Leave undefined for no upper bound. -ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE= - -# Pty name for calculating autosuggestions asynchronously -ZSH_AUTOSUGGEST_ASYNC_PTY_NAME=zsh_autosuggest_pty - -#--------------------------------------------------------------------# -# Utility Functions # -#--------------------------------------------------------------------# - -_zsh_autosuggest_escape_command() { - setopt localoptions EXTENDED_GLOB - - # Escape special chars in the string (requires EXTENDED_GLOB) - echo -E "${1//(#m)[\"\'\\()\[\]|*?~]/\\$MATCH}" -} - -#--------------------------------------------------------------------# -# Feature Detection # -#--------------------------------------------------------------------# - -_zsh_autosuggest_feature_detect_zpty_returns_fd() { - typeset -g _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD - typeset -h REPLY - - zpty zsh_autosuggest_feature_detect '{ zshexit() { kill -KILL $$; sleep 1 } }' - - if (( REPLY )); then - _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=1 - else - _ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD=0 - fi - - zpty -d zsh_autosuggest_feature_detect -} - -#--------------------------------------------------------------------# -# Widget Helpers # -#--------------------------------------------------------------------# - -_zsh_autosuggest_incr_bind_count() { - if ((${+_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]})); then - ((_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]++)) - else - _ZSH_AUTOSUGGEST_BIND_COUNTS[$1]=1 - fi - - typeset -gi bind_count=$_ZSH_AUTOSUGGEST_BIND_COUNTS[$1] -} - -_zsh_autosuggest_get_bind_count() { - if ((${+_ZSH_AUTOSUGGEST_BIND_COUNTS[$1]})); then - typeset -gi bind_count=$_ZSH_AUTOSUGGEST_BIND_COUNTS[$1] - else - typeset -gi bind_count=0 - fi -} - -# Bind a single widget to an autosuggest widget, saving a reference to the original widget -_zsh_autosuggest_bind_widget() { - typeset -gA _ZSH_AUTOSUGGEST_BIND_COUNTS - - local widget=$1 - local autosuggest_action=$2 - local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX - - local -i bind_count - - # Save a reference to the original widget - case $widgets[$widget] in - # Already bound - user:_zsh_autosuggest_(bound|orig)_*);; - - # User-defined widget - user:*) - _zsh_autosuggest_incr_bind_count $widget - zle -N $prefix${bind_count}-$widget ${widgets[$widget]#*:} - ;; - - # Built-in widget - builtin) - _zsh_autosuggest_incr_bind_count $widget - eval "_zsh_autosuggest_orig_${(q)widget}() { zle .${(q)widget} }" - zle -N $prefix${bind_count}-$widget _zsh_autosuggest_orig_$widget - ;; - - # Completion widget - completion:*) - _zsh_autosuggest_incr_bind_count $widget - eval "zle -C $prefix${bind_count}-${(q)widget} ${${(s.:.)widgets[$widget]}[2,3]}" - ;; - esac - - _zsh_autosuggest_get_bind_count $widget - - # Pass the original widget's name explicitly into the autosuggest - # function. Use this passed in widget name to call the original - # widget instead of relying on the $WIDGET variable being set - # correctly. $WIDGET cannot be trusted because other plugins call - # zle without the `-w` flag (e.g. `zle self-insert` instead of - # `zle self-insert -w`). - eval "_zsh_autosuggest_bound_${bind_count}_${(q)widget}() { - _zsh_autosuggest_widget_$autosuggest_action $prefix$bind_count-${(q)widget} \$@ - }" - - # Create the bound widget - zle -N $widget _zsh_autosuggest_bound_${bind_count}_$widget -} - -# Map all configured widgets to the right autosuggest widgets -_zsh_autosuggest_bind_widgets() { - local widget - local ignore_widgets - - ignore_widgets=( - .\* - _\* - zle-\* - autosuggest-\* - $ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX\* - $ZSH_AUTOSUGGEST_IGNORE_WIDGETS - ) - - # Find every widget we might want to bind and bind it appropriately - for widget in ${${(f)"$(builtin zle -la)"}:#${(j:|:)~ignore_widgets}}; do - if [[ -n ${ZSH_AUTOSUGGEST_CLEAR_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget clear - elif [[ -n ${ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget accept - elif [[ -n ${ZSH_AUTOSUGGEST_EXECUTE_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget execute - elif [[ -n ${ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS[(r)$widget]} ]]; then - _zsh_autosuggest_bind_widget $widget partial_accept - else - # Assume any unspecified widget might modify the buffer - _zsh_autosuggest_bind_widget $widget modify - fi - done -} - -# Given the name of an original widget and args, invoke it, if it exists -_zsh_autosuggest_invoke_original_widget() { - # Do nothing unless called with at least one arg - (( $# )) || return 0 - - local original_widget_name="$1" - - shift - - if (( ${+widgets[$original_widget_name]} )); then - zle $original_widget_name -- $@ - fi -} - -#--------------------------------------------------------------------# -# Highlighting # -#--------------------------------------------------------------------# - -# If there was a highlight, remove it -_zsh_autosuggest_highlight_reset() { - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - - if [[ -n "$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT" ]]; then - region_highlight=("${(@)region_highlight:#$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT}") - unset _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - fi -} - -# If there's a suggestion, highlight it -_zsh_autosuggest_highlight_apply() { - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - - if (( $#POSTDISPLAY )); then - typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT="$#BUFFER $(($#BUFFER + $#POSTDISPLAY)) $ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" - region_highlight+=("$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT") - else - unset _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - fi -} - -#--------------------------------------------------------------------# -# Autosuggest Widget Implementations # -#--------------------------------------------------------------------# - -# Disable suggestions -_zsh_autosuggest_disable() { - typeset -g _ZSH_AUTOSUGGEST_DISABLED - _zsh_autosuggest_clear -} - -# Enable suggestions -_zsh_autosuggest_enable() { - unset _ZSH_AUTOSUGGEST_DISABLED - - if (( $#BUFFER )); then - _zsh_autosuggest_fetch - fi -} - -# Toggle suggestions (enable/disable) -_zsh_autosuggest_toggle() { - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then - _zsh_autosuggest_enable - else - _zsh_autosuggest_disable - fi -} - -# Clear the suggestion -_zsh_autosuggest_clear() { - # Remove the suggestion - unset POSTDISPLAY - - _zsh_autosuggest_invoke_original_widget $@ -} - -# Modify the buffer and get a new suggestion -_zsh_autosuggest_modify() { - local -i retval - - # Only available in zsh >= 5.4 - local -i KEYS_QUEUED_COUNT - - # Save the contents of the buffer/postdisplay - local orig_buffer="$BUFFER" - local orig_postdisplay="$POSTDISPLAY" - - # Clear suggestion while waiting for next one - unset POSTDISPLAY - - # Original widget may modify the buffer - _zsh_autosuggest_invoke_original_widget $@ - retval=$? - - # Don't fetch a new suggestion if there's more input to be read immediately - if (( $PENDING > 0 )) || (( $KEYS_QUEUED_COUNT > 0 )); then - POSTDISPLAY="$orig_postdisplay" - return $retval - fi - - # Optimize if manually typing in the suggestion - if (( $#BUFFER > $#orig_buffer )); then - local added=${BUFFER#$orig_buffer} - - # If the string added matches the beginning of the postdisplay - if [[ "$added" = "${orig_postdisplay:0:$#added}" ]]; then - POSTDISPLAY="${orig_postdisplay:$#added}" - return $retval - fi - fi - - # Don't fetch a new suggestion if the buffer hasn't changed - if [[ "$BUFFER" = "$orig_buffer" ]]; then - POSTDISPLAY="$orig_postdisplay" - return $retval - fi - - # Bail out if suggestions are disabled - if [[ -n "${_ZSH_AUTOSUGGEST_DISABLED+x}" ]]; then - return $? - fi - - # Get a new suggestion if the buffer is not empty after modification - if (( $#BUFFER > 0 )); then - if [[ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]] || (( $#BUFFER <= $ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE )); then - _zsh_autosuggest_fetch - fi - fi - - return $retval -} - -# Fetch a new suggestion based on what's currently in the buffer -_zsh_autosuggest_fetch() { - if zpty -t "$ZSH_AUTOSUGGEST_ASYNC_PTY_NAME" &>/dev/null; then - _zsh_autosuggest_async_request "$BUFFER" - else - local suggestion - _zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY "$BUFFER" - _zsh_autosuggest_suggest "$suggestion" - fi -} - -# Offer a suggestion -_zsh_autosuggest_suggest() { - local suggestion="$1" - - if [[ -n "$suggestion" ]] && (( $#BUFFER )); then - POSTDISPLAY="${suggestion#$BUFFER}" - else - unset POSTDISPLAY - fi -} - -# Accept the entire suggestion -_zsh_autosuggest_accept() { - local -i max_cursor_pos=$#BUFFER - - # When vicmd keymap is active, the cursor can't move all the way - # to the end of the buffer - if [[ "$KEYMAP" = "vicmd" ]]; then - max_cursor_pos=$((max_cursor_pos - 1)) - fi - - # Only accept if the cursor is at the end of the buffer - if [[ $CURSOR = $max_cursor_pos ]]; then - # Add the suggestion to the buffer - BUFFER="$BUFFER$POSTDISPLAY" - - # Remove the suggestion - unset POSTDISPLAY - - # Move the cursor to the end of the buffer - CURSOR=${#BUFFER} - fi - - _zsh_autosuggest_invoke_original_widget $@ -} - -# Accept the entire suggestion and execute it -_zsh_autosuggest_execute() { - # Add the suggestion to the buffer - BUFFER="$BUFFER$POSTDISPLAY" - - # Remove the suggestion - unset POSTDISPLAY - - # Call the original `accept-line` to handle syntax highlighting or - # other potential custom behavior - _zsh_autosuggest_invoke_original_widget "accept-line" -} - -# Partially accept the suggestion -_zsh_autosuggest_partial_accept() { - local -i retval cursor_loc - - # Save the contents of the buffer so we can restore later if needed - local original_buffer="$BUFFER" - - # Temporarily accept the suggestion. - BUFFER="$BUFFER$POSTDISPLAY" - - # Original widget moves the cursor - _zsh_autosuggest_invoke_original_widget $@ - retval=$? - - # Normalize cursor location across vi/emacs modes - cursor_loc=$CURSOR - if [[ "$KEYMAP" = "vicmd" ]]; then - cursor_loc=$((cursor_loc + 1)) - fi - - # If we've moved past the end of the original buffer - if (( $cursor_loc > $#original_buffer )); then - # Set POSTDISPLAY to text right of the cursor - POSTDISPLAY="${BUFFER[$(($cursor_loc + 1)),$#BUFFER]}" - - # Clip the buffer at the cursor - BUFFER="${BUFFER[1,$cursor_loc]}" - else - # Restore the original buffer - BUFFER="$original_buffer" - fi - - return $retval -} - -for action in clear modify fetch suggest accept partial_accept execute enable disable toggle; do - eval "_zsh_autosuggest_widget_$action() { - local -i retval - - _zsh_autosuggest_highlight_reset - - _zsh_autosuggest_$action \$@ - retval=\$? - - _zsh_autosuggest_highlight_apply - - zle -R - - return \$retval - }" -done - -zle -N autosuggest-fetch _zsh_autosuggest_widget_fetch -zle -N autosuggest-suggest _zsh_autosuggest_widget_suggest -zle -N autosuggest-accept _zsh_autosuggest_widget_accept -zle -N autosuggest-clear _zsh_autosuggest_widget_clear -zle -N autosuggest-execute _zsh_autosuggest_widget_execute -zle -N autosuggest-enable _zsh_autosuggest_widget_enable -zle -N autosuggest-disable _zsh_autosuggest_widget_disable -zle -N autosuggest-toggle _zsh_autosuggest_widget_toggle - -#--------------------------------------------------------------------# -# Default Suggestion Strategy # -#--------------------------------------------------------------------# -# Suggests the most recent history item that matches the given -# prefix. -# - -_zsh_autosuggest_strategy_default() { - # Reset options to defaults and enable LOCAL_OPTIONS - emulate -L zsh - - # Enable globbing flags so that we can use (#m) - setopt EXTENDED_GLOB - - # Escape backslashes and all of the glob operators so we can use - # this string as a pattern to search the $history associative array. - # - (#m) globbing flag enables setting references for match data - # TODO: Use (b) flag when we can drop support for zsh older than v5.0.8 - local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" - - # Get the history items that match - # - (r) subscript flag makes the pattern match on values - typeset -g suggestion="${history[(r)${prefix}*]}" -} - -#--------------------------------------------------------------------# -# Match Previous Command Suggestion Strategy # -#--------------------------------------------------------------------# -# Suggests the most recent history item that matches the given -# prefix and whose preceding history item also matches the most -# recently executed command. -# -# For example, suppose your history has the following entries: -# - pwd -# - ls foo -# - ls bar -# - pwd -# -# Given the history list above, when you type 'ls', the suggestion -# will be 'ls foo' rather than 'ls bar' because your most recently -# executed command (pwd) was previously followed by 'ls foo'. -# -# Note that this strategy won't work as expected with ZSH options that don't -# preserve the history order such as `HIST_IGNORE_ALL_DUPS` or -# `HIST_EXPIRE_DUPS_FIRST`. - -_zsh_autosuggest_strategy_match_prev_cmd() { - # Reset options to defaults and enable LOCAL_OPTIONS - emulate -L zsh - - # Enable globbing flags so that we can use (#m) - setopt EXTENDED_GLOB - - # TODO: Use (b) flag when we can drop support for zsh older than v5.0.8 - local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}" - - # Get all history event numbers that correspond to history - # entries that match pattern $prefix* - local history_match_keys - history_match_keys=(${(k)history[(R)$prefix*]}) - - # By default we use the first history number (most recent history entry) - local histkey="${history_match_keys[1]}" - - # Get the previously executed command - local prev_cmd="$(_zsh_autosuggest_escape_command "${history[$((HISTCMD-1))]}")" - - # Iterate up to the first 200 history event numbers that match $prefix - for key in "${(@)history_match_keys[1,200]}"; do - # Stop if we ran out of history - [[ $key -gt 1 ]] || break - - # See if the history entry preceding the suggestion matches the - # previous command, and use it if it does - if [[ "${history[$((key - 1))]}" == "$prev_cmd" ]]; then - histkey="$key" - break - fi - done - - # Give back the matched history entry - typeset -g suggestion="$history[$histkey]" -} - -#--------------------------------------------------------------------# -# Async # -#--------------------------------------------------------------------# - -# Zpty process is spawned running this function -_zsh_autosuggest_async_server() { - emulate -R zsh - - # There is a bug in zpty module (fixed in zsh/master) by which a - # zpty that exits will kill all zpty processes that were forked - # before it. Here we set up a zsh exit hook to SIGKILL the zpty - # process immediately, before it has a chance to kill any other - # zpty processes. - zshexit() { - kill -KILL $$ - sleep 1 # Block for long enough for the signal to come through - } - - # Output only newlines (not carriage return + newline) - stty -onlcr - - # Silence any error messages - exec 2>/dev/null - - local last_pid - - while IFS='' read -r -d $'\0' query; do - # Kill last bg process - kill -KILL $last_pid &>/dev/null - - # Run suggestion search in the background - ( - local suggestion - _zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY "$query" - echo -n -E "$suggestion"$'\0' - ) & - - last_pid=$! - done -} - -_zsh_autosuggest_async_request() { - # Write the query to the zpty process to fetch a suggestion - zpty -w -n $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME "${1}"$'\0' -} - -# Called when new data is ready to be read from the pty -# First arg will be fd ready for reading -# Second arg will be passed in case of error -_zsh_autosuggest_async_response() { - setopt LOCAL_OPTIONS EXTENDED_GLOB - - local suggestion - - zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null - zle autosuggest-suggest -- "${suggestion%%$'\0'##}" -} - -_zsh_autosuggest_async_pty_create() { - # With newer versions of zsh, REPLY stores the fd to read from - typeset -h REPLY - - # If we won't get a fd back from zpty, try to guess it - if (( ! $_ZSH_AUTOSUGGEST_ZPTY_RETURNS_FD )); then - integer -l zptyfd - exec {zptyfd}>&1 # Open a new file descriptor (above 10). - exec {zptyfd}>&- # Close it so it's free to be used by zpty. - fi - - # Fork a zpty process running the server function - zpty -b $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME _zsh_autosuggest_async_server - - # Store the fd so we can remove the handler later - if (( REPLY )); then - _ZSH_AUTOSUGGEST_PTY_FD=$REPLY - else - _ZSH_AUTOSUGGEST_PTY_FD=$zptyfd - fi - - # Set up input handler from the zpty - zle -F $_ZSH_AUTOSUGGEST_PTY_FD _zsh_autosuggest_async_response -} - -_zsh_autosuggest_async_pty_destroy() { - # Remove the input handler - zle -F $_ZSH_AUTOSUGGEST_PTY_FD &>/dev/null - - # Destroy the zpty - zpty -d $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME &>/dev/null -} - -_zsh_autosuggest_async_pty_recreate() { - _zsh_autosuggest_async_pty_destroy - _zsh_autosuggest_async_pty_create -} - -_zsh_autosuggest_async_start() { - typeset -g _ZSH_AUTOSUGGEST_PTY_FD - - _zsh_autosuggest_feature_detect_zpty_returns_fd - _zsh_autosuggest_async_pty_recreate - - # We recreate the pty to get a fresh list of history events - add-zsh-hook precmd _zsh_autosuggest_async_pty_recreate -} - -#--------------------------------------------------------------------# -# Start # -#--------------------------------------------------------------------# - -# Start the autosuggestion widgets -_zsh_autosuggest_start() { - add-zsh-hook -d precmd _zsh_autosuggest_start - - _zsh_autosuggest_bind_widgets - - # Re-bind widgets on every precmd to ensure we wrap other wrappers. - # Specifically, highlighting breaks if our widgets are wrapped by - # zsh-syntax-highlighting widgets. This also allows modifications - # to the widget list variables to take effect on the next precmd. - add-zsh-hook precmd _zsh_autosuggest_bind_widgets - - if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then - _zsh_autosuggest_async_start - fi -} - -# Start the autosuggestion widgets on the next precmd -add-zsh-hook precmd _zsh_autosuggest_start diff --git a/.zprezto/modules/autosuggestions/init.zsh b/.zprezto/modules/autosuggestions/init.zsh deleted file mode 100644 index a3a772e..0000000 --- a/.zprezto/modules/autosuggestions/init.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# -# Integrates zsh-autosuggestions into Prezto. -# -# Authors: -# Sorin Ionescu -# - -# Load dependencies. -pmodload 'editor' - -# Source module files. -source "${0:h}/external/zsh-autosuggestions.zsh" || return 1 - -# -# Highlighting -# - -# Set highlight color, default 'fg=8'. -zstyle -s ':prezto:module:autosuggestions:color' found \ - 'ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE' || ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' - -# Disable highlighting. -if ! zstyle -t ':prezto:module:autosuggestions' color; then - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='' -fi - -# -# Key Bindings -# - -if [[ -n "$key_info" ]]; then - # vi - bindkey -M viins "$key_info[Control]F" vi-forward-word - bindkey -M viins "$key_info[Control]E" vi-add-eol -fi diff --git a/.zprezto/modules/command-not-found/README.md b/.zprezto/modules/command-not-found/README.md deleted file mode 100644 index ee5a94d..0000000 --- a/.zprezto/modules/command-not-found/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Command-Not-Found -================= - -When you try to use a command that is not available locally, searches -the package manager for a package offering that command and suggests -the proper install command. - -Debian and Arch Linux based distributions use the [`command-not-found`][1] tool. - -macOS uses Homebrew's [`command-not-found` clone][2]. Note that you also need to -[follow the instructions][3] to tap the `command-not-found` homebrew repository. - - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][4].* - - - [Joseph Booker](https://github.com/sargas) - -[1]: https://code.launchpad.net/command-not-found -[2]: https://github.com/Homebrew/homebrew-command-not-found -[3]: https://github.com/Homebrew/homebrew-command-not-found#install -[4]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/command-not-found/init.zsh b/.zprezto/modules/command-not-found/init.zsh deleted file mode 100644 index 2c59a4b..0000000 --- a/.zprezto/modules/command-not-found/init.zsh +++ /dev/null @@ -1,21 +0,0 @@ -# -# Displays installation information for not found commands. -# -# Authors: -# Joseph Jon Booker -# Indrajit Raychaudhuri -# - -# Load command-not-found on Debian-based distributions. -if [[ -s '/etc/zsh_command_not_found' ]]; then - source '/etc/zsh_command_not_found' -# Load command-not-found on Arch Linux-based distributions. -elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then - source '/usr/share/doc/pkgfile/command-not-found.zsh' -# Load command-not-found on macOS when homebrew tap is configured. -elif [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then - source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' -# Return if requirements are not found. -else - return 1 -fi diff --git a/.zprezto/modules/completion/README.md b/.zprezto/modules/completion/README.md deleted file mode 100644 index dc2b9b8..0000000 --- a/.zprezto/modules/completion/README.md +++ /dev/null @@ -1,53 +0,0 @@ -Completion -========== - -Loads and configures tab completion and provides additional completions from -the [zsh-completions][1] project. - -This module must be loaded **after** the *utility* module. - -Options -------- - - - `COMPLETE_IN_WORD` complete from both ends of a word. - - `ALWAYS_TO_END` move cursor to the end of a completed word. - - `PATH_DIRS` perform path search even on command names with slashes. - - `AUTO_MENU` show completion menu on a successive tab press. - - `AUTO_LIST` automatically list choices on ambiguous completion. - - `AUTO_PARAM_SLASH` if completed parameter is a directory, add a trailing slash. - - `EXTENDED_GLOB` needed for file modification glob modifiers with compinit. - - `MENU_COMPLETE` do not autoselect the first completion entry. - - `FLOW_CONTROL` disable start/stop characters in shell editor. - -Settings --------- - -### Ignore */etc/hosts* Entries - -To ignore certain entries from static */etc/hosts* for host completion, add the -following lines in *zpreztorc* with the IP addresses of the hosts as they -appear in */etc/hosts*. Both IP address and the corresponding hostname will be -ignored during host completion. However, some of the entries ignored from -*/etc/hosts* still might appear during completion because of their presence in -*ssh* configuration or history). - -```sh -zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \ - '0.0.0.0' '127.0.0.1' -``` - -Contributors ------------- - -Completions should be submitted to the [zsh-completions][1] project according -to its rules and regulations. This module will be synchronized against it. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/zsh-users/zsh-completions -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/completion/external/CONTRIBUTING.md b/.zprezto/modules/completion/external/CONTRIBUTING.md deleted file mode 100644 index 8002c56..0000000 --- a/.zprezto/modules/completion/external/CONTRIBUTING.md +++ /dev/null @@ -1,39 +0,0 @@ -# Contributing - -## How to Contribute to zsh-completions - -Contributions are welcome, just make sure you follow the guidelines: - - * Completions are not accepted when already available in zsh. - * Completions are not accepted when already available in their original project. - * Please do not just copy/paste someone else's completion, ask before. - * Partially implemented completions are not accepted. - * Please add a header containing authors, status and origin of the script and license header if you do not wish to use the Zsh license (example [here](src/_ack)). - * Any reasonable open source licence is acceptable but note that we recommend the use of the Zsh license and that you should use it if you hope for the function to migrate to zsh itself. - * Please try to follow the [Zsh completion style guide](https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide). - * Please send one separate pull request per file. - * Send a pull request or ask for committer access. - -## Contributing Completion Functions to Zsh - -The zsh project itself welcomes completion function contributions via -[github pull requests](https://github.com/zsh-users/zsh/), -[gitlab merge requests](https://gitlab.com/zsh-org/zsh/) or via patch -files sent to its mailing list, `zsh-workers@zsh.org`. - -Contributing to zsh has the advantage of reaching the most users. - -## Including Completion Functions in Upstream Projects - -Many upstream projects include zsh completions. - -If well maintained, this has the advantage that users get a completion -function that matches the installed version of their software. - -If you are the upstream maintainer this is a good choice. If the project -already includes completions for bash, fish, tcsh, etc then they are -likely open to including zsh's too. It can also be a good option for -completions handling commands that are system or distribution specific. - -Ideally, arrange for the project's build system to install the -completion function in `$prefix/share/zsh/site-functions`. diff --git a/.zprezto/modules/completion/external/LICENSE b/.zprezto/modules/completion/external/LICENSE deleted file mode 100644 index d275ca9..0000000 --- a/.zprezto/modules/completion/external/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -The Z Shell is copyright (c) 1992-2017 Paul Falstad, Richard Coleman, -Zoltán Hidvégi, Andrew Main, Peter Stephenson, Sven Wischnowsky, and -others. All rights reserved. Individual authors, whether or not -specifically named, retain copyright in all changes; in what follows, they -are referred to as `the Zsh Development Group'. This is for convenience -only and this body has no legal status. The Z shell is distributed under -the following licence; any provisions made in individual files take -precedence. - -Permission is hereby granted, without written agreement and without -licence or royalty fees, to use, copy, modify, and distribute this -software and to distribute modified versions of this software for any -purpose, provided that the above copyright notice and the following -two paragraphs appear in all copies of this software. - -In no event shall the Zsh Development Group be liable to any party for -direct, indirect, special, incidental, or consequential damages arising out -of the use of this software and its documentation, even if the Zsh -Development Group have been advised of the possibility of such damage. - -The Zsh Development Group specifically disclaim any warranties, including, -but not limited to, the implied warranties of merchantability and fitness -for a particular purpose. The software provided hereunder is on an "as is" -basis, and the Zsh Development Group have no obligation to provide -maintenance, support, updates, enhancements, or modifications. diff --git a/.zprezto/modules/completion/external/README.md b/.zprezto/modules/completion/external/README.md deleted file mode 100644 index 1265c4d..0000000 --- a/.zprezto/modules/completion/external/README.md +++ /dev/null @@ -1,65 +0,0 @@ -zsh-completions ![GitHub release](https://img.shields.io/github/release/zsh-users/zsh-completions.svg) ![GitHub contributors](https://img.shields.io/github/contributors/zsh-users/zsh-completions.svg) [![IRC](https://img.shields.io/badge/IRC-%23zsh--completions-yellow.svg)](irc://irc.freenode.net/#zsh-completions) [![Gitter](https://badges.gitter.im/zsh-users/zsh-completions.svg)](https://gitter.im/zsh-users/zsh-completions?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -============= - -**Additional completion definitions for [Zsh](http://www.zsh.org).** - -*This projects aims at gathering/developing new completion scripts that are not available in Zsh yet. The scripts may be contributed to the Zsh project when stable enough.* - - -## Usage - -### Using packages - -| System | Package | -| ------------- | ------------- | -| Debian / Ubuntu | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) | -| Fedora / CentOS / RHEL / Scientific Linux | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) | -| OpenSUSE / SLE | [zsh-completions OBS repository](https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions) | -| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-completions](https://www.archlinux.org/packages/zsh-completions), [zsh-completions-git](https://aur.archlinux.org/packages/zsh-completions-git) | -| Gentoo / Funtoo | [app-shells/zsh-completions](http://packages.gentoo.org/package/app-shells/zsh-completions) | -| NixOS | [zsh-completions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/zsh/zsh-completions/default.nix) | -| Void Linux | [zsh-completions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-completions/template) | -| Slackware | [Slackbuilds](https://slackbuilds.org/repository/14.2/system/zsh-completions) | -| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-completions.rb), [MacPorts](https://github.com/macports/macports-ports/blob/master/sysutils/zsh-completions/Portfile) | -| NetBSD | [pkgsrc](ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-completions/README.html) | - - -### Using zsh frameworks - -#### [antigen](https://github.com/zsh-users/antigen) - -Add `antigen bundle zsh-users/zsh-completions` to your `~/.zshrc`. - -#### [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh) - -* Clone the repository inside your oh-my-zsh repo: - - git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions - -* Enable it in your `.zshrc` by adding it to your plugin list and reloading the completion: - - plugins=(… zsh-completions) - autoload -U compinit && compinit - -### Manual installation - -* Clone the repository: - - git clone git://github.com/zsh-users/zsh-completions.git - -* Include the directory in your `$fpath`, for example by adding in `~/.zshrc`: - - fpath=(path/to/zsh-completions/src $fpath) - -* You may have to force rebuild `zcompdump`: - - rm -f ~/.zcompdump; compinit - -### Contributing - -Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md). - - -## License -Completions use the Zsh license, unless explicitly mentioned in the file header. -See [LICENSE](https://github.com/zsh-users/zsh-completions/blob/master/LICENSE) for more information. diff --git a/.zprezto/modules/completion/external/src/_ack b/.zprezto/modules/completion/external/src/_ack deleted file mode 100644 index d624209..0000000 --- a/.zprezto/modules/completion/external/src/_ack +++ /dev/null @@ -1,212 +0,0 @@ -#compdef ack ack2 ack-grep ack-standalone -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ack 1.96 and 2.14 (http://betterthangrep.com). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud (version 1.94) -# * Zhao Cai (version 2.04) -# -# ------------------------------------------------------------------------------ - -_ack_version() { - local version - version=(${(f)"$(_call_program version $words[1] --version)"}) - version=${${(z)${version[1]}}[2]} - echo $version -} - -_ack() { - local context curcontext="$curcontext" state line cmds update_policy ret=1 - integer NORMARG - typeset -A opt_args - - # Don't complete if command doesn't exist - [[ ${+commands[${words[1]}]} -eq 0 ]] && return 0 - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _ack_types_caching_policy - - unset _ack_raw_types - if ( [[ ${+_ack_raw_types} -eq 0 ]] || _cache_invalid "ack-grep" ) && ! _retrieve_cache "ack-grep"; then - _ack_raw_types=(${(S)${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}%; first line matches \/*\/}#*no\]}) - [[ $#_ack_raw_types -gt 0 ]] && _store_cache "ack-grep" _ack_raw_types - fi - - ack_20_options=( - '--ackrc[specify an ackrc file to use]:files:_files' - '(- 1 *)--bar[consult Admiral Ackbar]' - '(--nobreak --break)'{--nobreak,--break}'[print a break between results from different files, default on]' - '(- 1 *)--cathy[chocolate chocolate chocolate]' - '(- 1 *)--create-ackrc[create custom ackrc files based on the default settings loaded by ackrc]' - '(- 1 *)--dump[writes the list of options loaded and where they came from to standard output]' - '(--files-from -x)--files-from=[read the list of files to search from FILE]:files:_files' - '(--filter --nofilter)--filter[force ack to treat input as pipe]' - '(--filter --nofilter)--nofilter[force ack to treat input as tty]' - '(--noheading --heading)'{--noheading,--heading}'[print a filename heading above results, default on]' - '(- 1 *)--help-types[display all known types]' - '--ignore-ack-defaults[ignore default definitions included with ack]' - '*--ignore-file=[ignore file]:ignore file filter: _describe "ignore file filter" ignore_filter_opts' - '(-k --known-types)'{-k,--known-types}'[include only files of types that ack recognizes]' - '--lines=[only print line(s) NUM of each file]:number' - '--nopager[do not send output through a pager, overrides ackrc, ACK_PAGER & ACK_PAGER_COLOR]' - '-s[suppress error messages about nonexistent or unreadable files]' - '(- 1 *)--thpppt[bill the cat]' - '*--type-del[remove all filters associated with TYPE]' \ - '(-x --files-from)-x[read the list of files to search from STDIN]' - ) - - ack_19_options=( - '(-a --all -u --unrestricted)'{-a,--all}'[operate on all files, regardless of type (but still skip directories like blib, CVS, etc.)]' - '-G+[only paths matching the given regex are included in the search]:regex' - '--invert-file-match[print/search handle files that do not match -g/-G]' - '--line=[only print given line of each file]:number' \ - '(-u --unrestricted -a --all)'{-u,--unrestricted}'[all files and directories (including blib/, core.*, ...) are searched, nothing is skipped]' - ) - - if (( $(_ack_version) > 2.0 )); then - ack_version_options=(${ack_20_options}) - else - ack_version_options=(${ack_19_options}) - fi - - _arguments -C -s -S -n \ - '(- 1 *)--version[display version and copyright information]' \ - '(- 1 *)--help[print a short help statement]' \ - '(- 1 *)--man[print the manual page]' \ - $ack_version_options \ - '(-A --after-context -C --context)'{-A+,--after-context=}'[print N lines of trailing context after matching lines]:number' \ - '(-B --before-context -C --context)'{-B+,--before-context=}'[print N lines of leading context before matching lines]:number' \ - '(-C --context -A --after-context -B --before-context)'{-C-,--context=}'[print N lines (default 2) of context around matching lines]:number' \ - '(-c --count)'{-c,--count}'[suppress normal output; instead print a count of matching lines for each input file]' \ - '(--nocolor)--color[highlight the matching text]' \ - '(--color --color-filename --color-match --color-lineno)--nocolor[suppress the color]' \ - '(--nocolor --color)--color-filename[sets the color to be used for filenames]:color:->colors' \ - '(--nocolor --color)--color-match[sets the color to be used for matches]:color:->colors' \ - '(--nocolor --color)--color-lineno[sets the color to be used for line numbers]:color:->colors' \ - '--column[show the column number of the first match]' \ - '(--noenv)--env[enable environment processing]' \ - '(--env)--noenv[disable all environment processing, no .ackrc is read and all environment variables are ignored]' \ - '--flush[flush output immediately]' \ - '-f[only print the files that would be searched, without actually doing any searching]' \ - '(--nofollow)--follow[follow symlinks]' \ - '(--follow)--nofollow[don'\''t follow symlinks]' \ - '-g+[print files where the relative path + filename matches the given regex]:regex' \ - '(--nogroup)--group[group matches by file name]' \ - '(--group)--nogroup[do not group matches by file name]' \ - '(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the filename for each match]' \ - '(-h --no-filename -H --with-filename)'{-h,--no-filename}'[suppress the prefixing of filenames on output when multiple files are searched]' \ - '(-i --ignore-case)'{-i,--ignore-case}'[ignore case in the search strings]' \ - '*--ignore-dir=[ignore directory]:directory:_files' \ - '*--noignore-dir=[ignore directory]:directory:_files' \ - '(-l --files-with-matches -L --files-without-matches)'{-l,--files-with-matches}'[only print the filenames of matching files, instead of the matching text]' \ - '(-L --files-without-matches -l --files-with-matches)'{-L,--files-without-matches}'[only print the filenames of files that do NOT match]' \ - '--match=[specify the regular expression explicitly]:regex' \ - '(-m --max-count)'{-m+,--max-count=}'[stop reading a file after N matches]:number' \ - '(-r -R --recurse -n --no-recurse)'{-r,-R,--recurse}'[recurse into sub-directories]' \ - '(-n --no-recurse -r -R --recurse)'{-n,--no-recurse}'[no descending into subdirectories]' \ - '-o[show only the part of each line matching PATTERN (turns off text highlighting)]:pattern' \ - '--output=[output the evaluation of expr for each line (turns off text highlighting)]:expression' \ - '--pager=[direct ack'\''s output through program]:pager program:_command_names' \ - '--passthru[prints all lines, whether or not they match the expression]' \ - '--print0[the filenames are output separated with a null byte instead of the usual newline]' \ - '(-Q --literal)'{-Q,--literal}'[quote all metacharacters in the pattern, it is treated as a literal]' \ - '(--no-smart-case)--smart-case[ignore case in the search strings if pattern contains no uppercase characters]' \ - '(--smart-case)--no-smart-case[disable --smart-case option]' \ - '--sort-files[sorts the found files lexically]' \ - '--show-types[outputs the filetypes that ack associates with each file]' \ - '--thpppt[display the all-important Bill The Cat logo]' \ - '*--type=[specify the types of files to include or exclude from a search]:type:->types' \ - '*--type-add[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \ - '*--type-set[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \ - '(-v --invert-match)'{-v,--invert-match}'[invert match: select non-matching lines]' \ - '(-w --word-regexp)'{-w,--word-regexp}'[force the given pattern to match only whole words]' \ - '-1[stops after reporting first match of any kind]' \ - {'--','--no'}${_ack_raw_types/ ##/\[}']' \ - '*: :->args' \ - && ret=0 - - case $state in - args) - if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]; then - # If the current argument is the first non-option argument - # and --match isn't present then a pattern is expected - _message -e patterns 'pattern' && ret=0 - else - _files - fi - ;; - colors) - local colors; colors=( - 'black' 'on_black' - 'red' 'on_red' - 'green' 'on_green' - 'yellow' 'on_yellow' - 'blue' 'on_blue' - 'magenta' 'on_magenta' - 'cyan' 'on_cyan' - 'white' 'on_white' - 'clear' - 'reset' - 'dark' - 'bold' - 'underline' - 'underscore' - 'blink' - 'reverse' - 'concealed' - ) - _describe -t 'colors' 'color' colors && ret=0 - ;; - type-defs) - if compset -P '*='; then - local extensions; extensions=(*.*(:e)) - _values -s ',' 'file extension' '.'$extensions && ret=0 - else - _message -e type-name 'type name' && ret=0 - fi - ;; - types) - local types; types=({'','no'}${_ack_raw_types/ ##/:}) - _describe -t 'types' 'type' types - ;; - esac - - return ret -} - -ignore_filter_opts=( - 'is\::FILENAME' - 'ext\::[EXTENSION,EXTENSION2,...]' - 'match\::PATTERN' - 'firstlinematch\::PATTERN' -) - -_ack_types_caching_policy() { - - # Rebuild if ackrc more recent than cache. - [[ -f ${ACKRC:-$HOME/.ackrc} && ${ACKRC:-$HOME/.ackrc} -nt "$1" ]] && return 0 - - # Rebuild if cache is older than one week. - local -a oldp - oldp=( "$1"(Nmw+1) ) - (( $#oldp )) && return 0 - - return 1 -} - -_ack "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et - diff --git a/.zprezto/modules/completion/external/src/_afew b/.zprezto/modules/completion/external/src/_afew deleted file mode 100644 index c93dde7..0000000 --- a/.zprezto/modules/completion/external/src/_afew +++ /dev/null @@ -1,66 +0,0 @@ -#compdef afew -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for afew an initial tagging script for notmuch mail. (https://github.com/teythoon/afew) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - -_arguments \ - '(- 1 *)-h[display usage information]' \ - "(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[continuously monitor the mailbox for new messages matching the given query]" \ - "(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[run the tag filters]" \ - "(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[train category with the messages matching query]" \ - "(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[update the categories (requires no query)]" \ - "(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[update the reference category (takes quite some time) (requires no query)]" \ - "(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[classify each message matching the iven query]" \ - "(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[move mail files between maildir folders]" \ - "(-n --all)"{-a,--all}"[operate on all email]" \ - "(-a --new)"{-n,--new}"[operate on all new email]" \ - {-C,--notmuch-config=}"[specify path to notmuch configuration file]:files:_files" \ - {-e,--enable-filters=}"[specify filter classes to use]:filter" \ - {-d,--dry-run}"[don't change the DB]" \ - {-R,--reference-set-size=}"[specify size of the reference set]:size [1000]" \ - {-T,--reference-set-timeframe-days=}"[don't use emails older than specified age]:age (days) [30]" \ - {--verbose,-v}"[be more verbose]" \ - '*: :_guard "^-*" query' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_android b/.zprezto/modules/completion/external/src/_android deleted file mode 100644 index c26e2f8..0000000 --- a/.zprezto/modules/completion/external/src/_android +++ /dev/null @@ -1,308 +0,0 @@ -#compdef android -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for the android command (Revision 12) -# (http://developer.android.com/guide/developing/tools/android.html). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_android() { - typeset -A opt_args - local context state line curcontext="$curcontext" - - local ret=1 - - _arguments -C -A "-*" \ - '(- : *)'{-h,--help}'[get help on a specific command]:command:_android_cmds' \ - '(-s --silent -v --verbose)'{-v,--verbose}'[verbose mode: errors, warnings and informational messages are printed]' \ - '(-v --verbose -s --silent)'{-s,--silent}'[silent mode: only errors are printed out]' \ - '1: :_android_cmds' \ - '*::arg:->args' \ - && ret=0 - - case "$state" in - (args) - curcontext="${curcontext%:*:*}:android-cmd-$words[1]:" - case $words[1] in - (list) - _arguments -C \ - '1: :_android_list_entities' \ - '*::list-arg:->list-args' \ - && ret=0 - case "$state" in - (list-args) - case $words[1] in - (avd|target) - _arguments \ - '(-0 --null)'{-0,--null}'[terminate lines with \0 instead of \n (e.g. for xargs -0)]' \ - '(-c --compact)'{-c,--compact}'[compact output (suitable for scripts)]' \ - && ret=0 - ;; - (sdk) - _arguments \ - '(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \ - '--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \ - '--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \ - '(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \ - '(-u --no-ui)'{-u,--no-ui}'[display list result on console (no GUI)]' \ - && ret=0 - ;; - esac - ;; - esac - ;; - (create) - _arguments -C \ - '1: :_android_create_entities' \ - '*::create-arg:->create-args' \ - && ret=0 - case "$state" in - (create-args) - case $words[1] in - (avd) - _arguments \ - '(-c --sdcard)'{-c,--sdcard}'[path to a shared SD card image, or size of a new sdcard for the new AVD]:SD card image or size:_files -g "*.img"' \ - '(-n --name)'{-n,--name}'[name of the new AVD]:name' \ - '(-a --snapshot)'{-a,--snapshot}'[place a snapshots file in the AVD, to enable persistence]' \ - '(-p --path)'{-p,--path}'[directory where the new AVD will be created]: :_files -/' \ - '(-f --force)'{-f,--force}'[forces creation (overwrites an existing AVD)]' \ - '(-s --skin)'{-s,--skin}'[skin for the new AVD]:skin' \ - '(-t --target)'{-t,--target}'[target ID of the new AVD]: :_android_targets' \ - && ret=0 - ;; - (project) - _arguments \ - '(-n --name)'{-n,--name}'[project name]:project name' \ - '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \ - '(-k --package)'{-k,--package}'[Android package name for the application]:package name' \ - '(-a --activity)'{-a,--activity}'[name of the default Activity that is created]:activity name' \ - '(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \ - && ret=0 - ;; - (test-project) - _arguments \ - '(-n --name)'{-n,--name}'[project name]:project name' \ - '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \ - '(-m --main)'{-m,--main}'[path to directory of the app under test, relative to the test project directory]:path' \ - && ret=0 - ;; - (lib-project) - _arguments \ - '(-n --name)'{-n,--name}'[project name]:project name' \ - '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \ - '(-k --package)'{-k,--package}'[Android package name for the application]:package name' \ - '(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \ - && ret=0 - ;; - esac - ;; - esac - ;; - (update) - _arguments -C \ - '1: :_android_update_entities' \ - '*::update-arg:->update-args' \ - && ret=0 - case "$state" in - (update-args) - case $words[1] in - (avd) - _arguments \ - '(-n --name)'{-n,--name}'[name of the AVD to update]: :_android_avd_names' \ - && ret=0 - ;; - (project) - _arguments \ - '(-l --library)'{-l,--library}'[directory of an Android library to add, relative to this project'\''s directory]: :_files -/' \ - '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \ - '(-n --name)'{-n,--name}'[project name]:name' \ - '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \ - '(-s --subprojects)'{-s,--subprojects}'[also updates any projects in sub-folders, such as test projects]' \ - && ret=0 - ;; - (test-project) - _arguments \ - '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \ - '(-m --main)'{-m,--main}'[directory of the app under test, relative to the test project directory]:path' \ - && ret=0 - ;; - (lib-project) - _arguments \ - '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \ - '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \ - && ret=0 - ;; - (sdk) - _arguments \ - '(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \ - '--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \ - '--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \ - '(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \ - '(-u --no-ui)'{-u,--no-ui}'[update from command-line (no GUI)]' \ - '(-f --force)'{-f,--force}'[force replacement of a package or its parts, even if something has been modified]' \ - '(-t --filter)'{-t,--filter}'[a filter that limits the update to the specified types of packages]: :_android_sdk_update_filters -s ,' \ - '(-n --dry-mode)'{-n,--dry-mode}'[simulate the update but does not download or install anything]' \ - && ret=0 - ;; - esac - ;; - esac - ;; - (move) - _arguments -C \ - '1: :_android_move_entities' \ - '*::move-arg:->move-args' \ - && ret=0 - case "$state" in - (move-args) - case $words[1] in - (avd) - _arguments \ - '(-n --name)'{-n,--name}'[name of the AVD to move or rename]: :_android_avd_names' \ - '(-p --path)'{-p,--path}'[path to the AVD'\''s new directory]: :_files -/' \ - '(-r --rename)'{-r,--rename}'[new name of the AVD]:name' \ - && ret=0 - ;; - esac - ;; - esac - ;; - (delete) - _arguments -C \ - '1: :_android_delete_entities' \ - '*::delete-arg:->delete-args' \ - && ret=0 - case "$state" in - (delete-args) - case $words[1] in - (avd) - _arguments \ - '(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \ - && ret=0 - ;; - esac - ;; - esac - ;; - (display) - _arguments \ - '1: :_android_display_entities' \ - && ret=0 - ;; - esac - ;; - esac - - return ret -} - -(( $+functions[_android_cmds] )) || -_android_cmds() { - local commands; commands=( - 'list:list existing targets or virtual devices' - 'create:create new virtual devices or projects' - 'update:update a virtual device, project, SDK or adb' - 'move:move a virtual device' - 'delete:delete a virtual device' - 'avd:displays the AVD Manager window' - 'sdk:displays the SDK Manager window' - 'display:display manager windows' - ) - _describe -t commands 'command' commands "$@" -} - -(( $+functions[_android_list_entities] )) || -_android_list_entities() { - local entities; entities=( - 'avd:list existing Android Virtual Devices' - 'target:list existing targets' - 'sdk:list remote SDK repository' - ) - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_android_create_entities] )) || -_android_create_entities() { - local entities; entities=( - 'avd:create a new Android Virtual Device' - 'project:create a new Android project' - 'test-project:create a new Android project for a test package' - 'lib-project:create a new Android library project' - ) - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_android_update_entities] )) || -_android_update_entities() { - local entities; entities=( - 'avd:update an Android Virtual Device to match the folders of a new SDK' - 'project:update an Android project' - 'test-project:update the Android project for a test package' - 'lib-project:update an Android library project' - 'adb:update adb to support the USB devices declared in the SDK add-ons' - 'sdk:update the SDK by suggesting new platforms to install if available' - ) - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_android_move_entities] )) || -_android_move_entities() { - local entities; entities=( - 'avd:move or rename an Android Virtual Device' - ) - _describe -t entities 'entity' commands "$@" -} - -(( $+functions[_android_delete_entities] )) || -_android_delete_entities() { - local entities; entities=( - 'avd:delete an Android Virtual Device' - ) - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_android_display_entities] )) || -_android_display_entities() { - local entities; entities=( - 'sdk:display the SDK Manager window' - 'avd:display the AVD Manager window' - ) - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_android_targets] )) || -_android_targets() { - local targets; targets=(${(f)"$(_call_program targets $service list target --compact)"//:/\\:}) - _describe -t targets 'target' targets "$@" -} - -(( $+functions[_android_avd_names] )) || -_android_avd_names() { - local avd_names; avd_names=(${(f)"$(_call_program targets $service list avd --compact)"//:/\\:}) - _describe -t avd-names 'AVD name' avd_names "$@" -} - -(( $+functions[_android_sdk_update_filters] )) || -_android_sdk_update_filters() { - local filters; filters=(platform tool platform-tool doc sample extra) - _values $@ 'filter' "${filters[@]}" -} - -_android "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ansible b/.zprezto/modules/completion/external/src/_ansible deleted file mode 100644 index cf8b118..0000000 --- a/.zprezto/modules/completion/external/src/_ansible +++ /dev/null @@ -1,709 +0,0 @@ -#compdef ansible -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ansible v2.0.0.2 (http://ansible.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Romain Bossart (https://github.com/bosr) -# * Adam Stevko (https://github.com/xen0l) -# -# ------------------------------------------------------------------------------ -# -# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux -# (or /usr/local/etc/ansible/hosts on macOS) -# -# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git) -# has some files to help improve the hostfile shell parsing -# -# Note 2: I tried to use `_arguments --`, but the output of `ansible --help` -# is not parsed entirely correctly, and anyway no modules or host would available. -# - - -# ansible zsh completion -# - -__host_file_location () { - # find the location of the host file: - # 1. check $ANSIBLE_HOSTS - # 2. else check /etc/ansible/hosts or /usr/local/etc/... - # (depending on platform) - # - [[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts" - [[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts" - HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}} - [[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts" - [[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null - - echo ${HOST_FILE} -} - -__ll_group_list () { - # parses the ini hostfile for groups only: [...] - HOST_FILE=$(__host_file_location) - - local -a group_list - group_list=$(command \ - cat ${HOST_FILE} \ - | awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \ - { gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \ - | uniq ) - - echo ${group_list} -} - - -__host_list () -{ - # parses the ini hostfile for hosts only - # but then has to remove all group occurrences - HOST_FILE=$(__host_file_location) - - # this will also contain groups if they are referenced in other groups - local -a mixed_host_list - mixed_host_list=$(command \ - cat ${HOST_FILE} \ - | awk 'NF && $1 !~ /^[[:space:]]*#|[\[:=]/ { print $1 }' \ - | sort | uniq) - - # compute set difference h1 - h2 - local -a h1 h2 host_list - h1=${mixed_host_list} - h2=$(__ll_group_list) - host_list=($(command \ - sort <(echo $h1) <(echo $h2) <(echo $h2) \ - | uniq -u \ - | paste -s -d ' ' - ) - ) - - _wanted application expl 'hosts' compadd ${host_list} - - # method that delegates to ansible (slow) - # _wanted application expl 'hosts' compadd $(command ansible \ - # all --list-hosts\ - # 2>/dev/null) -} - -__group_list () -{ - gl=($(command echo $(__ll_group_list) | paste -s -d ' ' - )) # 'a\nb\nc' -> (a b c) - _wanted application2 expl 'groups' compadd $gl -} - - -_modules=( -'a10_server:Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' -'a10_service_group:Manage A10 Networks devices’ service groups' -'a10_virtual_server:Manage A10 Networks devices’ virtual servers' -'accelerate:Enable accelerated mode on remote node' -'acl:Sets and retrieves file ACL information.' -'add_host:add a host (and alternatively a group) to the ansible-playbook in-memory inventory' -'airbrake_deployment:Notify airbrake about app deployments' -'alternatives:Manages alternative programs for common commands' -'apache2_module:enables/disables a module of the Apache2 webserver' -'apk:Manages apk packages' -'apt:Manages apt-packages' -'apt_key:Add or remove an apt key' -'apt_repository:Add and remove APT repositories' -'apt_rpm:apt_rpm package manager' -'assemble:Assembles a configuration file from fragments' -'assert:Fail with custom message' -'async_status:Obtain status of asynchronous task' -'at:Schedule the execution of a command or script file via the at command.' -'authorized_key:Adds or removes an SSH authorized key' -'azure:create or terminate a virtual machine in azure' -'bigip_facts:Collect facts from F5 BIG-IP devices' -'bigip_gtm_wide_ip:Manages F5 BIG-IP GTM wide ip' -'bigip_monitor_http:Manages F5 BIG-IP LTM http monitors' -'bigip_monitor_tcp:Manages F5 BIG-IP LTM tcp monitors' -'bigip_node:Manages F5 BIG-IP LTM nodes' -'bigip_pool:Manages F5 BIG-IP LTM pools' -'bigip_pool_member:Manages F5 BIG-IP LTM pool members' -'bigip_virtual_server:Manages F5 BIG-IP LTM virtual servers' -'bigpanda:Notify BigPanda about deployments' -'blockinfile:Insert/update/remove a text block surrounded by marker lines.' -'boundary_meter:Manage boundary meters' -'bower:Manage bower packages with bower' -'bundler:Manage Ruby Gem dependencies with Bundler' -'bzr:Deploy software (or files) from bzr branches' -'campfire:Send a message to Campfire' -'capabilities:Manage Linux capabilities' -'circonus_annotation:create an annotation in circonus' -'cl_bond:Configures a bond port on Cumulus Linux' -'cl_bridge:Configures a bridge port on Cumulus Linux' -'cl_img_install:Install a different Cumulus Linux version.' -'cl_interface:Configures a front panel port, loopback or management port on Cumulus Linux.' -'cl_interface_policy:Configure interface enforcement policy on Cumulus Linux' -'cl_license:Install Cumulus Linux license' -'cl_ports:Configure Cumulus Switch port attributes (ports.conf)' -'clc_aa_policy:Create or Delete Anti Affinity Policies at CenturyLink Cloud.' -'clc_alert_policy:Create or Delete Alert Policies at CenturyLink Cloud.' -'clc_blueprint_package:deploys a blue print package on a set of servers in CenturyLink Cloud.' -'clc_firewall_policy:Create/delete/update firewall policies' -'clc_group:Create/delete Server Groups at Centurylink Cloud' -'clc_loadbalancer:Create, Delete shared loadbalancers in CenturyLink Cloud.' -'clc_modify_server:modify servers in CenturyLink Cloud.' -'clc_publicip:Add and Delete public ips on servers in CenturyLink Cloud.' -'clc_server:Create, Delete, Start and Stop servers in CenturyLink Cloud.' -'clc_server_snapshot:Create, Delete and Restore server snapshots in CenturyLink Cloud.' -'cloudflare_dns:manage Cloudflare DNS records' -'cloudformation:Create or delete an AWS CloudFormation stack' -'cloudtrail:manage CloudTrail creation and deletion' -'command:Executes a command on a remote node' -'composer:Dependency Manager for PHP' -'consul:Add, modify & delete services within a consul cluster.' -'consul_acl:manipulate consul acl keys and rules' -'consul_kv:Manipulate entries in the key/value store of a consul cluster.' -'consul_session:manipulate consul sessions' -'copy:Copies files to remote locations.' -'cpanm:Manages Perl library dependencies.' -'cron:Manage cron.d and crontab entries.' -'cronvar:Manage variables in crontabs' -'crypttab:Encrypted Linux block devices' -'cs_account:Manages accounts on Apache CloudStack based clouds.' -'cs_affinitygroup:Manages affinity groups on Apache CloudStack based clouds.' -'cs_cluster:Manages host clusters on Apache CloudStack based clouds.' -'cs_configuration:Manages configuration on Apache CloudStack based clouds.' -'cs_domain:Manages domains on Apache CloudStack based clouds.' -'cs_facts:Gather facts on instances of Apache CloudStack based clouds.' -'cs_firewall:Manages firewall rules on Apache CloudStack based clouds.' -'cs_instance:Manages instances and virtual machines on Apache CloudStack based clouds.' -'cs_instance_facts:Gathering facts from the API of instances from Apache CloudStack based clouds.' -'cs_instancegroup:Manages instance groups on Apache CloudStack based clouds.' -'cs_ip_address:Manages public IP address associations on Apache CloudStack based clouds.' -'cs_iso:Manages ISO images on Apache CloudStack based clouds.' -'cs_loadbalancer_rule:Manages load balancer rules on Apache CloudStack based clouds.' -'cs_loadbalancer_rule_member:Manages load balancer rule members on Apache CloudStack based clouds.' -'cs_network:Manages networks on Apache CloudStack based clouds.' -'cs_pod:Manages pods on Apache CloudStack based clouds.' -'cs_portforward:Manages port forwarding rules on Apache CloudStack based clouds.' -'cs_project:Manages projects on Apache CloudStack based clouds.' -'cs_resourcelimit:Manages resource limits on Apache CloudStack based clouds.' -'cs_securitygroup:Manages security groups on Apache CloudStack based clouds.' -'cs_securitygroup_rule:Manages security group rules on Apache CloudStack based clouds.' -'cs_sshkeypair:Manages SSH keys on Apache CloudStack based clouds.' -'cs_staticnat:Manages static NATs on Apache CloudStack based clouds.' -'cs_template:Manages templates on Apache CloudStack based clouds.' -'cs_user:Manages users on Apache CloudStack based clouds.' -'cs_vmsnapshot:Manages VM snapshots on Apache CloudStack based clouds.' -'cs_volume:Manages volumes on Apache CloudStack based clouds.' -'cs_zone:Manages zones on Apache CloudStack based clouds.' -'cs_zone_facts:Gathering facts of zones from Apache CloudStack based clouds.' -'datadog_event:Posts events to DataDog service' -'datadog_monitor:Manages Datadog monitors' -'debconf:Configure a .deb package' -'debug:Print statements during execution' -'deploy_helper:Manages some of the steps common in deploying projects.' -'digital_ocean:Create/delete a droplet/SSH_key in DigitalOcean' -'digital_ocean_domain:Create/delete a DNS record in DigitalOcean' -'digital_ocean_sshkey:Create/delete an SSH key in DigitalOcean' -'django_manage:Manages a Django application.' -'dnf:Manages packages with the *dnf* package manager' -'dnsimple:Interface with dnsimple.com (a DNS hosting service).' -'dnsmadeeasy:Interface with dnsmadeeasy.com (a DNS hosting service).' -'docker:manage docker containers' -'docker_image:manage docker images' -'docker_login:Manage Docker registry logins' -'dpkg_selections:Dpkg package selection selections' -'dynamodb_table:Create, update or delete AWS Dynamo DB tables.' -'easy_install:Installs Python libraries' -'ec2:create, terminate, start or stop an instance in ec2' -'ec2_ami:create or destroy an image in ec2' -'ec2_ami_copy:copies AMI between AWS regions, return new image id' -'ec2_ami_find:Searches for AMIs to obtain the AMI ID and other information' -'ec2_ami_search(D):Retrieve AWS AMI information for a given operating system.' -'ec2_asg:Create or delete AWS Autoscaling Groups' -'ec2_eip:associate an EC2 elastic IP with an instance.' -'ec2_elb:De-registers or registers instances from EC2 ELBs' -'ec2_elb_facts:Gather facts about EC2 Elastic Load Balancers in AWS' -'ec2_elb_lb:Creates or destroys Amazon ELB.' -'ec2_eni:Create and optionally attach an Elastic Network Interface (ENI) to an instance' -'ec2_eni_facts:Gather facts about ec2 ENI interfaces in AWS' -'ec2_facts:Gathers facts about remote hosts within ec2 (aws)' -'ec2_group:maintain an ec2 VPC security group.' -'ec2_key:maintain an ec2 key pair.' -'ec2_lc:Create or delete AWS Autoscaling Launch Configurations' -'ec2_metric_alarm:Create/update or delete AWS Cloudwatch ‘metric alarms’' -'ec2_remote_facts:Gather facts about ec2 instances in AWS' -'ec2_scaling_policy:Create or delete AWS scaling policies for Autoscaling groups' -'ec2_snapshot:creates a snapshot from an existing volume' -'ec2_tag:create and remove tag(s) to ec2 resources.' -'ec2_vol:create and attach a volume, return volume id and device map' -'ec2_vol_facts:Gather facts about ec2 volumes in AWS' -'ec2_vpc:configure AWS virtual private clouds' -'ec2_vpc_dhcp_options:Manages DHCP Options, and can ensure the DHCP options for the given VPC match what’s requested' -'ec2_vpc_igw:Manage an AWS VPC Internet gateway' -'ec2_vpc_net:Configure AWS virtual private clouds' -'ec2_vpc_net_facts:Gather facts about ec2 VPCs in AWS' -'ec2_vpc_route_table:Manage route tables for AWS virtual private clouds' -'ec2_vpc_route_table_facts:Gather facts about ec2 VPC route tables in AWS' -'ec2_vpc_subnet:Manage subnets in AWS virtual private clouds' -'ec2_vpc_subnet_facts:Gather facts about ec2 VPC subnets in AWS' -'ec2_win_password:gets the default administrator password for ec2 windows instances' -'ecs_cluster:create or terminate ecs clusters' -'ecs_service:create, terminate, start or stop a service in ecs' -'ecs_service_facts:list or describe services in ecs' -'ecs_task:run, start or stop a task in ecs' -'ecs_taskdefinition:register a task definition in ecs' -'ejabberd_user:Manages users for ejabberd servers' -'elasticache:Manage cache clusters in Amazon Elasticache.' -'elasticache_subnet_group:manage Elasticache subnet groups' -'elasticsearch_plugin:Manage Elasticsearch plugins' -'eos_command:Run arbitrary command on EOS device' -'eos_config:Manage Arista EOS configuration sections' -'eos_eapi:Manage and configure EAPI. Requires EOS v4.12 or greater.' -'eos_template:Manage Arista EOS device configurations' -'expect:Executes a command and responds to prompts' -'facter:Runs the discovery program *facter* on the remote system' -'fail:Fail with custom message' -'fetch:Fetches a file from remote nodes' -'file:Sets attributes of files' -'filesystem:Makes file system on block device' -'find:return a list of files based on specific criteria' -'fireball(D):Enable fireball mode on remote node' -'firewalld:Manage arbitrary ports/services with firewalld' -'flowdock:Send a message to a flowdock' -'gc_storage:This module manages objects/buckets in Google Cloud Storage.' -'gce:create or terminate GCE instances' -'gce_img:utilize GCE image resources' -'gce_lb:create/destroy GCE load-balancer resources' -'gce_net:create/destroy GCE networks and firewall rules' -'gce_pd:utilize GCE persistent disk resources' -'gce_tag:add or remove tag(s) to/from GCE instance' -'gem:Manage Ruby gems' -'get_url:Downloads files from HTTP, HTTPS, or FTP to node' -'getent:a wrapper to the unix getent utility' -'git:Deploy software (or files) from git checkouts' -'github_hooks:Manages github service hooks.' -'glance_image(D):Add/Delete images from glance' -'gluster_volume:Manage GlusterFS volumes' -'group:Add or remove groups' -'group_by:Create Ansible groups based on facts' -'grove:Sends a notification to a grove.io channel' -'hall:Send notification to Hall' -'haproxy:Enable, disable, and set weights for HAProxy backend servers using socket commands.' -'hg:Manages Mercurial (hg) repositories.' -'hipchat:Send a message to hipchat.' -'homebrew:Package manager for Homebrew' -'homebrew_cask:Install/uninstall homebrew casks.' -'homebrew_tap:Tap a Homebrew repository.' -'hostname:Manage hostname' -'htpasswd:manage user files for basic authentication' -'iam:Manage IAM users, groups, roles and keys' -'iam_cert:Manage server certificates for use on ELBs and CloudFront' -'iam_policy:Manage IAM policies for users, groups, and roles' -'include_vars:Load variables from files, dynamically within a task.' -'ini_file:Tweak settings in INI files' -'ios_command:Run arbitrary commands on ios devices.' -'ios_config:Manage Cisco IOS configuration sections' -'ios_template:Manage Cisco IOS device configurations over SSH' -'iosxr_command:Run arbitrary commands on ios devices.' -'iosxr_config:Manage Cisco IOS XR configuration sections' -'iosxr_template:Manage Cisco IOS device configurations over SSH' -'ipify_facts:Retrieve the public IP of your internet gateway.' -'iptables:Modify the systems iptables' -'irc:Send a message to an IRC channel' -'jabber:Send a message to jabber user or chat room' -'jboss:deploy applications to JBoss' -'jira:create and modify issues in a JIRA instance' -'junos_command:Execute arbitrary commands on Juniper JUNOS devices' -'junos_config:Manage Juniper JUNOS configuration sections' -'junos_template:Manage Juniper JUNOS device configurations' -'kernel_blacklist:Blacklist kernel modules' -'keystone_user(D):Manage OpenStack Identity (keystone) users, tenants and roles' -'known_hosts:Add or remove a host from the ``known_hosts`` file' -'layman:Manage Gentoo overlays' -'librato_annotation:create an annotation in librato' -'lineinfile:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.' -'linode:create / delete / stop / restart an instance in Linode Public Cloud' -'lldp:get details reported by lldp' -'locale_gen:Creates or removes locales.' -'logentries:Module for tracking logs via logentries.com' -'lvg:Configure LVM volume groups' -'lvol:Configure LVM logical volumes' -'lxc_container:Manage LXC Containers' -'macports:Package manager for MacPorts' -'mail:Send an email' -'maven_artifact:Downloads an Artifact from a Maven Repository' -'modprobe:Add or remove kernel modules' -'mongodb_user:Adds or removes a user from a MongoDB database.' -'monit:Manage the state of a program monitored via Monit' -'mount:Control active and configured mount points' -'mqtt:Publish a message on an MQTT topic for the IoT' -'mysql_db:Add or remove MySQL databases from a remote host.' -'mysql_replication:Manage MySQL replication' -'mysql_user:Adds or removes a user from a MySQL database.' -'mysql_variables:Manage MySQL global variables' -'nagios:Perform common tasks in Nagios related to downtime and notifications.' -'netscaler:Manages Citrix NetScaler entities' -'newrelic_deployment:Notify newrelic about app deployments' -'nexmo:Send a SMS via nexmo' -'nmcli:Manage Networking' -'nova_compute(D):Create/Delete VMs from OpenStack' -'nova_keypair(D):Add/Delete key pair from nova' -'npm:Manage node.js packages with npm' -'nxos_command:Run arbitrary command on Cisco NXOS devices' -'nxos_config:Manage Cisco NXOS configuration sections' -'nxos_nxapi:Manage NXAPI configuration on an NXOS device.' -'nxos_template:Manage Cisco NXOS device configurations' -'ohai:Returns inventory data from *Ohai*' -'open_iscsi:Manage iscsi targets with open-iscsi' -'openbsd_pkg:Manage packages on OpenBSD.' -'openvswitch_bridge:Manage Open vSwitch bridges' -'openvswitch_db:Configure open vswitch database.' -'openvswitch_port:Manage Open vSwitch ports' -'opkg:Package manager for OpenWrt' -'ops_command:Run arbitrary commands on OpenSwitch devices.' -'ops_config:Manage OpenSwitch configuration using CLI' -'ops_template:Push configuration to OpenSwitch' -'os_auth:Retrieve an auth token' -'os_client_config:Get OpenStack Client config' -'os_flavor_facts:Retrieve facts about one or more flavors' -'os_floating_ip:Add/Remove floating IP from an instance' -'os_group:Manage OpenStack Identity Groups' -'os_image:Add/Delete images from OpenStack Cloud' -'os_image_facts:Retrieve facts about an image within OpenStack.' -'os_ironic:Create/Delete Bare Metal Resources from OpenStack' -'os_ironic_node:Activate/Deactivate Bare Metal Resources from OpenStack' -'os_keypair:Add/Delete a keypair from OpenStack' -'os_keystone_domain:Manage OpenStack Identity Domains' -'os_keystone_role:Manage OpenStack Identity Roles' -'os_network:Creates/removes networks from OpenStack' -'os_networks_facts:Retrieve facts about one or more OpenStack networks.' -'os_nova_flavor:Manage OpenStack compute flavors' -'os_object:Create or Delete objects and containers from OpenStack' -'os_port:Add/Update/Delete ports from an OpenStack cloud.' -'os_project:Manage OpenStack Projects' -'os_router:Create or delete routers from OpenStack' -'os_security_group:Add/Delete security groups from an OpenStack cloud.' -'os_security_group_rule:Add/Delete rule from an existing security group' -'os_server:Create/Delete Compute Instances from OpenStack' -'os_server_actions:Perform actions on Compute Instances from OpenStack' -'os_server_facts:Retrieve facts about one or more compute instances' -'os_server_volume:Attach/Detach Volumes from OpenStack VM’s' -'os_subnet:Add/Remove subnet to an OpenStack network' -'os_subnets_facts:Retrieve facts about one or more OpenStack subnets.' -'os_user:Manage OpenStack Identity Users' -'os_user_group:Associate OpenStack Identity users and groups' -'os_volume:Create/Delete Cinder Volumes' -'osx_defaults:osx_defaults allows users to read, write, and delete macOS user defaults from Ansible' -'osx_say:Makes a macOS computer speak.' -'ovirt:oVirt/RHEV platform management' -'package:Generic OS package manager' -'pacman:Manage packages with *pacman*' -'pagerduty:Create PagerDuty maintenance windows' -'pagerduty_alert:Trigger, acknowledge or resolve PagerDuty incidents' -'pam_limits:Modify Linux PAM limits' -'patch:Apply patch files using the GNU patch tool.' -'pause:Pause playbook execution' -'pear:Manage pear/pecl packages' -'ping:Try to connect to host, verify a usable python and return ``pong`` on success.' -'pingdom:Pause/unpause Pingdom alerts' -'pip:Manages Python library dependencies.' -'pkg5:Manages packages with the Solaris 11 Image Packaging System' -'pkg5_publisher:Manages Solaris 11 Image Packaging System publishers' -'pkgin:Package manager for SmartOS, NetBSD, et al.' -'pkgng:Package manager for FreeBSD >= 9.0' -'pkgutil:Manage CSW-Packages on Solaris' -'portage:Package manager for Gentoo' -'portinstall:Installing packages from FreeBSD’s ports system' -'postgresql_db:Add or remove PostgreSQL databases from a remote host.' -'postgresql_ext:Add or remove PostgreSQL extensions from a database.' -'postgresql_lang:Adds, removes or changes procedural languages with a PostgreSQL database.' -'postgresql_privs:Grant or revoke privileges on PostgreSQL database objects.' -'postgresql_user:Adds or removes a users (roles) from a PostgreSQL database.' -'profitbricks:Create, destroy, start, stop, and reboot a ProfitBricks virtual machine.' -'profitbricks_datacenter:Create or destroy a ProfitBricks Virtual Datacenter.' -'profitbricks_nic:Create or Remove a NIC.' -'profitbricks_volume:Create or destroy a volume.' -'profitbricks_volume_attachments:Attach or detach a volume.' -'proxmox:management of instances in Proxmox VE cluster' -'proxmox_template:management of OS templates in Proxmox VE cluster' -'puppet:Runs puppet' -'pushbullet:Sends notifications to Pushbullet' -'pushover:Send notifications via https' -'quantum_floating_ip(D):Add/Remove floating IP from an instance' -'quantum_floating_ip_associate(D):Associate or disassociate a particular floating IP with an instance' -'quantum_network(D):Creates/Removes networks from OpenStack' -'quantum_router(D):Create or Remove router from openstack' -'quantum_router_gateway(D):set/unset a gateway interface for the router with the specified external network' -'quantum_router_interface(D):Attach/Dettach a subnet’s interface to a router' -'quantum_subnet(D):Add/remove subnet from a network' -'rabbitmq_binding:This module manages rabbitMQ bindings' -'rabbitmq_exchange:This module manages rabbitMQ exchanges' -'rabbitmq_parameter:Adds or removes parameters to RabbitMQ' -'rabbitmq_plugin:Adds or removes plugins to RabbitMQ' -'rabbitmq_policy:Manage the state of policies in RabbitMQ.' -'rabbitmq_queue:This module manages rabbitMQ queues' -'rabbitmq_user:Adds or removes users to RabbitMQ' -'rabbitmq_vhost:Manage the state of a virtual host in RabbitMQ' -'raw:Executes a low-down and dirty SSH command' -'rax:create / delete an instance in Rackspace Public Cloud' -'rax_cbs:Manipulate Rackspace Cloud Block Storage Volumes' -'rax_cbs_attachments:Manipulate Rackspace Cloud Block Storage Volume Attachments' -'rax_cdb:create/delete or resize a Rackspace Cloud Databases instance' -'rax_cdb_database:create / delete a database in the Cloud Databases' -'rax_cdb_user:create / delete a Rackspace Cloud Database' -'rax_clb:create / delete a load balancer in Rackspace Public Cloud' -'rax_clb_nodes:add, modify and remove nodes from a Rackspace Cloud Load Balancer' -'rax_clb_ssl:Manage SSL termination for a Rackspace Cloud Load Balancer.' -'rax_dns:Manage domains on Rackspace Cloud DNS' -'rax_dns_record:Manage DNS records on Rackspace Cloud DNS' -'rax_facts:Gather facts for Rackspace Cloud Servers' -'rax_files:Manipulate Rackspace Cloud Files Containers' -'rax_files_objects:Upload, download, and delete objects in Rackspace Cloud Files' -'rax_identity:Load Rackspace Cloud Identity' -'rax_keypair:Create a keypair for use with Rackspace Cloud Servers' -'rax_meta:Manipulate metadata for Rackspace Cloud Servers' -'rax_mon_alarm:Create or delete a Rackspace Cloud Monitoring alarm.' -'rax_mon_check:Create or delete a Rackspace Cloud Monitoring check for an existing entity.' -'rax_mon_entity:Create or delete a Rackspace Cloud Monitoring entity' -'rax_mon_notification:Create or delete a Rackspace Cloud Monitoring notification.' -'rax_mon_notification_plan:Create or delete a Rackspace Cloud Monitoring notification plan.' -'rax_network:create / delete an isolated network in Rackspace Public Cloud' -'rax_queue:create / delete a queue in Rackspace Public Cloud' -'rax_scaling_group:Manipulate Rackspace Cloud Autoscale Groups' -'rax_scaling_policy:Manipulate Rackspace Cloud Autoscale Scaling Policy' -'rds:create, delete, or modify an Amazon rds instance' -'rds_param_group:manage RDS parameter groups' -'rds_subnet_group:manage RDS database subnet groups' -'redhat_subscription:Manage Red Hat Network registration and subscriptions using the ``subscription-manager`` command' -'redis:Various redis commands, slave and flush' -'replace:Replace all instances of a particular string in a file using a back-referenced regular expression.' -'rhn_channel:Adds or removes Red Hat software channels' -'rhn_register:Manage Red Hat Network registration using the ``rhnreg_ks`` command' -'riak:This module handles some common Riak operations' -'rollbar_deployment:Notify Rollbar about app deployments' -'route53:add or delete entries in Amazons Route53 DNS service' -'route53_facts:Retrieves route53 details using AWS methods' -'route53_health_check:add or delete health-checks in Amazons Route53 DNS service' -'route53_zone:add or delete Route53 zones' -'rpm_key:Adds or removes a gpg key from the rpm db' -'s3:manage objects in S3.' -'s3_bucket:Manage s3 buckets in AWS' -'s3_lifecycle:Manage s3 bucket lifecycle rules in AWS' -'s3_logging:Manage logging facility of an s3 bucket in AWS' -'script:Runs a local script on a remote node after transferring it' -'seboolean:Toggles SELinux booleans.' -'selinux:Change policy and state of SELinux' -'selinux_permissive:Change permissive domain in SELinux policy' -'sendgrid:Sends an email with the SendGrid API' -'sensu_check:Manage Sensu checks' -'seport:Manages SELinux network port type definitions' -'service:Manage services.' -'set_fact:Set host facts from a task' -'setup:Gathers facts about remote hosts' -'shell:Execute commands in nodes.' -'slack:Send Slack notifications' -'slackpkg:Package manager for Slackware >= 12.2' -'slurp:Slurps a file from remote nodes' -'snmp_facts:Retrieve facts for a device using SNMP.' -'sns:Send Amazon Simple Notification Service (SNS) messages' -'sns_topic:Manages AWS SNS topics and subscriptions' -'solaris_zone:Manage Solaris zones' -'sqs_queue:Creates or deletes AWS SQS queues.' -'stackdriver:Send code deploy and annotation events to stackdriver' -'stat:retrieve file or file system status' -'sts_assume_role:Assume a role using AWS Security Token Service and obtain temporary credentials' -'subversion:Deploys a subversion repository.' -'supervisorctl:Manage the state of a program or group of programs running via supervisord' -'svc:Manage daemontools services.' -'svr4pkg:Manage Solaris SVR4 packages' -'swdepot:Manage packages with swdepot package manager (HP-UX)' -'synchronize:Uses rsync to make synchronizing file paths in your playbooks quick and easy.' -'sysctl:Manage entries in sysctl.conf.' -'taiga_issue:Creates/deletes an issue in a Taiga Project Management Platform' -'template:Templates a file out to a remote server.' -'twilio:Sends a text message to a mobile phone through Twilio.' -'typetalk:Send a message to typetalk' -'ufw:Manage firewall with UFW' -'unarchive:Unpacks an archive after (optionally) copying it from the local machine.' -'uptimerobot:Pause and start Uptime Robot monitoring' -'uri:Interacts with webservices' -'urpmi:Urpmi manager' -'user:Manage user accounts' -'vca_fw:add remove firewall rules in a gateway in a vca' -'vca_nat:add remove nat rules in a gateway in a vca' -'vca_vapp:Manages vCloud Air vApp instances.' -'vertica_configuration:Updates Vertica configuration parameters.' -'vertica_facts:Gathers Vertica database facts.' -'vertica_role:Adds or removes Vertica database roles and assigns roles to them.' -'vertica_schema:Adds or removes Vertica database schema and roles.' -'vertica_user:Adds or removes Vertica database users and assigns roles.' -'virt:Manages virtual machines supported by libvirt' -'virt_net:Manage libvirt network configuration' -'virt_pool:Manage libvirt storage pools' -'vmware_cluster:Create VMware vSphere Cluster' -'vmware_datacenter:Manage VMware vSphere Datacenters' -'vmware_dns_config:Manage VMware ESXi DNS Configuration' -'vmware_dvs_host:Add or remove a host from distributed virtual switch' -'vmware_dvs_portgroup:Create or remove a Distributed vSwitch portgroup' -'vmware_dvswitch:Create or remove a distributed vSwitch' -'vmware_host:Add/remove ESXi host to/from vCenter' -'vmware_migrate_vmk:Migrate a VMK interface from VSS to VDS' -'vmware_portgroup:Create a VMware portgroup' -'vmware_target_canonical_facts:Return canonical (NAA) from an ESXi host' -'vmware_vm_facts:Return basic facts pertaining to a vSphere virtual machine guest' -'vmware_vm_shell:Execute a process in VM' -'vmware_vm_vss_dvs_migrate:Migrates a virtual machine from a standard vswitch to distributed' -'vmware_vmkernel:Create a VMware VMkernel Interface' -'vmware_vmkernel_ip_config:Configure the VMkernel IP Address' -'vmware_vsan_cluster:Configure VSAN clustering on an ESXi host' -'vmware_vswitch:Add a VMware Standard Switch to an ESXi host' -'vsphere_copy:Copy a file to a vCenter datastore' -'vsphere_guest:Create/delete/manage a guest VM through VMware vSphere.' -'wait_for:Waits for a condition before continuing.' -'webfaction_app:Add or remove applications on a Webfaction host' -'webfaction_db:Add or remove a database on Webfaction' -'webfaction_domain:Add or remove domains and subdomains on Webfaction' -'webfaction_mailbox:Add or remove mailboxes on Webfaction' -'webfaction_site:Add or remove a website on a Webfaction host' -'win_acl:Set file/directory permissions for a system user or group.' -'win_chocolatey:Installs packages using chocolatey' -'win_copy:Copies files to remote locations on windows hosts.' -'win_dotnet_ngen:Runs ngen to recompile DLLs after .NET updates' -'win_environment:Modifies environment variables on windows hosts.' -'win_feature:Installs and uninstalls Windows Features' -'win_file:Creates, touches or removes files or directories.' -'win_file_version:Get DLL or EXE file build version' -'win_firewall_rule:Windows firewall automation' -'win_get_url:Fetches a file from a given URL' -'win_group:Add and remove local groups' -'win_iis_virtualdirectory:Configures a virtual directory in IIS.' -'win_iis_webapplication:Configures a IIS Web application.' -'win_iis_webapppool:Configures a IIS Web Application Pool.' -'win_iis_webbinding:Configures a IIS Web site.' -'win_iis_website:Configures a IIS Web site.' -'win_lineinfile:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.' -'win_msi:Installs and uninstalls Windows MSI files' -'win_nssm:NSSM ' -'win_package:Installs/Uninstalls a installable package, either from local file system or url' -'win_ping:A windows version of the classic ping module.' -'win_regedit:Add, Edit, or Remove Registry Keys and Values' -'win_regmerge:Merges the contents of a registry file into the windows registry' -'win_scheduled_task:Manage scheduled tasks' -'win_service:Manages Windows services' -'win_share:Manage Windows shares' -'win_stat:returns information about a Windows file' -'win_template:Templates a file out to a remote server.' -'win_timezone:Sets Windows machine timezone' -'win_unzip:Unzips compressed files and archives on the Windows node' -'win_updates:Download and install Windows updates' -'win_uri:Interacts with webservices.' -'win_user:Manages local Windows user accounts' -'win_webpicmd:Installs packages using Web Platform Installer command-line' -'xattr:set/retrieve extended attributes' -'xenserver_facts:get facts reported on xenserver' -'yum:Manages packages with the *yum* package manager' -'yum_repository:Add and remove YUM repositories' -'zabbix_group:Zabbix host groups creates/deletes' -'zabbix_host:Zabbix host creates/updates/deletes' -'zabbix_hostmacro:Zabbix host macro creates/updates/deletes' -'zabbix_maintenance:Create Zabbix maintenance windows' -'zabbix_screen:Zabbix screen creates/updates/deletes' -'zfs:Manage zfs' -'znode:Create, delete, retrieve, and update znodes using ZooKeeper.' -'zypper:Manage packages on SUSE and openSUSE' -'zypper_repository:Add and remove Zypper repositories' -) - - -_ansible () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -s -C -W \ - '1:pattern:->pattern'\ - "(-a --args)"{-a,--args}"[ARGS module arguments]:arguments:(ARG)"\ - '--ask-become-pass[ask for privilege escalation password]'\ - "(-k --ask-pass)"{-k,--ask-pass}"[ask for connection password]"\ - '--ask-su-pass[ask for su password (deprecated, use become)]'\ - "(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password (deprecated, use become)]"\ - '--ask-vault-pass[ask for vault password]'\ - "(-B --background)"{-B,--background}"[DURATION run asynchronously for DURATION (s)]:duration:(DURATION)"\ - "(-b --become)"{-b,--become}"[run operations with become (nopasswd implied)]"\ - '--become-method[privilege escalation method to use (default=sudo)]:method:(sudo su pbrun pfexec runas doas)'\ - '--become-user[run operations as this user (default=root)]:user:(USER)'\ - "(-C --check)"{-C,--check}"[don't make any changes]"\ - "(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\ - "(-D --diff)"{-D,--diff}"[show differences when changing (small) files and templates]"\ - "*"{-e,--extra-vars}"[set additional variables as key=value or YAML/JSON]"\ - "(-f --forks)"{-f,--forks}"[FORKS number of parallel processes to use (default=5)]:forks:(5)"\ - "(-h --help)"{-h,--help}"[help message]"\ - "*"{-i,--inventory,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\ - "(-l --limit)"{-l,--limit}"[SUBSET further limit selected hosts to an additional pattern]:subset pattern:->pattern"\ - '--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\ - "(-m --module-name)"{-m,--module-name}"[MODULE_NAME module name (default=command)]:module name:->module"\ - "*"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\ - '--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\ - "(-o --one-line)"{-o,--one-line}"[condense output]"\ - '--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\ - "(-P --poll)"{-P,--poll}"[POLL_INTERVAL set the poll interval (s) if using -B (default=15)]:poll interval:(15)"\ - '--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files'\ - '--scp-extra-args[specify extra arguments to pass to scp only]'\ - '--sftp-extra-args[specify extra arguments to pass to sftp only]'\ - '--ssh-common-args[specify common arguments to pass to sftp/scp/ssh]'\ - '--ssh-extra-args[specify extra arguments to pass to ssh only]'\ - "(-S --su)"{-S,--su}"[run operations with su (deprecated, use become)]"\ - "(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root) (deprecated, use become)]:su user:(root)"\ - "(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd) (deprecated, use become)]"\ - "(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root) (deprecated, use become)]:su user:(root)"\ - '--syntax-check[perform a syntax check on the playbook, but do not execute it]'\ - "(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\ - "(-t --tree)"{-t,--tree}"[OUTPUT_DIRECTORY log output to this directory]:output directory:_files -/"\ - "(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\ - "*--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\ - "*"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\ - "--version[show program's version number and exit]"\ - - case $state in - pattern) - _arguments '*:feature:__host_list' - _arguments '*:feature:__group_list' - ;; - module) - _describe -t commands "modules" _modules - ;; - esac -} - -_ansible "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ansible-galaxy b/.zprezto/modules/completion/external/src/_ansible-galaxy deleted file mode 100644 index ddd94be..0000000 --- a/.zprezto/modules/completion/external/src/_ansible-galaxy +++ /dev/null @@ -1,183 +0,0 @@ -#compdef ansible-galaxy -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ansible-galaxy v2.0.0.2 (http://ansible.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Romain Bossart (https://github.com/bosr) -# * Adam Stevko (https://github.com/xen0l) -# -# ------------------------------------------------------------------------------ -# -# Note: I tried to use `_arguments --`, but the output of `ansible --help` -# is not parsed entirely correctly, and anyway no modules or host would available. -# - -# ansible-galaxy zsh completion -# -_ansible-galaxy () -{ - local context curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - "1:command:(delete import info init install list login remove search setup)" \ - "*::option:->option" - - case $state in - option) - case $line[1] in - delete) - _arguments \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":github_user:(GITHUB_USER)" \ - ":github_repo:(GITHUB_REPO)" - ;; - import) - _arguments \ - "--branch[REFERENCE The name of a branch to import.]:reference:(master)" \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "--no-wait[Don't wait for import results.]" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "--status[Check the status of the most recent import request forgiven github_user/github_repo.]" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":github_user:(GITHUB_USER)" \ - ":github_repo:(GITHUB_REPO)" - ;; - info) - _arguments \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "*"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":role name:(ROLE,version)" - ;; - init) - _arguments \ - "(-f --force)"{-f,--force}"[ Force overwriting an existing role]" \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "(-p --init-path)"{-p,--init-path}"[INIT_PATH path in which the skeleton role will be created (default=./)]:init path:(./)" \ - "(--offline)--offline[Don't query the galaxy API when creating roles]" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":role name:(ROLE)" - ;; - install) - _arguments \ - "(-f --force)"{-f,--force}"[Force overwriting an existing role]" \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "(-i --ignore-errors)"{-i,--ignore-errors}"[Ignore errors and continue with the next specified role]" \ - "(-n --no-deps)"{-n,--no-deps}"[Don't download roles listed as dependencies]" \ - "(-r --role-file)"{-r,--role-file}"[ROLE_FILE A file containing a list of roles to be imported]:role file:_files" \ - "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":role name:(ROLE)" - ;; - list) - _arguments \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":role name:(ROLE)" - ;; - login) - _arguments \ - "--github_token[TOKEN Identify with github token rather than username and password.]:token:(TOKEN)" \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" - ;; - remove) - _arguments \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - "*:role name:(ROLE)" - ;; - search) - _arguments \ - "--author[AUTHOR GitHub username]:author:(AUTHOR)" \ - "--galaxy-tags[TAGS list of galaxy tags to filter by]:tags:(TAGS)" \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "--platforms[PLATFORMS list of OS platforms to filter by" \ - "(-p --roles-path)"{-p,--roles-path}"[ROLES_PATH The path to the directory containing your roles (default: from ansible.cfg)]:roles path:_files -/" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" - ;; - setup) - _arguments \ - "(-h --help)"{-h,--help}"[help message]" \ - "(-c --ignore-certs)"{-c,--ignore-certs}"[Ignore SSL certificate validation errors.]" \ - "--list[List all of your integrations.]" \ - "--remove[REMOVE_ID Remove the integration matching the provided ID value.]:id:(REMOVE_ID)" \ - "(-s --server)"{-s,--server}"[API_SERVER The API server destination]:api server:(http://apiserver)" \ - "(-v --verbose)"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]" \ - "--version[show program's version number and exit]" \ - ":source:(travis)" \ - ":github_user:(GITHUB_USER)" \ - ":github_repo:(GITHUB_REPO)" \ - ":secret:(SECRET)" - ;; - esac - ;; - esac -} - -_ansible-galaxy "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ansible-playbook b/.zprezto/modules/completion/external/src/_ansible-playbook deleted file mode 100644 index 749a813..0000000 --- a/.zprezto/modules/completion/external/src/_ansible-playbook +++ /dev/null @@ -1,191 +0,0 @@ -#compdef ansible-playbook -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ansible-playbook v2.0.0.2 (http://ansible.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Romain Bossart (https://github.com/bosr) -# * Adam Stevko (https://github.com/xen0l) -# -# ------------------------------------------------------------------------------ -# -# Needs either ANSIBLE_HOSTS or /etc/ansible/hosts on linux -# (or /usr/local/etc/ansible/hosts on macOS) -# -# Note 1: the following gist (https://gist.github.com/15ed54a438a36d67fd99.git) -# has some files to help improve the hostfile shell parsing -# -# Note 2: I tried to use `_arguments --`, but the output of `ansible --help` -# is not parsed entirely correctly, and anyway no modules or host would available. -# - -# ansible-playbook zsh completion -# -__host_file_location () { - # find the location of the host file: - # 1. check $ANSIBLE_HOSTS - # 2. else check /etc/ansible/hosts or /usr/local/etc/... - # (depending on platform) - # - - [[ "$OSTYPE" == darwin* ]] && FALLBACK="/usr/local/etc/ansible/hosts" - [[ "$OSTYPE" == linux* ]] && FALLBACK="/etc/ansible/hosts" - HOST_FILE=${ANSIBLE_HOSTS:=${FALLBACK}} - [[ -f ${HOST_FILE} ]] || HOST_FILE="$PWD/ansible/inventory/hosts" - [[ -f ${HOST_FILE} ]] || HOST_FILE=/dev/null - - echo ${HOST_FILE} -} - -__ll_group_list () { - # parses the ini hostfile for groups only: [...] - HOST_FILE=$(__host_file_location) - - local -a group_list - group_list=$(command \ - cat ${HOST_FILE} \ - | awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \ - { gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \ - | uniq ) - - echo ${group_list} -} - - -__host_list () -{ - # parses the ini hostfile for hosts only - # but then has to remove all group occurrences - HOST_FILE=$(__host_file_location) - - # this will also contain groups if they are referenced in other groups - local -a mixed_host_list - mixed_host_list=$(command \ - cat ${HOST_FILE} \ - | awk 'NF && $1 !~ /[\[:=]/ { print $1 }' \ - | sort | uniq) - - # compute set difference h1 - h2 - local -a h1 h2 host_list - h1=${mixed_host_list} - h2=$(__ll_group_list) - host_list=($(command \ - sort <(echo $h1) <(echo $h2) <(echo $h2) \ - | uniq -u \ - | paste -s -d ' ' - ) - ) - - _wanted application expl 'hosts' compadd ${host_list} - - # method that delegates to ansible (slow) - # _wanted application expl 'hosts' compadd $(command ansible \ - # all --list-hosts\ - # 2>/dev/null) -} - -__group_list () -{ - gl=($(command echo $(__ll_group_list) | paste -s -d ' ' - )) # 'a\nb\nc' -> (a b c) - _wanted application2 expl 'groups' compadd $gl -} - - - -_ansible-playbook () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -s -C -W \ - "*:playbook yml file:_files -g '*.yml|*.yaml'"\ - '--ask-become-pass[ask for privilege escalation password]'\ - "(-k --ask-pass)"{-k,--ask-pass}"[ask for connection password]"\ - '--ask-su-pass[ask for su password (deprecated, use become)]'\ - "(-K --ask-sudo-pass)"{-K,--ask-sudo-pass}"[ask for sudo password (deprecated, use become)]"\ - '--ask-vault-pass[ask for vault password]'\ - "(-b --become)"{-b,--become}"[run operations with become (nopasswd implied)]"\ - '--become-method[privilege escalation method to use (default=sudo)]:method:(sudo su pbrun pfexec runas doas)'\ - '--become-user[run operations as this user (default=root)]:user:(USER)'\ - "(-C --check)"{-C,--check}"[don't make any changes]"\ - "(-c --connection)"{-c,--connection}"[CONNECTION connection type to use (default=smart)]:connection type:(smart ssh local chroot)"\ - "(-D --diff)"{-D,--diff}"[when changing (small files and templates, show the diff in those. Works great with --check)]"\ - "*"{-e,--extra-vars}"[EXTRA_VARS set additional variables as key=value or YAML/JSON]:extra vars:(EXTRA_VARS)"\ - '--flush-cache[clear the fact cache]'\ - '--force-handlers[run handlers even if a task fails]'\ - "(-f --forks)"{-f,--forks}"[FORKS number of parallel processes to use (default=5)]:forks:(5)"\ - "(-h --help)"{-h,--help}"[help message]"\ - "*"{-i,--inventory,--inventory-file}"[INVENTORY specify inventory host file]:inventory file:_files"\ - "(-l --limit)"{-l,--limit}"[SUBSET further limit selected hosts to an additional pattern]:subset pattern:->pattern"\ - '--list-hosts[outputs a list of matching hosts. Does not execute anything else]'\ - '--list-tags[list all available tags]'\ - '--list-tasks[list all tasks that would be executed]'\ - "*"{-M,--module-path}"[MODULE_PATH specify path to module library (default=None)]:module path:_files -/"\ - '--new-vault-password-file[new vault password file for rekey]:new vault password file:_files'\ - '--output[output file name for encrypt or decrypt; use - for stdout]:output file:_files'\ - '--private-key[PRIVATE_KEY_FILE use this file to authenticate the connection]:private key file:_files'\ - '--scp-extra-args[specify extra arguments to pass to scp only]'\ - '--sftp-extra-args[specify extra arguments to pass to sftp only]'\ - "*--skip-tags[SKIP_TAGS only run plays and tasks whose tags do not match these values]:skip tags:(SKIP_TAGS)"\ - '--ssh-common-args[specify common arguments to pass to sftp/scp/ssh]'\ - '--ssh-extra-args[specify extra arguments to pass to ssh only]'\ - "--start-at-task[START_AT start the playbook at the task matching this name]:name:(TASK_NAME)"\ - '--step[one-step-at-a-time: confirm each task before running]'\ - "(-S --su)"{-S,--su}"[run operations with su (deprecated, use become)]"\ - "(-R --su-user)"{-R,--su-user}"[SU_USER run operations with su as this user (default=root) (deprecated, use become)]:su user:(root)"\ - "(-s --sudo)"{-s,--sudo}"[run operations with sudo (nopasswd) (deprecated, use become)]"\ - "(-U --sudo-user)"{-U,--sudo-user}"[SUDO_USER desired sudo user (default=root) (deprecated, use become)]:su user:(root)"\ - '--syntax-check[perform a syntax check on the playbook, but do not execute it]'\ - "*"{-t,--tags}"[TAGS only run plays and tasks gagged with these values]:task tags:(TAGS)"\ - "(-T --timeout)"{-T,--timeout}"[TIMEOUT override the SSH timeout (s) (default=10)]:ssh timeout:(10)"\ - "(-u --user)"{-u,--user}"[REMOTE_USER connect as this user (default=${USER})]:connect as user:(${USER})"\ - "*--vault-password-file[VAULT_PASSWORD_FILE vault password file]:vault password file:_files"\ - "*"{-v,--verbose}"[verbose mode (-vvv for more, -vvvv to enable connection debugging)]"\ - "--version[show program's version number and exit]"\ - - case $state in - pattern) - _arguments '*:feature:__host_list' - _arguments '*:feature:__group_list' - ;; - esac -} - -_ansible-playbook "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ansible-vault b/.zprezto/modules/completion/external/src/_ansible-vault deleted file mode 100644 index ede78d5..0000000 --- a/.zprezto/modules/completion/external/src/_ansible-vault +++ /dev/null @@ -1,94 +0,0 @@ -#compdef ansible-vault -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ansible v1.9.2 (http://ansible.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Rick van Hattem (https://github.com/wolph) -# -# ------------------------------------------------------------------------------ -# - -_ansible-vault-commands() { - local -a commands - - commands=( - 'create:Create new encrypted file' - 'decrypt:Decrypt encrypted file' - 'edit:Edit encrypted file' - 'encrypt:Encrypt unencrypted file' - 'rekey:Change password for encrypted file' - 'view:View encrypted file' - ) - - _arguments -s : $nul_args && ret=0 - _describe -t commands 'ansible-vault command' commands && ret=0 -} - -_ansible-vault-command(){ - args=( - '--debug[enable debugging]' \ - '--vault-password-file[vault password file]:password_file:_files' - $nul_args - "1::file_name:_files" - ) - _arguments -s : $args && ret=0 -} - -_ansible-vault() { - local -a nul_args - nul_args=( - '(-h --help)'{-h,--help}'[show help message and exit.]' - ) - - local curcontext=$curcontext ret=1 - - if ((CURRENT == 2)); then - _ansible-vault-commands - else - shift words - (( CURRENT -- )) - curcontext="${curcontext%:*:*}:ansible-vault-$words[1]:" - _call_function ret _ansible-vault-command - fi -} - -_ansible-vault "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_archlinux-java b/.zprezto/modules/completion/external/src/_archlinux-java deleted file mode 100644 index a497f76..0000000 --- a/.zprezto/modules/completion/external/src/_archlinux-java +++ /dev/null @@ -1,85 +0,0 @@ -#compdef archlinux-java -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for archlinux-java a tool for selecting default Java runtime (https://wiki.archlinux.org/index.php/java). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_archlinux-java_command_arguments() { - case $words[1] in - (set) - local java_versions=("${(@f)$(archlinux-java status | tail -n +2 | tr -s ' ' | cut -d ' ' -f2)}") - _describe -t output 'Downloads to delete' java_versions - ;; - esac -} - -_archlinux-java() { - local -a commands - - commands=( - "status:List installed Java environments and enabled one" - "get:Return the short name of the Java environment set as default" - "set:Force as default" - "unset:Unset current default Java environment" - "fix:Fix an invalid/broken default Java environment configuration" - "help:Show help" - ) - - _arguments -C \ - '1:cmd:->cmds' \ - '*:: :->args' \ - - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (*) - _archlinux-java_command_arguments - ;; - esac -} - -_archlinux-java - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_artisan b/.zprezto/modules/completion/external/src/_artisan deleted file mode 100644 index 1104a20..0000000 --- a/.zprezto/modules/completion/external/src/_artisan +++ /dev/null @@ -1,63 +0,0 @@ -#compdef artisan -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for artisan (http://laravel.com/docs/artisan). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * loranger (https://github.com/loranger) -# * Yohan Tambè (https://github.com/Cronos87) -# -# ------------------------------------------------------------------------------ - - -_artisan_get_command_list () { - IFS=" " - php artisan --no-ansi | \ - sed "1,/Available commands/d" | \ - awk '/ [a-z]+/ { print $1 }' | \ - sed -E 's/^[ ]+//g' | \ - sed -E 's/[:]+/\\:/g' | \ - sed -E 's/[ ]{2,}/\:/g' -} - -_artisan () { - if [ -f artisan ]; then - local -a commands - IFS=$'\n' - commands=(`_artisan_get_command_list`) - _describe 'commands' commands - fi -} - -compdef _artisan php artisan -compdef _artisan artisan diff --git a/.zprezto/modules/completion/external/src/_atach b/.zprezto/modules/completion/external/src/_atach deleted file mode 100644 index 5da9633..0000000 --- a/.zprezto/modules/completion/external/src/_atach +++ /dev/null @@ -1,71 +0,0 @@ -#compdef atach -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for atach (https://github.com/sorin-ionescu/atach). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Sorin Ionescu -# -# ------------------------------------------------------------------------------ - -local state mode_values existing_sessions ret=1 - -mode_values=( - "none:disable redrawing" - "ctrl_l:use ctrl + l to redraw" - "winch:use sigwinch to redraw" -) - -existing_sessions=($(_call_program session atach)) - -_arguments -C -s -S \ - '(--list -l)'{--list,-l}'[list sessions]' \ - '(--sockets -L)'{--sockets,-L}'[list sockets]' \ - '(--session -s)'{--session=,-s+}'[set the session name]:session' \ - '(--char -c)'{--char=,-c+}'[set the detach character (default: ^\\)]:char' \ - '(--redraw -r)'{--redraw=,-r+}'[set the redraw method (none, ctrl_l, or winch)]:mode:->mode' \ - '(--detached -d)'{--detached,-d}'[start the session detached]' \ - '(--no-detach -D)'{--no-detach,-D}'[disable detaching]' \ - '(--no-suspend -Z)'{--no-suspend,-Z}'[disable suspending]' \ - '(--version -v)'{--version,-v}'[display version and copyright]' \ - '(--help -h)'{--help,-h}'[display help]' \ - '(-)::args:->session-or-command' && ret=0 - -case "$state" in - (mode) - _describe -t mode 'redraw mode' mode_values && ret=0 - ;; - (session-or-command) - _describe -t 'session' 'sessions' existing_sessions && ret=0 - _path_commands && ret=0 - ;; -esac - -return $ret - diff --git a/.zprezto/modules/completion/external/src/_bitcoin-cli b/.zprezto/modules/completion/external/src/_bitcoin-cli deleted file mode 100644 index 8b61503..0000000 --- a/.zprezto/modules/completion/external/src/_bitcoin-cli +++ /dev/null @@ -1,182 +0,0 @@ -#compdef bitcoin-cli -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for bitcoin-cli (https://bitcoin.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Ian Ker-Seymer (https://github.com/ianks) -# -# ------------------------------------------------------------------------------ - -_bitcoin-cli() { - local context state line curcontext="$curcontext" - - _arguments -C \ - -?'[This help message]' \ - -conf='[Specify configuration file (default: bitcoin.conf)]:PATH:_files' \ - -datadir='[Specify data directory]:PATH:_directories' \ - -testnet'[Use the test chain]' \ - -regtest'[Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \ - -named'[Pass named instead of positional arguments (default: false)]' \ - -stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases)]' \ - -rpcport='[Connect to JSON-RPC on (default: 8332 or testnet: 18332)]: :_guard "[[\:digit\:]]#" "PORT"' \ - -rpcwait'[Wait for RPC server to start]' \ - -rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \ - -rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \ - -rpcconnect='[Send commands to node running on (default: 127.0.0.1)]:RPCCONNECT:_hosts' \ - -rpcclienttimeout='[Timeout during HTTP requests (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \ - ':subcommand:->subcommand' && ret=0 - - case $state in - subcommand) - subcommands=( - 'getbestblockhash' - 'getblock' - 'getblockchaininfo' - 'getblockcount' - 'getblockhash' - 'getblockheader' - 'getchaintips' - 'getdifficulty' - 'getmempoolancestors' - 'getmempooldescendants' - 'getmempoolentry' - 'getmempoolinfo' - 'getrawmempool' - 'gettxout' - 'gettxoutproof' - 'gettxoutsetinfo' - 'preciousblock' - 'pruneblockchain' - 'verifychain' - 'verifytxoutproof' - 'getinfo' - 'getmemoryinfo' - 'help' - 'stop' - 'generate' - 'generatetoaddress' - 'getblocktemplate' - 'getmininginfo' - 'getnetworkhashps' - 'prioritisetransaction' - 'submitblock' - 'addnode' - 'clearbanned' - 'disconnectnode' - 'getaddednodeinfo' - 'getconnectioncount' - 'getnettotals' - 'getnetworkinfo' - 'getpeerinfo' - 'listbanned' - 'ping' - 'setban' - 'setnetworkactive' - 'createrawtransaction' - 'decoderawtransaction' - 'decodescript' - 'fundrawtransaction' - 'getrawtransaction' - 'sendrawtransaction' - 'signrawtransaction' - 'createmultisig' - 'estimatefee' - 'estimatepriority' - 'estimatesmartfee' - 'estimatesmartpriority' - 'signmessagewithprivkey' - 'validateaddress' - 'verifymessage' - 'abandontransaction' - 'addmultisigaddress' - 'addwitnessaddress' - 'backupwallet' - 'bumpfee' - 'dumpprivkey' - 'dumpwallet' - 'getaccount' - 'getaccountaddress' - 'getaddressesbyaccount' - 'getbalance' - 'getnewaddress' - 'getrawchangeaddress' - 'getreceivedbyaccount' - 'getreceivedbyaddress' - 'gettransaction' - 'getunconfirmedbalance' - 'getwalletinfo' - 'importaddress' - 'importmulti' - 'importprivkey' - 'importprunedfunds' - 'importpubkey' - 'importwallet' - 'keypoolrefill' - 'listaccounts' - 'listaddressgroupings' - 'listlockunspent' - 'listreceivedbyaccount' - 'listreceivedbyaddress' - 'listsinceblock' - 'listtransactions' - 'listunspent' - 'lockunspent' - 'move' - 'removeprunedfunds' - 'sendfrom' - 'sendmany' - 'sendtoaddress' - 'setaccount' - 'settxfee' - 'signmessage' - 'walletlock' - 'walletpassphrase' - 'walletpassphrasechange' - ) - - _describe -t subcommands 'bitcoin-cli subcommands' subcommands && ret=0 - esac - - return ret -} - -_bitcoin-cli "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_bower b/.zprezto/modules/completion/external/src/_bower deleted file mode 100644 index 69197ea..0000000 --- a/.zprezto/modules/completion/external/src/_bower +++ /dev/null @@ -1,163 +0,0 @@ -#compdef bower -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Bower (http://bower.io). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Joe Lencioni (https://github.com/lencioni) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line _opts ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - _values "bower command" \ - "cache[manage bower cache]" \ - "help[display help information about Bower]" \ - "home[opens a package homepage into your favorite browser]" \ - "info[info of a particular package]" \ - "init[interactively create a bower.json file]" \ - "install[install a package locally]" \ - "link[symlink a package folder]" \ - "list[list local packages - and possible updates]" \ - "login[authenticate with GitHub and store credentials]" \ - "lookup[look up a package URL by name]" \ - "prune[removes local extraneous packages]" \ - "register[register a package]" \ - "search[search for a package by name]" \ - "update[update a local package]" \ - "uninstall[remove a local package]" \ - "unregister[remove a package from the registry]" \ - "version[bump a package version]" && ret=0 - _arguments \ - '(--force)--force[make various commands more forceful]' \ - '(--json)--json[output consumable JSON]' \ - '(--log-level)--log-level[what level of logs to report]' \ - "(--offline)--offline[don't hit the network]" \ - '(--quiet)--quiet[only output important information]' \ - "(--silent)--silent[don't output anything, besides errors]" \ - '(--verbose)--verbose[make output more verbose]' \ - '(--allow-root)--allow-root[allow running commands as root]' \ - '(--version)--version[output Bower version]' \ - '(--no-color)--no-color[disable colors]' && ret=0 - ;; - args) - case $line[1] in - help) - _values 'commands' \ - 'cache' \ - 'home' \ - 'info' \ - 'init' \ - 'install' \ - 'link' \ - 'list' \ - 'login' \ - 'lookup' \ - 'prune' \ - 'register' \ - 'search' \ - 'update' \ - 'uninstall' \ - 'unregister' \ - 'version' && ret=0 - ;; - (home|info|init|link|lookup|prune|register|search|unregister) - _arguments \ - '(--help)--help[show help message]' && ret=0 - ;; - install) - _arguments \ - '(--force-latest)--force-latest[force latest version on conflict]' \ - '(--help)--help[show help message]' \ - "(--production)--production[don't install project devDependencies]" \ - "(--save)--save[save installed packages into the project's bower.json dependencies]" \ - "(--save-dev)--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0 - ;; - list) - _arguments \ - '(--help)--help[show help message]' \ - '(--paths)--paths[generate a simple JSON source mapping]' \ - '(--relative)--relative[make paths relative to the directory config property, which defaults to bower_components]' && ret=0 - ;; - login) - _arguments \ - '(--help)--help[show help message]' \ - '(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0 - ;; - uninstall) - _arguments \ - '(--help)--help[show help message]' \ - "(--save)--save[save installed packages into the project's bower.json dependencies]" \ - "(--save-dev)--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0 - ;; - update) - _arguments \ - '(--force-latest)--force-latest[force latest version on conflict]' \ - '(--help)--help[show help message]' \ - "(--production)--production[don't install project devDependencies]" && ret=0 - ;; - version) - _arguments \ - '(--message)--message[custom git commit and tag message]' && ret=0 - ;; - exec) - _normal && ret=0 - ;; - *) - _opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) - _opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) - if [[ $_opts != "" ]]; then - _values 'option' $_opts && ret=0 - fi - ;; - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_bundle b/.zprezto/modules/completion/external/src/_bundle deleted file mode 100644 index a630918..0000000 --- a/.zprezto/modules/completion/external/src/_bundle +++ /dev/null @@ -1,129 +0,0 @@ -#compdef bundle -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Bundler (http://gembundler.com). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bruno Michel (https://github.com/nono) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line _gems _opts ret=1 - -_arguments -C -A "-v" -A "--version" \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - _values "bundle command" \ - "install[Install the gems specified by the Gemfile or Gemfile.lock]" \ - "update[Update dependencies to their latest versions]" \ - "package[Package the .gem files required by your application]" \ - "exec[Execute a script in the context of the current bundle]" \ - "config[Specify and read configuration options for bundler]" \ - "check[Determine whether the requirements for your application are installed]" \ - "list[Show all of the gems in the current bundle]" \ - "show[Show the source location of a particular gem in the bundle]" \ - "console[Start an IRB session in the context of the current bundle]" \ - "open[Open an installed gem in the editor]" \ - "viz[Generate a visual representation of your dependencies]" \ - "init[Generate a simple Gemfile, placed in the current directory]" \ - "gem[Create a simple gem, suitable for development with bundler]" \ - "help[Describe available tasks or one specific task]" \ - "platform[Displays platform compatibility information]" \ - "outdated[Show all of the outdated gems in the current bundle]" - ret=0 - ;; - args) - case $line[1] in - help) - _values 'commands' 'install' 'update' 'package' 'exec' 'config' 'check' 'list' 'show' 'console' 'open' 'viz' 'init' 'gem' 'help' 'platform' 'outdated' && ret=0 - ;; - install) - _policies=('HighSecurity' 'MediumSecurity' 'LowSecurity' 'AlmostNoSecurity' 'NoSecurity') - _arguments \ - '(--no-color)--no-color[disable colorization in output]' \ - '(--local)--local[do not attempt to connect to rubygems.org]' \ - '(--quiet)--quiet[only output warnings and errors]' \ - '(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \ - '(--system)--system[install to the system location]' \ - '(--deployment)--deployment[install using defaults tuned for deployment environments]' \ - '(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \ - '(--path)--path=-[specify a different path than the system default]:path:_files' \ - '(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \ - '(--without)--without=-[exclude gems that are part of the specified named group]:groups' \ - '(--with)--with=-[include gems that are part of the specified named group]:groups' \ - '(--clean)--clean[remove any gems not present in the current Gemfile]' \ - '(--full-index)--full-index[download and cache the index file of all gems]' \ - '(--jobs)--jobs=-[install gems parallely]:number' \ - '(--force)--force[force download every gem]' \ - '(--no-cache)--no-cache[do not update the cache in vendor/cache with newly installed gems]' \ - '(--no-prune)--no-prune[do not remove stale gem from cache after installation]' \ - '(--retry)--retry=-[number of times to retry failed network or git requests]:number' \ - '(--sheband)--shebang=-[specify ruby executable to execute scripts]:ruby' \ - '(--standalone)--standalone=-[create standalone bundles]:groups' \ - "(--trust-policy)--trust-policy=-[apply the Rubygems security policy]:arg:($_policies)" - ret=0 - ;; - exec) - _normal && ret=0 - ;; - (open|show) - _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') ) - if [[ $_gems != "" ]]; then - _values 'gems' $_gems && ret=0 - fi - ;; - *) - _opts=( $(bundle help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) - _opts+=( $(bundle help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) - if [[ $_opts != "" ]]; then - _values 'options' $_opts && ret=0 - fi - ;; - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_caffeinate b/.zprezto/modules/completion/external/src/_caffeinate deleted file mode 100644 index afcd569..0000000 --- a/.zprezto/modules/completion/external/src/_caffeinate +++ /dev/null @@ -1,50 +0,0 @@ -#compdef caffeinate -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------- -# Description -# ----------- -# -# Completion script for the macOS 'caffeinate' tool (man 8 caffeinate). -# -# ------------------------------------------------------------------------- -# Authors -# ------- -# -# * Nicolas Despres (initial version) -# -# ------------------------------------------------------------------------- - -_arguments -s \ - '-d[prevent the display from sleeping]' \ - '-i[prevent the system from idle sleeping]' \ - '-m[prevent the disk from idle sleeping]' \ - '-s[prevent the system from sleeping but only when running on AC power]' \ - '-u[declare that user is active]' \ - '-t+[assertion timeout value]:delay in seconds' \ - '-w+[waits for process to exit]:pid:_pids' \ - '(-):command: _command_names -e' \ - '*::args: _normal' diff --git a/.zprezto/modules/completion/external/src/_cap b/.zprezto/modules/completion/external/src/_cap deleted file mode 100644 index a9a8fe5..0000000 --- a/.zprezto/modules/completion/external/src/_cap +++ /dev/null @@ -1,81 +0,0 @@ -#compdef cap -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Capistrano (http://capify.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bruno Michel (https://github.com/nono) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - {-d,--debug}'[Prompts before each remote command execution]' \ - {-e,--explain}'[Displays help (if available) for the task]:task' \ - {-F,--default-config}'[Always use default config, even with -f]' \ - {-f,--file}'[A recipe file to load. May be given more than once]:file:_files' \ - {-H,--long-help}'[Explain these options and environment variables]' \ - {-h,--help}'[Display this help message]' \ - {-l,--logger}'[Choose logger method. STDERR used by default]:file:_files' \ - {-n,--dry-run}'[Prints out commands without running them]' \ - {-p,--password}'[Immediately prompt for the password]' \ - {-q,--quiet}'[Make the output as quiet as possible]' \ - {-r,--preserve-roles}'[Preserve task roles]' \ - {-S,--set-before}'[Set a variable before the recipes are loaded]:variable' \ - {-s,--set}'[Set a variable after the recipes are loaded]:variable' \ - {-T,--tasks}'[List all tasks (matching optional PATTERN) in the loaded recipe files]:pattern' \ - {-t,--tool}'[Abbreviates the output of -T for tool integration]' \ - {-V,--version}'[Display the Capistrano version, and exit]' \ - {-v,--verbose}'[Be more verbose. May be given more than once]' \ - {-X,--skip-system-config}'[Do not load the system config file (capistrano.conf)]' \ - {-x,--skip-user-config}'[Do not load the user config file (.caprc)]' \ - '*: :->cmds' && ret=0 - -case $state in - cmds) - cmds=( ${(f)"$(_call_program commands cap -T 2> /dev/null | sed -e '/ # /!d; s/:/\\:/g; s/cap \([A-Za-z0-9\\:_-]*\) .*# /\1:/')"} ) - _describe -t commands 'cap command' cmds && ret=0 - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_cask b/.zprezto/modules/completion/external/src/_cask deleted file mode 100644 index b2ba82a..0000000 --- a/.zprezto/modules/completion/external/src/_cask +++ /dev/null @@ -1,89 +0,0 @@ -#compdef cask -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for cask (http://cask.readthedocs.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * ptrv -# * Johan Andersson -# * Sebastien Duthil -# -# ------------------------------------------------------------------------------ - -function _cask() { - local ret=1 state - _arguments \ - ':subcommand:->subcommand' \ - '*:: :->subcmds' && ret=0 - - case $state in - subcommand) - subcommands=( - "build:build all Elisp files in the files directive" - "clean-elc:remove all byte compiled Elisp files in the files directive" - "exec:execute command with correct 'exec-path' and 'load-path'" - "exec-path:print 'exec-path' for all packages and dependencies" - "files:print list of files specified in the files directive" - "help:display usage information or documentation for specified command" - "info:show info about the current package" - "init:initialize the current directory with a Cask-file" - "install:install all packages specified in the Cask-file" - "link:manage links" - "list:list dependencies" - "load-path:print 'load-path' for all packages and dependencies" - "outdated:print list of outdated packages" - "package:build package and put in specified directory (default: dist)" - "package-directory:print current package installation directory" - "path:print 'exec-path' for all packages and dependencies" - "pkg-file:write a 'define-package' file" - "update:update package version" - "upgrade-cask:upgrade Cask itself and its dependencies" - "upgrade:upgrade Cask itself and its dependencies" - "version:print program version" - ) - _describe -t subcommands 'cask subcommands' subcommands && ret=0 - esac - - case "$words[1]" in - init) - _arguments \ - '(--dev)--dev[Run in dev mode]' && ret=0 ;; - exec) - _generic - ;; - esac - - return ret -} - -_cask "$@" diff --git a/.zprezto/modules/completion/external/src/_ccache b/.zprezto/modules/completion/external/src/_ccache deleted file mode 100644 index 8bb33a2..0000000 --- a/.zprezto/modules/completion/external/src/_ccache +++ /dev/null @@ -1,325 +0,0 @@ -#compdef ccache -P -value-,CCACHE_*,-default- - -# zsh completion script for ccache - -# Copyright 2018 CERN for the benefit of the LHCb Collaboration. - -# 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 copyright holder 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. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization -# or submit itself to any jurisdiction. - -# allow users to define their better compilers -# inspired by _cmake_compilers -# users could override with -# -# _ccache_compilers() { -# local -a _ccache_compilers -# _ccache_compilers=(gcc g++ clang clang++) -# _wanted compilers expl "compiler" compadd -- $_ccache_compilers -# } -(( $+functions[_ccache_compilers] )) || -_ccache_compilers() { - _command_names -e -} - -_ccache_booleans() { - _message 'There are no "false" values, unset variable to disable' - local description; description=${1:-boolean} - local booleans; booleans=( - 'true' - 'yes' - ) - _describe -t booeans "$description" booleans -} - -(( $+functions[_ccache_compressionlevels] )) || -_ccache_compressionlevels() { - local -a one_nine - one_nine=(1 2 3 4 5 6 7 8 9) - _describe -t onetonine "compression level (if using compression)" one_nine -} - -(( $+functions[_ccache_sloppiness] )) || -_ccache_sloppiness() { - _values -s ',' \ - "file_macro[ignore __FILE__]" \ - "file_stat_matches[rely on mtimes and ctimes]" \ - "include_file_ctime[ignore headers' ctime too new]" \ - "include_file_mtime[ignore headers' mtime too new]" \ - "no_system_headers[exclude system headers from cache]" \ - "pch_defines[be sloppy about #defines in pch]" \ - "time_macros[ignore __date__ and __time__]" -} - -(( $+functions[_ccache_compilerchecks] )) || -_ccache_compilerchecks() { - local -a compiler_check_values - compiler_check_values=( - 'content: the actual compiler binary' - 'mtime: mtime and size of the compiler' - 'none: ignore compiler for hashing' - 'string\:: any hard coded string (pre-computed version)' - '%compiler%\ -v:any compiler invocation output' - ) - _describe -t compilerchecks "compiler information included in the hash" compiler_check_values -} - -(( $+functions[_ccache_dirlevels] )) || -_ccache_dirlevels() { - local -a one_eight - one_eight=(1 2 3 4 5 6 7 8) - _describe -t onetoeight "directory levels in the cache directory" one_eight -} - -if [[ "$service" = -value-* ]]; then - case $service in - *CCACHE_*DIR*) - # CCACHE_BASEDIR: relative to which top level paths are hashed - # CCACHE_DIR: where the cache and config are kept - # CCACHE_TEMPDIR: where temporary files are kept - # all: a single path - _path_files -/ - ;; - *CCACHE_NLEVELS*) - _ccache_dirlevels - ;; - *CCACHE_CC*) - _ccache_compilers - ;; - *CCACHE_COMPILERCHECK*) - _ccache_compilerchecks - ;; - *CCACHE_*COMPRESS*) - _ccache_booleans "write compressed cache" - ;; - *CCACHE_COMPRESSLEVEL*) - _ccache_compressionlevels - ;; - *CCACHE_EXTENSION*) - _alternative ':set extension for intermediate files: ' - ;; - *CCACHE_*DIRECT*) - _ccache_booleans "use direct mode" - ;; - *CCACHE_*DISABLE*) - _ccache_booleans "disable cache usage" - ;; - *CCACHE_EXTRAFILES*) - local sep=: - compset -P "*${sep}" - compset -S "${sep}*" || suf="$sep" - - _files "" -r "${sep}"' /\t\t\-' "$@" - ;; - *CCACHE_*HARDLINK*) - _ccache_booleans "create hard links rather than copies" - ;; - *CCACHE_*HASHDIR*) - _ccache_booleans "include the cwd in the hash" - ;; - *CCACHE_IGNOREHEADERS*) - _dir_list - ;; - *CCACHE_*COMMENTS*) - _ccache_booleans "consider comments in hashing" - ;; - *CCACHE_LIMIT_MULTIPLE*) - _alternative ":clean up down to level (e.g. 0.8): " - ;; - *CCACHE_LOGFILE*) - _path_files -g "*(/) *.log" - ;; - *CCACHE_MAXFILES*) - _alternative ":maximum number of files in the cache (0= no limit): " - ;; - *CCACHE_MAXSIZE*) - _alternative ':maximum cache size (0= no limit) with suffix k,M,G,T or Ki,Mi,Gi,Ti: ' - ;; - *CCACHE_PATH*) - _alternative ':PATH for compiler lookup (instead of $PATH):_dir_list' - ;; - *CCACHE_PREFIX*) - _alternative ':prefixes for compiler invokation: ' - ;; - *CCACHE_PREFIX_CPP*) - _alternative ':prefixes for preprocessor invokation: ' - ;; - *CCACHE_*READONLY*) - _ccache_booleans "treat cache as read-only" - ;; - *CCACHE_*READONLY_DIRECT*) - _ccache_booleans "retrieve from read-only cache in direct mode" - ;; - *CCACHE_*RECACHE*) - _ccache_booleans "use cache in write-only mode" - ;; - *CCACHE_*CPP2*) - _ccache_booleans "pass originial rather than preprocessed source code to compiler" - ;; - *CCACHE_SLOPPINESS*) - _ccache_sloppiness - ;; - *CCACHE_*STATS*) - _ccache_booleans "update statistics counters" - ;; - *CCACHE_UMASK*) - _alternative ":umask value (octal): " - ;; - *CCACHE_*UNIFY*) - _ccache_booleans "normalise sources prior to processing" - ;; - esac - - return -fi - -__ccache_config_keys() { - local -a keys - keys=( - 'compression:write compressed cache' - 'direct_mode:use direct mode' - 'disable:disable cache usage' - 'hard_link:create hard links rather than copies' - 'hash_dir:include the cwd in the hash' - 'keep_comments_cpp:consider comments in hashing' - 'read_only:treat cache as read-only' - 'read_only_direct:retrieve from read-only cache in direct mode' - 'recache:use cache in write-only mode' - 'run_second_cpp:pass originial rather than preprocessed source code to compiler' - 'stats:update statistics counters' - 'unify:normalise sources prior to processing' - 'base_dir:specify relative to which top level paths are hashed' - 'temporary_dir:specify where temporary files are kept' - 'cache_dir:specify where the cache is kept' - 'compiler:specify compiler' - 'cache_dir_levels:directory levels in the cache directory' - 'compiler_check:compiler information included in the hash' - 'compression_level:cache compression level' - 'cpp_extension:set extensions for intermediate files' - 'extra_files_to_hash:additional files to consider in hashing' - 'ignore_headers_in_manifest:set paths to headers to ignore in hashing' - 'limit_multiple:cleanup level' - 'log_file:specify a log file' - 'max_files:maximum number of files in the cache' - 'max_size:maximum size of the cache' - 'path:PATH for compiler lookup (instead of $PATH)' - 'prefix_command:prefixes for compiler invokation' - 'prefix_command_cpp:prefixes for preprocessor invokation' - 'sloppiness:hash files sloppy' - 'umask:set umask for ccache and child processes (e.g. for sharing cache)' - ) - _describe -t configkeys "configuration keys" keys -S '=' -} - -if compset -P '--set-config=*='; then - case $IPREFIX in - *=compression= | *=direct_mode= | *=disable= | *=hard_link= | *=hash_dir= | *=keep_comments_cpp= | *=read_only= | *=read_only_direct= | *=recache= | *=run_second_cpp= | *=stats= | *=unify= ) - local booleans; booleans=( - 'true' - 'false' - ) - _describe -t booleans 'boolean' booleans - ;; - *=base_dir= | *=temporary_dir= | *=cache_dir=) - _path_files -/ - ;; - *=compiler=) - _ccache_compilers - ;; - *=cache_dir_levels=) - _ccache_dirlevels - ;; - *=compiler_check=) - _ccache_compilerchecks - ;; - *=compression_level=) - _ccache_compressionlevels - ;; - *=cpp_extension=) - _alternative ':set extension for intermediate files: ' - ;; - *=extra_files_to_hash=) - local sep=: - compset -P "*${sep}" - compset -S "${sep}*" || suf="$sep" - - _files "" -r "${sep}"' /\t\t\-' "$@" - ;; - *=ignore_headers_in_manifest=) - _dir_list - ;; - *=limit_multiple=) - _alternative ":clean up down to level (e.g. 0.8): " - ;; - *=log_file=) - _path_files -g "*(/) *.log" - ;; - *=max_files=) - _alternative ":maximum number of files in the cache (0= no limit): " - ;; - *=max_size=) - _alternative ':maximum cache size (0= no limit) with suffix k,M,G,T or Ki,Mi,Gi,Ti: ' - ;; - *=path=) - _alternative ':PATH for compiler lookup (instead of $PATH):_dir_list' - ;; - *=prefix_command=) - _alternative ':prefixes for compiler invokation: ' - ;; - *=prefix_command_cpp=) - _alternative ':prefixes for preprocessor invokation: ' - ;; - *=sloppiness=) - _ccache_sloppiness - ;; - *=umask=) - _alternative ":umask value (octal): " - ;; - esac -elif [[ $words[2] == -* ]]; then - # if the first argument starts with -, we are in configure-ccache mode - _arguments \ - '*'{-o,--set-config=}"[set configuration key]:keys:__ccache_config_keys" \ - '(: -)'{-h,--help}'[show help message]' \ - '(: -)'{-V,--version}'[print version and copyright information]' \ - '(-z --zero-stats)'{-z,--zero-stats}'[zero statistics counters]' \ - '(-c --cleanup)'{-c,--cleanup}'[delete old files and recalculate size counters]' \ - '(-C --clear)'{-C,--clear}'[clear the cache completely (except configuration)]' \ - '(-p --print-config)'{-p,--print-config}'[print current configuration options]' \ - '(-s --show-stats)'{-s,--show-stats}'[show statistics summary]' \ - '(-F --max-files=)'{-F,--max-files=}'[set maximum number of files in cache]:number of files in cache: ' \ - '(-M --max-size=)'{-M,--max-size=}'[set maximum size of cache]:cache size: ' -elif [[ $CURRENT -eq 2 ]]; then - _ccache_compilers -else - # the command line already looks like 'ccache ...' - # forward to the completion function of the compiler - (( CURRENT-- )) - shift words - _normal -fi diff --git a/.zprezto/modules/completion/external/src/_cf b/.zprezto/modules/completion/external/src/_cf deleted file mode 100644 index 2c899d1..0000000 --- a/.zprezto/modules/completion/external/src/_cf +++ /dev/null @@ -1,994 +0,0 @@ -#compdef cf -# ------------------------------------------------------------------------------ -# -# Copyright 2015 Ferran Rodenas & Danny Rosen -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ------------------------------------------------------------------------------ -# -# Description -# ----------- -# -# Completion script for Cloud Foundry CLI (https://github.com/cloudfoundry/cli#downloads) -# -# ------------------------------------------------------------------------------ -# -# Authors -# ------- -# -# * Ferran Rodenas (https://github.com/frodenas) -# * Danny Rosen (https://github.com/dannyzen) -# -# ------------------------------------------------------------------------------ - -# ---------------------- -# ----- Helper functions -# ---------------------- - -# Output a selectable list of organizations -__cf_orgs() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf orgs | awk 'NR>3{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'ORG' cont_cmd -} - -# Output a selectable list of spaces -__cf_spaces() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf spaces | awk 'NR>3{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'SPACE' cont_cmd -} - -# Output a selectable list of applications -__cf_apps() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf apps | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'APP' cont_cmd -} - -# Output a selectable list of stacks -__cf_stacks() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf stacks | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'STACK' cont_cmd -} - -# Output a selectable list of services -__cf_marketplace_services() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf marketplace | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'SERVICE' cont_cmd -} - -# Output a selectable list of services -__cf_services() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf services | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'SERVICE' cont_cmd -} - -# Output a selectable list of domains -__cf_domains() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v shared | awk 'NR>2{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'DOMAIN' cont_cmd -} - -# Output a selectable list of shared domains -__cf_shared_domains() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf domains | grep -v owned | awk 'NR>2{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'SHARED-DOMAIN' cont_cmd -} - -# Output a selectable list of hostnames -__cf_hostnames() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf routes | awk 'NR>3{print $2}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'ROUTE' cont_cmd -} - -# Output a selectable list of buildpacks -__cf_buildpacks() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf buildpacks | awk 'NR>3{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'BUILDPACK' cont_cmd -} - -# Output a selectable list of feature flags -__cf_feature_flags() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf feature-flags | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'FEATURE-FLAG' cont_cmd -} - -# Output a selectable list of plugin repos -__cf_repo_plugins() { - declare -a cont_cmd - cont_cmd=($(CF_COLOR=false CF_TRACE=false cf list-plugin-repos | awk 'NR>3{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'REPO-PLUGIN' cont_cmd -} - -# Output a selectable list of plugins -__cf_plugins() { - declare -a cont_cmd - cont_cmd=($(cf plugins | awk 'NR>4{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'PLUGIN' cont_cmd -} - -# Output a selectable list of targets (requires cf-targets plugin) -__cf_targets() { - declare -a cont_cmd - cont_cmd=($(cf targets | awk '{print $1}')) - if [[ 'X$cont_cmd' != 'X' ]] - _describe 'TARGET' cont_cmd -} - - -# -------------------------- -# ----- end Helper functions -# -------------------------- - -# -------------- -# ----- Commands -# -------------- - -__login() { - _arguments \ - '-a=[API endpoint (e.g. https://api.example.com)]:api endpoint:' \ - '-u=[Username]:username:' \ - '-p=[Password]:password:' \ - '-o=[Organization]:organization name:__cf_orgs' \ - '-s=[Space]:space name:__cf_spaces' \ - '--sso[Use a one-time password to login]' \ - '--skip-ssl-validation[Skip SSL validation]' -} - -__logout() { - # no arguments -} - -__passwd() { - _arguments \ - '1:password:' -} - -__target() { - _arguments \ - '-o=[Organization]:organization name:__cf_orgs' \ - '-s=[Space]:space name:__cf_spaces' -} - -__api() { - _arguments \ - '1:API url:' \ - '--unset[Remove all api endpoint targeting]' \ - '--skip-ssl-validation[Skip SSL validation]' -} - -__auth() { - # no arguments -} - -__apps() { - # no arguments -} - -__app() { - _arguments \ - '1:application name:__cf_apps' \ - '--guid[Retrieve and display the given app guid. All other health and status output for the app is suppressed]' -} - -__push() { - _arguments \ - '1:application name:__cf_apps' \ - '-b=[Custom buildpack by name (e.g. my-buildpack) or GIT URL or GIT BRANCH URL]:buildpack name:__cf_buildpacks' \ - '-c=[Startup command, set to null to reset to default start command]:startup command:' \ - '-d=[Domain (e.g. example.com)]:domain (e.g. example.com):__cf_domains' \ - '-f=[Path to manifest]:file:_files:' \ - '-i=[Number of instances]:number of instances:' \ - '-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \ - '-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \ - '-n=[Hostname (e.g. my-subdomain)]:hostname (e.g. my-subdomain):' \ - '-p=[Path to app directory or to a zip file of the contents of the app directory]:file:_files' \ - '-s=[Stack to use (a stack is a pre-built file system, including an operating system, that can run apps)]:stack name:__cf_stacks:' \ - '-t=[Maximum time (in seconds) for CLI to wait for application start, other server side timeouts may apply]:maximum time (in seconds):' \ - '--no-hostname[Map the root domain to this app]' \ - '--no-manifest[Ignore manifest file]' \ - '--no-route[Do not map a route to this app and remove routes from previous pushes of this app]' \ - '--no-start[Do not start an app after pushing]' \ - '--random-route[Create a random route for this app]' -} - -__scale() { - _arguments \ - '1:application name:__cf_apps' \ - '-i=[Number of instances]:number of instances:' \ - '-k=[Disk limit (e.g. 256M, 1024M, 1G)]:disk limit (e.g. 256M, 1024M, 1G):' \ - '-m=[Memory limit (e.g. 256M, 1024M, 1G)]:memory limit (e.g. 256M, 1024M, 1G):' \ - '-f[Force restart of app without prompt]' -} - -__delete() { - _arguments \ - '1:application name:__cf_apps' \ - '--f[Force deletion without confirmation]' \ - '--r[Also delete any mapped routes]' -} - -__rename() { - _arguments \ - '1:application name:__cf_apps' \ - '2:application name:' -} - -__start() { - _arguments \ - '1:application name:__cf_apps' -} - -__stop() { - _arguments \ - '1:application name:__cf_apps' -} - -__restart() { - _arguments \ - '1:application name:__cf_apps' -} - -__restage() { - _arguments \ - '1:application name:__cf_apps' -} - -__restart-app-instance() { - _arguments \ - '1:application name:__cf_apps' \ - '2:application index:' -} - -__events() { - _arguments \ - '1:application name:__cf_apps' -} - -__files() { - _arguments \ - '1:application name:__cf_apps' \ - '2::path:' \ - '-i=[instance]' -} - -__logs() { - _arguments \ - '1:application name:__cf_apps' \ - '--recent[Dump recent logs instead of tailing]' -} - -__env() { - _arguments \ - '1:application name:__cf_apps' -} - -__set-env() { - _arguments \ - '1:application name:__cf_apps' \ - '2:env var name:' \ - '3:env var value:' -} - -__unset-env() { - _arguments \ - '1:application name:__cf_apps' \ - '2:env var name:' -} - -__stacks() { - # no arguments -} - -__stack() { - _arguments \ - '1:stack name:__cf_stacks' \ - '--guid[Retrieve and display the given stack guid. All other output for the stack is suppressed]' -} - -__copy-source() { - _arguments \ - '1:source application name:__cf_apps' \ - '2:target application name:' \ - '-o=[Org that contains the target application]:organization name:__cf_orgs' \ - '-s=[Space that contains the target application]:space name:__cf_spaces' \ - '--no-restart[Override restart of the application in target environment after copy-source completes]' -} - -__create-app-manifest() { - _arguments \ - '1:application name:__cf_apps' \ - '-p=[Specify a path for file creation. If path not specified, manifest file is created in current working directory]:path:_files' -} - -__marketplace() { - _arguments \ - '-s=[Show plan details for a particular service offering]' -} - -__services() { - # no arguments -} - -__service() { - _arguments \ - '1:service name:__cf_services' \ - '--guid[Retrieve and display the given service guid. All other output for the service is suppressed]' -} - -__create-service() { - _arguments \ - '1:service:__cf_marketplace_services' \ - '2:plan:' \ - '3:service name:' \ - '-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \ - '-t=[User provided tags]' -} - -__update-service() { - _arguments \ - '1:service name:__cf_services' \ - '-p=[Change service plan for a service instance]' \ - '-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' \ - '-t=[User provided tags]' -} - -__rename-service() { - _arguments \ - '1:service name:__cf_services' \ - '2:service name:' -} - -__delete-service() { - _arguments \ - '1:service name:__cf_services' \ - '-f[Force deletion without confirmation]' -} - -__create-service-key() { - _arguments \ - '1:service name:__cf_services' \ - '2:service key:' \ - '-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' -} - -__service-keys() { - _arguments \ - '1:service name:__cf_services' -} - -__service-key() { - _arguments \ - '1:service name:__cf_services' \ - '2:service key:' -} - -__delete-service-key() { - _arguments \ - '1:service name:__cf_services' \ - '2:service key:' \ - '-f[Force deletion without confirmation]' -} - -__bind-service() { - _arguments \ - '1:application name:__cf_apps' \ - '2:service name:__cf_services' \ - '-c=[Valid JSON object containing service-specific configuration parameters, provided either in-line or in a file]' -} - -__unbind-service() { - _arguments \ - '1:application name:__cf_apps' \ - '2:service name:__cf_services' -} - -__create-user-provided-service() { - _arguments \ - '1:service name:' \ - '-p=[Credentials]' \ - '-l=[Syslog Drain Url]' -} - -__update-user-provided-service() { - _arguments \ - '1:service name:__cf_services' \ - '-p=[Credentials]' \ - '-l=[Syslog Drain Url]' -} - -__orgs() { - # no arguments -} - -__org() { - _arguments \ - '1:organization name:__cf_orgs' \ - '--guid[Retrieve and display the given org guid. All other output for the org is suppressed]' -} - -__create-org() { - _arguments \ - '1:organization name:' \ - '-q=[Quota to assign to the newly created org (excluding this option results in assignment of default quota)]' -} - -__delete-org() { - _arguments \ - '1:organization name:__cf_orgs' \ - '-f[Force deletion without confirmation]' -} - -__spaces() { - # no arguments -} - -__space() { - _arguments \ - '1:space name:__cf_spaces' \ - '--guid[Retrieve and display the given space guid. All other output for the space is suppressed]' \ - '--security-group-rules[Retrive the rules for all the security groups associated with the space]' -} - -__create-space() { - _arguments \ - '1:space name:' \ - '-o=[Org that contains the target application]:organization name:__cf_orgs' \ - '-q=[Quota to assign to the newly created space (excluding this option results in assignment of default quota)]' -} - -__delete-space() { - _arguments \ - '1:space name:__cf_spaces' \ - '-f[Force deletion without confirmation]' -} - -__domains() { - # no arguments -} - -__create-domain() { - _arguments \ - '1:organization name:__cf_orgs' \ - '2:domain:' -} - -__delete-domain() { - _arguments \ - '1:domain:__cf_domains' \ - '-f[Force deletion without confirmation]' -} - -__create-shared-domain() { - _arguments \ - '1:domain:' -} - -__delete-shared-domain() { - _arguments \ - '1:domain:__cf_shared_domains' \ - '-f[Force deletion without confirmation]' -} - -__routes() { - _arguments \ - '--orglevel[List all the routes for all spaces of current organization]' -} - -__create-route() { - _arguments \ - '1:space name:__cf_spaces' \ - '2:domain:__cf_domains' \ - '-n=[Hostname]' -} - -__check-route() { - _arguments \ - '1:hostname:__cf_hostnames' \ - '2:domain:__cf_domains' -} - -__map-route() { - _arguments \ - '1:application name:__cf_apps' \ - '2:domain:__cf_domains' \ - '-n=[Hostname]:hostname:__cf_hostnames:' -} - -__unmap-route() { - _arguments \ - '1:application name:__cf_apps' \ - '2:domain:__cf_domains' \ - '-n=[Hostname]:hostname:__cf_hostnames:' -} - -__delete-route() { - _arguments \ - '1:domain:__cf_domains' \ - '-n=[Hostname]:hostname:__cf_hostnames:' \ - '-f[Force deletion without confirmation]' -} - -__delete-orphaned-routes() { - _arguments \ - '-f[Force deletion without confirmation]' -} - -__buildpacks() { - # no arguments -} - -__create-buildpack() { - _arguments \ - '1:buildpack name:' \ - '2:path:_files' \ - '3:position:' \ - '--enable[Enable the buildpack to be used for staging]' \ - '--disable[Disable the buildpack from being used for staging]' -} - -__update-buildpack() { - _arguments \ - '1:buildpack name:__cf_buildpacks' \ - '-p=[Path to directory or zip file]:file:_files' \ - '-i=[The order in which the buildpacks are checked during buildpack auto-detection]' \ - '--enable[Enable the buildpack to be used for staging]' \ - '--disable[Disable the buildpack from being used for staging]' \ - '--lock[Lock the buildpack to prevent updates]' \ - '--unlock[Unlock the buildpack to enable updates]' -} - -__rename-buildpack() { - _arguments \ - '1:buildpack name:__cf_buildpacks' \ - '2:new buildpack name:' -} - -__delete-buildpack() { - _arguments \ - '1:buildpack name:__cf_buildpacks' \ - '-f[Force deletion without confirmation]' -} - -__running-environment-variable-group() { - # no arguments -} - -__staging-environment-variable-group() { - # no arguments -} - -__set-staging-environment-variable-group() { - # no arguments -} - -__set-running-environment-variable-group() { - # no arguments -} - -__feature-flags() { - # no arguments -} - -__feature-flag() { - _arguments \ - '1:feature name:__cf_feature_flags' -} - -__enable-feature-flag() { - _arguments \ - '1:feature name:__cf_feature_flags' -} - -__disable-feature-flag() { - _arguments \ - '1:feature name:__cf_feature_flags' -} - -__curl() { - _arguments \ - '1:path:' \ - '-i[Include response headers in the output]' \ - '-v[Enable CF_TRACE output for all requests and responses]' \ - '-X=[HTTP method]:http method:(GET POST PUT DELETE)' \ - '-h=[Custom headers to include in the request, flag can be specified multiple times]' \ - '-d=[HTTP data to include in the request body]' \ - '--output[Write curl body to FILE instead of stdout]' -} - -__config() { - _arguments \ - '--async-timeout=[Timeout for async HTTP requests]' \ - '--trace=[Trace HTTP requests]:trace:(true false)' \ - '--color=[Enable or disable color]:color:(true false)' \ - '--locale=[Set default locale. If LOCALE is CLEAR, previous locale is deleted]' -} - -__oauth-token() { - # no arguments -} - -__add-plugin-repo() { - _arguments \ - '1:repo name:' \ - '2:url:' -} - -__remove-plugin-repo() { - _arguments \ - '1:repo name:__cf_repo_plugins' \ - '2:url:' -} - -__list-plugin-repos() { - # no arguments -} - -__repo-plugins() { - _arguments \ - '-r=[Repo Name]:repo name:__cf_repo_plugins' -} - -__plugins() { - _arguments \ - '-checksum[Compute and show the sha1 value of the plugin binary file]' -} - -__install-plugin() { - _arguments \ - '1:plugin URL or path:_files' \ - '-r=[repo name where the plugin binary is located]:repo name:__cf_repo_plugins' -} - -__uninstall-plugin() { - _arguments \ - '1:plugin name:__cf_plugins' -} - -__save-target() { - _arguments \ - '1:target-name:' \ - '-f[Force save even if current target is already saved under another name]' -} - -__set-target() { - _arguments \ - '1:target-name:__cf_targets' \ - '-f[Force target change even if current target is unsaved]' -} - -__delete-target() { - _arguments \ - '1:target-name:__cf_targets' -} - -# ------------------ -# ----- end Commands -# ------------------ - -# ------------------- -# ----- 1st Arguments -# ------------------- - -local -a _1st_arguments -_1st_arguments=( - "login":"Log user in" - "logout":"Log user out" - "passwd":"Change user password" - "target":"Set or view the targeted org or space" - "api":"Set or view target api url" - "auth":"Authenticate user non-interactively" - "apps":"List all apps in the target space" - "app":"Display health and status for app" - "push":"Push a new app or sync changes to an existing app" - "scale":"Change or view the instance count, disk space limit, and memory limit for an app" - "delete":"Delete an app" - "rename":"Rename an app" - "start":"Start an app" - "stop":"Stop an app" - "restart":"Restart an app" - "restage":"Restage an app" - "restart-app-instance":"Terminate the running application Instance at the given index and instantiate a new instance of the application with the same index" - "events":"Show recent app events" - "files":"Print out a list of files in a directory or the contents of a specific file" - "logs":"Tail or show recent logs for an app" - "env":"Show all env variables for an app" - "set-env":"Set an env variable for an app" - "unset-env":"Remove an env variable" - "stacks":"List all stacks" - "stack":"Show information for a stack" - "copy-source":"Make a copy of app source code from one application to another. Unless overridden, the copy-source command will restart the application" - "create-app-manifest":"Create an app manifest for an app that has been pushed successfully" - "marketplace":"List available offerings in the marketplace" - "services":"List all service instances in the target space" - "service":"Show service instance info" - "create-service":"Create a service instance" - "update-service":"Update a service instance" - "delete-service":"Delete a service instance" - "rename-service":"Rename a service instance" - "create-service-key":"Create key for a service instance" - "service-keys":"List keys for a service instance" - "service-key":"Show service key info" - "delete-service-key":"Delete a service key" - "bind-service":"Bind a service instance to an app" - "unbind-service":"Unbind a service instance from an app" - "create-user-provided-service":"Make a user-provided service instance available to cf apps" - "update-user-provided-service":"Update user-provided service instance name value pairs" - "orgs":"List all orgs" - "org":"Show org info" - "create-org":"Create an org" - "delete-org":"Delete an org" - "rename-org":"Rename an org" - "spaces":"List all spaces in an org" - "space":"Show space info" - "create-space":"Create a space" - "delete-space":"Delete a space" - "rename-space":"Rename a space" - "domains":"List domains in the target org" - "create-domain":"Create a domain in an org for later use" - "delete-domain":"Delete a domain" - "create-shared-domain":"Create a domain that can be used by all orgs (admin-only)" - "delete-shared-domain":"Delete a shared domain" - "routes":"List all routes in the current space or the current organization" - "create-route":"Create a url route in a space for later use" - "check-route":"Perform a simple check to determine whether a route currently exists or not" - "map-route":"Add a url route to an app" - "unmap-route":"Remove a url route from an app" - "delete-route":"Delete a route" - "delete-orphaned-routes":"Delete all orphaned routes (e.g.: those that are not mapped to an app)" - "buildpacks":"List all buildpacks" - "create-buildpack":"Create a buildpack" - "update-buildpack":"Update a buildpack" - "rename-buildpack":"Rename a buildpack" - "delete-buildpack":"Delete a buildpack" - "running-environment-variable-group":"Retrieve the contents of the running environment variable group" - "staging-environment-variable-group":"Retrieve the contents of the staging environment variable group" - "set-staging-environment-variable-group":"Pass parameters as JSON to create a staging environment variable group" - "set-running-environment-variable-group":"Pass parameters as JSON to create a running environment variable group" - "feature-flags":"Retrieve list of feature flags with status of each flag-able feature" - "feature-flag":"Retrieve an individual feature flag with status" - "enable-feature-flag":"Enable the use of a feature so that users have access to and can use the feature" - "disable-feature-flag":"Disable the use of a feature so that users have access to and can use the feature" - "curl":"Executes a raw request, content-type set to application/json by default" - "config":"write default values to the config" - "oauth-token":"Retrieve and display the OAuth token for the current session" - "add-plugin-repo":"Add a new plugin repository" - "remove-plugin-repo":"Remove a plugin repository" - "list-plugin-repos":"list all the added plugin repository" - "repo-plugins":"List all available plugins in all added repositories" - "plugins":"list all available plugin commands" - "install-plugin":"Install the plugin defined in command argument" - "uninstall-plugin":"Uninstall the plugin defined in command argument" - "targets":"List all saved targets (requires cf-targets plugin)" - "save-target":"Save the current target under a given name (requires cf-targets plugin)" - "set-target":"Restore a previously saved target (requires cf-targets plugin)" - "delete-target":"Delete a saved target (requires cf-targets plugin)" -) - -# ----------------------- -# ----- end 1st Arguments -# ----------------------- - -# ---------- -# ----- Main -# ---------- - -_arguments '*:: :->command' - -if (( CURRENT == 1 )); then - _describe -t commands "cf command" _1st_arguments - return -fi - -local -a _command_args -case "$words[1]" in - login) - __login ;; - logout) - __logout ;; - passwd) - __passwd ;; - target) - __target ;; - api) - __api ;; - auth) - __auth ;; - apps) - __apps ;; - app) - __app ;; - push) - __push ;; - scale) - __scale ;; - delete) - __delete ;; - rename) - __rename ;; - start) - __start ;; - stop) - __stop ;; - restart) - __restart ;; - restage) - __restage ;; - restart-app-instance) - __restart-app-instance ;; - events) - __events ;; - files) - __files ;; - logs) - __logs ;; - env) - __env ;; - set-env) - __set-env ;; - unset-env) - __unset-env ;; - stacks) - __stacks ;; - stack) - __stack ;; - copy-source) - __copy-source ;; - create-app-manifest) - __create-app-manifest ;; - marketplace) - __marketplace ;; - services) - __services ;; - service) - __service ;; - create-service) - __create-service ;; - update-service) - __update-service ;; - rename-service) - __rename-service ;; - delete-service) - __delete-service ;; - create-service-key) - __create-service-key ;; - service-keys) - __service-keys ;; - service-key) - __service-key ;; - delete-service-key) - __delete-service-key ;; - bind-service) - __bind-service ;; - unbind-service) - __unbind-service ;; - create-user-provided-service) - __create-user-provided-service ;; - update-user-provided-service) - __update-user-provided-service ;; - orgs) - __orgs ;; - org) - __org ;; - create-org) - __create-org ;; - delete-org) - __delete-org ;; - spaces) - __spaces ;; - space) - __space ;; - create-space) - __create-space ;; - delete-space) - __delete-space ;; - domains) - __domains ;; - create-domain) - __create-domain ;; - delete-domain) - __delete-domain ;; - create-shared-domain) - __create-shared-domain ;; - delete-shared-domain) - __delete-shared-domain ;; - routes) - __routes ;; - create-route) - __create-route ;; - check-route) - __check-route ;; - map-route) - __map-route ;; - unmap-route) - __unmap-route ;; - delete-route) - __delete-route ;; - delete-orphaned-routes) - __delete-orphaned-routes ;; - buildpacks) - __buildpacks ;; - create-buildpack) - __create-buildpack ;; - update-buildpack) - __update-buildpack ;; - rename-buildpack) - __rename-buildpack ;; - delete-buildpack) - __delete-buildpack ;; - running-environment-variable-group) - __running-environment-variable-group ;; - staging-environment-variable-group) - __staging-environment-variable-group ;; - set-staging-environment-variable-group) - __set-staging-environment-variable-group ;; - set-running-environment-variable-group) - __set-running-environment-variable-group ;; - feature-flags) - __feature-flags ;; - feature-flag) - __feature-flag ;; - enable-feature-flag) - __enable-feature-flag ;; - disable-feature-flag) - __disable-feature-flag ;; - curl) - __curl ;; - config) - __config ;; - oauth-token) - __oauth-token ;; - add-plugin-repo) - __add-plugin-repo ;; - remove-plugin-repo) - __remove-plugin-repo ;; - list-plugin-repos) - __list-plugin-repos ;; - repo-plugins) - __repo-plugins ;; - plugins) - __plugins ;; - install-plugin) - __install-plugin ;; - uninstall-plugin) - __uninstall-plugin ;; - save-target) - __save-target ;; - set-target) - __set-target ;; - delete-target) - __delete-target ;; -esac diff --git a/.zprezto/modules/completion/external/src/_chattr b/.zprezto/modules/completion/external/src/_chattr deleted file mode 100644 index 072bb14..0000000 --- a/.zprezto/modules/completion/external/src/_chattr +++ /dev/null @@ -1,77 +0,0 @@ -#compdef chattr -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for chattr a tool to change file attributes on a Linux second extended file system. (http://e2fsprogs.sourceforge.net/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_chattr() { - -_arguments -C \ - "-R[Recursively change attributes of directories and their contents.]" \ - "-V[Be verbose with chattr's output and print the program version.]" \ - "-f[Suppress most error messages.]" \ - "-v[Set the file's version/generation number.]:version:" \ - "(-A)+A[Disable atime updates]" \ - "(+A)-A[Enable atime updates]" \ - "(-a)+a[Enable append only - file cannot be overridden]" \ - "(+a)-a[Disable append only - file can be overridden]" \ - "(-c)+c[Enable automatic compression]" \ - "(+c)-c[Disable automatic compression]" \ - "(-D)+D[Enable synchronous directory updates]" \ - "(+D)-D[Disable synchronous directory updates]" \ - "(-d)+d[Forbid backing file up with dump program]" \ - "(+d)-d[Allow backing file up with dump program]" \ - "(-i)+i[Mark as immutable]" \ - "(+i)-i[Unmark as immutable]" \ - "(-j)+j[Enable ext3 journaling]" \ - "(+j)-j[Disable ext3 journaling]" \ - "(-s)+s[Enable secure deletion - zero all blocks on delete]" \ - "(+s)-s[Disable secure deletion - do not zero all blocks on delete]" \ - "(-S)+S[Enable synchronous updates]" \ - "(+S)-S[Disable synchronous updates]" \ - "(-T)+T[Set top of hierarchy - direct subdirectories are allocated independently]" \ - "(+T)-T[Unset top of hierarchy]" \ - "(-t)+t[Disable tail merging]" \ - "(+t)-t[Enable tail merging]" \ - "(-u)+u[Mark as undeletable - enable undeletion]" \ - "(+u)-u[Unmark as undeletable - disable undeletion]" \ - '*:files:_files' \ -} - -_chattr - diff --git a/.zprezto/modules/completion/external/src/_cheat b/.zprezto/modules/completion/external/src/_cheat deleted file mode 100644 index 349249c..0000000 --- a/.zprezto/modules/completion/external/src/_cheat +++ /dev/null @@ -1,73 +0,0 @@ -#compdef cheat -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Cheat an interactive cheatsheets on the command-line. (https://github.com/chrisallenlane/cheat/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - -local cheats - -_cheat_load_cheats() { - cheats=("${(f)$(cheat -l | cut -d' ' -f1)}") -} - - -_cheat() { - - - _arguments -C -s -S -n \ - '(- 1 *)'{-d,--directories}'[List directories on CHEATPATH]: :->full' \ - '(- 1 *)'{-e,--edit}'[Edit cheatsheet]:cheat:->cheats' \ - '(- 1 *)'{-l,--list}'[List cheatsheets]: :->full' \ - '(- 1 *)'{-s,--search}'[Search cheatsheets for ]: :->full' \ - '(- 1 *)'{-v,--version}'[display version and copyright information]: :->full' \ - - case "$state" in - (full) - ;; - (cheats) - _cheat_load_cheats - _describe -t cheats 'cheats' cheats - ;; - (*) - _cheat_load_cheats - _describe -t cheats 'cheats' cheats - ;; - esac -} - -_cheat - diff --git a/.zprezto/modules/completion/external/src/_choc b/.zprezto/modules/completion/external/src/_choc deleted file mode 100644 index 3ac8c59..0000000 --- a/.zprezto/modules/completion/external/src/_choc +++ /dev/null @@ -1,60 +0,0 @@ -#compdef choc -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for choc (http://chocolatapp.com) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Nicholas Penree (https://github.com/drudge) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_arguments -C \ - '(-a --async)'{-a,--async}'[do not wait for the user to close the file in Chocolat]' \ - '(-w --wait)'{-w,--wait}'[wait for file to be closed by Chocolat]' \ - '(-n --no-reactivation)'{-n,--no-reactivation}'[after editing with -w, do not reactivate the calling app]' \ - '(-h --help)'{-h,--help}'[show help information]' \ - '(-v --version)'{-v,--version}'[print version information]' \ - '*:script or directory:_files' && ret=0 - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_chromium b/.zprezto/modules/completion/external/src/_chromium deleted file mode 100644 index 917739b..0000000 --- a/.zprezto/modules/completion/external/src/_chromium +++ /dev/null @@ -1,211 +0,0 @@ -#compdef chromium - -# Copyright 2018 CERN for the benefit of the LHCb Collaboration - -# 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 CERN 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 -# OWNER 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. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization -# or submit itself to any jurisdiction. - -_arguments \ - "--user-data-dir=[Specify the directory that user data is kept in]:directory:_path_files -/" \ - "--app=[Runs URL in app mode]:url:_urls" \ - "--incognito[Open in incognito mode]" \ - "--new-window[open in new window]" \ - "(--no-proxy-server --proxy-auto-detect --proxy-pac-url --password-store)--proxy-server=[specify proxy server]:[\://][\:]:_chromium_proxyurls" \ - "--no-proxy-server[Disables the proxy server]" \ - "--proxy-auto-detect[Autodetect proxy configuration]" \ - "--proxy-pac-url=[Specify proxy autoconfiguration URL]:proxy autoconfiguration url:_urls" \ - "--password-store=[Set the password store to use]:password store: _wanted arguments expl 'wallet store' compadd -- basic gnome kwallet" \ - "--version[print version]" \ - "*:: :{ _alternative _urls _files }" - -# excerpt from the chromium help message: -# -# Specify the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. This overrides any environment variables or settings picked via the options dialog. An individual proxy server is specified -# using the format: -# -# -# -# Where is the protocol of the proxy server, and is one of: -# -# "http", "socks", "socks4", "socks5". -# -# If the is omitted, it defaults to "http". Also note that "socks" is equivalent to "socks5". -# -# Examples: -# -# --proxy-server="foopy:99" -# Use the HTTP proxy "foopy:99" to load all URLs. -# -# --proxy-server="socks://foobar:1080" -# Use the SOCKS v5 proxy "foobar:1080" to load all URLs. -# -# --proxy-server="socks4://foobar:1080" -# Use the SOCKS v4 proxy "foobar:1080" to load all URLs. -# -# --proxy-server="socks5://foobar:66" -# Use the SOCKS v5 proxy "foobar:66" to load all URLs. -# -# It is also possible to specify a separate proxy server for different URL types, by prefixing the proxy server specifier with a URL specifier: -# -# Example: -# -# --proxy-server="https=proxy1:80;http=socks4://baz:1080" -# Load https://* URLs using the HTTP proxy "proxy1:80". And load http://* -# URLs using the SOCKS v4 proxy "baz:1080". -# - -_chromium_proxyurls () { - #TODO: semicolon separated urls not yet implemented - # mostly copied from _urls - local ipre scheme host user uhosts ret=1 expl match glob suf - local localhttp - zstyle -a ":completion:${curcontext}:urls" local localhttp - local localhttp_servername="$localhttp[1]" - local localhttp_documentroot="$localhttp[2]" - local localhttp_userdir="$localhttp[3]" - zstyle -a ":completion:${curcontext}:urls" urls urls - if [[ $#urls -gt 1 || ( $#urls -eq 1 && ! -d $urls[1] ) ]] - then - [[ $#urls -eq 1 && -f $urls[1] ]] && urls=($(< $urls[1])) - _wanted urls expl 'URL' compadd "$@" -a urls && return 0 - urls=() - fi - urls="$urls[1]" - glob=(-g '*(^/)') - zparseopts -D -K -E 'g:=glob' - ipre="$IPREFIX" - if ! compset -P '(#b)([-+.a-z0-9]#):' - then - _tags -C argument prefixes - while _tags - do - while _next_label prefixes expl 'URL prefix' -S '' "$@" - do - compset -S '[^:/]*' && compstate[to_end]='' - compadd "$expl[@]" http:// socks:// socks4:// socks5:// && ret=0 - done - (( ret )) || return 0 - done - return 1 - fi - scheme="$match[1]" - case "$scheme" in - (http(|s)|socks(|4|5)) if ! compset -P // - then - _wanted -C "$scheme" prefixes expl 'end of prefix' compadd -S '' "$@" // - return - fi ;; - (file) [[ -prefix //(127.0.0.1|localhost)/ ]] && compset -P '//(127.0.0.1|localhost)' - [[ -prefix /// ]] && compset -P // - if ! compset -P // - then - _tags -C file files - while _tags - do - while _next_label files expl 'local file' - do - if [[ -prefix / ]] - then - _path_files "$expl[@]" -S '' "${glob[@]}" && ret=0 - _path_files "$expl[@]" -S/ -r '/' -/ && ret=0 - elif [[ -z "$PREFIX" ]] - then - compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0 - fi - done - (( ret )) || return 0 - done - return 1 - fi ;; - esac - if ! compset -P '(#b)([^:/]#)([:/])' - then - uhosts=($urls/$scheme/$PREFIX*$SUFFIX(/:t)) - _tags hosts - while _tags - do - while _next_label hosts expl host - do - compset -S '[:/]*' || suf="/" - (( $#uhosts )) || _hosts -S "$suf" -r '/:' "$expl[@]" && ret=0 - [[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername) - compadd -S "$suf" -r '/:' "$expl[@]" -a uhosts && ret=0 - done - (( ret )) || return 0 - done - return 1 - fi - host="$match[1]" - [[ $match[2] = ':' ]] && ! compset -P '<->/' && _message -e ports 'port number' && return 0 - _tags remote-files files || return 1 - if [[ "$localhttp_servername" = "$host" ]] - then - if compset -P \~ - then - if ! compset -P '(#b)([^/]#)/' - then - _users -S/ "$@" - return - fi - user="$match[1]" - while _tags - do - while _next_label files expl 'local file' - do - _path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0 - _path_files -S/ -r '/' "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0 - done - (( ret )) || return 0 - done - else - while _tags - do - while _next_label files expl 'local file' - do - _path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0 - _path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0 - done - (( ret )) || return 0 - done - fi - else - while _tags - do - (( $#urls )) && while _next_label files expl 'local file' - do - _path_files "$expl[@]" "$@" -W $urls/$scheme/$host "${glob[@]}" && ret=0 - _path_files -S/ -r '/' "$expl[@]" -W $urls/$scheme/$host -/ && ret=0 - done - [[ $scheme = (scp|sftp) ]] && _requested remote-files && _remote_files -h $host -- ssh && ret=0 - (( ret )) || return 0 - done - fi - return $ret -} diff --git a/.zprezto/modules/completion/external/src/_cmake b/.zprezto/modules/completion/external/src/_cmake deleted file mode 100644 index 55efa73..0000000 --- a/.zprezto/modules/completion/external/src/_cmake +++ /dev/null @@ -1,474 +0,0 @@ -#compdef cmake -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------- -# Description -# ----------- -# -# Completion script for CMake (http://www.cmake.org). -# -# ------------------------------------------------------------------------- -# Authors -# ------- -# -# * Scott M. Kroll (initial version) -# * Paul Seyfert (handling of --build and updates) -# -# ------------------------------------------------------------------------- -# Notes -# ----- -# -# * By default only C and C++ languages are supported for compiler flag -# variables. To define your own list of languages: -# -# cmake_langs=('C' 'C' -# 'CXX' 'C++') -# zstyle ':completion:*:cmake:*' languages $cmake_langs -# -# ------------------------------------------------------------------------- - -local context state line curcontext="$curcontext" cmake_args - -local cmake_build_options;cmake_build_options=( - '-C[Pre-load a script to populate the cache]:script:_files' - '*-D-[Create a cmake cache entry]:property:_cmake_define_property' - '-U[Remove matching entries from CMake cache]:globbing expression' - '-G[Specify a makefile generator]:generator:_cmake_generators' - '-T[Specify toolset name if supported by generator]:toolset name' - '(-Wno-dev -Wdev)-Wno-dev[Suppress/Enable developer warnings]' - '(-Wno-dev -Wdev)-Wdev[Suppress/Enable developer warnings]' - '(-Wno-deprecated -Wdeprecated)-Wno-deprecated[Suppress/Enable deprecation warnings]' - '(-Wno-deprecated -Wdeprecated)-Wdeprecated[Suppress/Enable deprecation warnings]' - '(-Wno-error=dev -Werror=dev)-Wno-error=dev[Make developer warnings (not) errors]' - '(-Wno-error=dev -Werror=dev)-Werror=dev[Make developer warnings (not) errors]' - '(-Wno-error=deprecated -Werror=deprecated)-Werror=deprecated[Make deprecated macro and function warnings (not) errors]' - '(-Wno-error=deprecated -Werror=deprecated)-Wno-error=deprecated[Make deprecated macro and function warnings (not) errors]' - '--warn-uninitialized[Warn about uninitialized values.]' - '--warn-unused-vars[Warn about unused variables.]' - '--no-warn-unused-cli[Dont warn about command line options.]' - '-i[Run in wizard mode]' - '-L-[List cache variables]::_values "options" "[non-advanced cache variables]" "A[advanced cache variables]" "H[non-advanced cached variables with help]" "AH[advanced cache variables with help]"' - '--trace[Put cmake in trace mode]' - '--find-package[Run in pkg-config like mode.]' - ':cmake project:_files -/' -) - -# ------------------------ -# _cmake_generator_options -# -# arguments are $1: build working directory (top level Makefile or build.ninja file) -# $2: position of "--" in the command line -# ------------------------ -(( $+functions[_cmake_generator_options] )) || -_cmake_generator_options() { - # pass only the part of the command line starting at "--" to the completion - shift (( $2 - 1 )) words - (( CURRENT = $CURRENT + 1 - $2 )) - if [ -f $1/Makefile ] - then - $_comps[make] - elif [ -f $1/build.ninja ] - then - $_comps[ninja] - fi -} - -# -------------- -# _cmake_targets -# -------------- -(( $+functions[_cmake_targets] )) || -_cmake_targets() { - local -a targets - if [ -f $1/Makefile ] - then - # `make help` doesn't work for Makefiles in general, but for cmake generated makefiles it does. - i=1 - for target in $(make help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do - targets[$i]=$target - (( i = $i + 1 )) - done - elif [ -f $1/build.ninja ] - then - # `ninja help` doesn't seem to be the list of targets we're interested in - i=1 - for target in $(ninja -C $1 -t targets all 2&>/dev/null | awk -F: '{print $1}') ; do - targets[$i]="$target" - (( i++ )) - done - fi - _describe 'build targets' targets -} - -_cmake_suggest_builddirs() { - _alternative ':current directory:(.)' 'directory::_directories' && return 0 -} - -_cmake_on_build() { - local build_extras;build_extras=( - '--[Native build tool options]' - '--target[specify build target]' - '--clean-first[build target clean first]' - '--config[For multi-configuration tools]' - '--use-stderr') - local -a undescribed_build_extras - i=1 - for be in $build_extras ; do - undescribed_build_extras[$i]=$(echo $be | sed "s/\[.*//") - (( i++ )) - done - inbuild=false - dashdashposition=-1 - for ((i = (($CURRENT - 1)); i > 1 ; i--)); do - if [[ $words[$i] == --build ]] ; then - inbuild=true - buildat=$i - (( difference = $CURRENT - $i )) - elif [[ $words[$i] == -- ]] ; then - dashdashposition=$i - fi - done - # check if build mode has been left - outofbuild=false - for ((i = (($CURRENT - 1)); i > (($buildat + 1)); i--)); do - # don't check the word after --build (should be a directory) - if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi - if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi - if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi - outofbuild=true - done - if (( $dashdashposition > 0 )) ; then - _cmake_generator_options $words[(($buildat + 1))] $dashdashposition && return 0 - fi - if [[ "$inbuild" == false || "$difference" -eq 1 ]] ; then - # either there is no --build or completing the directory after --build - _arguments -C -s \ - - build_opts \ - "$cmake_build_options[@]" \ - - build_cmds \ - "$cmake_suggest_build[@]" && return 0 - elif [[ $words[(($CURRENT - 1))] == --target ]] ; then - # after --build --target, suggest targets - _cmake_targets $words[(($buildat + 1))] && return 0 - elif [[ $words[(($CURRENT - 1))] == --config ]] ; then - # after --build --config, no idea - return 0 - elif [ "$outofbuild" = true ] ; then - # after --build --, suggest other cmake_build_options (like -Wno-dev) - _arguments "$cmake_build_options[@]" && return 0 - else - # after --build , suggest other cmake_build_options (like -Wno-dev) or --build options (like --clean-first) - _arguments "$build_extras[@]" "$cmake_build_options[@]" && return 0 - fi -} - -local cmake_help_actions;cmake_help_actions=( - '(- 1)--help-command[Print help for a single command and exit]:command-name:_cmake_command_names' - '(- 1)--help-command-list[List available listfile commands and exit]' - '(- 1)--help-commands[Print help for all commands and exit]' - '(- 1)--help-compatcommands[Print help for compatibility commands]' - '(- 1)--help-module[Print help for compatibility commands]:module-name:_cmake_module_names' - '(- 1)--help-module-list[Print help for a single module and exit]' - '(- 1)--help-modules[Print help for all modules and exit]' - '(- 1)--help-property[List available properties and exit]:property-name:_cmake_property_names' - '(- 1)--help-property-list[List available properties and exit]' - '(- 1)--help-properties[Print help for all properties and exit]' - '(- 1)--help-variable[Print help for a single variable and exit]:variable-name:_cmake_variable_names' - '(- 1)--help-variable-list[List documented variables and exit]' - '(- 1)--help-variables[Print help for all variables and exit]' - '(- 1)--copyright[Print the CMake copyright and exit]' - '(- 1)'{--help,-help,-usage,-h,-H}'[Print usage information and exit]' - '(- 1)--help-full[Print full help and exit]' - '(- 1)--help-html[Print full help in HTML format]' - '(- 1)--help-man[Print full help as a UNIX man page and exit]' - '(- 1)'{--version,-version}'[Print full help as a UNIX man page and exit]' -) -_cmake_help() { - _arguments -C -s - help "$cmake_help_actions[@]" -} - -# ------------------- -# _cmake_command_names -# ------------------- -(( $+functions[_cmake_command_names] )) || -_cmake_command_names() { - local command_names; command_names=(${(f)"$($service --help-command-list 2> /dev/null)"}) - _values 'command name' ${command_names[@]:1} && return 0 -} - -# ----------------- -# _cmake_list_names -# ----------------- -(( $+functions[_cmake_list_names] )) || -_cmake_list_names() { - local command; command="$@[1]" - local desc; desc="$@[2]" - local list_names; list_names=(${(f)"$($service $command 2> /dev/null | sed -e 's/\[/\\\[/' -e 's/\]/\\\]/')"}) - - _values ${desc} ${list_names[@]:1} && return 0 -} - -# ------------------ -# _cmake_module_names -# ------------------ -(( $+functions[_cmake_module_names] )) || -_cmake_module_names() { - _cmake_list_names '--help-module-list' 'module name' && return 0 -} - -# -------------------- -# _cmake_property_names -# -------------------- -(( $+functions[_cmake_property_names] )) || -_cmake_property_names() { - _cmake_list_names '--help-property-list' 'property name' && return 0 -} - -# --------------------- -# _cmake_variable_names -# --------------------- -(( $+functions[_cmake_variable_names] )) || -_cmake_variable_names() { - _cmake_list_names '--help-variable-list' 'variable name' && return 0 -} - -# ---------------------- -# _cmake_define_property -# ---------------------- -(( $+functions[_cmake_define_property] )) || -_cmake_define_property() { - if compset -P '*='; then - _wanted property-values expl 'property value' _cmake_define_property_values ${${IPREFIX%=}#-D} && return 0 - else - _wanted property-names expl 'property name' _cmake_define_property_names -qS= && return 0 - fi -} - -# ---------------------------- -# _cmake_define_property_names -# ---------------------------- -(( $+functions[_cmake_define_property_names] )) || -_cmake_define_property_names() { - local alternatives; alternatives=( - 'common-property-names:common property name:_cmake_define_common_property_names -qS=' - ) - local -A cmake_langs - zstyle -a ":completion:${curcontext}:" languages cmake_langs - [[ $#cmake_langs -eq 0 ]] && cmake_langs=('C' 'C' 'CXX' 'C++') - - for cmake_lang in ${(k)cmake_langs}; do - cmake_lang_desc="${cmake_langs[$cmake_lang]}" - alternatives+=("${cmake_lang//:/-}-property-names:${cmake_lang_desc} language property name:_cmake_define_lang_property_names -qS= ${cmake_lang} ${cmake_lang_desc}") - done - - _alternative "${alternatives[@]}" -} - -# --------------------------------- -# _cmake_define_lang_property_names -# --------------------------------- -(( $+functions[_cmake_define_lang_property_names] )) || -_cmake_define_lang_property_names() { - local cmake_lang="$@[-2]" cmake_lang_desc="$@[-1]" - local properties; properties=( - "CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler" - "CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds" - "CMAKE_${cmake_lang}_FLAGS_DEBUG:${cmake_lang_desc} compiler flags for all Debug build" - "CMAKE_${cmake_lang}_FLAGS_RELEASE:${cmake_lang_desc} compiler flags for all Relase build" - "CMAKE_${cmake_lang}_FLAGS_MINSIZREL:${cmake_lang_desc} compiler flags for all MinSizRel build" - "CMAKE_${cmake_lang}_FLAGS_RELWITHDEBINFO:${cmake_lang_desc} compiler flags for all RelWithDebInfo build" - "CMAKE_${cmake_lang}_STANDARD:${cmake_lang_desc} language standard" - "CMAKE_${cmake_lang}_STANDARD_REQUIRED:${cmake_lang_desc} language standard is required" - "CMAKE_${cmake_lang}_EXTENSIONS:${cmake_lang_desc} enable compiler specific extensions" - ) - - _describe -t "${cmake_lang//:/-}-property-names" "${cmake_lang_desc} property name" properties $@[0,-3] && return 0 -} - -# ----------------------------------- -# _cmake_define_common_property_names -# ----------------------------------- -(( $+functions[_cmake_define_common_property_names] )) || -_cmake_define_common_property_names() { - local properties; properties=( - 'CMAKE_MODULE_PATH:Search path for cmake modules (FindPROJECT.cmake)' - 'CMAKE_PREFIX_PATH:Search path for installations (PROJECTConfig.cmake)' - 'CMAKE_BUILD_TYPE:Specifies the build type for make based generators' - 'CMAKE_TOOLCHAIN_FILE:Absolute or relative path to a cmake script which sets up toolchain related variables' - 'CMAKE_COLOR_MAKEFILE:Enables/disables color output when using the Makefile generator' - 'CMAKE_INSTALL_PREFIX:Install directory used by install' - 'CMAKE_EXPORT_COMPILE_COMMANDS:Enable/disable output of compilation database during generation' - 'CMAKE_RULE_MESSAGES:Specify whether to report a message for each make rule' - 'CMAKE_VERBOSE_MAKEFILE:Enable verbose output from Makefile builds' - ) - - _describe -t 'common-property-names' 'common property name' properties $@ -} - -# ---------------------------- -# _cmake_define_property_values -# ---------------------------- -(( $+functions[_cmake_define_property_values] )) || -_cmake_define_property_values() { - local ret=1 - setopt localoptions extendedglob - case $@[-1] in - (CMAKE_BUILD_TYPE) _wanted build-types expl 'build type' _cmake_build_types && ret=0;; - (CMAKE_CXX_STANDARD) _wanted cxx-standards expl 'cxx standard' _cmake_cxx_standars && ret=0;; - (CMAKE_C_STANDARD) _wanted c-standards expl 'c standard' _cmake_c_standars && ret=0;; - (CMAKE_TOOLCHAIN_FILE) _wanted toolchain-files expl 'file' _cmake_toolchain_files && ret=0;; - (CMAKE_COLOR_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (CMAKE_RULE_MESSAGES) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (CMAKE_VERBOSE_MAKEFILE) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (CMAKE_INSTALL_PREFIX) _files -/ && ret=0;; - (CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;; - (CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0;; - (CMAKE_*_STANDARD_REQUIRED) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (CMAKE_*_EXTENSIONS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; - (*) _files && ret=0;; - esac - - return ret -} - -# ------------------ -# _cmake_build_types -# ------------------ -(( $+functions[_cmake_build_types] )) || -_cmake_build_types() { - local build_types; build_types=( - 'Debug' - 'Release' - 'RelWithDebInfo' - 'MinSizeRel' - ) - _values 'build type' ${build_types[@]} -} - -# ------------------- -# _cmake_c_standars -# ------------------- -(( $+functions[_cmake_c_standars] )) || -_cmake_c_standars() { - local c_standards; c_standards=( - '90' - '99' - '11' - ) - _values 'c standard' ${c_standards[@]} -} - -# ------------------- -# _cmake_cxx_standars -# ------------------- -(( $+functions[_cmake_cxx_standars] )) || -_cmake_cxx_standars() { - local cxx_standards; cxx_standards=( - '98' - '11' - '14' - '17' - ) - _values 'cxx standard' ${cxx_standards[@]} -} - -# ----------------- -# _cmake_generators -# ----------------- -(( $+functions[_cmake_generators] )) || -_cmake_generators() { - local generators; generators=( - 'Unix Makefiles' - 'Ninja' - 'CodeBlocks - Ninja' - 'CodeBlocks - Unix Makefiles' - 'Eclipse CDT4 - Ninja' - 'Eclipse CDT4 - Unix Makefiles' - 'KDevelop3' - 'KDevelop3 - Unix Makefiles' - 'Sublime Text 2 - Ninja' - 'Sublime Text 2 - Unix Makefiles' - ) - - _describe -t generators 'generator' generators -} - -# ---------------------- -# _cmake_toolchain_files -# ---------------------- -(( $+functions[_cmake_toolchain_files] )) || -_cmake_toolchain_files() { - _files -g '*\.cmake*' -} - -# --------------- -# _cmake_booleans -# --------------- -(( $+functions[_cmake_booleans] )) || -_cmake_booleans() { - local booleans; booleans=( - 'YES' - 'NO' - ) - _describe -t booleans 'boolean' booleans -} - -# --------------- -# _cmake_compilers -# --------------- -(( $+functions[_cmake_compilers] )) || -_cmake_compilers() { - _command_names -e -} - -local cmake_command_actions;cmake_command_actions=( - '-E[CMake command mode]:*:command' -) -_cmake_command() { - _arguments -C -s - command "$cmake_command_actions[@]" -} - -local cmake_suggest_build;cmake_suggest_build=( - '--build[build]:build dir:_cmake_suggest_builddirs' -) - -if [ $CURRENT -eq 2 ] ; then - _arguments -C -s \ - - help \ - "$cmake_help_actions[@]" \ - - command \ - "$cmake_command_actions[@]" \ - - build_opts \ - "$cmake_build_options[@]" \ - - build_cmds \ - "$cmake_suggest_build[@]" && return 0 -elif [[ $words[2] = --help* ]] ; then - _cmake_help -elif [[ $words[2] != -E ]] ; then - _cmake_on_build -else - _cmake_command -fi diff --git a/.zprezto/modules/completion/external/src/_coffee b/.zprezto/modules/completion/external/src/_coffee deleted file mode 100644 index 10b6b81..0000000 --- a/.zprezto/modules/completion/external/src/_coffee +++ /dev/null @@ -1,81 +0,0 @@ -#compdef coffee -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Coffee.js v0.6.11 (http://coffeejs.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mario Fernandez (https://github.com/sirech) -# * Dong Weiming (https://github.com/dongweiming) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 version opts first second third -typeset -A opt_args -version=(${(f)"$(_call_program version $words[1] --version)"}) -version=${${(z)${version[1]}}[3]} -first=$(echo $version|cut -d '.' -f 1) -second=$(echo $version|cut -d '.' -f 2) -third=$(echo $version|cut -d '.' -f 3) -if (( $first < 2 )) && (( $second < 7 )) && (( $third < 3 ));then - opts+=('(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' - '(-r --require)'{-r,--require}'[require a library before executing your script]:library') -fi - - -_arguments -C \ - '(- *)'{-h,--help}'[display this help message]' \ - '(- *)'{-v,--version}'[display the version number]' \ - $opts \ - '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \ - '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \ - '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \ - '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \ - '(--nodejs)--nodejs[pass options directly to the "node" binary]' \ - '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \ - '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \ - '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \ - '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \ - '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \ - '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \ - '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \ - '*:script or directory:_files' && ret=0 - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_column b/.zprezto/modules/completion/external/src/_column deleted file mode 100644 index 1cb2245..0000000 --- a/.zprezto/modules/completion/external/src/_column +++ /dev/null @@ -1,60 +0,0 @@ -#compdef column -# -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for column (from util-linux 2.27.1->) -# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Ole Jørgen Brønner -# -# ------------------------------------------------------------------------------ -# -# Note: column has upstream bash completions. -# -# Automatically generated with http://github.com/RobSis/zsh-completion-generator - -local arguments - -arguments=( - '(-c --columns)'{-c,--columns}'[width of output in number of characters]:width:' - '(-t --table)'{-t,--table}'[create a table]' - '(-s --separator)'{-s,--separator}'[possible table delimiters]:separator:' - '(-o --output-separator)'{-o,--output-separator}'[columns separator for table output; default is two spaces]:separator:' - '(-x --fillrows)'{-x,--fillrows}'[fill rows before columns]' - '(-h --help)'{-h,--help}'[display this help and exit]' - '(-V --version)'{-V,--version}'[output version information and exit]' - '*:filename:_files' -) - -_arguments -s $arguments diff --git a/.zprezto/modules/completion/external/src/_composer b/.zprezto/modules/completion/external/src/_composer deleted file mode 100644 index 76e1260..0000000 --- a/.zprezto/modules/completion/external/src/_composer +++ /dev/null @@ -1,76 +0,0 @@ -#compdef composer -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for composer (https://getcomposer.org/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Daniel Gomes (me@danielcsgomes.com) -# * Valerii Hiora (https://github.com/vhbit) -# * loranger (https://github.com/loranger) -# -# ------------------------------------------------------------------------------ - -local curcontext=$curcontext state line -declare -A opt_args - -_composer_get_command_list () { - composer --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }' -} - -_composer_get_required_list () { - composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' -} - - -_composer () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments \ - '1: :->command'\ - '*: :->args' - if [ -f composer.json ]; then - case $state in - command) - compadd `_composer_get_command_list` - ;; - *) - compadd `_composer_get_required_list` - ;; - esac - else - compadd create-project init search selfupdate show - fi -} - -compdef _composer composer \ No newline at end of file diff --git a/.zprezto/modules/completion/external/src/_conan b/.zprezto/modules/completion/external/src/_conan deleted file mode 100644 index dd56b87..0000000 --- a/.zprezto/modules/completion/external/src/_conan +++ /dev/null @@ -1,626 +0,0 @@ -#compdef conan -# ------------------------------------------------------------------------------ -# Copyright (c) 2010-2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for conan 0.28.1 (https://www.conan.io). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_conan() { - - local context state state_descr line - typeset -A opt_args - - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(- : *)'{-v,--version}'[display version information]' \ - '(-h --help)1: :_conan_commands' \ - '(-h --help)*:: :->command_args' - - case $state in - command_args) - (( $+functions[_conan_${words[1]}_args] )) && _conan_${words[1]}_args - ;; - esac -} - -(( $+functions[_conan_commands] )) || -_conan_commands() { - local consumer_commands creator_commands package_development_commands misc_commands deprecated_commands - consumer_commands=( - 'install:installs the requirements specified in a "conanfile.py" or "conanfile.txt"' - 'config:manages conan configuration information' - 'get:gets a file or list a directory of a given reference or package' - 'info:prints information about a package recipe'\''s dependency graph' - 'search:search package recipes and binaries in the local cache or in a remote server' - ) - creator_commands=( - 'new:creates a new package recipe template with a '\''conanfile.py'\''' - 'create:export, build package and test it with a consumer project' - 'upload:uploads a package recipe and the generated binary packages to a specified remote' - 'export:copies the package recipe (conanfile.py and associated files) to your local cache' - 'export-pkg:exports a recipe & creates a package with given files calling '\''package'\''' - 'test:runs a test-folder/conanfile.py to test an existing package' - ) - package_development_commands=( - 'source:calls your conanfile.py "source()" method to configure the source directory' - 'build:utility command to run your current project "conanfile.py" build() method' - 'package:calls your conanfile.py "package" method for a specific package recipe' - ) - misc_commands=( - 'profile:list profiles in the ".conan/profiles" folder, or show profile details' - 'remote:handles the remote list and the package recipes associated to a remote' - 'user:update your cached user name (and auth token) to avoid it being requested later' - 'imports:execute the "imports" stage of a conanfile.txt or a conanfile.py' - 'copy:copy conan recipes and packages to another user/channel.' - 'remove:remove any package recipe or binary matching a pattern' - 'alias:creates and export an alias recipe' - ) - _describe -t 'consumer-commands' "consumer commands" consumer_commands - _describe -t 'creator-commands' "creator commands" creator_commands - _describe -t 'package-development-commands' "package development commands" package_development_commands - _describe -t 'misc-commands' "misc commands" misc_commands -} - -(( $+functions[_conan_alias_args] )) || -_conan_alias_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1:alias reference:_conan_package_references' \ - '(-h --help)2:target reference:_conan_package_references' -} - -(( $+functions[_conan_build_args] )) || -_conan_build_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - "(-h --help -f --file)"{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \ - "(-h --help -sf --source-folder)"{-sf,--source-folder}'[local folder containing the sources. Defaulted to the directory of the conanfile. A relative path can also be specified (relative to the current directory)]: :_files -/' \ - "(-h --help -bf --build-folder)"{-bf,--build-folder}'[build folder, working directory of the build process. Defaulted to the current directory. A relative path can also be specified (relative to the current directory)]: :_files -/' \ - "(-h --help -pf --package-folder)"{-pf,--package-folder}'[folder to install the package (when the build system or build() method does it). Defaulted to the '\''{build_folder}/package'\'' folder. A relative path can be specified, relative to the current folder. Also an absolute path is allowed.]: :_files -/' \ - "(-h --help -if --install-folder)"{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution). Defaulted to --build-folder]: :_files -/' \ - '(-h --help)1: :_conan_conanfiles' -} - -(( $+functions[_conan_config_args] )) || -_conan_config_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_config_commands' \ - '(-h --help)*:: :->command_args' - - case $state in - command_args) - (( $+functions[_conan_config_${words[1]}_args] )) && _conan_config_${words[1]}_args - ;; - esac -} - -(( $+functions[_conan_config_commands] )) || -_conan_config_commands() { - local commands - commands=( - 'rm:rm an existing config element' - 'set:set/add value' - 'get:get the value of existing element' - 'install:install a full configuration from a zip file, local or remote' - ) - _describe -t 'commands' "command" commands -} - -(( $+functions[_conan_config_rm_args] )) || -_conan_config_rm_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_config_keys' -} - -(( $+functions[_conan_config_get_args] )) || -_conan_config_get_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_config_keys' -} - -(( $+functions[_conan_config_set_args] )) || -_conan_config_set_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_config_set_key_values' -} - -(( $+functions[_conan_config_set_key_values] )) || -_conan_config_set_key_values() { - local ret=1 - if compset -P '*='; then - _wanted property-values expl 'config value' _conan_config_values ${IPREFIX%=} && ret=0 - else - _wanted property-names expl 'config key' _conan_config_keys -qS= && ret=0 - fi - return ret -} - -(( $+functions[_conan_config_install_args] )) || -_conan_config_install_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1:config file:_files' -} - -(( $+functions[_conan_copy_args] )) || -_conan_copy_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - "(-h --help --all -p --package)"{-p,--package}'[copy specified package ID]:package reference:_conan_package_references' \ - '(-h --help --all -p --package)--all[copy all packages from the specified package recipe]' \ - '(-h --help --force)--force[override destination packages and the package recipe]' \ - '(-h --help)1: :_conan_package_references' \ - '(-h --help)2: :_conan_user_channels' -} - -(( $+functions[_conan_export_args] )) || -_conan_export_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help -p --path)'{-p,--path}'[folder with a conanfile.py (default current directory)]: :_files -/' \ - '(-h --help -k --keep-source)'{-k,--keep-source}'[do not remove the source folder in the local cache]' \ - '(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \ - '(-h --help)1: :_conan_channel_or_package_references' -} - -(( $+functions[_conan_get_args] )) || -_conan_get_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - "(-h --help -p --package)"{-p,--package}'[package ID]: :_conan_package_references' \ - '(-h --help -r --remote)'{-r,--remote}'[get from this specific remote]: :_conan_remotes' \ - '(-h --help -raw --raw)'{-raw,--raw}'[do not decorate the text]' \ - '(-h --help)1: :_conan_package_references' \ - '(-h --help)2:file or directory path:_files' -} - -(( $+functions[_conan_imports_args] )) || -_conan_imports_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help -f --file)'{-f,--file}'[use another filename]: :_conan_conanfiles' \ - '(-h --help -imf --import-folder)'{-imf,--import-folder}'[directory to copy the artifacts to. By default it will be the current directory]: :_files -/' \ - '(-h --help -if --install-folder)'{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution)]: :_files -/' \ - '(-h --help -u --undo)'{-u,--undo}'[undo imports (remove imported files)]' \ - '(-h --help)1: :_conan_directory_or_package_references' -} - -(( $+functions[_conan_info_args] )) || -_conan_info_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \ - '(-h --help -n --only)'{-n,--only}'[filter fields]: :_conan_info_only_values' \ - '(-h --help --paths)--paths[show package paths in local cache]' \ - '(-h --help --package-filter)--package-filter[print information only for packages that match the filtere.g., MyPackage/1.2@user/channel or MyPackage*]: :_conan_package_references' \ - '(-h --help -bo --build_order)'{-bo,--build_order}'[given a modified reference, return an ordered list to build (CI)]' \ - '(-h --help -j --json)'{-j,--json}'[only with --build_order option, return the information in a json]: :_files -g "*.json"' \ - '(-h --help -g --graph)'{-g,--graph}'[creates file with project dependencies graph]: :_files -g "*.(dot|html)"' \ - '(-h --help -u --update)'{-u,--update}'[check updates exist from upstream remotes]' \ - '(-h --help -sc --scope)'{-sc,--scope}'[use the specified scope in the install command]: :_conan_scopes' \ - '(-h --help -pr --profile)'{-pr,--profile}'[apply the specified profile to the install command]: :_conan_profiles' \ - '(-h --help -r --remote)'{-r,--remote}'[look in the specified remote server]: :_conan_remotes' \ - '(-h --help)'{-o,--options}'[options to build the package, overwriting the defaults. e.g., -o with_qt=true]: :_conan_options' \ - '(-h --help)'{-s,--settings}'[settings to build the package, overwriting the defaults. e.g., -s compiler=gcc]: :_conan_settings' \ - '(-h --help)'{-e,--env}'[environment variables that will be set during the package build, -e CXX=/usr/bin/clang++]: :_conan_environment_variables' \ - '(-h --help -b --build)'{-b,--build}'[given a build policy (same install command "build" parameter), return an ordered list of packages that would be built from sources in install command (simulation)]: :_conan_build_policies' \ - '(-h --help)1: :_conan_conanfile_or_package_references' -} - -(( $+functions[_conan_info_only_values] )) || -_conan_info_only_values() { - local values - values=( - 'id:show only "id"' - 'build_id:show only "build_id"' - 'remote:show only "remote"' - 'url:show only "url"' - 'license:show only "license"' - 'requires:show only "requires"' - 'update:show only "update"' - 'required:show only "required"' - 'date:show only "date"' - 'author:show only "author"' - 'export_folder:use with --paths' - 'build_folder:use with --paths' - 'package_folder:use with --paths' - 'source_folder:use with --paths' - 'None:show only references' - ) - _describe -t 'values' "value" values -} - -(( $+functions[_conan_install_args] )) || -_conan_install_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help -f --file)'{-f,--file}'[specify conanfile filename]: :_conan_conanfiles' \ - '(-h --help -g --generator)'{-g,--generator}'[generators to use]: :_conan_generators' \ - '(-h --help --werror)--werror[error instead of warnings for graph inconsistencies]' \ - '(-h --help -if --install-folder)'{-if,--install-folder}'[Use this directory as the directory where to put the generatorfiles, conaninfo/conanbuildinfo.txt etc.]: :_files -/' \ - '(-h --help -m --manifests)'{-m,--manifests}'[install dependencies manifests in folder for later verify]: :_files -/' \ - '(-h --help -mi --manifests-interactive)'{-mi,--manifests-interactive}'[install dependencies dependencies manifests in folder for later verify]: :_files -/' \ - '(-h --help -v --verify)'{-v,--verify}'[verify dependencies manifests against stored ones]: :_files -/' \ - '(-h --help --no-imports)--no-imports[install specified packages but avoid running imports]' \ - '(-h --help -u --update)'{-u,--update}'[check updates exist from upstream remotes]' \ - '(-h --help -sc --scope)'{-sc,--scope}'[use the specified scope in the install command]: :_conan_scopes' \ - '(-h --help -pr --profile)'{-pr,--profile}'[apply the specified profile to the install command]: :_conan_profiles' \ - '(-h --help -r --remote)'{-r,--remote}'[look in the specified remote server]: :_conan_remotes' \ - '(-h --help)'{-o,--options}'[options to build the package, overwriting the defaults. e.g., -o with_qt=true]: :_conan_options' \ - '(-h --help)'{-s,--settings}'[settings to build the package, overwriting the defaults. e.g., -s compiler=gcc]: :_conan_settings' \ - '(-h --help)'{-e,--env}'[environment variables that will be set during the package build, -e CXX=/usr/bin/clang++]: :_conan_environment_variables' \ - '(-h --help -b --build)'{-b,--build}'[given a build policy (same install command "build" parameter), return an ordered list of packages that would be built from sources in install command (simulation)]: :_conan_build_policies' \ - '(-h --help)1: :_conan_conanfile' -} - -(( $+functions[_conan_new_args] )) || -_conan_new_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help -t --test)'{-t,--test}'[create test_package skeleton to test package]' \ - '(-h --help -i --header)'{-i,--header}'[create a headers only package template]' \ - '(-h --help -c --pure_c)'{-c,--pure_c}'[create a C language package only package, deleting "self.settings.compiler.libcxx" setting in the configure method]' \ - '(-h --help -s --sources)'{-s,--sources}'[create a package with embedded sources in "src" folder, using "exports_sources" instead of retrieving external code with the "source()" method]' \ - '(-h --help -b --bare)'{-b,--bare}'[create the minimum package recipe, without build() or package() methods. Useful in combination with "package_files" command]' \ - '(-h --help -cis --ci_shared)'{-cis,--ci_shared}'[package will have a "shared" option to be used in CI]' \ - '(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \ - '(-h --help -cilc --ci_travis_clang)'{-cilc,--ci_travis_clang}'[generate travis-ci files for linux clang]' \ - '(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \ - '(-h --help -cio --ci_travis_osx)'{-cio,--ci_travis_osx}'[generate travis-ci files for OSX apple-clang]' \ - '(-h --help -ciw --ci_appveyor_win)'{-ciw,--ci_appveyor_win}'[generate appveyor files for Appveyor Visual Studio]' \ - '(-h --help -ciglg --ci_gitlab_gcc)'{-ciglg,--ci_gitlab_gcc}'[generate GitLab files for linux gcc]' \ - '(-h --help -ciglc --ci_gitlab_clang)'{-ciglc,--ci_gitlab_clang}'[generate GitLab files for linux clang]' \ - '(-h --help -cilg --ci_travis_gcc)'{-cilg,--ci_travis_gcc}'[generate travis-ci files for linux gcc]' \ - '(-h --help -gi --gitignore)'{-gi,--gitignore}'[generate a .gitignore with the known patterns to excluded]' \ - '(-h --help -ciu --ci_upload_url)'{-ciu,--ci_upload_url}'[define URL of the repository to upload]: :_urls' \ - '(-h --help)1: :_conan_package_references' -} - -(( $+functions[_conan_package_args] )) || -_conan_package_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - "(-h --help -sf --source-folder)"{-sf,--source-folder}'[local folder containing the sources. Defaulted to the directory of the conanfile. A relative path can also be specified (relative to the current directory)]: :_files -/' \ - "(-h --help -bf --build-folder)"{-bf,--build-folder}'[build folder, working directory of the build process. Defaulted to the current directory. A relative path can also be specified (relative to the current directory)]: :_files -/' \ - "(-h --help -pf --package-folder)"{-pf,--package-folder}'[folder to install the package (when the build system or build() method does it). Defaulted to the '\''{build_folder}/package'\'' folder. A relative path can be specified, relative to the current folder. Also an absolute path is allowed.]: :_files -/' \ - "(-h --help -if --install-folder)"{-if,--install-folder}'[local folder containing the conaninfo.txt and conanbuildinfo.txt files (from a previous conan install execution). Defaulted to --build-folder]: :_files -/' \ - '(-h --help)1: :_conan_package_references' \ - '(-h --help)2:package ID:' -} - -(( $+functions[_conan_profile_args] )) || -_conan_profile_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_profile_commands' \ - '(-h --help)*:: :->command_args' - - case $state in - command_args) - (( $+functions[_conan_profile_${words[1]}_args] )) && _conan_profile_${words[1]}_args - ;; - esac -} - -(( $+functions[_conan_profile_commands] )) || -_conan_profile_commands() { - local commands - commands=( - 'list:list current profiles' - 'show:show the values defined for a profile' - 'new:creates a new empty profile' - 'update:update a profile' - 'get:get a profile key' - 'remove:remove a profile key' - ) - _describe -t 'commands' "command" commands -} - -(( $+functions[_conan_profile_list_args] )) || -_conan_profile_list_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' -} - -(( $+functions[_conan_profile_show_args] )) || -_conan_profile_show_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_profiles' -} - -(( $+functions[_conan_profile_new_args] )) || -_conan_profile_new_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)--detect[autodetect settings and fill \[settings\] section]' \ - '(-h --help)1:profile name:' -} - -(( $+functions[_conan_profile_update_args] )) || -_conan_profile_update_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_settings' \ - '(-h --help)2: :_conan_profiles' -} - -(( $+functions[_conan_profile_get_args] )) || -_conan_profile_get_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_setting_keys' \ - '(-h --help)2: :_conan_profiles' -} - -(( $+functions[_conan_profile_remove_args] )) || -_conan_profile_remove_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_setting_keys' \ - '(-h --help)2: :_conan_profiles' -} - -(( $+functions[_conan_remote_args] )) || -_conan_remote_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_remote_commands' \ - '(-h --help)*:: :->command_args' - - case $state in - command_args) - (( $+functions[_conan_remote_${words[1]}_args] )) && _conan_remote_${words[1]}_args - ;; - esac -} - -(( $+functions[_conan_remote_commands] )) || -_conan_remote_commands() { - local commands - commands=( - 'list:list current remotes' - 'add:add a remote' - 'remove:remove a remote' - 'update:update the remote url' - 'list_ref:list the package recipes and its associated remotes' - 'add_ref:associate a recipe'\''s reference to a remote' - 'remove_ref:dissociate a recipe'\''s reference and its remote' - 'update_ref:update the remote associated with a package recipe' - ) - _describe -t 'commands' "command" commands -} - -(( $+functions[_conan_remote_list_args] )) || -_conan_remote_list_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' -} - -(( $+functions[_conan_remote_add_args] )) || -_conan_remote_add_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1:name of the remote:' \ - '(-h --help)2:url of the remote:_urls' \ - '(-h --help)3:verify SSL certificated:(True False)' -} - -(( $+functions[_conan_remote_remove_args] )) || -_conan_remote_remove_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_remotes' -} - -(( $+functions[_conan_remote_update_args] )) || -_conan_remote_update_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' \ - '(-h --help)1: :_conan_remotes' \ - '(-h --help)2:url of the remote:_urls' \ - '(-h --help)3:verify SSL certificated:(True False)' -} - -(( $+functions[_conan_remote_list_ref_args] )) || -_conan_remote_list_ref_args() { - _arguments -C \ - '(- : *)'{-h,--help}'[display help information]' -} - -# TODO complete conan remote add_ref -# TODO complete conan remote remove_ref -# TODO complete conan remote update_ref -# TODO complete conan remove -# TODO complete conan search -# TODO complete conan source -# TODO complete conan upload -# TODO complete conan user -# TODO complete conan export-pkg -# TODO complete conan test - - -(( $+functions[_conan_conanfiles] )) || -_conan_conanfiles() { - _files -g '*.py' -} - -(( $+functions[_conan_directory_or_package_references] )) || -_conan_conanfile_or_package_references() { - _alternative \ - 'conanfile: :_conan_conanfiles' \ - 'package-references: :_conan_package_references' -} - -(( $+functions[_conan_directory_or_package_references] )) || -_conan_directory_or_package_references() { - _alternative \ - 'directory: :_files -/' \ - 'package-references: :_conan_package_references' -} - -(( $+functions[_conan_channel_or_package_references] )) || -_conan_channel_or_package_references() { - _alternative \ - 'package-references: :_conan_package_references' \ - 'user-channels: :_conan_user_channels' -} - -(( $+functions[_conan_package_references] )) || -_conan_package_references() { - _guard '[^\-]#' 'package reference' # TODO complete package references -} - -(( $+functions[_conan_user_channels] )) || -_conan_user_channels() { - _guard '[^\-]#' 'user channel' # TODO complete user channels -} - -(( $+functions[_conan_remotes] )) || -_conan_remotes() { - local remotes; remotes=(${(f)"$(_call_program remotes $service remote list)"}) - _describe -t remotes 'remote' remotes "$@" -} - -(( $+functions[_conan_scopes] )) || -_conan_scopes() { - _guard '[^\-]#' 'scope' # TODO complete scopes -} - -(( $+functions[_conan_build_policies] )) || -_conan_build_policies() { - _guard '[^\-]#' 'build policy' # TODO complete build policies -} - -(( $+functions[_conan_generators] )) || -_conan_generators() { - _guard '[^\-]#' 'generator' # TODO complete generators -} - -(( $+functions[_conan_profiles] )) || -_conan_profiles() { - local profiles; profiles=(${(f)"$(_call_program profiles $service profile list)"}) - _describe -t profiles 'profile' profiles "$@" -} - -(( $+functions[_conan_config_keys] )) || -_conan_config_keys() { - _guard '[^\-]#' 'config key' # TODO complete config keys -} - -(( $+functions[_conan_config_values] )) || -_conan_config_values() { - _guard '[^\-]#' 'config value' # TODO complete config values -} - -(( $+functions[_conan_options] )) || -_conan_options() { - local ret=1 - if compset -P '*='; then - _wanted option-values expl 'option value' _conan_option_values ${IPREFIX%=} && ret=0 - else - _wanted option-names expl 'option key' _conan_option_keys -qS= && ret=0 - fi - return ret -} - -(( $+functions[_conan_option_keys] )) || -_conan_option_keys() { - _guard '[^\-]#' 'option key' # TODO complete option keys -} - -(( $+functions[_conan_option_values] )) || -_conan_option_values() { - _guard '[^\-]#' 'option value' # TODO complete option values -} - -(( $+functions[_conan_settings] )) || -_conan_settings() { - local ret=1 - if compset -P '*='; then - _wanted setting-values expl 'setting value' _conan_setting_values ${IPREFIX%=} && ret=0 - else - _wanted setting-names expl 'setting key' _conan_setting_keys -qS= && ret=0 - fi - return ret -} - -(( $+functions[_conan_setting_keys] )) || -_conan_setting_keys() { - _guard '[^\-]#' 'setting key' # TODO complete setting keys -} - -(( $+functions[_conan_setting_values] )) || -_conan_setting_values() { - _guard '[^\-]#' 'setting value' # TODO complete setting values -} - -(( $+functions[_conan_environment_variables] )) || -_conan_environment_variables() { - local ret=1 - if compset -P '*='; then - _wanted environment_variable-values expl 'environment variable value' _conan_environment_variable_values ${IPREFIX%=} && ret=0 - else - _wanted environment_variable-names expl 'environment variable' _conan_environment_variable_keys -qS= && ret=0 - fi - return ret -} - -(( $+functions[_conan_environment_variable_keys] )) || -_conan_environment_variable_keys() { - _parameters -g "*export*" -} - -(( $+functions[_conan_environment_variable_values] )) || -_conan_environment_variable_values() { - _guard '[^\-]#' 'environment variable value' # TODO complete environment variable values -} - - -_conan "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_console b/.zprezto/modules/completion/external/src/_console deleted file mode 100644 index 7e5b454..0000000 --- a/.zprezto/modules/completion/external/src/_console +++ /dev/null @@ -1,64 +0,0 @@ -#compdef console -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for symfony console (https://github.com/symfony/Console). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * loranger (https://github.com/loranger) -# * Yohan Tambè (https://github.com/Cronos87) -# -# ------------------------------------------------------------------------------ - -_find_console () { - echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)" -} - -_console_get_command_list () { - IFS=" " - `_find_console` --no-ansi | \ - sed "1,/Available commands/d" | \ - awk '/ [a-z]+/ { print $0 }' | \ - sed -E 's/^[ ]+//g' | \ - sed -E 's/[:]+/\\:/g' | \ - sed -E 's/[ ]{2,}/\:/g' -} - -_console () { - local -a commands - IFS=$'\n' - commands=(`_console_get_command_list`) - _describe 'commands' commands -} - -compdef _console php console -compdef _console console diff --git a/.zprezto/modules/completion/external/src/_dad b/.zprezto/modules/completion/external/src/_dad deleted file mode 100644 index 9ceee06..0000000 --- a/.zprezto/modules/completion/external/src/_dad +++ /dev/null @@ -1,68 +0,0 @@ -#compdef dad -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for dad a command line manager of aria2 daemon. (https://github.com/baskerville/diana). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - -_dad() { - local -a commands - - commands=( - "start:Start aria2c daemon" - "stop:Stop aria2c daemon" - ) - - _arguments -C \ - '(- 1 *)'-h"[Show help and exit]" \ - "-d[Set download dir]:download_dir:->val" \ - "-s[Set secret token]:secret_token:->val" \ - "-u[Set aria2c username]:username:->val" \ - "-p[Set aria2c password]:password:->val" \ - '1:cmd:->cmds' \ - '*: : :->args' \ - - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (*) - ;; - esac -} - -_dad - diff --git a/.zprezto/modules/completion/external/src/_debuild b/.zprezto/modules/completion/external/src/_debuild deleted file mode 100644 index 20c676e..0000000 --- a/.zprezto/modules/completion/external/src/_debuild +++ /dev/null @@ -1,40 +0,0 @@ -#compdef debuild -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for debuild 2.10. -# -# Status: incomplete. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -# FIXME --noconf is only allowed in first position -_arguments \ - '(- 1 *)'{-h,--help}'[show help]' \ - '(- 1 *)--version[show version and copyright information]' \ - {--no-conf,--noconf}'[don'\''t read devscripts config files]' \ - {-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \ - '*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \ - '(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \ - '*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \ - '--prepend-path=[prepend to the sanitised PATH]: :_files -/' \ - '(-D)-d[skip checking of build dependencies]' \ - '(-d)-D[force checking of build dependencies]' \ - '--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \ - '--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_dget b/.zprezto/modules/completion/external/src/_dget deleted file mode 100644 index 7460210..0000000 --- a/.zprezto/modules/completion/external/src/_dget +++ /dev/null @@ -1,61 +0,0 @@ -#compdef dget -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for dget -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Kris Shannon -# -# ------------------------------------------------------------------------------ - -_dget() { - local context state line expl - local -A opt_args - - _arguments -A "-*" \ - '(--no-conf -h --help)'{-h,--help}'[Show help message]' \ - '(--no-conf -V --version)'{-v,--version}'[Print license, copyright, and version information and exit]' \ - '(--no-conf -b --backup)'{-b,--backup}'[Move files that would be overwritten to ./backup]' \ - '(--no-conf -q --quiet)'{-q,--quiet}'[Suppress wget/curl output]' \ - '(--no-conf -x --extract -d --download-only --build)'{-d,--download-only}'[Do not extract downloaded source]' \ - '(--no-conf -x --extract -d --download-only --build)'{-x,--extract}'[Unpack downloaded source]' \ - '(--no-conf -x --extract -d --download-only --build)--build[Build package with dpkg-buildpackage after download]' \ - '(--no-conf -u --allow-unauthenticated)'{-u,--allow-unauthenticated}'[Make no attempt to verify source package signature]' \ - '(--no-conf)--path[Check this directory in addition to the apt archive]:DIR:_files -/' \ - '(--no-conf --insecure)--insecure[Do not check SSL certificates when downloading]' \ - '(--no-conf --no-cache)--no-cache[Disable server-side HTTP cache]' \ - "(--no-conf)--no-conf[Don't read devscripts config files]" \ - '(-)*:debian package urls:_urls' -} - -_dget "$@" diff --git a/.zprezto/modules/completion/external/src/_dhcpcd b/.zprezto/modules/completion/external/src/_dhcpcd deleted file mode 100644 index 82b821f..0000000 --- a/.zprezto/modules/completion/external/src/_dhcpcd +++ /dev/null @@ -1,53 +0,0 @@ -#compdef dhcpcd -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for dhcpcd 2.3.2. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '1:network interface:_net_interfaces' \ - - release \ - '(-k --release)'{-k,--release}'[causes an existing dhcpcd process running on the interface to release it'\''s lease, deconfigure the interface and then exit]' \ - - exit \ - '(-x --exit)'{-x,--exit}'[causes an existing dhcpcd process running on the interface to exit]' \ - - main \ - '(-d --debug)'{-d,--debug}'[echo debug and informational messages to the console]' \ - '(-h --hostname)'{-h,--hostname}'[specify the hostname sent, or an empty string to stop any hostname from being sent]:hostname:_hosts' \ - '(-i --classid)'{-i,--classid}'[override the DHCP vendor classid field we send]:classid' \ - '(-l --leasetime)'{-l,--leasetime}'[request a specific lease time in seconds]:lease time \(seconds\)' \ - '(-m --metric)'{-m,--metric}'[added routes will use the metric on systems where this is supported]:metric' \ - '(-n --renew)'{-n,--renew}'[notifies an existing dhcpcd process running on the interface to renew it'\''s lease]' \ - '(-p --persistent)'{-p,--persistent}'[don'\''t deconfigure the interface and configuration at exit]' \ - '(-r --request)'{-r,--request}'[skip the broadcast request step and just request an address]:address' \ - '(-s --inform)'{-s,--inform}'[behaves exactly like -r, but sends a DHCP inform instead of a request]:address' \ - '(-t --timeout)'{-t,--timeout}'[timeout after seconds, instead of the default 20]:timeout \(seconds\)' \ - '(-u --userclass)'{-u,--userclass}'[tags the DHCP message with the userclass class]:class' \ - '*'{-H,--sethostname}'[forces dhcpcd to set the hostname as supplied by the DHCP server]' \ - '({-I --clientid)'{-I,--clientid}'[send clientid as a client identifier string]:clientid' \ - '*'{-S,--mscsr}'[request Microsoft specific Classless Static Routes (RFC 3442) code as well]' \ - '(-A --noarp)'{-A,--noarp}'[don'\''t request or claim the address by ARP]' \ - '(-G --nogateway)'{-G,--nogateway}'[don'\''t set any default routes]' \ - '(-L --noipv4ll)'{-L,--noipv4ll}'[don'\''t use IPv4LL at all]' \ - '(-M --nomtu)'{-M,--nomtu}'[don'\''t set the MTU of the interface]' \ - '(-N --nontp)'{-N,--nontp}'[don'\''t touch /etc/ntpd.conf or restart the ntp service]' \ - '(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \ - '(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \ - '(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_diana b/.zprezto/modules/completion/external/src/_diana deleted file mode 100644 index 54bb029..0000000 --- a/.zprezto/modules/completion/external/src/_diana +++ /dev/null @@ -1,150 +0,0 @@ -#compdef diana -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Diana a command line interface to the aria2 daemon. (https://github.com/baskerville/diana). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - -local GIDs PGIDs - -_diana_load_gids() { - GIDs=() - local downloads hashArr fileName - - downloads=$(diana list | cut -d' ' -f1) - - if [ ${#downloads} -eq "0" ]; then - return - fi - - hashArr=("${(f)$(echo "$downloads")}") - for ((i=1; i<=${#hashArr[@]}; i++)); do - fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev); - GIDs+=("$hashArr[i]:$fileName"); - done -} - -_diana_load_paused_gids() { - PGIDs=() - local downloads hashArr fileName - - downloads=$(diana paused | cut -d' ' -f1) - - if [ ${#downloads} -eq "0" ]; then - return - fi - - hashArr=("${(f)$(echo "$downloads")}") - for ((i=1; i<=${#hashArr[@]}; i++)); do - fileName=$(diana files $hashArr[i] | grep "[X]" | rev | cut -d'/' -f1 | rev); - PGIDs+=("$hashArr[i]:$fileName"); - done -} - -_diana_command_arguments() { - case $words[1] in - (remove) - _diana_load_gids - _describe -t output 'Downloads to delete' GIDs - ;; - (info) - _diana_load_gids - _describe -t output 'Downloads to get info' GIDs - ;; - (files) - _diana_load_gids - _describe -t output 'Get files for downloads' GIDs - ;; - (forcerm) - _diana_load_gids - _describe -t output 'Downloads to delete' GIDs - ;; - (pause) - _diana_load_gids - _describe -t output 'Downloads to pause' GIDs - ;; - (resume) - _diana_load_paused_gids - _describe -t output 'Downloads to resume' PGIDs - ;; - (preview) - _diana_load_gids - _describe -t output 'Downloads to preview' GIDs - ;; - esac - - -} - -_diana() { - local -a commands - - commands=( - "list:Output the list of active downloads." - "paused:Output the list of paused downloads." - "stopped:Output the list of stopped downloads." - "info:Output informations regarding the given GIDs." - "files:Output the files owned by the downloads corresponding to the given GIDs." - "errors:Output the list of errors." - "stats:Output download bandwidth statistics." - "add:Download the given items (local or remote URLs to torrents, etc.)." - "remove:Remove the downloads corresponding to the given GIDs." - "forcerm:Forcibly remove the downloads corresponding to the given GIDs." - "pause:Pause the downloads corresponding to the given GIDs." - "resume:Resume the downloads corresponding to the given GIDs." - "preview:Preview all the files from all the downloads corresponding to the given GIDs." - "sleep:Pause all the active downloads." - "wake:Resume all the paused downloads." - "purge:Clear the list of stopped downloads and errors." - "clean:Stop seeding completed downloads." - ) - -_arguments -C \ - '1:cmd:->cmds' \ - '*:: :->args' \ - -case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (*) - _diana_command_arguments - ;; -esac -} - -_diana - diff --git a/.zprezto/modules/completion/external/src/_docpad b/.zprezto/modules/completion/external/src/_docpad deleted file mode 100644 index 21ff533..0000000 --- a/.zprezto/modules/completion/external/src/_docpad +++ /dev/null @@ -1,83 +0,0 @@ -#compdef docpad -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for docpad (https://github.com/bevry/docpad). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Changwoo Park (https://github.com/pismute) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 - -local -a _1st_arguments -_1st_arguments=( - 'run: run [options], does everything - skeleton, generate, watch, server' - 'server: server [options], creates a server for your generated project' - 'skeleton: skeleton [options], will create a new project in your cwd based off an existing skeleton' - 'render: render [path], render the file at and output its results to stdout:path:_files' - 'generate: (re)generates your project' - 'watch: watches your project for changes, and (re)generates whenever a change is made' - 'install: ensure everything is installed correctly' - 'clean: ensure everything is cleaned correctly' - 'info: display the information about your docpad instance' - 'help: output the help' -) - -_arguments -C \ - '(-h --help)'{-h,--help}'[output usage information]'\ - '(-V --version)'{-V,--version}'[output the version number]'\ - '(-o --out)'{-o,--out}'[where to output the rendered directory or files]:path:_files'\ - '(-c --config)'{-c,--config}'[a custom configuration file to load in]:path:_files'\ - '(-e --env)'{-e,--env}'[the environment name to use for this instance, multiple names can be separated with a comma]'\ - '(-d --debug)'{-d,--debug}'+[the level of debug messages you would like to display, if specified defaults to 7, otherwise 6]:number'\ - '(-f --force)'{-f,--force}'[force a re-install of all modules]'\ - '1: :->cmds'\ - '*: :_files'&& ret=0 - -case $state in - cmds) - _describe -t commands 'docpad command' _1st_arguments && ret=0 - ;; - -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_drush b/.zprezto/modules/completion/external/src/_drush deleted file mode 100644 index 8f281db..0000000 --- a/.zprezto/modules/completion/external/src/_drush +++ /dev/null @@ -1,191 +0,0 @@ -#compdef drush -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Drush (http://drush.ws). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Vasily Kraev (https://github.com/vasilykraev) -# -# ------------------------------------------------------------------------------ - -_drush() { - local curcontext='$curcontext' state line cmds ret=1 - integer NORMARG - typeset -A opt_args - - global_args=('--debug' '--verbose' '--yes' '--no' '--simulate' '--root=' '--uri=') - - _arguments -C \ - '(--*)'{--version,--version}'[Show drush version.]' \ - '(- *)'{-d,--debug}'[Display even more information, including internal messages.]' \ - '(- *)'{-v,--verbose}'[Display extra information about the command.]' \ - '(- *)'{-y,--yes}'[Assume "yes" as answer to all prompts.]' \ - '(- *)'{-n,--no}'[Assume "no" as answer to all prompts.]' \ - '(- *)'{-s,--simulate}'[Simulate all relevant actions (dont actually change the system).]' \ - '(- *)'{-r,--root=}'[Drupal root directory to use (default: current directory).]' \ - '(- *)'{-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]' \ - '1: :->cmds' \ - '*::arg:->args' \ - && ret=0 - -case $state in - cmds) - _values 'drush command' \ - '(archive-dump)'{archive-dump,ard,arb}'[Backup your code, files, and database into a single file.]' \ - '(archive-restore)'{archive-restore,arr}'[Expand a site archive into a Drupal web site.]' \ - '(cache-clear)'{cache-clear,cc}'[Clear a specific cache, or all drupal caches.]' \ - '(core-status)'{core-status,status,st}'[Provides a birds-eye view of the current Drupal installation, if any.]' \ - '(core-cron)'{core-cron,cron}'[Run all cron hooks in all active modules for specified site.]' \ - '(core-execute)'{core-execute,exec}'[Execute a shell command. Usually used with a site alias.]' \ - '(drupal-directory)'{drupal-directory,dd}'[Return the filesystem path for modules/themes and other key folders.]' \ - 'help[Print this help message.]' \ - 'image-flush[Flush all derived images for a given style.]' \ - '(site-alias)'{site-alias,sa}'[Print an alias record.]' \ - '(site-install)'{site-install,si}'[Install Drupal along with modules/themes/configuration using the specified install profile.]' \ - 'test-clean[Clean temporary tables and files.]' \ - 'test-run[Run tests. Note that you must use the --uri option.]' \ - '(updatedb)'{updatedb,updb}'[Apply any database updates required (as with running update.php).]' \ - '(variable-delete)'{variable-delete,vdel}'[Delete a variable.]' \ - '(variable-get)'{variable-get,vget}'[Get a list of some or all site variables and values.]' \ - '(variable-set)'{variable-set,vset}'[Set a variable.]' \ - '(pm-list)'{pm-list,pml}'[Show a list of available extensions (modules and themes).]' \ - '(pm-disable)'{pm-disable,dis}'[Disable one or more extensions (modules or themes). Disable dependant extensions as well.]' \ - '(pm-download)'{pm-download,dl}'[Download projects from drupal.org or other sources.]' \ - '(pm-enable)'{pm-enable,en}'[Enable one or more extensions (modules or themes). Enable dependant extensions as well.]' \ - 'pm-uninstall[Uninstall one or more modules.]' \ - 'pm-update[Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).]' \ - '(sql-cli)'{sql-cli,sqlc}'[Open a SQL command-line interface using Drupals credentials.]' \ - 'sql-drop[Drop all tables in a given database.]' \ - 'sql-dump[Exports the Drupal DB as SQL using mysqldump or equivalent.]' \ - '(sql-query)'{sql-query,sqlq}'[Execute a query against the site database.]' \ - 'sql-sync[Copy and import source database to target database. Transfers via rsync.]' \ - '(user-login)'{user-login,uli}'[Display a one time login link for the given user account (defaults to uid 1).]' \ - '(user-password)'{user-password,upwd}'[(Re)Set the password for the user account with the specified name.]' \ - '(devel-reinstall)'{devel-reinstall,dre}'[Disable, Uninstall, and Install a list of projects. (devel)]' \ - '(devel-token)'{devel-token,token}'[List available tokens (devel)]' \ - '(generate-content)'{generate-content,genc}'[Create content. (devel_generate)]' \ - '(generate-menus)'{generate-menus,genm}'[Create menus and menu items. (devel_generate)]' \ - '(generate-terms)'{generate-terms,gent}'[Create terms in specified vocabulary. (devel_generate)]' \ - '(generate-users)'{generate-users,genu}'[Create users. (devel_generate)]' \ - '(generate-vocabs)'{generate-vocabs,genv}'[Create vocabularies. (devel_generate)]' \ - '(features-diff)'{features-diff,fd}'[Show the difference between the default and overridden state of a feature.]' \ - '(features-export)'{features-export,fe}'[Export a feature from your site into a module.]' \ - '(features-list)'{features-list,fl}'[List all the available features for your site.]' \ - '(features-revert)'{features-revert,fr}'[Revert a feature module on your site.]' \ - '(features-revert-all)'{features-revert-all,fra}'[Revert all enabled feature module on your site.]' \ - '(features-update)'{features-update,fu}'[Update a feature module on your site.]' \ - '(features-update-all)'{features-update-all,fua}'[Update all feature modules on your site.]' \ - && ret=0 - ;; - args) - case $line[1] in - (archive-dump|ard) - _arguments \ - '(--description)--description=[Filter out extensions that are provided by drupal core.]' \ - '(--destination)--destination=[The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory.]' \ - '(--no-core)--no-core[Exclude Drupal core, so the backup only contains the site specific stuff.]' \ - '(--pipe)--pipe[Only print the destination of the archive. Useful for scripts that dont pass --destination.]' \ - '(--tar-options)--tar-options=[Options passed thru to the tar command.]' \ - && ret=0 - compadd -a global_args - ;; - (archive-restore|arr) - _arguments \ - '(--db-prefix)--db-prefix[An optional table prefix to use during restore.]' \ - '(--db-su)--db-su[Account to use when creating the new database. Optional.]' \ - '(--db-su-pw)--db-su-pw[Password for the "db-su" account. Optional.]' \ - '(--db-url)--db-url=[A Drupal 6 style database URL indicating the target for database restore. If not provided, the archived settings.php is used. ]' \ - '(--destination)--destination[Specify where the Drupal site should be expanded, including the docroot. Defaults to the current working directory.]' \ - '(--overwrite)--overwrite[Allow drush to overwrite any files in the destination.]' \ - && ret=0 - compadd -a global_args - ;; - (user-password|upwd) - _arguments \ - '--password=:Set the password for the username someuser.' \ - && ret=0 - ;; - (help) - _values 'commands' 'arb' 'archive-dump' 'archive-restore' 'ard' 'arr' 'cache-clear' 'cc' 'core-cron' 'core-execute' 'core-status' 'cron' 'dd' 'devel-reinstall' 'devel-token' 'dis' 'dl' 'dre' 'drupal-directory' 'en' 'exec' 'fd' 'fe' 'features-diff' 'features-export' 'features-list' 'features-revert' 'features-revert-all' 'features-update' 'features-update-all' 'fl' 'fr' 'fra' 'fu' 'fua' 'genc' 'generate-content' 'generate-menus' 'generate-terms' 'generate-users' 'generate-vocabs' 'genm' 'gent' 'genu' 'genv' 'help' 'image-flush' 'pm-disable' 'pm-download' 'pm-enable' 'pm-list' 'pm-uninstall' 'pm-update' 'pml' 'sa' 'si' 'site-alias' 'site-install' 'sql-cli' 'sql-drop' 'sql-dump' 'sql-query' 'sql-sync' 'sqlc' 'sqlq' 'st' 'status' 'test-clean' 'test-run' 'token' 'uli' 'updatedb' 'updb' 'upwd' 'user-login' 'user-password' 'variable-delete' 'variable-get' 'variable-set' 'vdel' 'vget' 'vset' - ;; - (cc) - _values 'options' 'all' 'drush' 'theme-registry' 'menu' 'css-js' 'block' - ;; - (pm-list|pml) - _arguments \ - '(--core)--core[Filter out extensions that are not in drupal core.]' \ - '(--no-core)--no-core[Filter out extensions that are provided by drupal core.]' \ - '(--pipe)--pipe[Returns a whitespace delimited list of the names of the resulting extensions.]' \ - '(--status)--status=-[Filter by extension status. Choices: enabled, disabled and/or "not installed".]:status:(enabled disabled)' \ - '(--type)--type=-[Filter by extensions ension type. Choices: module, theme.]:type:(module theme)' \ - && ret=0 - ;; - (pm-disable|dis) - _modules=( $(drush pml --status=enabled --pipe) ) - if [[ $_modules != "" ]]; then - _values 'enabled modules' $_modules - fi - ;; - (pm-enable|en) - _arguments -C \ - '--resolve-dependencies[Attempt to download any missing dependencies. At the moment, only works when the module name is the same as the project name.]' \ - '--skip[Skip automatic downloading of libraries (c.f. devel).]' && ret=0 - _modules=( $(drush pml --status="disabled,not installed" --pipe) ) - if [[ $_modules != "" ]]; then - _values -s 'not yet enabled modules' $_modules && ret=0 - fi - ;; - (*) - _values 'Global options' \ - {-d,--debug}'[Display even more information, including internal messages.]' \ - {-v,--verbose}'[Display extra information about the command.]' \ - {-y,--yes}'[Assume "yes" as answer to all prompts.]' \ - {-n,--no}'[Assume "no" as answer to all prompts.]' \ - {-s,--simulate}'[Simulate all relevant actions (dont actually change the system).]' \ - {-r,--root=}'[Drupal root directory to use (default: current directory).]' \ - {-l,--uri=}'[URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).]' - ;; - esac - ;; -esac -} - -_drush '$@' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ecdsautil b/.zprezto/modules/completion/external/src/_ecdsautil deleted file mode 100644 index 5d0a6f3..0000000 --- a/.zprezto/modules/completion/external/src/_ecdsautil +++ /dev/null @@ -1,53 +0,0 @@ -#compdef ecdsautil -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ecdsaultils v0.4.0 (https://github.com/tcatm/ecdsautils) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Robinhuett -# -# ------------------------------------------------------------------------------ - -_ecdsautil_args() { - case $words[1] in - (sign) - _arguments '1:somefile:_files' - ;; - (verify) - _arguments '-s[signature]:secret:_files' '-p[publickey]:pubkey:_files' -'-n[signaturecount]:signaturecount:""' ':file:_files' - ;; - esac -} - -_ecdsautil() { - local -a commands - - commands=( - "help:Show help" - "generate-key:generate a new secret on stdout" - "show-key:output public key of secret read from stdin" - "sign:sign file" - "verify:verify signature of file" - ) - - _arguments -C \ - '1:cmd:->cmds' \ - '*:: :->args' \ - - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (*) - _ecdsautil_args - ;; - esac -} - -_ecdsautil "$@" diff --git a/.zprezto/modules/completion/external/src/_emulator b/.zprezto/modules/completion/external/src/_emulator deleted file mode 100644 index 0ca397a..0000000 --- a/.zprezto/modules/completion/external/src/_emulator +++ /dev/null @@ -1,114 +0,0 @@ -#compdef emulator -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for emulator (Android Emulator) 12.0 -# (http://developer.android.com/guide/developing/tools/emulator.html). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -typeset -A opt_args -local context state line curcontext="$curcontext" - -# TODO All image options are contextual to -sysdir value -# TODO All skin options are contextual to -skindir value -# TODO snapshot options are mutually exclusive -# TODO Use '-snapshot-list' output for snapshot names -# TODO Complete -avd with avd names ? -# TODO -logcat: use completer from _adb -# TODO Complete options with device values -# TODO Complete -prop -_arguments \ - '(- : *)-version[display emulator version number]' \ - '(- : *)-help[display help information]' \ - '(- : *)-help-disk-images[about disk images]' \ - '(- : *)-help-keys[supported key bindings]' \ - '(- : *)-help-debug-tags[debug tags for -debug ]' \ - '(- : *)-help-char-devices[character specification]' \ - '(- : *)-help-environment[environment variables]' \ - '(- : *)-help-keyset-file[key bindings configuration file]' \ - '(- : *)-help-virtual-device[virtual device management]' \ - '(- : *)-help-sdk-images[about disk images when using the SDK]' \ - '(- : *)-help-build-images[about disk images when building Android]' \ - '(- : *)-help-all[prints all help content]' \ - '(- : *)-help-'{version,sysdir,system,image,datadir,kernel,ramdisk,initdata,data,partition-size,cache,no-cache,nocache,sdcard,snapstorage,no-snapstorage,snapshot,no-snapshot,no-snapshot-save,no-snapshot-load,snapshot-list,no-snapshot-update-time,wipe-data,avd,skindir,skin,noskin,no-skin,memory,netspeed,netdelay,netfast,trace,show-kernel,shell,no-jni,nojni,logcat,noaudio,no-audio,audio,raw-keys,radio,port,ports,onion,onion-alpha,onion-rotation,scale,dpi-device,http-proxy,timezone,dns-server,cpu-delay,no-boot-anim,no-window,report-console,gps,keyset,shell-serial,tcpdump,bootchart,charmap,prop,shared-net-id,nand-limits,memcheck,qemu,verbose}'[print option-specific help]' \ - '-sysdir[search for system disk images in the directory]: :_files -/' \ - '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \ - '-datadir[write user data into the directory]: :_files -/' \ - '-kernel[use specific emulated kernel]: :_files' \ - '-ramdisk[ramdisk image (default /ramdisk.img]: :_files -g "*.img"' \ - '-initdata[same as '\''-init-data '\'']: :_files' \ - '-data[data image (default /userdata-qemu.img]: :_files -g "*.img"' \ - '-partition-size[system/data partition size]:size (in MBs)' \ - '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \ - '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \ - '-sdcard[SD card image (default /sdcard.img]: :_files -g "*.img"' \ - '(-no-snapstorage)-snapstorage[file that contains all state snapshots (default /snapshots.img)]: :_files -g "*.img"' \ - '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \ - '-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \ - '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \ - '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \ - '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \ - '-snapshot-list[show a list of available snapshots]' \ - '-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \ - '-wipe-data[reset the user data image (copy it from initdata)]' \ - '-avd[use a specific android virtual device]:android virtual device name' \ - '-skindir[search skins in (default /skins)]: :_files -/' \ - '-skin[select a given skin]' \ - '(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \ - '-memory[physical RAM size in MBs]:size (in MBs)' \ - '-netspeed[maximum network download/upload speeds]:speed' \ - '-netdelay[network latency emulation]:delay' \ - '-netfast[disable network shaping]' \ - '-trace[enable code profiling (F9 to start)]:trace name' \ - '-show-kernel[display kernel messages]' \ - '-shell[enable root shell on current terminal]' \ - {-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \ - '-logcat[enable logcat output with given tags]:logcat tags' \ - '(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \ - '(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \ - '-raw-keys[disable Unicode keyboard reverse-mapping]' \ - '-radio[redirect radio modem interface to character device]:device' \ - '-port[TCP port that will be used for the console]:port number' \ - '-ports[TCP ports used for the console and adb bridge]:console port,adb port' \ - '-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \ - '-onion-alpha[specify onion-skin translucency]:percentage' \ - '-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \ - '-scale[scale emulator window]:scale' \ - '-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \ - '-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \ - '-timezone[use this timezone instead of the host'\''s default]:timezone' \ - '-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \ - '-cpu-delay[throttle CPU emulation]:CPU delay' \ - '-no-boot-anim[disable animation for faster boot]' \ - '-no-window[disable graphical window display]' \ - '-report-console[report console port to remote socket]: :_socket' \ - '-gps[redirect NMEA GPS to character device]:device' \ - '-keyset[specify keyset file name]: :_files' \ - '-shell-serial[specific character device for root shell]:device' \ - '-tcpdump[capture network packets to file]: :_files' \ - '-bootchart[enable bootcharting]:timeout' \ - '-charmap[use specific key character map]: :_files' \ - '*-prop[set system property on boot]:name=value' \ - '-shared-net-id[join the shared network, using IP address 10.1.2.]:number' \ - '-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \ - '-memcheck[enable memory access checking]:flags' \ - '-qemu[pass arguments to qemu]:arguments' \ - '-verbose[same as '\''-debug-init'\'']' \ - '*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_envdir b/.zprezto/modules/completion/external/src/_envdir deleted file mode 100644 index 6437993..0000000 --- a/.zprezto/modules/completion/external/src/_envdir +++ /dev/null @@ -1,49 +0,0 @@ -#compdef envdir -# ------------------------------------------------------------------------------ -# Copyright (c) 2016, Github zsh-users (https://github.com/zsh-users) -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for envdir (https://github.com/jezdez/envdir). -# It completes its few options and then a directory and command. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Daniel Hahler -# -# ------------------------------------------------------------------------------ - -args=( - '(-h --help)'{-h+,--help}'[show this help message and exit]' - '(-)'--version'[display version information and exit]' - '(-)1:directory: _path_files -/' - '(-)2:command: _command_names -e' - '*::arguments: _precommand' -) -_arguments -S $args diff --git a/.zprezto/modules/completion/external/src/_exportfs b/.zprezto/modules/completion/external/src/_exportfs deleted file mode 100644 index 1925f07..0000000 --- a/.zprezto/modules/completion/external/src/_exportfs +++ /dev/null @@ -1,51 +0,0 @@ -#compdef exportfs -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for nfs's exportfs - maintain table of exported NFS file systems. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Timofey Titovets -# -# ------------------------------------------------------------------------------ -_exportfs() { - _values -w 'option' \ - '(-i)-a[Export or unexport all directories]' \ - '(-a -r -u)-i[Ignore the /etc/exports file and files under /etc/exports.d directory]' \ - '(-i)-r[Reexport all directories]' \ - '(-i)-u[Unexport one or more directories]' \ - '-f[flush everything out of export table]' \ - '-o[option1,option2.. Specify a list of export options]' \ - '-s[Display the current export list suitable for /etc/exports]' \ - '-v[Be verbose]' -} -_exportfs "$@" diff --git a/.zprezto/modules/completion/external/src/_fab b/.zprezto/modules/completion/external/src/_fab deleted file mode 100644 index 21b3a28..0000000 --- a/.zprezto/modules/completion/external/src/_fab +++ /dev/null @@ -1,109 +0,0 @@ -#compdef fab -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Fabric (http://fabfile.org) -# -# Source: https://github.com/vhbit/fabric-zsh-autocomplete -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Valerii Hiora (https://github.com/vhbit) -# -# ------------------------------------------------------------------------------ - - -local curcontext=$curcontext state line -declare -A opt_args - -declare target_list -target_list=(`fab --shortlist 2>/dev/null`) - -_targets() { - _describe -t commands "fabric targets" target_list -} - -output_levels=( - 'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.' - 'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!' - 'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.' - 'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.' - 'stdout: Local, or remote, stdout, i.e. non-error output from commands.' - 'stderr: Local, or remote, stderr, i.e. error-related output from commands.' - 'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.' -) - -_arguments -w -S -C \ - '(-)'{-h,--help}'[show this help message and exit]: :->noargs' \ - '(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \ - '(-)--list[print list of possible commands and exit]: :->noargs' \ - '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \ - '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \ - '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \ - "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \ - '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \ - '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \ - '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \ - '(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \ - '(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \ - '(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \ - '(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \ - '(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \ - '(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \ - '-i+[path to SSH private key file. May be repeated]: :_files' \ - "(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \ - '(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \ - '(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \ - '(--ssh-config-path=)--ssh-config-path=[ssh config path]: :_files' \ - '(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \ - '(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \ - '*::: :->subcmds' && return 0 - -if [[ CURRENT -ge 1 ]]; then - case $state in - noargs) - _message "nothing to complete";; - levels) - _describe -t commands "output levels" output_levels;; - *) - _targets;; - esac - - return -fi - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ffind b/.zprezto/modules/completion/external/src/_ffind deleted file mode 100644 index c9a05a0..0000000 --- a/.zprezto/modules/completion/external/src/_ffind +++ /dev/null @@ -1,61 +0,0 @@ -#compdef ffind -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ffind (https://github.com/jaimebuelta/ffind). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Sergei Eremenko (https://github.com/SmartFinn) -# -# ------------------------------------------------------------------------------ - -_arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--version[show version number and exit]' \ - '-p[match whole path, not only name of files]' \ - '--nocolor[do not display color]' \ - '--nosymlinks[do not follow symlinks]' \ - '--hidden[do not ignore hidden directories]' \ - '-c[force case sensitive]' \ - '--delete[delete files found]' \ - '--exec[execute the given command with the file found]:command:_command_names' \ - '--module[execute the given module with the file found]:module_name args:' \ - '--command[execute the given python program with the file found]:program:_files' \ - '--ignore-vcs[ignore version control system files and directories]' \ - '-f[experimental fuzzy search]' \ - '--return-results[for testing purposes only]' \ - '1:directory to search:_path_files -/' \ - '*:filepattern:' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_fleetctl b/.zprezto/modules/completion/external/src/_fleetctl deleted file mode 100644 index a754e3c..0000000 --- a/.zprezto/modules/completion/external/src/_fleetctl +++ /dev/null @@ -1,123 +0,0 @@ -#compdef fleetctl -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for fleetctl (https://github.com/coreos/fleet). -# -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Remi Paulmier (https://github.com/shtouff) -# -# ------------------------------------------------------------------------------ - -# fleetctl zsh completion - -local -a _1st_arguments -_1st_arguments=( - 'cat:Output the contents of a submitted unit' - 'destroy:Destroy one or more units in the cluster' - 'fd-forward:Proxy stdin and stdout to a unix domain socket' - 'help:Show a list of commands or help for one command' - 'journal:Print the journal of a unit in the cluster to stdout' - 'list-machines:Enumerate the current hosts in the cluster' - 'list-unit-files:List the units that exist in the cluster.' - 'list-units:List the current state of units in the cluster' - 'load:Schedule one or more units in the cluster, first submitting them if necessary.' - 'ssh:Open interactive shell on a machine in the cluster' - 'start:Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary.' - 'status:Output the status of one or more units in the cluster' - 'stop:Instruct systemd to stop one or more units in the cluster.' - 'submit:Upload one or more units to the cluster without starting them' - 'unload:Unschedule one or more units in the cluster.' - 'version:Print the version and exit' -) - -__task_list () -{ - local expl - declare -a tasks - - tasks=(cat destroy fd-forward help journal list-machines list-unit-files \ - list-units load ssh start status stop submit unload version) - - _wanted tasks expl 'help' compadd $tasks -} - -__unit_list () -{ - _wanted application expl 'command' compadd $(command fleetctl list-units | \ - tail -n +2 | awk '{print $1}') -} - -local expl - -local curcontext="$curcontext" state line -local -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "gem subcommand" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _arguments ':feature:__task_list' - ;; - - (destroy|journal|start|status|stop|unload|cat) - _arguments '*:feature:__unit_list' - ;; - - (load|submit) - _arguments '*:file:_files -g *.service' - ;; - - (ssh) - _arguments '*:host:_hosts' - ;; - - (*) - _arguments '*:file:_files' - ;; - esac - ;; -esac - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_flutter b/.zprezto/modules/completion/external/src/_flutter deleted file mode 100644 index c63a5d9..0000000 --- a/.zprezto/modules/completion/external/src/_flutter +++ /dev/null @@ -1,442 +0,0 @@ -#compdef flutter -# ------------------------------------------------------------------------------ -#MIT License -# -#Copyright (c) 2018 Nickolay Simonov -# -#Permission is hereby granted, free of charge, to any person obtaining a copy -#of this software and associated documentation files (the "Software"), to deal -#in the Software without restriction, including without limitation the rights -#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -#copies of the Software, and to permit persons to whom the Software is -#furnished to do so, subject to the following conditions: -# -#The above copyright notice and this permission notice shall be included in all -#copies or substantial portions of the Software. -# -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -#SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for the Flutter.io sdk's cli tool (https://flutter.io) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Nikolai Simonov (https://github.com/NiKoTron) -# -# ------------------------------------------------------------------------------ -_flutter() { - -typeset -A opt_args -local context state line - -local curcontext="$curcontext" - -local ret=1 - -_arguments -C -A "-*" \ -'(-h --help)'{-h,--help}'[Print this usage information.]' \ -'(-v --verbose)'{-v,--verbose}'[Noisy logging, including all shell commands executed.]' \ -'--quiet[Reduce the amount of output from some commands.]' \ -'(-d --device-id)'{-d,--device-id}'[Target device id or name (prefixes allowed).]' \ -'--version[Reports the version of this tool.]' \ -'--color[Whether to use terminal colors.]' \ -'--no-color[Whether to use terminal colors.]' \ -'--suppress-analytics[Suppress analytics reporting when this command runs.]' \ -'--bug-report[Captures a bug report file to submit to the Flutter team (contains local paths, device identifiers, and log snippets).]' \ -'--packages[Path to your ".packages" file. (required, since the current directory does not contain a ".packages" file)]' \ -'--flutter-root[The root directory of the Flutter repository (uses $FLUTTER_ROOT if set).]' \ -'1: :_root_commands' \ -'*::arg:->args' \ -&& ret=0 - - case "$state" in - (args) - case $words[1] in - (help) - _arguments -C \ - '1: :_root_commands' \ - && ret=0 - ;; - (analyze) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--flutter-repo[Include all the examples and tests from the Flutter repository.]' \ - '--no-flutter-repo[Include all the examples and tests from the Flutter repository.]' \ - '--current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \ - '--no-current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \ - '--watch[Run analysis continuously, watching the filesystem for changes.]' \ - '--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \ - '--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \ - '--write=[Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.]: :_files -/' \ - '--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \ - '--no-congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \ - '--preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \ - '--no-preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \ - && ret=0 - ;; - (build) - _arguments -C \ - '1: :_build_entities' \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (channel) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (clean) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (config) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \ - '--no-analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \ - '--clear-ios-signing-cert[Clear the saved development certificate choice used to sign apps for iOS device deployment.]' \ - '--gradle-dir[The gradle install directory.]' \ - '--android-sdk[The Android SDK directory.]' \ - '--android-studio-dir[The Android Studio install directory.]' \ - && ret=0 - ;; - - (create) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \ - '--no-pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \ - '--offline[When "flutter packages get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all dependencies already available in the pub cache to succeed.]' \ - '--no-offline[When "flutter packages get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all dependencies already available in the pub cache to succeed.]' \ - "--with-driver-test[Also add a fl:_root_commandsutter_driver dependency and generate a sample 'flutter drive' test.]" \ - "--no-with-driver-test[Also add a flutter_driver dependency and generate a sample 'flutter drive' test.]" \ - '(-t= --template=)'{-t=,--template=}'[Specify the type of project to create.]: :_project_templates' \ - "--description[The description to use for your new Flutter project. This string ends up in the pubspec.yaml file. (defaults to 'A new Flutter project.')]" \ - "--org[The organization responsible for your new Flutter project, in reverse domain name notation. This string is used in Java package names and as prefix in the iOS bundle identifier. (defaults to 'com.example')]" \ - '(-i= --ios-language)'{-i=,--ios-language}'[iOS project language]: :_ios_languages' \ - '(-a= --android-language)'{-a=,--android-language}'[Android project language]: :_droid_languages' \ - && ret=0 - ;; - - (daemon) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (devices) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (doctor) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - "--android-licenses[Run the Android SDK manager tool to accept the SDK's licenses.]" \ - && ret=0 - ;; - (drive) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--debug[Build a debug version of your app (default mode).]' \ - '--profile[Build a version of your app specialized for performance profiling.]' \ - '--release[Build a release version of your app.]' \ - '--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \ - '--trace-startup[Start tracing during startup.]' \ - '--route[Which route to load when running the app.]' \ - '--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \ - '(-t= --target=)'{-t=,-target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \ - '--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port. Defaults to the first available port after 8100.]' \ - '--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--no-keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \ - '--keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \ - '--use-existing-app=[Connect to an already running instance via the given observatory URL. If this option is given, the application will not be automatically started, and it will only be stopped if --no-keep-app-running is explicitly set.]' \ - '--driver=[The test file to run on the host (as opposed to the target file to run on the device). By default, this file has the same base name as the target file, but in the "test_driver/" directory instead, and with "_test" inserted just before the extension, so e.g. if the target is "lib/main.dart", the driver will be "test_driver/main_test.dart".]: :_files' \ - '--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \ - '--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \ - && ret=0 - ;; - (format) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (fuchsia_reload) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--debug[Build a debug version of your app (default mode).]' \ - '--profile[Build a version of your app specialized for performance profiling.]' \ - '--release[Build a release version of your app.]' \ - '(-a --address)'{-a,--address}'[Fuchsia device network name or address.]' \ - '(-b --build-dir)'{-b,--build-dir}'[Fuchsia build directory, e.g. out/release-x86-64.]' \ - '(-g --gn-target)'{-g,--gn-target}'[GN target of the application, e.g //path/to/app:app.]' \ - '(-i --isolate-number)'{-i,--isolate-number}'[To reload only one instance, specify the isolate number, e.g. the number in foo$main-###### given by --list.]' \ - '(-l --list)'{-l,--list}'[Lists the running modules.]' \ - '(-l --no-list)'{-l,--no-list}'[Lists the running modules.]' \ - '(-n --name-override)'{-n,--name-override}'[On-device name of the application binary.]' \ - '(-2 --preview-dart-2)'{-2,--preview-dart-2}'[Preview Dart 2.0 functionality.]' \ - '(-2 --no-preview-dart-2)'{-2,--no-preview-dart-2}'[Preview Dart 2.0 functionality.]' \ - '(-t --target)'{-t,--target}'[Target app path / main entry-point file. Relative to --gn-target path, e.g. lib/main.dart. (defaults to "lib/main.dart")]' \ - && ret=0 - ;; - (ide-config) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--overwrite[When performing operations, overwrite existing files.]' \ - '--no-overwrite[When performing operations, overwrite existing files.]' \ - '--update-templates[Update the templates in the template directory from the current configuration files. This is the opposite of what ide-config usually does. Will search the flutter tree for .iml files and copy any missing ones into the template directory. If --overwrite is also specified, it will update any out-of-date files, and remove any deleted files from the template directory.]' \ - && ret=0 - ;; - (inject-plugins) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (install) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (logs) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '(-c --clear)'{-c,--clear}'[Clear log history before reading from logs.]' \ - && ret=0 - ;; - (packages) - _arguments -C \ - '1: :_package_subcomands' \ - '*::pkg-arg:->pkg-args' \ - && ret=0 - case "$state" in - (pkg-args) - case $words[1] in - (get) - _arguments \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--offline[Use cached packages instead of accessing the network.]' \ - && ret=0 - ;; - (pub) - _arguments \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (test) - _arguments \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (upgrade) - _arguments \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--offline[Use cached packages instead of accessing the network.]' \ - && ret=0 - ;; - esac - ;; - esac - ;; - - (precache) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '(-a --all-platforms)]'{-a--all-platforms}'[Precache artifacts for all platforms.]' \ - && ret=0 - ;; - (run) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--debug[Build a debug version of your app (default mode).]' \ - '--profile[Build a version of your app specialized for performance profiling.]' \ - '--release[Build a release version of your app.]' \ - '--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \ - '--trace-startup[Start tracing during startup.]' \ - '--route[Which route to load when running the app.]' \ - '--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \ - '(-t= --target=)'{-t=,--target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \ - '--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port.Defaults to the first available port after 8100.]' \ - '--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--full-restart[Stop any currently running application process before running the app. (defaults to on)]' \ - '--no-full-restart[Stop any currently running application process before running the app. (defaults to on)]' \ - '--start-paused[Start in a paused mode and wait for a debugger to connect.]' \ - '--enable-software-rendering[Enable rendering using the Skia software backend. This is useful when testing Flutter on emulators. By default, Flutter will attempt to either use OpenGL or Vulkan and fall back to software when neither is available.]' \ - '--skia-deterministic-rendering When combined with --enable-software-rendering, provides 100% deterministic Skia rendering.]' \ - '--trace-skia[Enable tracing of Skia code. This is useful when debugging the GPU thread. By default, Flutter will not log skia code.]' \ - '--use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \ - '--no-use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \ - '--build[If necessary, build the app before running. (defaults to on)]' \ - '--no-build[If necessary, build the app before running. (defaults to on)]' \ - '--hot[Run with support for hot reloading. (defaults to on)]' \ - '--no-hot[Run with support for hot reloading. (defaults to on)]' \ - '--pid-file[Specify a file to write the process id to. You can send SIGUSR1 to trigger a hot reload and SIGUSR2 to trigger a full restart.]' \ - && ret=0 - ;; - (screenshot) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '(-o --out)'{-o,--out}'[Location to write the screenshot.]: :_files' \ - '--skia=[Retrieve the last frame rendered by a Flutter app as a Skia picture using the specified observatory port. To find the observatory port number, use "flutter run --verbose" and look for "Forwarded host port ... for Observatory" in the output.]' \ - && ret=0 - ;; - (stop) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (test) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ - '--name=[A regular expression matching substrings of the names of tests to run.]' \ - '--plain-name=[A plain-text substring of the names of tests to run.]' \ - '--start-paused[Start in a paused mode and wait for a debugger to connect. You must specify a single test file to run, explicitly. Instructions for connecting with a debugger and printed to the console once the test has started.]' \ - '--coverage[Whether to collect coverage information.]' \ - '--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info". Implies collecting coverage data. (Requires lcov)]' \ - '--coverage-path[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]' \ - && ret=0 - (trace) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--start[Start tracing.]' \ - '--stop[Stop tracing.]' \ - '--out[Specify the path of the saved trace file.]' \ - '(-d --duration)'{-d,--duration}'[Duration in seconds to trace. (defaults to "10")]' \ - '--debug-port[Local port where the observatory is listening. (defaults to "8100")]' \ - && ret=0 - ;; - (update-packages) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - '--force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \ - '--no-force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \ - '--paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \ - '--no-paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \ - '--from[Used with flag --dependency-path. Specifies the package to begin searching dependency path from.]' \ - '--to[Used with flag --dependency-path. Specifies the package that the sought after dependency path leads to.]' \ - '--transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \ - '--no-transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \ - '--verify-only[verifies the package checksum without changing or updating deps]' \ - '--no-verify-only[verifies the package checksum without changing or updating deps]' \ - && ret=0 - ;; - (upgrade) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - - esac - ;; - esac - - - return ret - - } - - -(( $+functions[root_commands] )) || -_root_commands() { - local commands; - commands=( - "analyze:Analyze the project's Dart code." - 'build:Flutter build commands.' - 'channel:List or switch flutter channels.' - 'clean:Delete the build/ directory.' - 'config:Configure Flutter settings.' - 'create:Create a new Flutter project.' - 'daemon:Run a persistent, JSON-RPC based server to communicate with devices.' - 'devices:List all connected devices.' - 'doctor:Show information about the installed tooling.' - 'drive:Runs Flutter Driver tests for the current project.' - 'format:Format one or more dart files.' - 'fuchsia_reload:Hot reload on Fuchsia.' - 'help:Display help information for flutter.' - 'ide-config:Configure the IDE for use in the Flutter tree.' - 'inject-plugins:Re-generates the GeneratedPluginRegistrants.' - 'install:Install a Flutter app on an attached device.' - 'logs:Show log output for running Flutter apps.' - 'packages:Commands for managing Flutter packages.' - "precache:Populates the Flutter tool's cache of binary artifacts." - 'run:Run your Flutter app on an attached device.' - 'screenshot:Take a screenshot from a connected device.' - 'stop:Stop your Flutter app on an attached device.' - 'test:Run Flutter unit tests for the current project.' - 'trace:Start and stop tracing for a running Flutter app.' - 'update-packages:Update the packages inside the Flutter repo.' - 'upgrade:Upgrade your copy of Flutter.') - _describe -t commands 'command' commands "$@" -} - -(( $+functions[_build_entities] )) || -_build_entities() { - local entities; - entities=("aot:Build an ahead-of-time compiled snapshot of your app's Dart code." - "apk:Build an Android APK file from your app." - "flx:Build a Flutter FLX file from your app." - "ios:Build an iOS application bundle (Mac OS X host only).") - _describe -t entities 'entity' entities "$@" -} - -(( $+functions[_project_templates] )) || -_project_templates() { - local templates; - templates=("app:(default) Generate a Flutter application." - "package:Generate a shareable Flutter project containing modular Dart code." - "plugin:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both.") - _describe -t templates 'template' templates "$@" -} - -(( $+functions[_ios_languages] )) || -_ios_languages() { - local languages; - languages=("objc:(default) Objective-C." - "swift:Swift.") - _describe -t languages 'language' languages "$@" -} - -(( $+functions[_droid_languages] )) || -_droid_languages() { - local languages; - languages=("java:(default) Java." - "kotlin:Kotlin.") - _describe -t languages 'language' languages "$@" -} - -(( $+functions[_target_platforms] )) || -_target_platforms() { - local platforms; - platforms=("default:(default) default." - "android-arm:android-arm." - "android-arm64:android-arm64.") - _describe -t platforms 'platform' platforms "$@" -} - - -(( $+functions[_package_subcomands] )) || -_package_subcomands() { - local subcommands; - subcommands=("get:Get packages in a Flutter project." - "pub:Pass the remaining arguments to Dart's 'pub' tool." - "test:Run the 'test' package." - "upgrade:Upgrade packages in a Flutter project.") - _describe -t subcommands 'subcommand' subcommands "$@" -} - -_flutter "$@" diff --git a/.zprezto/modules/completion/external/src/_force b/.zprezto/modules/completion/external/src/_force deleted file mode 100644 index 327d96a..0000000 --- a/.zprezto/modules/completion/external/src/_force +++ /dev/null @@ -1,221 +0,0 @@ -#compdef force -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for force CLI 0.22.39 (https://github.com/heroku/force). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Peter Limbach -# -# ------------------------------------------------------------------------------ - -local -a _1st_arguments -_1st_arguments=( - 'apiversion:Display/Set current API version' - 'login:force login [-i=] [<-u=username> <-p=password>]' - 'logout:Log out from force.com' - 'logins:List force.com logins used' - 'active:Show or set the active force.com account' - 'whoami:Show information about the active account' - 'describe:Describe the object or list of available objects' - 'sobject:Manage standard & custom objects' - 'bigobject:Manage big objects' - 'field:Manage sobject fields' - 'record:Create, modify, or view records' - 'bulk:Load csv file use Bulk API' - 'fetch:Export specified artifact(s) to a local directory' - 'import:Import metadata from a local directory' - 'export:Export metadata to a local directory' - 'query:Execute a SOQL statement' - 'apex:Execute anonymous Apex code' - 'trace:Manage trace flags' - 'log:Fetch debug logs' - 'eventlogfile:List and fetch event log file' - 'oauth:Manage ConnectedApp credentials' - 'test:Run apex tests' - 'security:Displays the OLS and FLS for a give SObject' - 'version:Display current version' - 'update:Update to the latest version' - 'push:Deploy artifact from a local directory' - 'aura:force aura push -f ' - 'password:See password status or reset password' - 'notify:Should notifications be used' - 'limits:Display current limits' - 'help:Show this help' - 'datapipe:Manage DataPipes' -) - -local -a _field_arguments - - -_apex_types=( - 'string' 'textarea' 'longtextarea' 'richtextarea' - 'boolean' 'double' 'number' 'autonumber' 'picklist' - 'lookup' 'masterdetail' 'geolocation' -) - -_field_arguments=( - 'list' 'create' 'delete' 'type' -) - -_sobject_arguments=( - 'list' 'create' 'delete' -) - -_bulk_arguments=( - 'insert:upload a .csv file to insert records' - 'update:upload a .csv file to update records' - 'query:run a SOQL statement to generate a .csv file on the server' - 'retrieve:retrieve a query generated .csv file from the server' - 'job:get information about a job based on job Id' - 'batch:get detailed information about a batch within a job based on job Id and batch Id' - 'batches:get a list of batches associated with a job based on job Id' -) - -__sobject_list() { - _wanted application expl 'sobjects' compadd $(force sobject list) -} - -__log_list() { - _wanted application expl 'logfiles' compadd $(force log | grep -o -e '07\w*') -} - -__login_user_list() { - # remove active user string, remove colors & print the username - _wanted application expl 'usernames' compadd $(force logins | sed 's/(active)//' | sed 's,$(printf "\033"")\\[[0-9;]*[a-zA-Z],,g' | awk '{print $1}') -} - -__login_instance_list() { - _wanted application expl 'instances' compadd $(force logins | awk '{print $3}' | sed 's/https:\/\///') -} - -__sobject_command () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "sobject commands" _sobject_arguments - return - ;; - - (options) - case $line[1] in - (delete) - _arguments ':feature:__sobject_list' - ;; - esac - ;; - esac -} - -__field_command () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "field commands" _field_arguments - return - ;; - - (options) - case $line[1] in - (list) - _arguments ':feature:__sobject_list' - ;; - (type) - _describe -t commands "apex types" _apex_types - return - ;; - esac - ;; - esac -} - -local expl -local -a active logins - -local curcontext="$curcontext" state line -local -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "force commands" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _describe -t commands "command help" _1st_arguments - return - ;; - - (login) - _arguments \ - '-u[salesforce user]:userame:__login_user_list' \ - '-i[salesforce instance]:instance:__login_instance_list' \ - '-p[salesforce password]' - ;; - (bulk) - _arguments \ - '-c[bulk command]:_bulk_arguments' - ;; - - (log) - _arguments ':feature:__log_list' - ;; - - (field) - __field_command - ;; - - (sobject) - __sobject_command - ;; - - esac - ;; -esac \ No newline at end of file diff --git a/.zprezto/modules/completion/external/src/_gas b/.zprezto/modules/completion/external/src/_gas deleted file mode 100644 index c173507..0000000 --- a/.zprezto/modules/completion/external/src/_gas +++ /dev/null @@ -1,69 +0,0 @@ -#compdef gas -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for gas (https://github.com/walle/gas). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Fredrik Wallgren -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '(-h|--help)'{-h,--help}'[show help information]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case "$state" in - (cmds) - cmds=( - "version:Prints Gas's version" - "use:Uses author" - "show:Shows your current user" - "list:Lists your authors" - "import:Imports current user to gasconfig" - "help:Describe available tasks or one specific task" - "delete:Deletes author" - "add:Adds author to gasconfig" - ) - _describe -t commands 'gas command' cmds && ret=0 - ;; - (args) - case "$line[1]" in - (use|delete) - _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0 - ;; - esac - ;; -esac - -return ret - diff --git a/.zprezto/modules/completion/external/src/_geany b/.zprezto/modules/completion/external/src/_geany deleted file mode 100644 index 79278b8..0000000 --- a/.zprezto/modules/completion/external/src/_geany +++ /dev/null @@ -1,48 +0,0 @@ -#compdef geany -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Geany (http://www.geany.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '(- 1 *)'{-h,--help}'[Show help options]' \ - '(- 1 *)--help-all[Show all help options]' \ - '(- 1 *)--help-gtk[Show GTK+ Options]' \ - '(- 1 *)'{-V,--version}'[Show version and exit]' \ - '(--column)--column[Set initial column number for the first opened file (useful in conjunction with --line)]:column number' \ - '(-c --config)'{-c,--config}'[Use an alternate configuration directory]:configuration file:_files' \ - '(--ft-names)--ft-names[Print internal filetype names]' \ - '(-g --generate-tags)'{-g,--generate-tags}'[Generate global tags file (see documentation)]' \ - '(-P --no-preprocessing)'{-P,--no-preprocessing}'[Don'\''t preprocess C/C++ files when generating tags]' \ - '(-i --new-instance)'{-i,--new-instance}'[Don'\''t open files in a running instance, force opening a new instance]' \ - '(--socket-file)--socket-file[Use this socket filename for communication with a running Geany instance]:socket file:_files' \ - '(--list-documents)--list-documents[Return a list of open documents in a running Geany instance]' \ - '(-l --line)'{-l,--line}'[Set initial line number for the first opened file]:line number' \ - '(-m --no-msgwin)'{-m,--no-msgwin}'[Don'\''t show message window at startup]' \ - '(-n --no-ctags)'{-n,--no-ctags}'[Don'\''t load auto completion data (see documentation)]' \ - '(-p --no-plugins)'{-p,--no-plugins}'[Don'\''t load plugins]' \ - '(--print-prefix)--print-prefix[Print Geany'\''s installation prefix]' \ - '(-s --no-session)'{-s,--no-session}'[Don'\''t load the previous session'\''s files]' \ - '(-t --no-terminal)'{-t,--no-terminal}'[Don'\''t load terminal support]' \ - '(--vte-lib)--vte-lib[Filename of libvte.so]:libvte.so filename:_files -g "*.so"' \ - '(-v --verbose)'{-v,--verbose}'[Be verbose]' \ - '(--display)--display[X display to use]:X display:_x_display' \ - '*: :_files' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ghc b/.zprezto/modules/completion/external/src/_ghc deleted file mode 100644 index 2709406..0000000 --- a/.zprezto/modules/completion/external/src/_ghc +++ /dev/null @@ -1,618 +0,0 @@ -#compdef ghc ghci ghc-pkg -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ghc (http://www.haskell.org/ghc/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Gérard Milmeister -# * Philip Dexter -# -# ------------------------------------------------------------------------------ - -local state -local WORDS - -# -# ghci -# - -_ghc_ghci () { _ghc_compiler } - -# -# ghc -# - -_ghc_compiler () -{ - _arguments \ - "-no-hs-main[Don't assume this program contains main]" \ - "-no-user-package-conf[Don't load the user's package config file]" \ - '(- *)'{--help,-\?}'[Show help information]' \ - '*-I-[Add directory to path for #include files]:directory:_files -/' \ - '*-X-[Language flags]:flag:_ghc_language_flags' \ - '*-d-[Debugging options]:flag:_ghc_debugging_options' \ - '*-f-[Compiler options]:flag:_ghc_compiler_flags' \ - '*-hide-package[Hide package]:Package:_ghc_pkg_list_packages' \ - '*-trust[Expose package and set it to be trusted]:Package:_ghc_pkg_list_packages' \ - '*-distrust[Expose package and set it to be distrusted]:Package:_ghc_pkg_list_packages' \ - '*-distrust-all[Distrust all packages by default]' \ - '*-i-[Add directory to import path]:directory:->ghc_include_directory' \ - '*-package[Expose package]:Package:_ghc_pkg_list_packages' \ - '*:file:_files -g \*.\{lhs,hs,hc,c,s\}' \ - '--info[Display information about the compiler]' \ - '--show-options[Display the supported command line options]' \ - '--interactive[Interactive mode]' \ - '--make[Compile and link a complete Haskell program]:file:_files -g "*.{lhs,hs,hc,c,s}"' \ - '--numeric-version[Display GHC version (numeric only)]' \ - '--print-libdir[Display GHC library directory]' \ - '--show-iface[Show interface]:file:_files -g "*.hi"' \ - {--supported-languages,--supported-extensions}'[Display the supported language extensions]' \ - '-C[Stop after generating C]' \ - '-E[Stop after generating preprocessed, de-litted Haskell]' \ - '-H[Minimum heap size]:size:' \ - '-M[Output Makefile rules]' \ - '-O-[Enable optimization]:level:(0 1 2)' \ - '-Rghc-timing[Summarise timing stats for GHC]' \ - '-S[Stop after generating assembler]' \ - '-V[Display GHC version]' \ - '-W[Enable normal warnings]' \ - '-Wall[Enable almost all warnings]' \ - '-Werror[Make warnings fatal]' \ - '-Wwarn[Make warnings non-fatal]' \ - '-c[Stop after generating object files]' \ - '-eventlog[Enable runtime event tracing]' \ - '-debug[Use the debugging runtime]' \ - "-dylib-install-name[On Darwin/macOS only, set the install name]" \ - '-dynamic[Use dynamic Haskell libraries]' \ - '-dynamic-too[Build dynamic object files as well as static object files during compilation]' \ - '-dynosuf[Set the output suffix for dynamic object files]' \ - '-dynload[Select one of a number of modes for finding shared libraries at runtime]' \ - '--mk-dll[DLL-creation mode (Windows only)]' \ - '-framework-path[On Darwin/macOS/iOS only, add dir to the list of directories searched for frameworks]' \ - '-shared[Generate a shared library (as opposed to an executable)]' \ - '-staticlib[On Darwin/macOS/iOS only, generate a standalone static library (as opposed to an executable)]' \ - '-e[Evaluate expression]' \ - '-hide-all-packages[Hide all packages by default]' \ - '-hpcdir[Directory to deposit .mix files during compilation (default is .hpc)]' \ - '-n[Do a dry run]' \ - '-o[Set output filename]:file:_files' \ - '-outputdir[Set output directory]:directory:_files -/' \ - '-package-name[Compile to be part of package]' \ - '-hide-all-packages[Hide all packages by default]' \ - '-package-db[Add file to the package db stack]:file:_files' \ - '-clear-package-db[Clear the package db stack]' \ - '-msse2[(x86 only) Use SSE2 for floating point]' \ - '-monly-\[432\]-regs[(x86 only) give some registers back to the C compiler]' \ - '-no-global-package-db[Remove the global package db from the stack]' \ - '-global-package-db[Add the global package db to the stack]' \ - "-no-user-package-db[Remove the user's package db from the stack]" \ - "-user-package-db[Add the user's package db to the stack]" \ - "-no-auto-link-packages[Don't automatically link in the base and rts packages]" \ - '-optL[pass option to the literate pre-processor]' \ - '-optP[pass option to cpp (with -cpp only)]' \ - '-optF[pass option to the custom pre-processor]' \ - '-optc[pass option to the C compiler]' \ - '-optlo[pass option to the LLVM optimiser]' \ - '-optlc[pass option to the LLVM compiler]' \ - '-optm[pass option to the mangler]' \ - '-opta[pass option to the assembler]' \ - '-optl[pass option to the linker]' \ - '-optdll[pass option to the DLL generator]' \ - '-optwindres[pass option to windres.]' \ - '-prof[Turn on profiling]' \ - '-pgmL[Use cmd as the literate pre-processor]' \ - '-pgmP[Use cmd as the C pre-processor (with -cpp only)]' \ - '-pgmc[Use cmd as the C compiler]' \ - '-pgms[Use cmd as the splitter]' \ - '-pgml[Use cmd as the linker]' \ - '-pgmdll[Use cmd as the DLL generator]' \ - '-pgmF[Use cmd as the pre-proecessor (with -F only)]' \ - '-pgmwindres[Use cmd as the program for embedding manifests on Windows]' \ - '-pgmlibtool[Use cmd as the command for libtool (with -staticlib only)]' \ - '-rtsopts[Only a minimum of safe options can be given to RTS]' \ - '-rtsopts=[Control whether the RTS behavior can be tweaked via command-line flags and the GHCRTS environment varaible (none, som, or all)]' \ - '-with-rtsopts=[Set the default RTS options]' \ - '-threaded[Use the threaded runtime]' \ - '-ticky[Turn on ticky-ticky profiling]' \ - '-tmpdir[Set the directory for temporary files]:directory:_files -/' \ - '-v-[Control verbosity]:level:(0 1 2 3 4 5)' \ - '-w[Disable all warnings]' \ - '-x[Override default behaviour for source files]:suffix:(hs lhs hc c s o hspp)' \ - '-hcsuf[Set the suffix to use for intermediate]:suffix:' \ - '-hidir[Set directory for interface files]:directory:_files -/' \ - '-hisuf[Set the suffix to use for interface files]:suffix:' \ - '-odir[Set directory for object files]:directory:_files -/' \ - '-ohi[Set the filename in which to put the interface]:filename:_files -/' \ - '-osuf[Set the output file suffix]:suffix:' \ - '-stubdir[Redirect FFi stub files]:directory:_files -/' \ - '-dumpdir[Redirect dump files]:directory:_files -/' \ - '-outputdir[Set output directory]:directory:_files -/' \ - '-keep-hc-files[Retain intermediate .hc files]' \ - '-keep-llvm-files[Retain intermediate LLVM .ll files]' \ - '-keep-s-files[Retain intermediate .s files]' \ - '-keep-raw-s-files[Retain intermediate .raw_s files]' \ - '-keep-tmp-files[Retain all intermediate temporary files]' \ - '-static[Use static Haskell libraries]' \ - '-split-objs[Split objects (for libraries)]' \ - '-no-link[Omit linking]' \ - '-main-is[Set main module and function]:function:' \ - '*-L-[Add dir to the list of directories searched for libraries]:directory:_files -/' \ - '*-l-[Link in library]:library:->library' - - [[ -n "$state" ]] && - case "$state" in - ghc_include_directory) _ghc_include_directory ;; - library) - _wanted libraries expl library \ - compadd - \ - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) \ - && ret=0 - esac -} - - -_ghc_include_directory () -{ - compset -P '*:' - compset -S ':*' - _path_files -r': ' -/ -} - -_ghc_compiler_flags () -{ - local _ghc_compiler_flags_list - _ghc_compiler_flags_list=( - 'ghci-hist-size:Set the number of entries GHCi keeps for \:history' - 'print-explicit-foralls:Print explicit forall quantification in types' - 'print-explicit-kinds:Print explicit kind foralls and kind arguments in types' - {no-,}'break-on-error:Break on uncaught exceptions and errors' - {no-,}'break-on-exception:Break on any exception thrown' - {no-,}'case-merge:Enable case-merging' - {no-,}'defer-type-errors:Defer as many type errors as possible until runtime' - {no-,}'dicts-strict:Make dictionaries strict' - {no-,}'do-eta-reduction:Enable eta-reduction' - {no-,}'do-lambda-eta-expansion:Enable lambda eta-reduction' - 'eager-blackholing:Turn on eager blackholing' - {no-,}'enable-rewrite-rules:Switch on all rewrite rules (including rules generated by automatic specialisation of overloaded functions)' - 'error-spans:Output full span in error messages' - 'ext-core:Generate .hcr external Core file' - 'force-recomp:Turn off recompilation checking' - {no-,}'float-in:Turn on the float-in transformation' - {no-,}'full-laziness:Turn on full laziness (floating bindings outwards)' - {no-,}'fun-to-thunk:Allow worker-wrapper to convert a function closure into a thunk if the function does not use any of its arguments. Off by default.' - {no-,}'glasgow-exts:Enable most language extensions' - {no-,}'helpful-errors:Make suggestions for mis-spelled names' - 'history-size:Set simplification history size' - {no-,}'ignore-asserts:Ignore assertions in the source' - {no-,}'ignore-interface-pragmas:Ignore pragmas in interface files' - {no-,}'loopification:Turn saturated self-recursive tail-calls into local jumps in the generated assembly' - {no-,}'late-dmd-anal:Run demand analysis again, at the end of the simplification pipeline' - {no-,}'liberate-case:Turn on the liberate-case transformation' - 'liberate-case-threshold=:Set the size threshold for the liberate-case transformation (default 200)' - 'no-liberate-case-threshold:Set the size threshold for the liberate-case transformation (default 200)' - {no-,}'max-relevant-bindings=N:Set the maximum number of bindings to display in type error messages (default 6).' - 'max-worker-args=:If a worker has that many arguments, none will be unpacked anymore (default 10)' - 'max-simplifier-iterations=:Set the max iterations for the simplifier' - 'no-asm-mangling:Turn off assembly mangling' - 'no-black-holing:Turn off black holing' - "no-hi-version-check:Don't complain about .hi file mismatches" - 'no-implicit-import-qualified:Turn off implicit qualified import of everything in GHCi' - 'no-print-bind-contents:Turn off printing of binding contents in GHCi' - 'no-opt-coercion:Turn off the coercion optimiser' - 'no-ghci-history:Do not use the load/store the GHCi command history from/to ghci_history' - 'no-ghci-sandbox:Turn off the GHCi sandbox. Means computations are run in the main thread, rather than a forked thread' - 'no-gen-manifest:Do not generate a manifest file (Windows only)' - 'no-embed-manifest:Do not embed the manifest in the executable (Windows only)' - "no-shared-implib:Don't generate an import library for a DLL (Windows only)" - 'no-pre-inlining:Turn off pre-inlining' - 'no-state-hack:Turn off the "state hack" whereby any lambda with a real-world state token as argument is considered to be single-entry' - {no-,}'print-bind-result:Turn on printing of binding results in GHCi' - {no-,}'print-evld-with-show:Enable usage of Show instances in \:print' - 'unregisterised:Unregisterised compilation' - 'asm:Use the native code generator' - 'via-C:Compile via C' - 'no-code:Omit code generation' - 'byte-code:Generate byte-code' - 'object-code:Generate object code' - 'hpc:Turn on Haskell program coverage instrumentation' - 'PIC:Generate position-independent code' - 'plugin=:Load a plugin exported by a given module' - 'plugin-opt=:Give arguments to a plugin module' - 'context-stack=:Set the limit for context reduction (default is 20)' - 'type-function-depth=:Set the limit for type function reductions (default is 200)' - 'force-recomp:Turn off recompilation checking' - {no-,}"omit-interface-pragmas:Don't generate interface pragmas" - 'package-trust:Enable Safe Haskell trusted package requirement for trustworthy modules' - {no-,}'pedantic-bottoms:Make GHC be more precise about its treatment of bottom' - {no-,}'disambiguate-record-fields:Enable record field disambiguation' - {no-,}'irrefutable-tuples:Make tuple pattern matching irrefutable' - {no-,}'vectorise:Enable vectorisation of nested data parallelism' - {no-,}'avoid-vect:Enable vectorisation avoidance' - {no-,}'excess-precision:Enable excess intermediate precision' - {no-,}'prof-auto:Auto-add SCCs to all bindings not marked INLINE' - {no-,}'prof-auto-top:Auto-add SCCs to all top-level bindings not marked INLINE' - {no-,}'prof-auto-exported:Auto-add SCCs to all exported bindings not marked INLINE' - {no-,}'prof-cafs:Auto-add SCCs to all CAFs' - {no-,}'prof-count-entries:Collect entry counts' - 'simplifier-phases:Set the number of phases for the simplifier (default 2)' - 'simpl-tick-factor=:Set the percentage factor for simplifier ticks (default 100)' - {no-,}'spec-constr:Turn on the SpecConstr transformation' - {no-,}'spec-constr-threshold=:Set the size threshold for the SpecConstr transformation (default 200)' - {no-,}'spec-constr-count=:Set the maximum number of specialisations that will be created for any one function by the SpecConstr transformation (default 3)' - 'strictness=before=:Run an additional strictness analysis before a simplifier phase' - {no-,}'static-argument-transformation:Turn on the static argument transformation' - {no-,}'unbox-strict-fields:Flatten strict constructor fields' - {no-,}'unbox-small-strict-fields:Flatten strict constructor fields with a pointer-sized representation' - {no-,}'unfolding-creation-threshold:Tweak unfolding settings' - {no-,}'unfolding-fun-discount:Tweak unfolding settings' - {no-,}'unfolding-keeness-factor:Tweak unfolding settings' - {no-,}'unfolding-use-threshold:Tweak unfolding settings' - {no-,}'warn-warnings-deprecations:Warn about uses of functions & types that have warnings or deprecated pragmas' - {no-,}'warn-deprecated-flags:Warn about uses of commandline flags that are deprecated' - {no-,}'warn-duplicate-exports:Warn when an entity is exported multiple times' - {no-,}'warn-hi-shadowing:Warn when a .hi file in the current directory shadows a library' - {no-,}'warn-implicit-prelude:Warn when the Prelude is implicitly imported' - {no-,}'warn-incomplete-patterns:Warn when a pattern match could fail' - {no-,}'warn-incomplete-record-updates:Warn when a record update could fail' - {no-,}'warn-missing-fields:Warn when fields of a record are uninitialised' - {no-,}'warn-missing-methods:Warn when class methods are undefined' - {no-,}'warn-missing-signatures:Warn about top-level functions without signatures' - {no-,}'warn-duplicate-constraints:Warn when a constraint appears duplicated in a type signature' - {no-,}'warn-identities:Warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted)' - {no-,}'warn-incomplete-uni-patterns:Warn when a pattern match in a lambda expression or pattern binding could fail' - {no-,}'warn-lazy-unlifted-bindings:(Deprecated) warn when a pattern binding looks lazy but must be strict' - {no-,}'warn-missing-import-lists:Warn when an import declaration does not explicitly list all the names brought into scope' - {no-,}'warn-missing-local-sigs:Warn about polymorphic local bindings without signatures' - {no-,}'warn-monomorphism-restriction:Warn when the Monomorphism Restriction is applied' - {no-,}'warn-name-shadowing:Warn when names are shadowed' - {warn-orphans,warn-auto-orphans}':Warn when the module contains orphan instance declarations or rewrite rules' - {no-,}'warn-overlapping-patterns:Warn about overlapping patterns' - {no-,}'warn-tabs:Warn if there are tabs in the source file' - {no-,}'warn-type-defaults:Warn when defaulting happens' - {no-,}"warn-unrecognised-pragmas:Warn about uses of pragmas that GHC doesn't recognise" - {no-,}'warn-unused-binds:Warn about bindings that are unused' - {no-,}'warn-unused-imports:Warn about unnecessary imports' - {no-,}"warn-unused-matches:Warn about variables in patterns that aren't used" - {no-,}'warn-unused-do-bind:Warn about do bindings that appear to throw away values of types other than ()' - {no-,}'warn-wrong-do-bind:Warn about do bindings that appear to throw away monadic values that you should have bound instead' - {no-,}'warn-unsafe:Warn if the module being compiled is regarded to be unsafe' - {no-,}'warn-safe:Warn if the module being compiled is regarded to be safe' - {no-,}'warn-amp:Warn on definitions conflicting with the Applicative-Monad Proposal (AMP)' - {no-,}'warn-typed-holes:Enable holes in expressions' - ) - _describe -t flags 'ghc' _ghc_compiler_flags_list || compadd "$@" -} - -_ghc_debugging_options () -{ - local _ghc_debugging_options_list - _ghc_debugging_options_list=( - "dump-hi:Dump the new interface to stdout" - "dump-hi-diffs:Show the differences vs. the old interface" - "dump-minimal-imports:Dump a minimal set of imports" - "core-lint:Turn on internal sanity checking" - "dump-asm:Dump assembly" - "dump-bcos:Dump interpreter byte code" - "dump-cmm:Dump C-- output" - "dump-cpranal:Dump output from CPR analysis" - "dump-cse:Dump CSE output" - "dump-deriv:Dump deriving output" - "dump-ds:Dump desugarer output" - 'dump-flatC:Dump "flat" C' - "dump-foreign:Dump foreign export stubs" - "dump-hpc:Dump after instrumentation for program coverage" - "dump-inlinings:Dump inlining info" - "dump-occur-anal:Dump occurrence analysis output" - "dump-opt-cmm:Dump the results of C-- to C-- optimising passes" - "dump-parsed:Dump parse tree" - "dump-prep:Dump prepared core" - "dump-rn:Dump renamer output" - "dump-rules:Dump rules" - "dump-simpl:Dump final simplifier output" - "dump-simpl-phases:Dump output from each simplifier phase" - "dump-simpl-iterations:Dump output from each simplifier iteration" - "dump-spec:Dump specialiser output" - "dump-splices:Dump TH spliced expressions" - "dump-stg:Dump final STG" - "dump-stranal:Dump strictness analyser output" - "dump-tc:Dump typechecker output" - "dump-types:Dump type signatures" - "dump-worker-wrapper:Dump worker-wrapper output" - "dump-if-trace:Trace interface files" - "dump-tc-trace:Trace typechecker" - "dump-to-file:Dump to files instead of stdout" - "dump-core-stats:Print a one-line summary of the size of the Core program at the end of the optimisation pipeline" - "dump-llvm:Dump LLVM intermediate code" - "dump-rule-firings:Dump rule firing info" - "dump-rule-rewrites:Dump detailed rule firing info" - "dump-vect:Dump vectoriser input and output" - "dump-strsigs:Dump strictness signatures" - "dump-vt-trace:Trace vectoriser" - "dump-rn-trace:Trace renamer" - "dump-rn-stats:Renamer stats" - "dump-simpl-stats:Dump simplifier stats" - "suppress-all:In core dumps, suppress everything (except for uniques) that is suppressible" - "suppress-uniques:Suppress the printing of uniques in debug output (easier to use diff)" - "suppress-idinfo:Suppress extended information about identifiers where they are bound" - "suppress-module-prefixes:Suppress the printing of module qualification prefixes" - "suppress-type-signatures:Suppress type signatures" - "suppress-type-applications:Suppress type applications" - "suppress-coercions:Suppress the printing of coercions in Core dumps to make them shorter" - "no-debug-output:Suppress unsolicited debugging output" - "ppr-debug:Turn on debug printing (more verbose)" - "ppr-noprags:Don't output pragma info in dumps" - "ppr-user-length:Set the depth for printing expressions in error msgs" - "ppr-colsNNN:Set the width of debugging output. For example -dppr-cols200" - "ppr-case-as-let:Print single alternative case expressions as strict lets" - "source-stats:Dump haskell source stats" - "cmm-lint:C-- pass sanity checking" - "stg-lint:STG pass sanity checking" - "stg-stats:Dump STG stats" - "verbose-core2core:Show output from each core-to-core pass" - "verbose-stg2stg:Show output from each STG-to-STG pass" - "show-passes:Print out each pass name as it happens" - "faststring-stats:Show statistics for fast string usage when finished" - ) - _describe -t flags 'ghc' _ghc_debugging_options_list || compadd "$@" -} - - -_ghc_language_flags () -{ - local _ghc_language_flags_list - _ghc_language_flags_list=( - "AllowAmbiguousTypes:Allow the user to write ambiguous types, and the type inference engine to infer them" - "Arrows:Enable arrow notation extension" - "AutoDeriveTypeable:Automatically derive Typeable instances for every datatype and type class declaration" - "BangPatterns:Enable bang patterns" - "ConstraintKinds:Enable a kind of constraints" - "CPP:Enable the C preprocessor" - "ConstrainedClassMethods:Enable constrained class methods" - "DataKinds:Enable datatype promotion" - "DefaultSignatures:Enable default signatures" - "DeriveDataTypeable:Enable deriving for the Data and Typeable classes" - "DeriveGeneric:Enable deriving for the Generic class" - "DisambiguateRecordFields:Enable record field disambiguation" - "EmptyCase:Allow empty case alternatives" - "EmptyDataDecls:Enable empty data declarations" - "ExistentialQuantification:Enable existential quantification" - "ExplicitForAll:Enable explicit universal quantification" - "ExplicitNamespaces:Enable using the keyword type to specify the namespace of entries in imports and exports" - "ExtendedDefaultRules:Use GHCi's extended default rules in a normal module" - "FlexibleContexts:Enable flexible contexts" - "FlexibleInstances:Enable flexible instances" - "ForeignFunctionInterface:Enable foreign function interface" - "FunctionalDependencies:Enable functional dependencies" - "GADTs:Enable generalised algebraic data types" - "GADTSyntax:Enable generalised algebraic data type syntax" - "GeneralizedNewtypeDeriving:Enable newtype deriving" - "Generics:Enable generic classes" - "ImplicitParams:Enable Implicit Parameters" - "ImpredicativeTypes:Enable impredicative types" - "IncoherentInstances:Enable incoherent instances" - "InterruptibleFFI:Enable interruptible FFI" - "KindSignatures:Enable kind signatures" - "LambdaCase:Enable lambda-case expressions" - "LiberalTypeSynonyms:Enable liberalised type synonyms" - "MonadComprehensions:Enable monad comprehensions" - "MonoLocalBinds:Enable do not generalise local bindings" - "MultiParamTypeClasses:Enable multi parameter type classes" - "MultiWayIf:Enable multi-way if-expressions" - "NamedFieldPuns:Enable record puns" - "NegativeLiterals:Enable support for negative literals" - "NewQualifiedOperators:Enable new qualified operator syntax" - "NoImplicitPrelude:Don't implicitly import Prelude" - "NoMonoPatBinds:Make pattern bindings polymorphic" - "NoMonomorphismRestriction:Disable the monomorphism" - "NoNPlusKPatterns:Disable support for n+k patterns" - "NoTraditionalRecordSyntax:Disable support for traditional record syntax (as supported by Haskell 98) C {f = x}" - "NullaryTypeClasses:Enable nullary (no parameter) type classes" - "NumDecimals:Enable support for 'fractional' integer literals" - "OverlappingInstances:Enable overlapping instances" - "OverloadedLists:Enable overloaded lists" - "OverloadedStrings:Enable overloaded string literals" - "PArr:Enable parallel arrays" - "PackageImports:Enable package-qualified imports" - "ParallelArrays:Enable parallel arrays" - "ParallelListComp:Enable parallel list comprehensions" - "PatternGuards:Enable pattern guards" - "PolyKinds:Enable kind polymorphism" - "PolymorphicComponents:Enable polymorphic components for data constructors" - "QuasiQuotes:Enable quasiquotation" - "Rank2Types:Enable rank-2 types" - "RankNTypes:Enable rank-N types" - "RebindableSyntax:Employ rebindable syntax" - "RecordWildCards:Enable record wildcards" - "RecursiveDo:Enable recursive do (mdo) notation" - "RelaxedPolyRec:Relaxed checking for mutually-recursive polymorphic functions" - "Safe:Enable the Safe Haskell Safe mode" - "ScopedTypeVariables:Enable lexically-scoped type variables" - "StandaloneDeriving:Enable standalone deriving" - "TemplateHaskell:Enable Template Haskell" - "TransformListComp:Enable transform list comprehensions" - "TypeFamilies:Enable type families" - "TypeOperators:Enable type operators" - "TypeSynonymInstances:Enable type synonyms" - "Trustworthy:Enable the Safe Haskell Trustworthy mode" - "UnboxedTuples:Enable unboxed tuples" - "UndecidableInstances:Enable undecidable instances" - "UnicodeSyntax:Enable unicode syntax" - "UnliftedFFITypes:Enable unlifted FFI types" - "Unsafe:Enable Safe Haskell Unsafe mode" - "ViewPatterns:Enable view patterns" - 'MagicHash:Allow "#" as a postfix modifier on identifiers' - ) - _describe -t flags 'ghc' _ghc_language_flags_list || compadd "$@" -} - -# -# ghc-pkg -# - -_ghc_pkg () -{ - WORDS=() - for w in $words[1,(($CURRENT - 1))]; do - if [[ $w != --* ]]; then WORDS+=$w; fi - done - _arguments '*:command:_ghc_pkg_command' -} - -_ghc_pkg_command() -{ - local -a _ghc_pkg_cmds - _ghc_pkg_cmds=( - "register:Register the package using package description" - "update:Register the package (overwriting existing package)" - "unregister:Unregister the specified package" - "expose:Expose the specified package" - "hide:Hide the specified package" - "list:List registered packages" - "find-module:List registered packages exposing module" - "latest:Prints the highest registered version of a package" - "check:Check the consistency of package dependencies and list broken packages" - "describe:Give the registered description for the specified package" - "field:Extract the specified field of the package description" - "dump:Dump the registered description for every package" - ) - - if (( $#WORDS == 1 )); then - _describe -t commands 'command' _ghc_pkg_cmds || compadd "$@" - else - local curcontext="$curcontext" - cmd="${${_ghc_pkg_cmds[(r)$WORDS[2]:*]%%:*}}" - if (( $#cmd )); then - _arguments \ - "--user[Use current user's package database]" \ - '--global[User the global package database]' \ - {-f,--package-conf=}'[Use the specified package config file]:Package config file:_files' \ - '--no-user-package-conf[Never reader the user package config]' \ - {-V,--version}'[Output version information and exit]' \ - '--force[Ignore missing directories and libraries only]' \ - {-g,--auto-ghci-libs}'[Automatically build libs for GHCi]' \ - {-?,--help}'[Display this help and exit]' \ - '--simple-output[Print output in easy-to-parse format for some commands]' \ - '--names-only[Only print package names, not versions]' \ - '--ignore-case[Ignore case for substring matching]' \ - '*:argument:_ghc_pkg_'$cmd - else - _message "unknown ghc-pkg command: $WORDS[2]" - fi - fi -} - -_ghc_pkg_unregister () { _ghc_pkg_list_packages } - -_ghc_pkg_expose () { _ghc_pkg_list_packages } - -_ghc_pkg_hide () { _ghc_pkg_list_packages } - -_ghc_pkg_latest () { _ghc_pkg_list_packages } - -_ghc_pkg_describe () { _ghc_pkg_list_packages } - -_ghc_pkg_field () -{ - _ghc_pkg_available_packages - if (( $#WORDS == 2 )); then - compadd "$@" -a -- _ghc_pkg_packages - elif (( $#WORDS == 3 )); then - compset -P '*,' - compset -S ',*' - compadd "$@" -S ',' -q -- \ - name version license copyright maintainer \ - stability homepage package-url description \ - category author exposed exposed-modules \ - hidden-modules import-dirs hs-libraries \ - extra-libraries extra-ghci-libraries include-dirs \ - includes depends hugs-options cc-options ld-options \ - framework-dirs frameworks haddock-interfaces \ - haddock-html - fi -} - -_ghc_pkg_register () { _files } - -_ghc_pkg_update () { _files } - -_ghc_pkg_list () { _ghc_pkg_list_packages } - -_ghc_pkg_find-module () -{ - if (( $#WORDS == 2)); then - if ( [[ ${+_ghc_modules} -eq 0 ]] || _cache_invalid GHC_MODULES ) && - ! _retrieve_cache GHC_MODULES; - then - _ghc_modules=( $(ghc-pkg dump | sed -n '/^exposed-modules:/{s/^exposed-modules:[ ]\+\(.*\)$/\1/;s/ /\n/;p;be};b;:e;n;/^ /{s/^[ ]\+\(.*\)$/\1/;s/ /\n/;p;be}') ) - _store_cache GHC_MODULES _ghc_modules - fi - compadd "$@" -a -- _ghc_modules - fi -} - -_ghc_pkg_dump () {} - -_ghc_pkg_check () {} - -_ghc_pkg_available_packages () -{ - if ( [[ ${+_ghc_pkg_packages_pkgs} -eq 0 ]] || _cache_invalid GHC_PACKAGES ) && - ! _retrieve_cache GHC_PACKAGES; - then - _ghc_pkg_packages=( $(ghc-pkg list --simple-output --names-only) ) - _store_cache GHC_PACKAGES _ghc_pkg_packages - fi -} - -_ghc_pkg_list_packages () -{ - _ghc_pkg_available_packages - compadd "$@" -a -- _ghc_pkg_packages -} - - -# -# dispatcher -# - -case $service in - ghc) - _ghc_compiler - ;; - ghci) - _ghc_ghci - ;; - ghc-pkg) - _ghc_pkg - ;; -esac diff --git a/.zprezto/modules/completion/external/src/_gist b/.zprezto/modules/completion/external/src/_gist deleted file mode 100644 index 77544a6..0000000 --- a/.zprezto/modules/completion/external/src/_gist +++ /dev/null @@ -1,119 +0,0 @@ -#compdef gist -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for gist (https://github.com/defunkt/gist) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Akira Maeda -# * Patrick Ziegler -# -# ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_arguments -C \ - '(--login)--login[Authenticate gist on this computer.]' \ - '(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \ - '(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \ - '(-p --private)'{-p,--private}'[Makes your gist private.]' \ - '(--no-private)'--no-private'[Makes your gist no private.]' \ - '(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \ - '(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \ - '(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID' \ - '(-a --anonymous)'{-a,--anonymous}'[Create an anonymous gist.]' \ - '(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \ - '(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \ - '(-o --open)'{-o,--open}'[Open the resulting URL in a browser]' \ - '(--no-open)'--no-open'[No open the resulting URL in a browser]' \ - '(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \ - '(-h --help)'{-h,--help}'[print options help]' \ - '(-v --version)'{-v,--version}'[print version]' \ - '(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:user_gists' \ - '*: :_files' && ret=0 - -_user_gists_cache_policy() { - # rebuild if cache is more than a day old - local -a oldp - oldp=( "$1"(mh+1) ) - (( $#oldp )) -} - -user_gists() { - local update_policy ret=1 - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy - fi - - # stores the gists of the logged in user in the format ID[Description] - _list=() - _cached_gists="user_gists" - - # retrieve/Write gists from/to cache - if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then - _gists=$(gist -l) - - if [ $? -eq 0 ]; then - _store_cache $_cached_gists _gists - else - # some error occurred, the user is probably not logged in - # set _gists to an empty string so that no completion is attempted - _gists="" - fi - else - _retrieve_cache $_cached_gists - fi - - if [ -n "$_gists" ]; then - echo "$_gists" | while read -r line; do - # Splitting the gist -l output - url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)" - # gists w/o descriptions can have only one column in the output, those - # have their description set to an empty string - description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')" - - _list+=( "${url}[${description}]" ) - done - - _values "gists" $_list - ret=0 - fi - - return ret -} - -return ret diff --git a/.zprezto/modules/completion/external/src/_git-flow b/.zprezto/modules/completion/external/src/_git-flow deleted file mode 100644 index d7c7b73..0000000 --- a/.zprezto/modules/completion/external/src/_git-flow +++ /dev/null @@ -1,444 +0,0 @@ -#compdef git-flow -# ------------------------------------------------------------------------------ -# Copyright (c) 2010-2015 Justin Hileman -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -# OR OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for git-flow (http://github.com/nvie/gitflow). -# -# Source: https://github.com/bobthecow/git-flow-completion -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Justin Hileman (https://github.com/bobthecow) -# * Yusuke Muraoka (https://github.com/jbking) -# * Vincent Driessen (https://github.com/nvie) -# * Zifei Tong (https://github.com/chevalun) -# * Ben O'Hara (https://github.com/benohara) -# -# ------------------------------------------------------------------------------ - - -_git-flow () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - 'status:Shows some status.' - ) - _describe -t commands 'git flow' subcommands - ;; - - (options) - case $line[1] in - - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' \ - -d'[Use default branch naming conventions and prefixes]' - ;; - - (version) - ;; - - (hotfix) - __git-flow-hotfix - ;; - - (release) - __git-flow-release - ;; - - (feature) - __git-flow-feature - ;; - - (support) - __git-flow-support - ;; - - esac - ;; - esac -} - -__git-flow-release () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git flow release`)' - 'publish:Publish this release branch to origin.`)' - 'track:Track a release branch from origin.`)' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -n'[Dont tag this release ]'\ - -p'[Push to $ORIGIN after performing finish]'\ - -k'[Keep branch after performing finish]'\ - ':version:__git_flow_version_list' - ;; - - (publish) - _arguments \ - ':version:__git_flow_version_list' - ;; - - (track) - _arguments \ - ':version:__git_flow_version_list' - ;; - - - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-hotfix () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - 'publish:Publish this hotfix branch to origin`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':hotfix:__git_flow_hotfix_list' - ;; - - (publish) - _arguments \ - ':hotfix:__git_flow_hotfix_list' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-feature () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new feature branch.' - 'finish:Finish a feature branch.' - 'list:List all your feature branches. (Alias to `git flow feature`)' - 'publish:Publish this feature branch to origin.' - 'track:Track a feature branch from origin.' - 'diff:Show a diff of changes since this feature branched off.' - 'rebase:Rebase a feature branch on top of develop.' - 'checkout:Check out (switch to) the given feature branch.' - 'pull:Pull a feature branch from a remote peer.' - ) - _describe -t commands 'git flow feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; - - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Finish branch by rebasing first]'\ - -k'[Keep branch after performing finish]'\ - -D'[Force delete feature branch after finish]'\ - ':feature:__git_flow_feature_list' - ;; - - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; - - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; - - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; - - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; - - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git-flow-support () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - 'start:Start a new support branch.' - 'list:List all your support branches. (Alias to `git flow support`)' - ) - _describe -t commands 'git flow support' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; - - (options) - case $line[1] in - - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_support_list'\ - ':branch-name:__git_branch_names' - ;; - - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac -} - -__git_flow_version_list () -{ - local expl - declare -a versions - - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted versions expl 'version' compadd $versions -} - -__git_flow_feature_list () -{ - local expl - declare -a features - - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted features expl 'feature' compadd $features -} - -__git_remotes () { - local expl gitdir remotes - - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return - - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return - - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi -} - -__git_flow_hotfix_list () -{ - local expl - declare -a hotfixes - - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'hotfix' compadd $hotfixes -} - -__git_flow_support_list () -{ - local expl - declare -a support - - support=(${${(f)"$(_call_program support git flow support list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return - - _wanted hotfixes expl 'support' compadd $support -} - - -__git_branch_names () { - local expl - declare -a branch_names - - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return - - _wanted branch-names expl branch-name compadd $* - $branch_names -} - -__git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 -} - -_git-flow "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_git-journal b/.zprezto/modules/completion/external/src/_git-journal deleted file mode 100644 index 0f2dfbe..0000000 --- a/.zprezto/modules/completion/external/src/_git-journal +++ /dev/null @@ -1,225 +0,0 @@ -#compdef git-journal -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for git-journal: -# https://github.com/saschagrunert/git-journal -# -# Authors -# ------- -# -# * Sascha Grunert -# * Nico Wagner -# ------------------------------------------------------------------------------ - -_git-journal() { - typeset -A opt_args - local ret=1 - - local context curcontext="$curcontext" state line - _arguments -s -S -C \ -"-p+[Sets a custom working path.]" \ -"--path+[Sets a custom working path.]" \ -"-n+[The number of tags until the parser stops when a single revision is given.]" \ -"--tags-count+[The number of tags until the parser stops when a single revision is given.]" \ -"-e+[A pattern to exclude git tags from the processing.]" \ -"-t+[Use a custom output template.]" \ -"--template+[Use a custom output template.]" \ -"-o+[The output file for the changelog.]" \ -"--output+[The output file for the changelog.]" \ -"-a[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \ -"--all[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \ -"-g[Generate a fresh output template from a commit range.]" \ -"--generate[Generate a fresh output template from a commit range.]" \ -"-s[Print only the shortlog (summary) form.]" \ -"--short[Print only the shortlog (summary) form.]" \ -"-u[Skip entries without any relation to a git TAG.]" \ -"--skip-unreleased[Skip entries without any relation to a git TAG.]" \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -"1:: :_git-journal_commands" \ -"*:: :->git-journal" \ -&& ret=0 - case $state in - (git-journal) - curcontext="${curcontext%:*:*}:git-journal-command-$words[1]:" - case $line[1] in - (p) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -"1:: :_git-journal_prepare_commands" \ -&& ret=0 -;; -(prepare) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -"1:: :_git-journal_prepare_commands" \ -&& ret=0 -;; -(s) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -&& ret=0 -;; -(setup) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -&& ret=0 -;; -(v) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -"1:: :_git-journal_verify_commands" \ -&& ret=0 -;; -(verify) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -"1:: :_git-journal_verify_commands" \ -&& ret=0 -;; -(help) -_arguments -s -S -C \ -"-h[Prints help information]" \ -"--help[Prints help information]" \ -"-V[Prints version information]" \ -"--version[Prints version information]" \ -&& ret=0 -;; - esac - ;; -esac -} - -(( $+functions[_git-journal_commands] )) || -_git-journal_commands() { - local commands; commands=( - "prepare:Prepare a commit message before the user can edit it." \ -"p:Prepare a commit message before the user can edit it." \ -"setup:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \ -"s:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \ -"verify:Verify the specified commit message." \ -"v:Verify the specified commit message." \ -"help:Prints this message or the help of the given subcommand(s)" \ -"REVISION_RANGE:Specifies the revision range to be processed. If a single revision is specified, the output will stop at the first following git TAG." \ - ) - _describe -t commands 'git-journal commands' commands "$@" -} -(( $+functions[_git-journal_help_commands] )) || -_git-journal_help_commands() { - local commands; commands=( - - ) - _describe -t commands 'git-journal help commands' commands "$@" -} -(( $+functions[_git-journal_p_commands] )) || -_git-journal_p_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ -"TYPE:The type of the commit. For example "message"." \ - ) - _describe -t commands 'git-journal p commands' commands "$@" -} -(( $+functions[_p_commands] )) || -_p_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ -"TYPE:The type of the commit. For example "message"." \ - ) - _describe -t commands 'p commands' commands "$@" -} -(( $+functions[_git-journal_prepare_commands] )) || -_git-journal_prepare_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ -"TYPE:The type of the commit. For example "message"." \ - ) - _describe -t commands 'git-journal prepare commands' commands "$@" -} -(( $+functions[_git-journal_s_commands] )) || -_git-journal_s_commands() { - local commands; commands=( - - ) - _describe -t commands 'git-journal s commands' commands "$@" -} -(( $+functions[_s_commands] )) || -_s_commands() { - local commands; commands=( - - ) - _describe -t commands 's commands' commands "$@" -} -(( $+functions[_git-journal_setup_commands] )) || -_git-journal_setup_commands() { - local commands; commands=( - - ) - _describe -t commands 'git-journal setup commands' commands "$@" -} -(( $+functions[_git-journal_v_commands] )) || -_git-journal_v_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ - ) - _describe -t commands 'git-journal v commands' commands "$@" -} -(( $+functions[_v_commands] )) || -_v_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ - ) - _describe -t commands 'v commands' commands "$@" -} -(( $+functions[_git-journal_verify_commands] )) || -_git-journal_verify_commands() { - local commands; commands=( - "MESSAGE:The path to the commit message which should be prepared." \ - ) - _describe -t commands 'git-journal verify commands' commands "$@" -} - -_git-journal "$@" \ No newline at end of file diff --git a/.zprezto/modules/completion/external/src/_git-pulls b/.zprezto/modules/completion/external/src/_git-pulls deleted file mode 100644 index 8dfc117..0000000 --- a/.zprezto/modules/completion/external/src/_git-pulls +++ /dev/null @@ -1,83 +0,0 @@ -#compdef git-pulls -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for git-pulls 0.3.1 (https://git-pulls.com/schacon/git-pulls). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud (https://github.com/nicoulaj) -# -# ------------------------------------------------------------------------------ - - -_git-pulls() { - typeset -A opt_args - local context state line curcontext="$curcontext" - - local ret=1 - - _arguments -C \ - '(- 1 *)--help[show usage]' \ - '1:cmd:->cmds' \ - '*::arg:->args' \ - && ret=0 - - case "$state" in - (cmds) - local commands; commands=( - 'update:update pull requests list' - 'list:list pull requests' - 'show:show pull request' - 'browse:open pull request in a web browser' - 'merge:merge pull request' - ) - _describe -t commands 'command' commands && ret=0 - ;; - (args) - curcontext="${curcontext%:*:*}:git-pulls-cmd-$words[1]:" - case $words[1] in - (update) - _message 'no more arguments' && ret=0 - ;; - (list) - _arguments \ - '--reverse[list in reverse order]' \ - && ret=0 - ;; - (show) - _arguments \ - '1: :_git-pulls_pull_requests_numbers' \ - '--full[use verbose output]' \ - && ret=0 - ;; - (browse|merge) - _arguments \ - '1: :_git-pulls_pull_requests_numbers' \ - && ret=0 - ;; - esac - ;; - esac - - return ret -} - -(( $+functions[_git-pulls_pull_requests_numbers] )) || -_git-pulls_pull_requests_numbers() { - local pull_requests; pull_requests=(${${${(M)${(f)"$(_call_program users $service list)"}:#[[:digit:]]##[[:space:]]*}//:/\\:}/[[:space:]]##/:}) - _describe -t pull-request-numbers 'pull request number' pull_requests "$@" -} - -_git-pulls "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_git-wtf b/.zprezto/modules/completion/external/src/_git-wtf deleted file mode 100644 index e909235..0000000 --- a/.zprezto/modules/completion/external/src/_git-wtf +++ /dev/null @@ -1,58 +0,0 @@ -#compdef git-wtf -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for git-wtf, authored by -# William Morgan (http://git-wt-commit.rubyforge.org/git-wtf) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mario Fernandez (https://github.com/sirech) -# -# ------------------------------------------------------------------------------ - -_arguments -w -C -s \ - '(--long --short)'{-l,--long}'[include author info and date for each commit]' \ - '(--long --short)'{-s,--short}'[do not show commits]' \ - '(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \ - '(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \ - '(--key)'{-k,--key}'[show key]' \ - '(--relations)'{-r,--relations}'[show relation to features / integration branches]' \ - '(--dump-config)--dump-config[print out current configuration and exit]' \ - '*: :__git_branch_names' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_glances b/.zprezto/modules/completion/external/src/_glances deleted file mode 100644 index a86f875..0000000 --- a/.zprezto/modules/completion/external/src/_glances +++ /dev/null @@ -1,75 +0,0 @@ -#compdef glances -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for glances (http://nicolargo.github.com/glances/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * loranger (https://github.com/loranger) -# -# ------------------------------------------------------------------------------ - -_glances() { - - _arguments \ - "-0[Divide task CPU usage by the total number of CPUs]" \ - "-1[Start Glances in per CPU mode]" \ - "-2[Disable left sidebar]" \ - "-3[Disable quick look module]" \ - "-4[Disable all but quick look and load]" \ - "-5[Disable top menu]" \ - "-6[Start Glances in mean GPU mode]" \ - "-b[Display network rate in Byte per second]" \ - "-B[Bind server to the given IP or host NAME]:host:_hosts" \ - "-c[Connect to a Glances server]:host:_hosts" \ - "-C[Path to the configuration file]:configuration path:_files -/" \ - "-d[Enable debug mode]" \ - "-h[Display the syntax and exit]" \ - "-o[Define additional output (available: HTML or CSV)]:output type:(HTML CSV)" \ - "-p[Define the client or server TCP port (default: 61209)]:port:_ports" \ - "-q[Disable the curses interface]" \ - "-s[Run Glances in server mode]" \ - "-t[Set the refresh time in seconds (default: 3)]:seconds:" \ - "-V[Display the version and exit]" \ - "-w[Run Glances in web server mode]" \ - "-z[Do not use the bold color attribute]" \ - "--browser[Start the client browser]" \ - "--disable-bg[Disable background colors in the terminal]" \ - "--disable-bold[Disable bold mode in the terminal]" \ - "--hide-kernel-threads[Hide kernel threads in process list]" \ - "--password[Define a client/server password]" \ - "--theme-white[Optimize display colors for white background]" \ - "--tree[Display processes as tree]" \ - "--username[Define a client/server username]" \ -} - -_glances "$@" diff --git a/.zprezto/modules/completion/external/src/_golang b/.zprezto/modules/completion/external/src/_golang deleted file mode 100644 index ad37aab..0000000 --- a/.zprezto/modules/completion/external/src/_golang +++ /dev/null @@ -1,646 +0,0 @@ -#compdef go -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# Copyright (c) 2013-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# Copyright (c) 2010-2014 Go authors -# -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for go 1.11 (http://golang.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mikkel Oscar Lyderik Larsen -# * oh-my-zsh authors: -# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/golang/golang.plugin.zsh -# * Go authors -# -# ------------------------------------------------------------------------------ - -typeset -A opt_args - -__go_buildmodes() { - local -a buildmodes - buildmodes=( - 'archive[non-main packages into .a files]' - 'c-archive[main package, plus all packages it imports, into a C archive file]' - 'c-shared[main package, plus all packages it imports, into a C shared library]' - 'default[main packages are built into executables and listed non-main packages are built into .a files]' - 'shared[non-main packages into a single shared library that will be used when building with the -linkshared option]' - 'exe[main packages into executables]' - 'pie[main packages and everything they import into position independent executables (PIE)]' - 'plugin[main packages, plus all packages that they import, into a Go plugin]' - ) - - _values 'mode' $buildmodes -} - - -local -a commands build_flags -commands=( -'bug:start a bug report' -'build:compile packages and dependencies' -'clean:remove object files and cached files' -'doc:show documentation for package or symbol' -'env:print Go environment information' -'fix:update packages to use new APIs' -'fmt:gofmt (reformat) package sources' -'generate:generate Go files by processing source' -'get:download and install packages and dependencies' -'install:compile and install packages and dependencies' -'list:list packages or modules' -'mod:module maintenance' -'run:compile and run Go program' -'test:test packages' -'tool:run specified go tool' -'version :print Go version' -'vet:report likely mistakes in packages' -'help:get more information about a command' -) - -_arguments \ - "1: :{_describe 'command' commands}" \ - '*:: :->args' - -case $state in - args) - build_flags=( - '-a[force rebuilding of packages that are already up-to-date]' - '-n[print the commands but do not run them]' - '-p[number of builds that can be run in parallel]:number' - '-race[enable data race detection]' - '-v[print the names of packages as they are compiled]' - '-work[print temporary work directory and keep it]' - '-x[print the commands]' - '-asmflags[arguments for each go tool asm invocation]:flags' - '-buildmode[build mode to use]:mode:__go_buildmodes' - '-compiler[name of compiler to use]:name' - '-gccgoflags[arguments for gccgo]:args' - '-gcflags[arguments for each go tool compile invocation]:args' - '-installsuffix[suffix to add to package directory]:suffix' - '-ldflags[arguments to pass on each go tool link invocation.]:flags' - '-linkshared[link against shared libraries]' - '-pkgdir[install and load all packages from dir]:dir' - '-tags[list of build tags to consider satisfied]:tags' - '-toolexec[program to use to invoke toolchain programs]:args' - ) - - __go_packages() { - local gopaths - declare -a gopaths - gopaths=("${(s/:/)$(go env GOPATH)}") - gopaths+=("$(go env GOROOT)") - for p in $gopaths; do - _path_files -W "$p/src" -/ - done - } - - case $words[1] in - build) - _arguments \ - '-o[force build to write to named output file]:file:_files' \ - '-i[installs the packages that are dependencies of the target]' \ - ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - - clean) - _arguments \ - '-i[remove corresponding installed archive or binary]' \ - '-r[apply clean recursively on all dependencies]' \ - ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - - doc) - _arguments \ - '-c[respect case when matching symbols]' \ - '-cmd[treat a command (package main) like a regular package]' \ - '-u[show docs for unexported and exported symbols and methods]' - ;; - - fix) - _arguments '*:importpaths:__go_packages' - ;; - - fmt) - _arguments \ - '-n[prints commands that would be executed]' \ - '-x[prints commands as they are executed]' \ - '*:importpaths:__go_packages' - ;; - - generate) - _arguments \ - '-run=[specifies a regular expression to select directives]:regex' \ - '-x[print the commands]' \ - '-n[print the commands but do not run them]' \ - '-v[print the names of packages as they are compiled]' \ - "*:args:{ _alternative ':importpaths:__go_packages' _files }" - ;; - - get) - _arguments \ - '-d[instructs get to stop after downloading the packages]' \ - '-f[force get -u not to verify that each package has been checked from vcs]' \ - '-fix[run the fix tool on the downloaded packages]' \ - '-insecure[permit fetching/resolving custom domains]' \ - '-t[also download the packages required to build tests]' \ - '-u[use the network to update the named packages]' \ - ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - - install) - _arguments ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - - list) - _arguments \ - '-e[changes the handling of erroneous packages]' \ - '-f[specifies an alternate format for the list]:format' \ - '-json[causes package data to be printed in JSON format]' \ - '-compiled[set CompiledGoFiles to the Go source files presented to the compiler]' \ - '-deps[iterate over named packages and their dependencies]' \ - '-m[list modules instead of packages]' \ - ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - - mod) - local -a mod_commands - mod_commands=( - 'download:download modules to local cache' - 'edit:edit go.mod from tools or scripts' - 'graph:print module requirement graph' - 'init:initialize new module in current directory' - 'tidy:add missing and remove unused modules' - 'vendor:make vendored copy of dependencies' - 'verify:verify dependencies have expected content' - 'why:explain why packages or modules are needed' - 'help:get more information about a command' - ) - - _arguments \ - "1: :{_describe 'command' mod_commands}" \ - '*:: :->args' - - case $state in - args) - case $words[1] in - download) - _arguments \ - '-json[print a sequance of JSON objects to standard output]' - ;; - - edit) - _arguments \ - '-fmt[reformats the go.mod file without making other changes]' \ - "-module[change the module's path]" \ - '*-require=[add a requirement on the given module path and version]:require' \ - '*-droprequire=[drop a requirement on the given module path and version]:droprequire' \ - '*-exclude=[add an exclusion for the given module path and version]:exclude' \ - '*-dropexclude=[drop an exclusion for the given module path and version]:dropexclude' \ - '*-replace=[add a replacement of the given module path and version]:replace' \ - '*-dropreplace=[drop a replacement of the given module path and version]:dropreplace' \ - '-json[prints the final go.mod file in JSON format]' \ - '-print[prints the final go.mod in its text format]' \ - ':go.mod:_path_files -g "go.mod"' - ;; - graph) - ;; - init) - # Use go packages as module name suggestion - _arguments \ - '*:module:__go_packages' - ;; - tidy) - _arguments \ - '-v[print information about removed modules to standard error]' - ;; - vendor) - _arguments \ - '-v[print the names of vendored modules and packages to standard error]' - ;; - verify) - ;; - why) - _arguments \ - '-m[treats the arguments as a list of modules]' \ - '-vendor[exclude tests of dependencies]' \ - '*:module:__go_packages' - ;; - esac - ;; - esac - ;; - - run) - _arguments \ - ${build_flags[@]} \ - '-exec[invoke the binary using xprog]:xporg' \ - '*:file:_files -g "*.go(-.)"' - ;; - - test) - _arguments \ - "-c[compile but don't run test]" \ - '-i[install dependencies of the test]' \ - '-bench[run benchmarks matching the regular expression]:regexp' \ - '-benchmem[print memory allocation statistics for benchmarks]' \ - '-benchtime[run benchmarks for t rime]:t' \ - '-blockprofile[write a goroutine blocking profile to the specified file]:block' \ - '-blockprofilerate[control goroutine blocking profiles]:n' \ - '-count[run each test and benchmark n times]:n' \ - '-cover[enable coverage analysis]' \ - '-covermode[set the mode for coverage analysis]:mode:(set count atomic)' \ - '-coverpkg[apply coverage analysis in each test of listed packages]:list' \ - '-coverprofile[write a coverage profile to file]:cover' \ - '-cpu[specify a list of GOMAXPROCS values]:cpus' \ - '-cpuprofile[write a CPU profile to the specified file]:profile' \ - '-memprofile[write a memory profile to file]:mem' \ - '-memprofilerate[enable more precise memory profiles]:n' \ - '-outputdir[place output files from profiling in output dir]:dir' \ - '-parallel[allow parallel execution of test functions]:n' \ - '-run[run tests and examples matching the regular expression]:regexp' \ - '-short[tell long-running tests to shorten their run time]' \ - '-timeout[timeout long running tests]:t' \ - '-trace[write an execution trace to the specified file]:trace' \ - '-v[verbose output]' \ - ${build_flags[@]} \ - '-exec[run test binary using xprog]:xprog' \ - '-o[compile test binary to named file]:file:_files' \ - '*:importpaths:__go_packages' - ;; - - tool) - local -a tools - tools=($(go tool)) - - _arguments \ - '-n[print command that would be executed]' \ - "1: :{_describe 'tool' tools}" \ - '*:: :->args' - - case $state in - args) - case $words[1] in - addr2line) - _files - ;; - - asm) - _arguments \ - '-D[predefined symbol with optional simple value]:value' \ - '-I[include directory]:value' \ - '-S[print assembly and machine code]' \ - '-debug[dump instructions as they are parsed]' \ - '-dynlink[support references to Go symbols]' \ - '-o[output file]:string' \ - '-shared[generate code that can be linked into a shared lib]' \ - '-trimpath[remove prefix from recorded source file paths]:string' - ;; - - callgraph) - local -a algos graphs - algos=( - 'static:static calls only' - 'cha:Class Hierarchy Analysis' - 'rta:Rapid Type Analysis' - 'pta:inclusion-based Points-To Analysis' - ) - graphs=( - 'digraph:output in digraph format' - 'graphviz:output in AT&T GraphViz (.dot) format' - ) - - _arguments \ - '-algo=[call-graph construction algorithm]:algos:{ _describe "algos" algos }' \ - "-test[include the package's tests in the analysis]" \ - '-format=[format in which each call graph edge is displayed]:graphs:{ _describe "graphs" graphs }' - ;; - - cgo) - _arguments \ - '-debug-define[print relevant #defines]' \ - '-debug-gcc[print gcc invocations]' \ - '-dynimport[if non-empty, print dynamic import data]:string' \ - '-dynlinker[record dynamic linker information]' \ - '-dynout[write -dynimport output to file]:file' \ - '-dynpackage[set Go package for -dynimport output]:string' \ - '-exportheader[where to write export header]:string' \ - '-gccgo[generate files for use with gccgo]' \ - '-gccgopkgpath[-fgo-pkgpath option used with gccgo]:string' \ - '-gccgoprefix[-fgo-prefix option used with gccgo]:string' \ - '-godefs[write Go definitions for C file to stdout]' \ - '-import_runtime_cgo[import runtime/cgo in generated code]' \ - '-import_syscall[import syscall in generated code]' \ - '-importpath[import path of package being built]:path' \ - '-objdir[object directory]:dir' - ;; - - compile) - _arguments \ - '-%[debug non-static initializers]' \ - '-+[compiling runtime]' \ - "-A[for bootstrapping, allow 'any' type]" \ - '-B[disable bounds checking]' \ - '-D[set relative path for local imports]:path' \ - '-E[debug symbol export]' \ - '-I[add directory to import search path]:directory' \ - '-K[debug missing line numbers]' \ - '-L[use full (long) path in error messages]' \ - '-M[debug move generation]' \ - '-N[disable optimizations]' \ - '-P[debug peephole optimizer]' \ - '-R[debug register optimizer]' \ - '-S[print assembly listing]' \ - '-V[print compiler version]' \ - '-W[debug parse tree after type checking]' \ - '-asmhdr[write assembly header to file]:file' \ - '-buildid[record id as the build id in the export metadata]:id' \ - '-complete[compiling complete package (no C or assembly)]' \ - '-cpuprofile[write cpu profile to file]:file' \ - '-d[print debug information about items in list]:list' \ - '-dynlink[support references to Go symbols]' \ - '-e[no limit on number of errors reported]' \ - '-f[debug stack frames]' \ - '-g[debug code generation]' \ - '-h[halt on error]' \ - '-i[debug line number stack]' \ - '-importmap[add definition of the form source=actual to import map]:definition' \ - '-installsuffix[set pkg directory suffix]:suffix' \ - '-j[debug runtime-initialized variables]' \ - '-l[disable inlining]' \ - '-largemodel[generate code that assumes a large memory model]' \ - '-live[debug liveness analysis]' \ - '-m[print optimization decisions]' \ - '-memprofile[write memory profile to file]:file' \ - '-memprofilerate[set runtime.MemProfileRate to rate]:rate' \ - '-nolocalimports[reject local (relative) imports]' \ - '-o[write output to file]:file' \ - '-p[set expected package import path]:path' \ - '-pack[write package file instead of object file]' \ - '-r[debug generated wrappers]' \ - '-race[enable race detector]' \ - '-s[warn about composite literals that can be simplified]' \ - '-shared[generate code that can be linked into a shared library]' \ - '-trimpath[remove prefix from recorded source file paths]:prefix' \ - '-u[reject unsafe code]' \ - '-v[increase debug verbosity]' \ - '-w[debug type checking]' \ - '-wb[enable write barrier (default 1)]' \ - '-x[debug lexer]' \ - '-y[debug declarations in canned imports (with -d)]' \ - '*:file:_files -g "*.go(-.)"' - ;; - - cover) - if (( CURRENT == 2 )); then - _arguments \ - '-func=[output coverage profile information for each function]:string' \ - '-html=[generate HTML representation of coverage profile]:file:_files' \ - '-mode=[coverage mode]:mode:(set count atomic)' - return - fi - - _arguments \ - '-o[file for output]:file' \ - '-var=[name of coverage variable to generate]:var' \ - '*:file:_files -g "*.go(-.)"' - ;; - - doc) - _arguments \ - '-c[respect case when matching symbols]' \ - '-cmd[treat a command (package main) like a regular package]' \ - '-u[show docs for unexported and exported symbols and methods]' \ - ;; - - fix) - _arguments \ - '-diff[display diffs instead of rewriting files]' \ - '-force[force fixes to run even if the code looks updated]:string' \ - '-r[restrict the rewrites]:string' \ - '*:files:_files' - ;; - - link) - _arguments \ - '-B[add an ELF NT_GNU_BUILD_ID note when using ELF]:note' \ - '-C[check Go calls to C code]' \ - '-D[set data segment address (default -1)]:address' \ - '-E[set entry symbol name]:entry' \ - '-H[set header type]:type' \ - '-I[use linker as ELF dynamic linker]:linker' \ - '-L[add specified directory to library path]:directory' \ - '-R[set address rounding quantum (default -1)]:quantum' \ - '-T[set text segment address (default -1)]:address' \ - '-V[print version and exit]' \ - '-W[disassemble input]' \ - '-X[add string value definition]:definition' \ - '-a[disassemble output]' \ - '-buildid[record id as Go toolchain build id]:id' \ - '-buildmode[set build mode]:mode' \ - '-c[dump call graph]' \ - '-cpuprofile[write cpu profile to file]:file' \ - '-d[disable dynamic executable]' \ - '-extld[use linker when linking in external mode]:linker' \ - '-extldflags[pass flags to external linker]:flags' \ - '-f[ignore version mismatch]' \ - '-g[disable go package data checks]' \ - '-h[halt on error]' \ - '-installsuffix[set package directory suffix]:suffix' \ - '-k[set field tracking symbol]:symbol' \ - '-linkmode[set link mode]:mode:(internal external auto)' \ - '-linkshared[link against installed Go shared libraries]' \ - '-memprofile[write memory profile to file]:file' \ - '-memprofilerate[set runtime.MemProfileRate to rate]:rate' \ - '-n[dump symbol table]' \ - '-o[write output to file]:file' \ - '-r[set the ELF dynamic linker search path to dir1:dir2:...]:path' \ - '-race[enable race detector]' \ - '-s[disable symbol table]' \ - '-shared[generate shared object (implies -linkmode external)]' \ - '-tmpdir[use directory for temporary files]:directory' \ - '-u[reject unsafe packages]' \ - '-v[print link trace]' \ - '-w[disable DWARF generation]' \ - '*:files:_files' - ;; - - objdump) - _arguments \ - '-s[only dump symbols matching this regexp]:regexp' \ - '*:files:_files' - ;; - - pack) - _arguments '1:ops:(c p r t x)' '::verbose:(v)' ':files:_files' - ;; - - pprof) - _arguments \ - '-callgrind[outputs a graph in callgrind format]' \ - '-disasm=[output annotated assembly]:p' \ - '-dot[outputs a graph in DOT format]' \ - '-eog[visualize graph through eog]' \ - '-evince[visualize graph through evince]' \ - '-gif[outputs a graph image in GIF format]' \ - '-gv[visualize graph through gv]' \ - '-list=[output annotated source for functions matching regexp]:p' \ - '-pdf[outputs a graph in PDF format]' \ - '-peek=[output callers/callees of functions matching regexp]:p' \ - '-png[outputs a graph image in PNG format]' \ - '-proto[outputs the profile in compressed protobuf format]' \ - '-ps[outputs a graph in PS format]' \ - '-raw[outputs a text representation of the raw profile]' \ - '-svg[outputs a graph in SVG format]' \ - '-tags[outputs all tags in the profile]' \ - '-text[outputs top entries in text form]' \ - '-top[outputs top entries in text form]' \ - '-tree[outputs a text rendering of call graph]' \ - '-web[visualize graph through web browser]' \ - '-weblist=[output annotated source in HTML]:p' \ - '-output=[generate output on file f (stdout by default)]:f' \ - '-functions[report at function level (default)]' \ - '-files[report at source file level]' \ - '-lines[report at source line level]' \ - '-addresses[report at address level]' \ - '-base[show delta from this profile]:profile' \ - '-drop_negative[ignore negative differences]' \ - '-cum[sort by cumulative data]' \ - '-seconds=[length of time for dynamic profiles]:n' \ - '-nodecount=[max number of nodes to show]:n' \ - '-nodefraction=[hide nodes below *total]:f' \ - '-edgefraction=[hide edges below *total]:f' \ - '-sample_index[index of sample value to display]' \ - '-mean[average sample value over first value]' \ - '-inuse_space[display in-use memory size]' \ - '-inuse_objects[display in-use object counts]' \ - '-alloc_space[display allocated memory size]' \ - '-alloc_objects[display allocated object counts]' \ - '-total_delay[display total delay at each region]' \ - '-contentions[display number of delays at each region]' \ - '-mean_delay[display mean delay at each region]' \ - '-runtime[show runtime call frames in memory profiles]' \ - '-focus=[restricts to paths going through a node matching regexp]:r' \ - '-ignore=[skips paths going through any nodes matching regexp]:r' \ - '-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \ - '-tagignore=[discard samples tagged with key:value matching regexp]' \ - '-call_tree[generate a context-sensitive call tree]' \ - '-unit=[convert all samples to unit u for display]:u' \ - '-divide_by=[scale all samples by dividing them by f]:f' \ - '-buildid=[override build id for main binary in profile]:id' \ - '-tools=[search path for object-level tools]:path' \ - '-help[help message]' \ - '*:files:_files' - ;; - - trace) - _arguments \ - '-http=[HTTP service address]:addr' \ - '*:files:_files' - ;; - - vet) - _arguments \ - '-all[check everything]' \ - '-asmdecl[check assembly against Go declarations]' \ - '-assign[check for useless assignments]' \ - '-atomic[check for common mistaken usages of the sync/atomic]' \ - '-bool[check for mistakes involving boolean operators]' \ - '-buildtags[check that +build tags are valid]' \ - '-composites[check that composite literals used field-keyed elements]' \ - '-compositewhitelist[use composite white list]' \ - '-copylocks[check that locks are not passed by value]' \ - '-methods[check that canonically named methods are canonically defined]' \ - '-nilfunc[check for comparisons between functions and nil]' \ - '-printf[check printf-like invocations]' \ - '-printfuncs[print function names to check]:string' \ - '-rangeloops[check that range loop variables are used correctly]' \ - '-shadow[check for shadowed variables]' \ - '-shadowstrict[whether to be strict about shadowing]' \ - '-shift[check for useless shifts]' \ - '-structtags[check that struct field tags have canonical format]' \ - '-tags[list of build tags to apply when parsing]:list' \ - '-test[for testing only: sets -all and -shadow]' \ - '-unreachable[check for unreachable code]' \ - '-unsafeptr[check for misuse of unsafe.Pointer]' \ - '-unusedfuncs[list of functions whose results must be used]:string' \ - '-unusedresult[check for unused result of calls to functions in -unusedfuncs]' \ - '-unusedstringmethods[list of methods whose results must be used]:string' \ - '-v[verbose]' \ - '*:files:_files' - ;; - - yacc) - _arguments \ - '-o[output]:output' \ - '-v[parsetable]:parsetable' \ - '*:files:_files' - ;; - esac - ;; - esac - ;; - - vet) - _arguments \ - '-n[print commands that would be executed]' \ - '-x[prints commands as they are executed]' \ - ${build_flags[@]} \ - '*:importpaths:__go_packages' - ;; - help) - local -a topics - topics=( - 'buildmode:build modes' - 'c:calling between Go and C' - 'cache:build and test caching' - 'environment:environment variables' - 'filetype:file types' - 'go.mod:the go.mod file' - 'gopath:GOPATH environment variable' - 'gopath-get:legacy GOPATH go get' - 'goproxy:module proxy protocol' - 'importpath:import path syntax' - 'modules:modules, module versions, and more' - 'module-get:module-aware go get' - 'packages:package lists and patterns' - 'testflag:testing flags' - 'testfunc:testing functions' - ) - - _arguments "1: :{_describe 'command' commands -- topics}" - ;; - esac - ;; -esac diff --git a/.zprezto/modules/completion/external/src/_google b/.zprezto/modules/completion/external/src/_google deleted file mode 100644 index 8cd6a1b..0000000 --- a/.zprezto/modules/completion/external/src/_google +++ /dev/null @@ -1,94 +0,0 @@ -#compdef google -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for googlecl (https://code.google.com/p/googlecl/) -# -# Source: https://raw.github.com/dadrc/zsh-cfg/master/completions/_google -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * dadrc (https://github.com/dadrc) -# * Ben O'Hara (https://github.com/benohara) -# -# ------------------------------------------------------------------------------ - -_google() { - # init variables - local curcontext="$curcontext" state line - typeset -A opt_args - - # init state - _arguments \ - '1: :->service'\ - '2: :->task' - - case $state in - service) - _arguments '1:service:(picasa blogger youtube docs contacts calendar finance)' - ;; - *) - case $words[2] in - picasa) - compadd "$@" get create list list-albums tag post delete - ;; - blogger) - compadd "$@" post tag list delete - ;; - youtube) - compadd "$@" post tag list delete - ;; - docs) - compadd "$@" edit delete list upload get - ;; - contacts) - compadd "$@" list list-groups add add-groups delete-groups delete - ;; - calendar) - compadd "$@" add list today delete - ;; - finance) - compadd "$@" list-txn delete-pos create-pos delete-txn create create-txn list list-pos delete - ;; - *) - esac - esac -} - -_google "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_gtk-launch b/.zprezto/modules/completion/external/src/_gtk-launch deleted file mode 100644 index a2bede4..0000000 --- a/.zprezto/modules/completion/external/src/_gtk-launch +++ /dev/null @@ -1,87 +0,0 @@ -#compdef gtk-launch -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for gtk-launch on gtk+-3.14.8 (http://www.gtk.org/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * ncaq (version 3.14.8) -# -# ------------------------------------------------------------------------------ - -_gtk-launch() { - _arguments \ - {-h,--help}'[Show help options]' \ - --help-all'[Show all help options]' \ - --help-gtk'[Show GTK+ Options]' \ - --display='[X display to use]' \ - '1: :_applications' -} - -_applications() { - local -a applications - - for file in /usr/share/applications/*.desktop; do - applications+=`_format_entry $file` - done - - _values -w \ - 'applications' \ - $applications -} - -_format_entry() { - echo "`_remove_path_extension $1`[`_get_description $1`]" -} - -_remove_path_extension() { - # echo arg - # remove path string - # remove extension string - echo $1 | \ - sed 's/.*\///' | \ - sed 's/\.desktop//' -} - -_get_description() { - # grep --no-messages option is handling of not UTF-8 text - grep --no-messages '^Comment=\|^Exec=' $1 | \ - tr '\n' ' ' -} - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_hledger b/.zprezto/modules/completion/external/src/_hledger deleted file mode 100644 index 0c1937b..0000000 --- a/.zprezto/modules/completion/external/src/_hledger +++ /dev/null @@ -1,286 +0,0 @@ -#compdef hledger - -# ------------------------------------------------------------------------------ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for hleder 1.10 ( http://hledger.org/ ) -# Last updated: 07.08.2018 -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Valodim ( https://github.com/Valodim ) -# * fdw ( https://github.com/fdw ) -# -# ------------------------------------------------------------------------------ -# Notes -# ----- -# -# account completion depends on availability of a ~/.hledger.journal file -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" curstate state line expl grp cmd ret=1 -typeset -a args -typeset -A opt_args - -args=( - '(- *)'{-h,--help}'[print help information]' - '(-f --file)'{-f,--file}'=[use a different input file]:input file:_files' - '--rules-file=[CSV conversion rules file]:rules file:_files' - '--alias=[display accounts named OLD as NEW]:alias specification' - '--anon=[anonymize accounts and payees]' - '(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date' - '(-e --end)'{-e,--end}'=[include postings/txns before this date]:date' - '(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]' - '(-W --weekly)'{-W,--weekly}'[multiperiod/multicolumn report by week]' - '(-M --monthly)'{-M,--monthly}'[multiperiod/multicolumn report by month]' - '(-Q --quarterly)'{-Q,--quarterly}'[multiperiod/multicolumn report by quarter]' - '(-Y --yearly)'{-Y,--yearly}'[multiperiod/multicolumn report by year]' - '(-p --period)'{-p,--period}'=[set start date, end date, and/or reporting interval all at once]' - '(-C --cleared)'{-C,--cleared}'[include only cleared postings/txns]' - '(-U --uncleared)'{-U,--uncleared}'[include only uncleared postings/txns]' - '(-R --real)'{-R,--real}'[include only non-virtual postings]' - '(--depth)--depth=[hide accounts/postings deeper than N]:depth' - '(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]' - '(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]' - '(-V --value)'{-V,--value}'[converts reported amounts to the current market value]' - '(-I --ignore-assertions)'{-I,--ignore-assertions}'[ignore any failing balance assertions]' - '--forecast=[apply periodic transaction rules to generate future transactions]' -) - -_arguments -C "$args[@]" -A "-*" \ - '(- *)--version[print version information]' \ - '--debug[show debug output]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -while (( $#state )); do - curstate=$state - shift state - case $curstate in - cmds) - typeset -a cmds - cmds=( - 'accounts:show account names (a)' - 'activity:show an ascii barchart of posting counts per interval' - 'add:prompt for transactions and add them to the journal' - 'balance:show accounts and balances (b, bal)' - 'balancesheet:show a balance sheet (bs)' - 'balancesheetequity:like balancesheet, but also reports equity' - 'cashflow:show a cashflow statement (cf)' - 'check-dates:check that transactions are sorted by increasing date' - 'check-dupes:report account names having the same leaf but different prefixes' - 'close:print closing/opening transactions that bring some or all account balances to zero and back' - 'help:show any of the hledger manuals' - 'import:read new transactions added to each file since last run, and add them to the main journal file' - 'incomestatement:show an income statement (is)' - 'prices:print market price directives from the journal' - 'print:show transaction entries (p, txns)' - 'print-unique:print transactions which do not reuse an already-seen description' - 'register:show postings and running total (r, reg)' - 'register-patch:print the one posting whose transaction description is closest to the description' - 'rewrite:print all transactions, adding custom postings to the matched ones' - 'stats:show some journal statistics' - 'tags:list all the tag names used in the journal' - 'test:run built-in unit tests' - ) - _describe 'subcommands' cmds && ret=0 - ;; - args) - : $words - local cmd=$words[1] - (( $+cmd )) || return 1 - # curcontext="${curcontext%:*:*}:$service-$cmd:" - case $cmd in - accounts) - args=( - '(--declared)--declared[show account names declared with account directives]' - '(--used)--used[show account names posted to by transactions]' - '(--tree)--tree[show accounts as a tree (default in simple reports)]' - '(--flat)--flat[show accounts as a list (default in multicolumn)]' - '(--drop)--drop=[flat mode, omit N leading account name parts]:drop n' - ) - ;; - activity) - ;; - add) - args=( - '(--no-new-accounts)--no-new-accounts=[do not allow creating new accounts]' - ) - ;; - bal|balance) - args+=( - '(--change)--change[show balance change in each period (default)]' - '(--cumulative)--cumulative[show balance change accumulated across periods]' - '(-H --historical)'{-H,--historical}'[show historical ending balance in each period]' - '(--tree)--tree[show accounts as a tree (default in simple reports)]' - '(--flat)--flat[show accounts as a list (default in multicolumn)]' - '(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]' - '(-T --row-total)'{-T,--row-total}'[show a row total column]' - '(-N --no-total)'{-N,--no-total}'[do not show the final total row]' - '(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n' - '(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]' - '(--format)--format=[in tree mode, use this custom line format]:custom line format' - '(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format' - '(-o --output-file)'{-o,--output-file}'=[write output to file]:file' - '(--pretty-tables)--pretty-tables[use unicode to display prettier tables]' - '(--sort-amount)--sort-amount[sort by amount instead of account code/name]' - '(--invert)--invert[display all amounts with reversed sign]' - '(--budget)--budget[show performance compared to budget goals]' - '(--show-unbudgeted)--show-unbudgeted[with --budget, show unbudgeted accounts also]' - ) - ;; - bl|balancesheet|balancesheetequity) - args+=( - '(--change)--change[show balance change in each period (default)]' - '(--cumulative)--cumulative[show balance change accumulated across periods]' - '(-H --historical)'{-H,--historical}'[show historical ending balance in each period]' - '(--tree)--tree[show accounts as a tree (default in simple reports)]' - '(--flat)--flat[show accounts as a list (default in multicolumn)]' - '(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]' - '(-T --row-total)'{-T,--row-total}'[show a row total column]' - '(-N --no-total)'{-N,--no-total}'[do not show the final total row]' - '(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n' - '(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]' - '(--format)--format=[in tree mode, use this custom line format]:custom line format' - '(--sort-amount)--sort-amount[sort by amount instead of account code/name]' - ) - ;; - cashflow|cf|balancesheet|bs|incomestatement|is) - args+=( - '(--change)--change[show balance change in each period (default)]' - '(--cumulative)--cumulative[show balance change accumulated across periods]' - '(-H --historical)'{-H,--historical}'[show historical ending balance in each period]' - '(--tree)--tree[show accounts as a tree (default in simple reports)]' - '(--flat)--flat[show accounts as a list (default in multicolumn)]' - '(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]' - '(-T --row-total)'{-T,--row-total}'[show a row total column]' - '(-N --no-total)'{-N,--no-total}'[do not show the final total row]' - '(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n' - '(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]' - '(--format)--format=[in tree mode, use this custom line format]:custom line format' - '(--sort-amount)--sort-amount[sort by amount instead of account code/name]' - ) - ;; - import) - args=( - '(--dry-run)--dry-run[just show the transactions to be imported]' - ) - ;; - is|incomestatement) - args+=( - '(--change)--change[show balance change in each period (default)]' - '(--cumulative)--cumulative[show balance change accumulated across periods]' - '(-H --historical)'{-H,--historical}'[show historical ending balance in each period]' - '(--tree)--tree[show accounts as a tree (default in simple reports)]' - '(--flat)--flat[show accounts as a list (default in multicolumn)]' - '(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]' - '(-T --row-total)'{-T,--row-total}'[show a row total column]' - '(-N --no-total)'{-N,--no-total}'[do not show the final total row]' - '(--drop)--drop=[in flat mode, omit N leading account name parts]:drop n' - '(--no-elide)--no-elide[tree mode, do not squash boring parent accounts]' - '(--format)--format=[in tree mode, use this custom line format]:custom line format' - '(--sort-amount)--sort-amount[sort by amount instead of account code/name]' - ) - ;; - print) - args=( - '(-m --match)'{-m,--match}'[show the transaction whose description is most similar]:string' - '(--new)--new[show only newer-dated transactions added in each file since last run]' - '(-x --explicit)'{-x,--explicit}'[show all amounts explicitly]' - '(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format' - '(-o --output-file)'{-o,--output-file}'=[write output to file]:file' - ) - ;; - register|reg) - args+=( - '(--cumulative)--cumulative[show balance change accumulated across periods]' - '(-H --historical)'{-H,--historical}'[show historical ending balance in each period]' - '(-A --average)'{-A,--average}'[show a row average column (in multicolumn mode)]' - '(-r --related)'{-r,--related}'[show postings'\'' siblings instead]' - '(-w --width)'{-w,--width}'=[set output width to 120, or N]:width (default 80)' - '(-O --output-format)'{-O,--output-format}='[select the output format from txt, csv, html]:format' - '(-o --output-file)'{-o,--output-file}'=[write output to file]:file' - ) - ;; - stats) - args=( - '(-o --output-file)'{-o,--output-file}'=[write output to file]:file' - ) - ;; - # fallback to _default - *) _arguments -C -A "-*" "$args[@]" \ - '*: :_default' && ret=0 - continue - esac - _arguments -C -A "-*" "$args[@]" \ - '*:query patterns:->query' && ret=0 - ;; - query) - - local -a accs keywords - keywords=( - 'acct\::match account names' - 'code\::match by transaction code' - 'desc\::match transaction descriptions' - 'tag\::match by tag name' - 'depth\::match at or above depth' - 'status\::match cleared/uncleared transactions' - 'real\::match real/virtual transactions' - 'empty\::match if amount is/is not zero' - 'amt\::match transaction amount' - 'cur\::match by currency' - ) - if compset -P 'amt:'; then - _message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0 - continue - fi - if compset -P '(#b)(code|desc|tag|depth|status|real|empty):'; then - _message "'$match[1]' parameter" && ret=0 - continue - fi - - accs=( ${(f)"$(_call_program hledger hledger accounts $PREFIX 2>/dev/null)"} ) - if (( $? )); then - _message "error fetching accounts from hledger" - fi - - # decided against partial matching here. these lines can - # be uncommented to complete subaccounts hierarchically - # (add -S '' -q to the compadd below, too) - # if compset -P '(#b)(*):'; then - # accs=( ${(M)accs:#$match[1]:*} ) - # accs=( ${accs#$IPREFIX} ) - # fi - # accs=( ${accs%%:*} ) - - _wanted accounts expl "accounts" compadd -a accs && ret=0 - _describe "matcher keywords" keywords -S '' && ret=0 - - # not is special, it doesn't need the -S '' - keywords=( - 'not:negate expression' - ) - _describe "matcher keywords" keywords && ret=0 - - ;; - esac -done - -return ret diff --git a/.zprezto/modules/completion/external/src/_homestead b/.zprezto/modules/completion/external/src/_homestead deleted file mode 100644 index 9dc1c41..0000000 --- a/.zprezto/modules/completion/external/src/_homestead +++ /dev/null @@ -1,53 +0,0 @@ -#compdef homestead -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for homestead (http://laravel.com/docs/homestead). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * loranger (https://github.com/loranger) -# -# ------------------------------------------------------------------------------ - - -_homestead_get_command_list () { - homestead --no-ansi | sed "1,/Available commands/d" | awk '/ [a-z]+/ { print $1 }' -} - -_homestead () { - if [ -f homestead ]; then - compadd `_homestead_get_command_list` - fi -} - -compdef _homestead php homestead -compdef _homestead homestead diff --git a/.zprezto/modules/completion/external/src/_httpie b/.zprezto/modules/completion/external/src/_httpie deleted file mode 100644 index 4d702ef..0000000 --- a/.zprezto/modules/completion/external/src/_httpie +++ /dev/null @@ -1,181 +0,0 @@ -#compdef http -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for httpie 0.7.2 (http://httpie.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Akira Maeda -# * Valodim -# * Claus Klingberg -# -# ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ - -_httpie_params () { - - local ret=1 expl - - # or a url - if (( CURRENT <= NORMARG+1 )) && [[ $words[NORMARG] != *:* ]] ; then - _httpie_urls && ret=0 - - # regular param, if we already have a url - elif (( CURRENT > NORMARG )); then - - # if the suffix is precisely : this is shorthand for a header - if [[ -prefix ':' ]]; then - PREFIX= - SUFFIX=: - fi - - # if we are in front of a : (possibly due to the PREFIX move before) - if [[ -suffix ':' ]]; then - - # this is rather buggy with normal tab behavior :\ - compstate[insert]=menu - _wanted http_header expl 'HTTP Header' \ - compadd -s ':' -S '' -- Content-Type Cookie && return 0 - fi - - # ignore all prefix stuff - compset -P '(#b)([^:@=]#)' - local name=$match[1] - - if compset -P '='; then - _message "$name data field value" - elif compset -P '@'; then - _files - elif compset -P ':=@'; then - _files - elif compset -P ':='; then - _message "$name raw json data" - elif compset -P '=='; then - _message "$name url parameter value" - elif compset -P ':'; then - _message "$name header content" - else - typeset -a ops - ops=( - '=:data field' - '\::header' - '==:request parameter' - '@:data file field' - '\:=:raw json field' - '\:=@:raw json field file path' - ) - _describe -t httpparams "parameter types" ops -Q -S '' - fi - - ret=0 - - fi - - # first arg may be a request method - (( CURRENT == NORMARG )) && - _wanted http_method expl 'Request Method' \ - compadd GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK && ret=0 - - return $ret - -} - -_httpie_urls() { - - local ret=1 - - if ! [[ -prefix [-+.a-z0-9]#:// ]]; then - local expl - compset -S '[^:/]*' && compstate[to_end]='' - _wanted url-schemas expl 'URL schema' compadd -S '' http:// https:// && ret=0 - else - _urls && ret=0 - fi - - return $ret - -} - -_httpie_printflags () { - - local ret=1 - - # not sure why this is necessary, but it will complete "-pH" style without it - [[ $IPREFIX == "-p" ]] && IPREFIX+=" " - - compset -P '(#b)([a-zA-Z]#)' - - local -a flags - [[ $match[1] != *H* ]] && flags+=( "H:request headers" ) - [[ $match[1] != *B* ]] && flags+=( "B:request body" ) - [[ $match[1] != *h* ]] && flags+=( "h:response headers" ) - [[ $match[1] != *b* ]] && flags+=( "b:response body" ) - - _describe -t printflags "print flags" flags -S '' && ret=0 - - return $ret - -} - -integer NORMARG - -_arguments -n -C -s \ - '(-j --json -f)'{-j,--json}'[Data items from the command line are serialized as a JSON object.]' \ - '(-f --form -j)'{-f,--form}'[Data items from the command line are serialized as form fields.]' \ - '--pretty=[Controls output processing.]:output format:(all colors format none)' \ - '(-s --style)'{-s,--style}'=[Output coloring style]:STYLE:(autumn borland bw colorful default emacs friendly fruity manni monokai murphy native pastie perldoc ttr solarized tango trac vim vs)' \ - '(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \ - '(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response.]' \ - '(-p -h --headers)'{-h,--headers}'[Print only the response headers.]' \ - '(-p -b --body)'{-b,--body}'[Print only the response body.]' \ - '(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`.]' \ - '(-o --output)'{-o,--output}'=[Save output to FILE.]:output file:_files' \ - '(-d --download)'{-d,--download}'=[Do not print the response body to stdout.]' \ - '(-c --continue)'{-c,--continue}'[Resume an interrupted download.]' \ - '(--session-read-only)--session=[Create, or reuse and update a session.]:session name (or path)' \ - '(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange.]:session name (or path)' \ - '(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \ - '--auth-type=[The authentication mechanism to be used. Defaults to "basic".]:AUTH-TYPE:(basic digest)' \ - '--proxy=[String mapping protocol to the URL of the proxy.]:PROXY' \ - '--follow[Allow full redirects.]' \ - "--verify=[Enable or disable verification of ssl certificates.]:verify certificate:(yes no)" \ - '--allow-redirects[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new ``Location``)]' \ - '--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback).]:timeout (seconds)' \ - '--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \ - '--ignore-stdin[Do not attempt to read stdin.]' \ - '(- *)--help[show help message.]' \ - "(- *)--version[show program's version number and exit.]" \ - '--traceback[Prints exception traceback should one occur.]' \ - '--debug[Prints exception traceback should one occur and other information useful for debugging HTTPie itself.]' \ - '*:args:_httpie_params' && return 0 diff --git a/.zprezto/modules/completion/external/src/_ibus b/.zprezto/modules/completion/external/src/_ibus deleted file mode 100644 index 69c114c..0000000 --- a/.zprezto/modules/completion/external/src/_ibus +++ /dev/null @@ -1,84 +0,0 @@ -#compdef ibus -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ibus (https://github.com/ibus/ibus). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Tomo Kazahaya -# -# ------------------------------------------------------------------------------ - -# The completion of "ibus emoji --lang=" depends on _language_codes from -# https://github.com/zsh-users/zsh-completions. - -local context state state_descr line -typeset -A opt_args -local curcontext=$curcontext - -_arguments -C \ - ":command:(($(ibus help|sed -ne 's/^ \(\S\+\) \+\(.*\)/"\1\\:\2"/p')))" \ - '*:: :->args' \ - && return - -case $state in - args) - case $line[1] in - engine) - _arguments \ - ":engine:(($(ibus list-engine|sed -ne 's/:/\\\\:/g' -e 's/^ \(\S\+\) - \(.*\)$/"\1:\2"/p')))" \ - && return - ;; - read-cache) - _arguments \ - '--system[show the content of the system registry cache]' \ - '--file=[custom registry cache to show]:registry cache:_files' \ - && return - ;; - write-cache) - _arguments \ - '--system[save the system registry cache]' \ - '--file=[custom registry cache to save]:registry cache:_files' \ - && return - ;; - emoji) - _arguments \ - '--font=[emoji font]:emoji font: ' \ - '--lang=[language of emoji annotations]:language:_language_codes ISO-639-1' \ - '--partial-match[match annotations with a partial string]' \ - && return - ;; - esac - ;; -esac - -return 1 diff --git a/.zprezto/modules/completion/external/src/_include-what-you-use b/.zprezto/modules/completion/external/src/_include-what-you-use deleted file mode 100644 index bb9902c..0000000 --- a/.zprezto/modules/completion/external/src/_include-what-you-use +++ /dev/null @@ -1,65 +0,0 @@ -#compdef include-what-you-use - -# Copyright 2018 CERN for the benefit of the LHCb Collaboration. -# All rights reserved. -# -# Developed by: -# -# CERN LBC group -# -# CERN -# -# http://cern.ch -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# with the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimers. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimers in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of the LBC group, CERN, nor the names of its -# contributors may be used to endorse or promote products derived from -# this Software without specific prior written permission. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH -# THE SOFTWARE. -# -# In applying this licence, CERN does not waive the privileges and immunities -# granted to it by virtue of its status as an Intergovernmental Organization or -# submit itself to any jurisdiction. - -# TODO: -# - prevent _iwyu_opts from running once the first clang option got passed - -_iwyu_opts() { - _arguments '--check_also=[print iwyu-violation info for files matching the given glob pattern]:glob pattern:' \ - '--cwd=[specify the current working directory]:current working directory:_path_files -/' \ - '--howtodebug[print instructions on how to run iwyu under gdb]' \ - '--howtodebug=[print instructions on how to run iwyu under gdb if file matches argument]:file for debug run:_path_files' \ - '*'"--mapping_file=[iwyu mapping file]:iwyu mapping file:_path_files -g '*(/) *.imp'" \ - "--no_default_mappings[do not add iwyu's default mappings]" \ - '--pch_in_code[mark the first include in a translation unit as a precompiled header]' \ - '--prefix_header_includes=[what to do with command line includes]:command line include treatment:(add keep remove)' \ - "--transitive_includes_only[do not suggest that a file add headers that aren't already visible]" \ - '--max_line_length=[maximum line length for includes]:a number:' \ - '--no_comments[do not add "why" comments]' \ - '--no_fwd_decls[do not use forward declarations]' \ - '--verbose=[the higher the level, the more output]:a number:' -} - -_arguments "*-Xiwyu[include-what-you-use options]:include-what-you-use options:_iwyu_opts" -# gcc will also provide --version and --help. Not ideal. -_gcc diff --git a/.zprezto/modules/completion/external/src/_jmeter b/.zprezto/modules/completion/external/src/_jmeter deleted file mode 100644 index c26db82..0000000 --- a/.zprezto/modules/completion/external/src/_jmeter +++ /dev/null @@ -1,49 +0,0 @@ -#compdef jmeter -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for JMeter (http://jakarta.apache.org/jmeter). -# -# Status: incomplete -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '(- 1 *)'{-h,--help}'[print usage information and exit]' \ - '(- 1 *)'{-v,--version}'[print the version information and exit]' \ - {-p,--propfile}'[the jmeter property file to use]:properties file:_files -g "*.properties"' \ - '*'{-q,--addprop}'[additional property file(s)]:properties file:_files -g "*.properties"' \ - {-t,--testfile}'[the jmeter test plan file to run]:JMeter test plan file:_files -g "*.jmx"' \ - {-j,--jmeterlogfile}'[the jmeter log file]: :_files -g "*.log"' \ - {-l,--logfile}'[the file to log samples to]: :_files -g "*.jtl"' \ - {-n,--nongui}'[run JMeter in nongui mode]' \ - {-s,--server}'[run the JMeter server]' \ - {-H,--proxyHost}'[set a proxy server for JMeter to use]: :_hosts' \ - {-P,--proxyPort}'[set proxy server port for JMeter to use]:number' \ - {-u,--username}'[set username for proxy server that JMeter is to use]:username:_users' \ - {-a,--password}'[set password for proxy server that JMeter is to use]:password' \ - {-J-,--jmeterproperty}'[define additional JMeter properties]:argument=value' \ - {-G-,--globalproperty}'[define Global properties (sent to servers)]:argument=value' \ - {-D-,--systemproperty}'[define additional System properties]:argument=value' \ - {-S,--systemPropertyFile}'[a property file to be added as System properties]:properties file:_files -g "*.properties"' \ - {-L,--loglevel}'[define loglevel]:[category=]level' \ - {-r,--runremote}'[start remote servers (as defined by the jmeter property remote_hosts)]' \ - {-R,--remotestart}'[start these remote servers (overrides remote_hosts)]:remote servers list' \ - {-d,--homedir}'[the JMeter home directory to use]: :_files -/' \ - {-X,--remoteexit}'[exit the remote servers at end of test (non-GUI)]' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_jmeter-plugins b/.zprezto/modules/completion/external/src/_jmeter-plugins deleted file mode 100644 index 3253896..0000000 --- a/.zprezto/modules/completion/external/src/_jmeter-plugins +++ /dev/null @@ -1,42 +0,0 @@ -#compdef jmeter-plugins -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for jmeter-plugins command line tool 0.4.2 -# (http://code.google.com/p/jmeter-plugins). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '(- 1 *)--help[show help options]' \ - '--generate-png[generate PNG file containing graph]:PNG file name:_files -g "*.png"' \ - '--generate-csv[generate CSV file containing graph data]:CSV file name:_files -g "*.csv"' \ - '--input-jtl[load data from specified JTL file]:JTL file:_files -g "*.jtl"' \ - '--plugin-type[type of graph to use for results generation]:class:((AggregateReport ThreadsStateOverTime BytesThroughputOverTime HitsPerSecond LatenciesOverTime PerfMon ResponseCodesPerSecond ResponseTimesDistribution ResponseTimesOverTime ResponseTimesPercentiles ThroughputOverTime ThroughputVsThreads TimesVsThreads TransactionsPerSecond))' \ - '--width[set graph width]:graph width (pixels)' \ - '--height[set graph height]::graph height (pixels)' \ - '--granulation[granulation time for samples]:time (ms)' \ - '--relative-times[use relative X axis times, no will set absolute times]: :((yes no))' \ - '--aggregate-rows[aggregate all rows into one]: :((yes no))' \ - '--paint-gradient[paint gradient background]: :((yes no))' \ - '--paint-zeroing[paint zeroing lines]: :((yes no))' \ - '--prevent-outliers[prevent outliers on distribution graph]: :((yes no))' \ - '--limit-rows[limit number of points in row]:number of points' \ - '--force-y[force Y axis limit]:limit' \ - '--hide-low-counts[hide points with sample count below limit]:limit' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_jonas b/.zprezto/modules/completion/external/src/_jonas deleted file mode 100644 index 1965917..0000000 --- a/.zprezto/modules/completion/external/src/_jonas +++ /dev/null @@ -1,100 +0,0 @@ -#compdef jonas -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for JOnAS 5.2 (http://jonas.ow2.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -typeset -A opt_args -local context state line curcontext="$curcontext" ret=1 - -_arguments -C \ - '1:cmd:->cmds' \ - '*::arg:->args' \ -&& ret=0 - -case "$state" in - (cmds) - local commands; commands=( - 'version:show version information' - 'check:check that the JOnAS environment is correctly set' - 'start:start a server instance' - 'stop:stop a server instance' - 'admin:administrate a server instance' - ) - _describe -t commands 'command' commands && ret=0 - ;; - (args) - curcontext="${curcontext%:*:*}:jonas-cmd-$words[1]:" - case $words[1] in - (version|check) - _message 'no more arguments' && ret=0 - ;; - (start) - _arguments \ - '-standby[start a minimal JOnAS server with only mandatory services]' \ - '(-bg)-fg[start the server in foreground mode]' \ - '(-fg)-bg[start the server in background mode]' \ - '-win[start the server in a new window]' \ - '(-bg)-tui[start the Apache Felix TUI (force foreground mode)]' \ - '-gui[start the Apache Felix GUI]' \ - '-dev[start a JOnAS server by using bundles present in the default maven repository instead of bundles under $JONAS_ROOT/lib/bundles]' \ - '-clean[clean the Apache Felix cache before starting a JOnAS server]' \ - '-n[set the server name, must be unique in the domain (default: jonas)]:name' \ - '-target[start another server or cluster (group of servers) in the domain]:server' \ - '-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \ - && ret=0 - ;; - (stop) - _arguments \ - '-standby[stop all services except the mandatory ones]' \ - '-n[set the name of the server to stop (default: jonas)]:name' \ - '-target[stop another server or cluster (group of servers) in the domain]:server' \ - '-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \ - && ret=0 - ;; - (admin) - _arguments \ - '(- : *)-?[print the help message]' \ - '-win[administer the server in a new window]' \ - '-n[set the name of the server to administer (default: jonas)]:name' \ - '-username[set the username when authentication is required]: :_users' \ - '-password[set the password when authentication is required]:password' \ - '-registry[set the registry URL]: :_urls' \ - '-protocol[set the protocol name]:protocol:((jrmp\:JRE\ implementation\ of\ RMI\ on\ the\ JRMP\ protocol\ \(default\) iiop\:JacORB\ implementation\ of\ RMI\ over\ the\ IIOP\ protocol irmi\:Oracle\ JRE\ independant\ implementation\ of\ RMI))' \ - '-a[deploy an application from a given filepath on the current server, or on another target in the domain if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \ - '-r[undeploy a previously deployed application from the current server or from the specified target if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \ - '-gc[run the garbage collector on the current JOnAS server]' \ - '-passivate[passivate all entity bean instances]' \ - '-e[list the properties of the current JOnAS server]' \ - '-j[list the registered JNDI names, as seen by the current JOnAS server]' \ - '-l[list the beans currently loaded by the current JOnAS server]' \ - '-synch[synchronize the entity bean instances on the current JOnAS server]' \ - '-debug[set the logging level for the given topic to DEBUG]:topic' \ - '-tt[change the default timeout for transactions]:timeout (seconds)' \ - '-ping[wait until the JOnAS server is available]' \ - '-timeout[maximum time to wait when -ping is used]:timeout (seconds)' \ - && ret=0 - ;; - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_jq b/.zprezto/modules/completion/external/src/_jq deleted file mode 100644 index 3cd9c50..0000000 --- a/.zprezto/modules/completion/external/src/_jq +++ /dev/null @@ -1,84 +0,0 @@ -#compdef jq -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for jq (http://stedolan.github.io/jq/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Hideaki Miyake (https://github.com/mollifier) -# * George Kontridze (https://github.com/gkze) -# -# ------------------------------------------------------------------------------ - -declare -a opts args -args=( - '--argfile[This option passes the first value from the named file as a value to the jq program as a predefined variable]' - '--unbuffered[Flush the output after each JSON object is printed]' - '(-C --color-output)'{-C,--color-output}'[Colorize the output even if writing to a pipe or a file]' - '(-I --online-input)'{-I,--online-input}'[When the top-level input value is an array produce its elements instead of the array]' - '(-M --monochrome-output)'{-M,--monochrome-output}'[Not colorize the output]' - '(-R --raw-input)'{-R,--raw-input}'[Parse the input as not JSON but string]' - '(-S --sort-keys)'{-S,--sort-keys}'[Output the fields of each object with the keys in sorted order]' - '(-V --version)'{-V,--version}'[Display version information]' - '(-a --ascii-output)'{-a,--ascii-output}'[Output with pure ASCII characters]' - '(-e --exit-status)'{-e,--exit-status}'[Sets the exitstatus of jq to 0 if the last output values was neither false nor null, 1 if the last output value was either false or null, or 4 if no valid result was ever produced]' - '(-c --compact-output)'{-c,--compact-output}'[Compact output]' - '(-h --help)'{-h,--help}'[Display help information]' - '(-n --null-input)'{-n,--null-input}'[Run the filter using null as the input]' - '(-r --raw-output)'{-r,--raw-output}'[Not format string result as a JSON string with quotes]' - '(-s --slurp)'{-s,--slurp}'[Run the filter just once]' - '--arg[Passes a value to the jq program, e.g. --arg foo bar]:jq variable: ' - '1: :_guard "^-*" pattern' - '*:files:->file' -) -local curcontext=$curcontext state line ret=1 -declare -A opt_args - -_arguments -C $opts \ - $args && ret=0 - -case $state in - file) - _files && ret=0 - ;; -esac - -return $ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et - diff --git a/.zprezto/modules/completion/external/src/_jrnl b/.zprezto/modules/completion/external/src/_jrnl deleted file mode 100644 index c0c03e6..0000000 --- a/.zprezto/modules/completion/external/src/_jrnl +++ /dev/null @@ -1,65 +0,0 @@ -#compdef jrnl -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for jrnl a simple journal application for your command line. (https://maebert.github.io/jrnl/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_jrnl() { - - _arguments -C \ - '(- 1 *)'-h"[Show help and exit]" \ - '(- 1 *)'-v"[Prints version information and exits]" \ - '(- 1 *)'-ls"[Displays accessible journals]" \ - '(- 1 *)'-d"[Execute in debug mode]" \ - '(- 1 *)'--tags"[Returns a list of all tags and number of occurences]" \ - "--short[Show only titles or line containing the search]" \ - "-from[View entries after this date]:date:" \ - "-until[View entries before this date]:date:" \ - "-to[View entries before this date]:date:" \ - "-on[View entries on this date]:date:" \ - "-and[Filter by tags using AND (default: OR)]" \ - "-starred[Show only starred entries]" \ - "-n[Shows the last n entries matching the filter. And '-3' have the same effect.]":number: \ - "--export[Export your journal. TYPE can be json, markdown text.]:format:(json markdown text)" \ - "-o[Optionally specifies output file when using --export If OUTPUT is a directory, exports each entry in individual file instead.]:output file:" \ - "--encrypt[Encrypts your existing journal with a new pass]" \ - "--decrypt[Decrypts your journal and stores it in plain text]" \ -} - -_jrnl - diff --git a/.zprezto/modules/completion/external/src/_kak b/.zprezto/modules/completion/external/src/_kak deleted file mode 100644 index 6079f36..0000000 --- a/.zprezto/modules/completion/external/src/_kak +++ /dev/null @@ -1,71 +0,0 @@ -#compdef kak -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for kak (https://github.com/mawww/kakoune) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Frank LENORMAND -# -# ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ - -_kak_sessions() { - local -a session_ids expl - session_ids=($(_call_program session_names kak -l)) - _description session-ids expl "session name" - compadd "$expl[@]" -a session_ids -} - -_kak() { - _arguments \ - '-n[do not source rc files on startup]' \ - '-l[list existing sessions]:session_id:_kak_sessions' \ - '-clear[clear dead sessions]' \ - '-ro[readonly mode]' \ - '(-help --help)'{-help,--help}'[display a help message and quit]' \ - '-d[run as a headless session (requires -s)]' \ - '-q[in filter mode, be quiet about errors applying keys]' \ - '-c[connect to given session]:session_id:_kak_sessions' \ - '-e[execute argument on client initialisation]:keys' \ - '-E[execute argument on server initialisation]:keys' \ - '-s[set session name]:session_id' \ - '-p[just send stdin as commands to the given session]:session_id:_kak_sessions' \ - '-f[act as a filter, executing given keys on given files]:keys' \ - '-i[backup the files on which a filter is applied using the given suffix]:suffix' \ - '-ui[set the type of user interface to use (ncurses, dummy, or json)]:ui_type:(ncurses dummy json)' \ - '*::files:_files' -} - -_kak "$@" diff --git a/.zprezto/modules/completion/external/src/_kitchen b/.zprezto/modules/completion/external/src/_kitchen deleted file mode 100644 index dee5c58..0000000 --- a/.zprezto/modules/completion/external/src/_kitchen +++ /dev/null @@ -1,85 +0,0 @@ -#compdef kitchen -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Test Kitchen (http://kitchen.ci/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Peter Eisentraut (https://github.com/petere) -# -# ------------------------------------------------------------------------------ - - -_kitchen() { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments '1: :->cmds'\ - '2: :->args' - - case $state in - cmds) - _kitchen_commands - ;; - args) - case $line[1] in - converge|create|destroy|diagnose|list|setup|test|verify) - compadd 'all' - _kitchen_instances - ;; - login) - _kitchen_instances - ;; - esac - ;; - esac -} - -_kitchen_commands() { - local commands - - commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}") - _describe -t commands 'kitchen commands' commands -} - -_kitchen_instances() { - if [[ $_kitchen_instances_cache_dir != $PWD ]]; then - unset _kitchen_instances_cache - fi - if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then - _kitchen_instances_cache=(${(f)"$(_call_program instances $service list -b 2>/dev/null)"}) - _kitchen_instances_cache_dir=$PWD - fi - _wanted instances expl 'instance' compadd -a _kitchen_instances_cache -} - -_kitchen "$@" diff --git a/.zprezto/modules/completion/external/src/_knife b/.zprezto/modules/completion/external/src/_knife deleted file mode 100644 index 53aa9ac..0000000 --- a/.zprezto/modules/completion/external/src/_knife +++ /dev/null @@ -1,238 +0,0 @@ -#compdef knife -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Chef's knife (http://www.opscode.com/chef). -# -# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/knife -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Frank Louwers (https://github.com/franklouwers) -# * Mark Cornick (https://github.com/markcornick) -# -# ------------------------------------------------------------------------------ - - -# knife has a very special syntax, some example calls are: -# knife status -# knife cookbook list -# knife role show ROLENAME -# knife data bag show DATABAGNAME -# knife role show ROLENAME --attribute ATTRIBUTENAME -# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes - -# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces -_knife() { - local curcontext="$curcontext" state line - typeset -A opt_args - - # These flags should be available everywhere according to man knife - knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes --environment ) - - cloudproviders=(bluebox ec2 rackspace slicehost terremark) - _arguments \ - '1: :->knifecmd'\ - '2: :->knifesubcmd'\ - '3: :->knifesubcmd2' \ - '4: :->knifesubcmd3' \ - '5: :->knifesubcmd4' \ - '6: :->knifesubcmd5' - - case $state in - knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff environment user exec index node recipe role search ssh status windows $cloudproviders - ;; - knifesubcmd) - case $words[2] in - (bluebox|ec2|rackspace|slicehost|terremark) - compadd "$@" server images - ;; - client) - compadd -Q "$@" "bulk delete" list create show delete edit reregister - ;; - configure) - compadd "$@" client - ;; - cookbook) - compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload - ;; - diff) - _arguments '*:file or directory:_files -g "*.(rb|json)"' - ;; - environment) - compadd -Q "$@" create delete edit "from file" list show - ;; - user) - compadd -Q "$@" create delete edit list reregister show - ;; - node) - compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" - ;; - recipe) - compadd "$@" list - ;; - role) - compadd -Q "$@" "bulk delete" create delete edit "from file" list show - ;; - windows) - compadd "$@" bootstrap - ;; - *) - _arguments '2:Subsubcommands:($(_knife_options1))' - esac - ;; - knifesubcmd2) - case $words[3] in - server) - compadd "$@" list create delete - ;; - images) - compadd "$@" list - ;; - site) - compadd "$@" vendor show share search download list unshare - ;; - (show|delete|edit) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))' - ;; - (upload|test) - _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - bag) - compadd -Q "$@" show edit list "from file" create delete - ;; - *) - _arguments '3:Subsubcommands:($(_knife_options2))' - esac - ;; - knifesubcmd3) - case $words[3] in - show) - case $words[2] in - cookbook) - versioncomp=1 - _arguments '4:Cookbookversions:($(_cookbook_versions) latest)' - ;; - (node|client|role|environment) - compadd "$@" --attribute - esac - esac - case $words[4] in - (show|edit) - _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))' - ;; - file) - _arguments '*:file or directory:_files -g "*.(rb|json)"' - ;; - list) - compadd -a "$@" knife_general_flags - ;; - *) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac - ;; - knifesubcmd4) - if (( versioncomp > 0 )); then - compadd "$@" attributes definitions files libraries providers recipes resources templates - else - _arguments '*:Subsubcommands:($(_knife_options2))' - fi - ;; - knifesubcmd5) - _arguments '*:Subsubcommands:($(_knife_options3))' - esac -} - -# Helper functions to provide the argument completion for several depths of commands -_knife_options1() { - ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options2() { - ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -_knife_options3() { - ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done ) -} - -# The chef_x_remote functions use knife to get a list of objects of type x on the server -_chef_roles_remote() { - (knife role list | awk '{print $1}') -} - -_chef_clients_remote() { - (knife client list | awk '{print $1}') -} - -_chef_nodes_remote() { - (knife node list | awk '{print $1}') -} - -_chef_cookbooks_remote() { - (knife cookbook list | awk '{print $1}') -} - -_chef_sitecookbooks_remote() { - (knife cookbook site list | awk '{print $1}') -} - -_chef_data_bags_remote() { - (knife data bag list | awk '{print $1}') -} - -_chef_environments_remote() { - (knife environment list | awk '{print $1}') -} - -_chef_users_remote() { - (knife user list | awk '{print $1}') -} - -# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server -_chef_cookbooks_local() { - (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' | cut -d '"' -f2 ); do ls $i; done) -} - -# This function extracts the available cookbook versions on the chef server -_cookbook_versions() { - (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g') -} - -_knife "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_language_codes b/.zprezto/modules/completion/external/src/_language_codes deleted file mode 100644 index ef9d25a..0000000 --- a/.zprezto/modules/completion/external/src/_language_codes +++ /dev/null @@ -1,250 +0,0 @@ -#autoload -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completer for language codes. -# -# Usage: _language_codes ISO-639-1 -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -(( $+functions[_language_codes_iso_639_1] )) || -_language_codes_iso_639_1() { - local codes; codes=( - 'aa:Afar' - 'ab:Abkhazian' - 'af:Afrikaans' - 'ak:Akan' - 'sq:Albanian' - 'am:Amharic' - 'ar:Arabic' - 'an:Aragonese' - 'hy:Armenian' - 'as:Assamese' - 'av:Avaric' - 'ae:Avestan' - 'ay:Aymara' - 'az:Azerbaijani' - 'ba:Bashkir' - 'bm:Bambara' - 'eu:Basque' - 'be:Belarusian' - 'bn:Bengali' - 'bh:Bihari languages' - 'bi:Bislama' - 'bo:Tibetan' - 'bs:Bosnian' - 'br:Breton' - 'bg:Bulgarian' - 'my:Burmese' - 'ca:Catalan' - 'cs:Czech' - 'ch:Chamorro' - 'ce:Chechen' - 'zh:Chinese' - 'cu:Church Slavic' - 'cv:Chuvash' - 'kw:Cornish' - 'co:Corsican' - 'cr:Cree' - 'cy:Welsh' - 'cs:Czech' - 'da:Danish' - 'de:German' - 'dv:Divehi' - 'nl:Dutch' - 'dz:Dzongkha' - 'el:Greek, Modern (1453-)' - 'en:English' - 'eo:Esperanto' - 'et:Estonian' - 'eu:Basque' - 'ee:Ewe' - 'fo:Faroese' - 'fa:Persian' - 'fj:Fijian' - 'fi:Finnish' - 'fr:French' - 'fy:Western Frisian' - 'ff:Fulah' - 'ka:Georgian' - 'de:German' - 'gd:Gaelic' - 'ga:Irish' - 'gl:Galician' - 'gv:Manx' - 'gn:Guarani' - 'gu:Gujarati' - 'ht:Haitian' - 'ha:Hausa' - 'he:Hebrew' - 'hz:Herero' - 'hi:Hindi' - 'ho:Hiri Motu' - 'hr:Croatian' - 'hu:Hungarian' - 'hy:Armenian' - 'ig:Igbo' - 'is:Icelandic' - 'io:Ido' - 'ii:Sichuan Yi' - 'iu:Inuktitut' - 'ie:Interlingue' - 'ia:Interlingua (International Auxiliary Language Association)' - 'id:Indonesian' - 'ik:Inupiaq' - 'is:Icelandic' - 'it:Italian' - 'jv:Javanese' - 'ja:Japanese' - 'kl:Kalaallisut' - 'kn:Kannada' - 'ks:Kashmiri' - 'ka:Georgian' - 'kr:Kanuri' - 'kk:Kazakh' - 'km:Central Khmer' - 'ki:Kikuyu' - 'rw:Kinyarwanda' - 'ky:Kirghiz' - 'kv:Komi' - 'kg:Kongo' - 'ko:Korean' - 'kj:Kuanyama' - 'ku:Kurdish' - 'lo:Lao' - 'la:Latin' - 'lv:Latvian' - 'li:Limburgan' - 'ln:Lingala' - 'lt:Lithuanian' - 'lb:Luxembourgish' - 'lu:Luba-Katanga' - 'lg:Ganda' - 'mk:Macedonian' - 'mh:Marshallese' - 'ml:Malayalam' - 'mi:Maori' - 'mr:Marathi' - 'ms:Malay' - 'mk:Macedonian' - 'mg:Malagasy' - 'mt:Maltese' - 'mn:Mongolian' - 'mi:Maori' - 'ms:Malay' - 'my:Burmese' - 'na:Nauru' - 'nv:Navajo' - 'nr:Ndebele, South' - 'nd:Ndebele, North' - 'ng:Ndonga' - 'ne:Nepali' - 'nl:Dutch' - 'nn:Norwegian Nynorsk' - 'nb:Bokmål, Norwegian' - 'no:Norwegian' - 'ny:Chichewa' - 'oc:Occitan (post 1500)' - 'oj:Ojibwa' - 'or:Oriya' - 'om:Oromo' - 'os:Ossetian' - 'pa:Panjabi' - 'fa:Persian' - 'pi:Pali' - 'pl:Polish' - 'pt:Portuguese' - 'ps:Pushto' - 'qu:Quechua' - 'rm:Romansh' - 'ro:Romanian' - 'ro:Romanian' - 'rn:Rundi' - 'ru:Russian' - 'sg:Sango' - 'sa:Sanskrit' - 'si:Sinhala' - 'sk:Slovak' - 'sk:Slovak' - 'sl:Slovenian' - 'se:Northern Sami' - 'sm:Samoan' - 'sn:Shona' - 'sd:Sindhi' - 'so:Somali' - 'st:Sotho, Southern' - 'es:Spanish' - 'sq:Albanian' - 'sc:Sardinian' - 'sr:Serbian' - 'ss:Swati' - 'su:Sundanese' - 'sw:Swahili' - 'sv:Swedish' - 'ty:Tahitian' - 'ta:Tamil' - 'tt:Tatar' - 'te:Telugu' - 'tg:Tajik' - 'tl:Tagalog' - 'th:Thai' - 'bo:Tibetan' - 'ti:Tigrinya' - 'to:Tonga (Tonga Islands)' - 'tn:Tswana' - 'ts:Tsonga' - 'tk:Turkmen' - 'tr:Turkish' - 'tw:Twi' - 'ug:Uighur' - 'uk:Ukrainian' - 'ur:Urdu' - 'uz:Uzbek' - 've:Venda' - 'vi:Vietnamese' - 'vietnamien' - 'vo:Volapük' - 'cy:Welsh' - 'wa:Walloon' - 'wo:Wolof' - 'xh:Xhosa' - 'yi:Yiddish' - 'yo:Yoruba' - 'za:Zhuang' - 'zh:Chinese' - 'zu:Zulu' - ) - _describe -t language-codes 'ISO 639-1 language code' codes "$@" -} - -_language_codes() { - local command="$argv[$#]" ret=1 - - case $command in - ISO-639-1) - _language_codes_${${command//-/_}:l} "${@[1,-2]}" && ret=0 - ;; - *) - _message "unknown command: $command" - ;; - esac - - return ret -} - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_lsattr b/.zprezto/modules/completion/external/src/_lsattr deleted file mode 100644 index 3d936fe..0000000 --- a/.zprezto/modules/completion/external/src/_lsattr +++ /dev/null @@ -1,54 +0,0 @@ -#compdef lsattr -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for lsattr a tool which lists file attributes on a Linux second extended file system. (http://e2fsprogs.sourceforge.net/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_lsattr() { - -_arguments -C \ - "(-d)-R[Recursively list attributes of directories and their contents.]" \ - "-V[Display the program version.]" \ - "(-d)-a[List all files in directories, including files that start with '.']" \ - "(-a -R)-d[List directories like other files, rather than listing their contents.]" \ - "-v[List the file\'s version/generation number.]" \ - '*:files:_files' \ -} - -_lsattr - diff --git a/.zprezto/modules/completion/external/src/_lsblk b/.zprezto/modules/completion/external/src/_lsblk deleted file mode 100644 index 4040338..0000000 --- a/.zprezto/modules/completion/external/src/_lsblk +++ /dev/null @@ -1,97 +0,0 @@ -#compdef lsblk -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for lsblk (from util-linux 2.27.1->) -# (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Ole Jørgen Brønner -# -# ------------------------------------------------------------------------------ -# -# Note: lsblk has upstream bash completions, which has served as a guide -# Note: Credit to https://github.com/RobSis/zsh-completion-generator which was -# used to generate an initial skeleton - -local arguments - -local lsblk_cols_all=( - NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT - LABEL UUID PARTTYPE PARTLABEL PARTUUID PARTFLAGS - RA RO RM - MODEL SIZE STATE OWNER GROUP MODE - ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC - ROTA SCHED RQ-SIZE TYPE DISC-ALN - DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN - RAND PKNAME HCTL TRAN REV VENDOR) - -_lsblk_columns() { - compadd $@ $lsblk_cols_all -} - -_lsblk_major_number() { - # /sys/dev/block/ contains MAJOR:MINOR symlinks. eg. 7:0 - local device_paths=(/sys/dev/block/*(N)) - local major_numbers=(${${device_paths##*/}%%:*}) - # major_numbers might have duplicates but compadd handles that - compadd $@ $major_numbers -} - -arguments=( - '(-a --all)'{-a,--all}'[print all devices]' - '(-b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]' - '(-d --nodeps)'{-d,--nodeps}'[dont print slaves or holders]' - '(-D --discard)'{-D,--discard}'[print discard capabilities]' - '(-e --exclude)'{-e,--exclude}'[exclude devices by major number]:major number:_sequence _lsblk_major_number' - '(-f --fs)'{-f,--fs}'[output info about filesystems]' - '(-i --ascii)'{-i,--ascii}'[use ascii characters only]' - '(-I --include)'{-I,--include}'=[show only devices with specified major numbers]:major number:_sequence _lsblk_major_number' - '(-J --json)'{-J,--json}'[use JSON output format]' - '(-l --list)'{-l,--list}'[use list format output]' - '(-m --perms)'{-m,--perms}'[output info about permissions]' - '(-n --noheadings)'{-n,--noheadings}'[dont print headings]' - '(-o --output)'{-o,--output}'=[specify output columns]:output column:_sequence _lsblk_columns' - '(-O --output-all)'{-O,--output-all}'[output all columns]' - '(-p --paths)'{-p,--paths}'[print complete device path]' - '(-P --pairs)'{-P,--pairs}'[use key="value" output format]' - '(-r --raw)'{-r,--raw}'[use raw output format]' - '(-s --inverse)'{-s,--inverse}'[inverse dependencies]' - '(-S --scsi)'{-S,--scsi}'[output info about SCSI devices]' - '(-t --topology)'{-t,--topology}'[output info about topology]' - '(-x --sort)'{-x,--sort}'=[sort output by specified column]:sort column:_lsblk_columns' - '(-h --help)'{-h,--help}'[display this help and exit]' - '(-V --version)'{-V,--version}'[output version information and exit]' - '*:device:_path_files -g "*(N-%) *(N-/)"' -) - -_arguments -s $arguments diff --git a/.zprezto/modules/completion/external/src/_lunchy b/.zprezto/modules/completion/external/src/_lunchy deleted file mode 100644 index 38cbda9..0000000 --- a/.zprezto/modules/completion/external/src/_lunchy +++ /dev/null @@ -1,74 +0,0 @@ -#compdef lunchy -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for lunchy (https://github.com/mperham/lunchy). -# -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Blake Walters (https://github.com/markupboy) -# -# ------------------------------------------------------------------------------ - -local state line cmds ret=1 - -_arguments -C '1: :->cmds' '*: :->args' - -case $state in - cmds) - local -a cmds - cmds=( - 'ls:list available agents' - 'start:start an agent' - 'stop:stop an agent' - 'restart:restart an agent' - 'status:get the status of agent[s]' - 'install:install an agents plist file' - 'edit:edit an agent' - ) - _describe -t commands 'lunchy command' cmds && ret=0 - ;; - args) - case $line[1] in - (install) - ;; - (restart|stop) - _values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0 - ;; - *) - _values 'items' `lunchy ls` 2>/dev/null && ret=0 - ;; - esac - ;; -esac - -return ret diff --git a/.zprezto/modules/completion/external/src/_middleman b/.zprezto/modules/completion/external/src/_middleman deleted file mode 100644 index cbcebf2..0000000 --- a/.zprezto/modules/completion/external/src/_middleman +++ /dev/null @@ -1,156 +0,0 @@ -#compdef middleman -# ------------------------------------------------------------------------------ -# Copyright (c) 2013 Jozef Izso, MIT License -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for middleman (http://middlemanapp.com/) -# Includes commands from middleman-blog and middleman-deploy extesions. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jozef Izso (https://github.com/jozefizso) -# -# ------------------------------------------------------------------------------ - -local ret=1 state - -local -a common_ops -common_ops=( - "--help[Display help]" -) - -typeset -A opt_args -_arguments \ - ':subcommand:->subcommand' \ - $common_ops \ - '*::options:->options' && ret=0 - -case $state in - subcommand) - local -a subcommands - subcommands=( - "article:Create a new blog article" - "build:Builds the static site for deployment" - "console:Start an interactive console in the context of your Middleman application" - "deploy:Deploy a middleman built site over rsync, ftp, sftp, or git (e.g. gh-pages on github)." - "extension:Create Middleman extension scaffold" - "init:Create new project" - "server:Start the preview server" - "upgrade:Upgrade installed bundle" - "version:Show version" - ) - - _describe -t subcommands 'middleman subcommand' subcommands && ret=0 - ;; - - options) - local -a args - args=( - $common_ops - ) - - local -a help - help=( - "--help[Display help information]" - ) - - case $words[1] in - article) - args=( - {-d,--date}"[The date to create the post with (defaults to now)]:date" - ) - ;; - - build) - args=( - "--clean[Remove orphaned files from build (Default: true)]" - "--no-clean[Disable removing orphaned files from build]" - {-g,--glob}"[Build a subset of the project]:glob" - "--verbose[Print debug messages]" - "--instrument[Print instrument messages]:instrument" - "--profile[Generate profiling report for the build]" - ) - ;; - - console) - args=( - {-e,--environment}"[The environment Middleman will run under (Default: development)]:environment" - "--verbose[Print debug messages]" - ) - ;; - - deploy) - args=( - {-b,--build-before}"[Run \`middleman build\` before the deploy step]" - ) - ;; - - extension) - args=( - "--git[Default: true]" - ) - ;; - - init) - args=( - {-T,--template}"[Use a project template: default, html5, mobile, smacss, empty. (Default: default)]:template" - "--css-dir [The path to the css files]:css_dir" - "--js-dir [The path to the javascript files]:js_dir" - "--images-dir [The path to the image files]:images_dir" - "--rack [Include a config.ru file]" - "--skip-gemfile [Don't create a Gemfile]" - "--skip-bundle [Don't run bundle install]" - "--skip-git [Skip Git ignores and keeps]" - ) - ;; - - server) - args=( - {-e,--environment}"[The environment Middleman will run under (Default: development)]:environment" - {-h,--host}"[Bind to HOST address (Default: 0.0.0.0)]:host" - {-p,--port}"[The port Middleman will listen on (Default: 4567)]:port" - "--verbose [Print debug messages]" - "--instrument [Print instrument messages]:instrument" - "--disable-watcher [Disable the file change and delete watcher process]" - "--profile [Generate profiling report for server startup]" - "--reload-paths [Additional paths to auto-reload when files change]:reload_paths" - "--force-polling [Force file watcher into polling mode]" - ) - ;; - - upgrade) - args=() - ;; - - version) - args=() - ;; - esac - - _arguments $args && ret=0 - ;; -esac - -return ret diff --git a/.zprezto/modules/completion/external/src/_mina b/.zprezto/modules/completion/external/src/_mina deleted file mode 100644 index 01b06f2..0000000 --- a/.zprezto/modules/completion/external/src/_mina +++ /dev/null @@ -1,68 +0,0 @@ -#compdef mina -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Mina (http://nadarei.co/mina/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Kazuya Takeshima (https://github.com/mitukiii) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - {-h,--help}'[Show help]' \ - {-V,--version}'[Show program version]' \ - {-v,--verbose}'[Show commands as they happen]' \ - {-s,--simulate}'[Run in simulation mode]' \ - {-t,--trace}'[Show backtraces when errors occur]' \ - -f'[Use FILE as the deploy configuration]:file:_files' \ - '*: :->cmds' && ret=0 - -case $state in - cmds) - cmds=( ${(f)"$(_call_program commands mina -T 2> /dev/null | sed -e 's/:/\\:/g; s/\[/\\[/g; s/\]/\\]/g; s/mina \([^ ]*\) .*# /\1:/g')"} ) - _describe -t commands 'mina command' cmds && ret=0 - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_mix b/.zprezto/modules/completion/external/src/_mix deleted file mode 100644 index bb4233f..0000000 --- a/.zprezto/modules/completion/external/src/_mix +++ /dev/null @@ -1,235 +0,0 @@ -#compdef mix -#autoload - -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Elixir Mix -# -# Last updated: 18.04.2017 -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Han Ngo (https://github.com/tieubao) -# * Teja Sophista (https://github.com/tejanium) -# -# ------------------------------------------------------------------------------ - -local -a _1st_arguments -_1st_arguments=( - 'app.start:Starts all registered apps' - 'app.tree:Prints the application tree' - 'archive:Lists installed archives' - 'archive.build:Archives this project into a .ez file' - 'archive.install:Installs an archive locally' - 'archive.uninstall:Uninstalls archives' - 'clean:Deletes generated application files' - 'cmd:Executes the given command' - 'compile:Compiles source files' - 'deps:Lists dependencies and their status' - "deps.clean:Deletes the given dependencies' files" - 'deps.compile:Compiles dependencies' - 'deps.get:Gets all out of date dependencies' - 'deps.tree:Prints the dependency tree' - 'deps.unlock:Unlocks the given dependencies' - 'deps.update:Updates the given dependencies' - 'do:Executes the tasks separated by comma' - 'ecto:Prints Ecto help information' - 'ecto.create:Creates the repository storage' - 'ecto.drop:Drops the repository storage' - 'ecto.dump:Dumps the repository database structure' - 'ecto.gen.migration:Generates a new migration for the repo' - 'ecto.gen.repo:Generates a new repository' - 'ecto.load:Loads previously dumped database structure' - 'ecto.migrate:Runs the repository migrations' - 'ecto.migrations:Displays the repository migration status' - 'ecto.rollback:Rolls back the repository migrations' - 'escript:Lists installed escripts' - 'escript.build:Builds an escript for the project' - 'escript.install:Installs an escript locally' - 'escript.uninstall:Uninstalls escripts' - 'gettext.extract:Extracts translations from source code' - 'gettext.merge:Merge template files into translation files' - 'help:Prints help information for tasks' - 'hex:Prints Hex help information' - 'hex.build:Builds a new package version locally' - 'hex.config:Reads, updates or deletes Hex config' - 'hex.docs:Fetch or open documentation of a package' - 'hex.info:Prints Hex information' - 'hex.key:Manages Hex API key' - 'hex.outdated:Shows outdated Hex deps for the current project' - 'hex.owner:Manages Hex package ownership' - 'hex.public_keys:Manages Hex public keys' - 'hex.publish:Publishes a new package version' - 'hex.retire:Retires a package version' - 'hex.search:Searches for package names' - 'hex.user:Registers or manages Hex user' - 'loadconfig:Loads and persists the given configuration' - 'local:Lists local tasks' - 'local.hex:Installs Hex locally' - 'local.phoenix:Updates Phoenix locally' - 'local.phx:Updates the Phoenix project generator locally' - 'local.public_keys:Manages public keys' - 'local.rebar:Installs Rebar locally' - 'new:Creates a new Elixir project' - 'phoenix.gen.html:Generates controller, model and views for an HTML based resource' - 'phoenix.server:Starts applications and their servers' - 'phx.digest:Digests and compresses static files' - 'phx.digest.clean:Removes old versions of static assets.' - 'phx.gen.channel:Generates a Phoenix channel' - 'phx.gen.context:Generates a context with functions around an Ecto schema' - 'phx.gen.html:Generates controller, views, and context for an HTML resource' - 'phx.gen.json:Generates controller, views, and context for a JSON resource' - 'phx.gen.presence:Generates a Presence tracker' - 'phx.gen.schema:Generates an Ecto schema and migration file' - 'phx.gen.secret:Generates a secret' - 'phx.new:Creates a new Phoenix application' - 'phx.new.ecto:Creates a new Ecto project within an umbrella project' - 'phx.new.web:Creates a new Phoenix web project within an umbrella project' - 'phx.routes:Prints all routes' - 'phx.server:Starts applications and their servers' - 'profile.fprof:Profiles the given file or expression with fprof' - 'run:Runs the given file or expression' - "test:Runs a project's tests" - 'xref:Performs cross reference checks' - '--help:Describe available tasks' - '--version:Prints the Elixir version information' -) - -__task_list () -{ - local expl - declare -a tasks - - tasks=( - 'app.start' - 'app.tree' - 'archive' - 'archive.build' - 'archive.install' - 'archive.uninstall' - 'clean' - 'cmd' - 'compile' - 'deps' - 'deps.clean' - 'deps.compile' - 'deps.get' - 'deps.tree' - 'deps.unlock' - 'deps.update' - 'do' - 'ecto' - 'ecto.create' - 'ecto.drop' - 'ecto.dump' - 'ecto.gen.migration' - 'ecto.gen.repo' - 'ecto.load' - 'ecto.migrate' - 'ecto.migrations' - 'ecto.rollback' - 'escript' - 'escript.build' - 'escript.install' - 'escript.uninstall' - 'gettext.extract' - 'gettext.merge' - 'help' - 'hex' - 'hex.build' - 'hex.config' - 'hex.docs' - 'hex.info' - 'hex.key' - 'hex.outdated' - 'hex.owner' - 'hex.public_keys' - 'hex.publish' - 'hex.retire' - 'hex.search' - 'hex.user' - 'loadconfig' - 'local' - 'local.hex' - 'local.public_keys' - 'local.rebar' - 'new' - 'phoenix.gen.html' - 'phoenix.server' - 'phx.digest' - 'phx.digest.clean' - 'phx.gen.channel' - 'phx.gen.context' - 'phx.gen.html' - 'phx.gen.json' - 'phx.gen.presence' - 'phx.gen.schema' - 'phx.gen.secret' - 'phx.routes' - 'phx.server' - 'profile.fprof' - 'run' - 'test' - 'xref' - ) - - _wanted tasks expl 'help' compadd $tasks -} - -local expl - -local curcontext="$curcontext" state line -typeset -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "mix subcommand" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _arguments ':feature:__task_list' - return - ;; - (test) - _arguments ':PATH:_files' - return - ;; - esac - ;; -esac diff --git a/.zprezto/modules/completion/external/src/_multirust b/.zprezto/modules/completion/external/src/_multirust deleted file mode 100644 index 00deb67..0000000 --- a/.zprezto/modules/completion/external/src/_multirust +++ /dev/null @@ -1,163 +0,0 @@ -#compdef multirust -# ------------------------------------------------------------------------------ -# Copyright (C) 2016 by Hideo Hattori -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for multirust (https://github.com/brson/multirust). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Hideo Hattori (https://github.com/hhatto) -# -# ------------------------------------------------------------------------------ - -_multirust() { - typeset -A opt_args - local context state line - - _arguments -s -S \ - "--verbose[run verbosely]" \ - "--version[print version info]" \ - "*::multirust commands:_multirust_command" -} - -(( $+functions[_multirust_command] )) || -_multirust_command() { - local cmd ret=1 - - (( $+multirust_cmds )) || _multirust_cmds=( - "default:Set the default toolchain" \ - "override:Set the toolchain override for the current directory tree" \ - "update:Install or update a given toolchain" \ - "show-override:Show information about the current override" \ - "show-default:Show information about the current default" \ - "list-overrides:List all overrides" \ - "list-toolchains:List all installed toolchains" \ - "remove-override:Remove an override, for current directory unless specified" \ - "remove-toolchain:Uninstall a toolchain" \ - "run:Run a command in an environment configured for a toolchain" \ - "delete-data:Delete all user metadata, including installed toolchains" \ - "upgrade-data:Upgrade the ~/.multirust directory from previous versions" \ - "doc:Open the documentation for the currently active toolchain" \ - "which:Report location of the currently active Rust tool." \ - "help:Show help for this command or subcommands" \ - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'multirust subcommand' _multirust_cmds || compadd "$@" - ${(s.:.)${(j.:.)_multirust_syns}} - else - local curcontext="$curcontext" - - cmd="${${_multirust_cmds[(r)$words[1]:*]%%:*}:-${(k)_multirust_syns[(r)(*:|)$words[1](:*|)]}}" - if (( $#cmd )); then - curcontext="${curcontext%:*:*}:multirust-${cmd}:" - _call_function ret _multirust_$cmd || _message 'no more arguments' - else - _message "unknown multirust command: $words[1]" - fi - return ret - fi -} - -(( $+functions[_multirust_default] )) || -_multirust_default() { - _arguments -s \ - "--copy-local[install by copying a local toolchain]:PATH:_gnu_generic::" \ - "--link-local[install by linking a local toolchain]:PATH:_gnu_generic::" \ - "--installer[allows arbitrary builds of rust to be installed from a custom-built installer]:PATH:_gnu_generic::" \ - "*::multirust commands:_multirust" -} - -(( $+functions[_multirust_override] )) || -_multirust_override() { - _multirust_default -} - -(( $+functions[_multirust_update] )) || -_multirust_update() { - _multirust_default -} - -__overrides() { - declare -a overrides - overrides=($(multirust list-overrides|awk -F";" '{print $1":"$2}')) - _describe 'override' overrides -} - -__toolchains() { - declare -a toolchains - toolchains=($(multirust list-toolchains)) - _describe "toolchain" toolchains -} - -__subcommands() { - declare -a cmds - cmds=($(multirust|grep "# "|awk '{print $2}')) - _describe "command" cmds -} - -(( $+functions[_multirust_remove-override] )) || -_multirust_remove-override() { - __overrides -} - -(( $+functions[_multirust_remove-toolchain] )) || -_multirust_remove-toolchain() { - __toolchains -} - -(( $+functions[_multirust_run] )) || -_multirust_run() { - __toolchains -} - -(( $+functions[_multirust_delete-data] )) || -_multirust_delete-data() { - _arguments -s \ - "-y[Disable prompt]" \ - "*::multirust commands:_multirust" -} - -(( $+functions[_multirust_doc] )) || -_multirust_doc() { - _arguments -s \ - "--all[open the documentation overview page, which gives access to all the installed documentation]:" \ - "*::multirust commands:_multirust" -} - -(( $+functions[_multirust_help] )) || -_multirust_help() { - __subcommands -} - -_multirust "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_mussh b/.zprezto/modules/completion/external/src/_mussh deleted file mode 100644 index ff2e96e..0000000 --- a/.zprezto/modules/completion/external/src/_mussh +++ /dev/null @@ -1,86 +0,0 @@ -#compdef mussh -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for MUltihost SSH Wrapper (http://mussh.sourceforge.net/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mario Fernandez (https://github.com/sirech) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -# TODO: -# -i: admit more than one use -# -d, -v, -t: control input -# -m: Accept number (but also empty) -# -h: Accept multiple hosts, also more than one use -# -H: Accept multiple files, also more than one use - -_arguments -C \ - '--help[display this help message]' \ - '-V[print version info and exit]' \ - '-d[Verbose debug]:level (from 0 to 2)' \ - '-v[SSH debug level]:level (from 0 to 3)' \ - '-m[Run concurrently]' \ - '(-b -B)-b[Print each hosts output in a block without mingling with other hosts output]' \ - '(-b -B)-B[Allow hosts output to mingle. (default)]' \ - '(-a -A)-a[Force loading ssh-agent]' \ - '(-a -A)-A[Do NOT load ssh-agent]' \ - '(-u -U)-u[Unique. Eliminate duplicate hosts. (default)]' \ - '(-u -U)-U[Do NOT make host list unique]' \ - '-P[Do NOT fall back to passwords on any host. This will skip hosts where keys fail]' \ - '-i[Load an identity file. May be used more than once]:identity' \ - '-o[Args to pass to ssh with -o option]:ssh-args' \ - '(-l -L)-l[Use _login_ when no other is specified with the hostname]:login' \ - '(-l -L)-L[Force use of _login_ on all hosts]:login' \ - '-s[Path to shell on remote host]:shell' \ - '-t[Timeout setting for each session]:timeout' \ - '-p[Host to use as proxy]:[user@]host' \ - '-po[Args to pass to ssh on proxy with -o option]:ssh-args' \ - '(-h -H)-h[Add a host to list of hosts]:[user@]host' \ - '(-h -H)-H[Add contents of file to list of hosts]:host file:_files' \ - '(-c -C)-c[Add a command or quoted list of commands to list of commands to be executed on each host]:command' \ - '(-c -C)-C[Add file contents to list of commands to be executed on each host]:commands file:_files' \ - '(-q)-q[No output unless necessary]' && ret=0 - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_mvn b/.zprezto/modules/completion/external/src/_mvn deleted file mode 100644 index 6f4b31c..0000000 --- a/.zprezto/modules/completion/external/src/_mvn +++ /dev/null @@ -1,613 +0,0 @@ -#compdef mvn mvnDebug -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Maven (http://maven.apache.org). -# -# Status: See FIXME and TODO tags. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ -# Notes -# ----- -# -# * By default advanced phases are displayed only if you start typing them. To have -# them always displayed: -# -# zstyle ':completion:*:mvn:*' show-all-phases true -# -# * By default full form plugins (groupId:artifactId[:version]) are only shown if you -# start typing them. To have them always displayed: -# -# zstyle ':completion:*:mvn:*' show-full-form-plugins true -# -# * By default only the plugins for which the completion has already been -# called ("mvn plugin:") are shown. To define your own list of plugins: -# -# maven_plugins=(jboss tomcat gwt android) -# zstyle ':completion:*:mvn:*' plugins $maven_plugins -# -# * To have a better presentation of completions: -# -# zstyle ':completion:*:*:mvn:*:matches' group 'yes' -# zstyle ':completion:*:*:mvn:*:options' description 'yes' -# zstyle ':completion:*:*:mvn:*:options' auto-description '%d' -# zstyle ':completion:*:*:mvn:*:descriptions' format $'\e[1m -- %d --\e[22m' -# zstyle ':completion:*:*:mvn:*:messages' format $'\e[1m -- %d --\e[22m' -# zstyle ':completion:*:*:mvn:*:warnings' format $'\e[1m -- No matches found --\e[22m' -# -# ------------------------------------------------------------------------------ - - -_mvn() { - typeset -A opt_args - local context state line - - local curcontext="$curcontext" maven_version excl_opts - - excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password) - - _pick_variant -r maven_version maven3='Maven 3' maven2='Maven 2' unknown --version - if [[ $maven_version == 'maven3' ]]; then - opts=( - "($excl_opts -T --threads)"{-T,--threads}'[thread count, for instance 2.0C where C is core multiplied]:thread count:_mvn_thread_counts' - "($excl_opts -t --toolchains)"{-t,--toolchains}'[alternate path for the user toolchains file]:toolchains file:_mvn_toolchains_files' - "($excl_opts -l --log-file)"{-l,--log-file}'[log file to where all build output will go]:log file:_mvn_log_files' - ) - elif [[ $maven_version == 'maven2' ]]; then - opts=( - "($excl_opts -cpu --check-plugin-updates -up --update-plugins -npu --no-plugin-updates -o --offline)"{-cpu,--check-plugin-updates,-up,--update-plugins}'[force upToDate check for any relevant registered plugins]' - "($excl_opts -npr --no-plugin-registry)"{-npr,--no-plugin-registry}'[don'\''t use plugin-registry.xml for plugin versions]' - "($excl_opts -npu --no-plugin-updates -cpu --check-plugin-updates -up --update-plugins)"{-npu,--no-plugin-updates}'[suppress upToDate check for any relevant registered plugins]' - "($excl_opts -r --reactor)"{-r,--reactor}'[dynamically build reactor from subdirectories]:reactor:_mvn_reactors' - ) - fi - - [[ -n ${(M)words:#"-pl"} || -n ${(M)words:#"--projects"} ]] && opts+=( - "($excl_opts -am --also-make)"{-am,--also-make}'[if project list is specified, also build projects required by the list]' - "($excl_opts -amd --also-make-dependents)"{-amd,--also-make-dependents}'[if project list is specified, also build projects that depend on projects on the list]' - ) - - _arguments -C \ - "(- : *)"{-h,--help}'[display help information]' \ - "(- : *)"{-v,--version}'[display version information]' \ - "(- : *)"{-emp,--encrypt-master-password}'[encrypt master security password]:master password:_mvn_passwords' \ - "(- : *)"{-ep,--encrypt-password}'[encrypt server password]:password:_mvn_passwords' \ - "($excl_opts -B --batch-mode)"{-B,--batch-mode}'[run in non-interactive (batch) mode]' \ - "($excl_opts -V --show-version)"{-V,--show-version}'[display version information without stopping build]' \ - "($excl_opts -q --quiet -X --debug)"{-q,--quiet}'[quiet output, only show errors]' \ - "($excl_opts -X --debug -q --quiet)"{-X,--debug}'[produce execution debug output]' \ - "($excl_opts -N --non-recursive)"{-N,--non-recursive}'[do not recurse into sub-projects]' \ - "($excl_opts -C --strict-checksums -c --lax-checksums)"{-C,--strict-checksums}'[fail the build if checksums don'\''t match]' \ - "($excl_opts -c --lax-checksums -C --strict-checksums)"{-c,--lax-checksums}'[warn if checksums don'\''t match]' \ - "($excl_opts -e --errors)"{-e,--errors}'[produce execution error messages]' \ - "($excl_opts -f --file)"{-f,--file}'[force the use of an alternate POM file]:POM file:_mvn_pom_files' \ - "($excl_opts -s --settings)"{-s,--settings}'[alternate path for the user settings file]:settings file:_mvn_settings_files' \ - "($excl_opts -gs --global-settings)"{-gs,--global-settings}'[alternate path for the global settings file]:global settings file:_mvn_settings_files' \ - "($excl_opts -fae --fail-at-end -ff --fail-fast -fn --fail-never)"{-fae,--fail-at-end}'[only fail the build afterwards, allow all non-impacted builds to continue]' \ - "($excl_opts -ff --fail-fast -fae --fail-at-end -fn --fail-never)"{-ff,--fail-fast}'[stop at first failure in reactorized builds]' \ - "($excl_opts -fn --fail-never -fae --fail-at-end -ff --fail-fast)"{-fn,--fail-never}'[never fail the build, regardless of project result]' \ - "($excl_opts)*"{-P,--activate-profiles}'[comma-delimited list of profiles to activate]:profile:_mvn_profiles -s ,' \ - "($excl_opts -pl --projects)"{-pl,--projects}'[build specified reactor projects instead of all projects]:project list:_mvn_projects -s ,' \ - "($excl_opts -rf --resume-from)"{-rf,--resume-from}'[resume reactor from specified project]:project:_mvn_projects' \ - "($excl_opts -o --offline -U --update-snapshots -cpu --check-plugin-updates -up --update-plugins)"{-o,--offline}'[work offline]' \ - "($excl_opts -U --update-snapshots -nsu --no-snapshot-updates -o --offline)"{-U,--update-snapshots}'[force a check for updated releases and snapshots on remote repositories]' \ - "($excl_opts -nsu --no-snapshot-updates -U --update-snapshots -o --offline)"{-nsu,--no-snapshot-updates}'[Suppress SNAPSHOT updates]' \ - "*"{-D-,--define}'[define a system property]:property:_mvn_properties' \ - "${opts[@]}" \ - "($excl_opts)*: :_mvn_args" -} - -(( $+functions[_mvn_args] )) || -_mvn_args() { - _alternative \ - 'phases:phase:_mvn_phases' \ - 'plugin-colon-goals:plugin colon goal:_mvn_plugin_colon_goals' -} - -(( $+functions[_mvn_phases] )) || -_mvn_phases() { - local phases - phases=( - 'clean:remove all files generated by the previous build' - 'compile:compile the source code of the project' - 'test:run tests using a suitable unit testing framework' - 'package:take the compiled code and package it in its distributable format, such as a JAR' - 'integration-test:process and deploy the package if necessary into an environment where integration tests can be run' - 'verify:run any checks to verify the package is valid and meets quality criteria' - 'install:install the package into the local repository, for use as a dependency in other projects locally' - 'deploy:done in an integration or release environment, copies the final package to the remote repository' - 'site:generates the projects site documentation' - 'site-deploy:deploys the generated site documentation to the specified web server' - ) - if [[ $#PREFIX -gt 0 ]] || zstyle -t ":completion:${curcontext}:" show-all-phases; then - phases+=( - 'pre-clean:executes processes needed prior to the actual project cleaning' - 'post-clean:executes processes needed to finalize the project cleaning' - 'validate:validate the project is correct and all necessary information is available' - 'initialize:initialize build state, e.g. set properties or create directories' - 'generate-sources:generate any source code for inclusion in compilation' - 'process-sources:process the source code, for example to filter any values' - 'generate-resources:generate resources for inclusion in the package' - 'process-resources:copy and process the resources into the destination directory, ready for packaging' - 'process-classes:post-process the generated files from compilation' - 'generate-test-sources:generate any test source code for inclusion in compilation' - 'process-test-sources:process the test source code, for example to filter any values' - 'generate-test-resources:create resources for testing' - 'process-test-resources:copy and process the resources into the test destination directory' - 'test-compile:compile the test source code into the test destination directory' - 'process-test-classes:post-process the generated files from test compilation' - 'prepare-package:perform any operations necessary to prepare a package before the actual packaging' - 'pre-integration-test:perform actions required before integration tests are executed' - 'post-integration-test:perform actions required after integration tests have been executed' - 'pre-site:executes processes needed prior to the actual project site generation.' - 'post-site:executes processes needed to finalize the site generation, and to prepare for site deployment' - ) - fi - _describe -t 'phases' "phase" phases -} - -(( $+functions[_mvn_plugins] )) || -_mvn_plugins() { - local ret=1 - if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then - _wanted full-form-plugins expl 'full form plugin' _mvn_full_form_plugins && ret=0 - else - _wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes && ret=0 - fi - return ret -} - -(( $+functions[_mvn_plugin_colon_goals] )) || -_mvn_plugin_colon_goals() { - local ret=1 - if [[ $words[CURRENT] == *.* ]] || zstyle -t ":completion:${curcontext}:" show-full-form-plugins; then - _wanted full-form-plugin-colon-goals expl 'full form plugin colon goal' _mvn_full_form_plugin_colon_goals && ret=0 - else - _wanted plugin-prefix-colon-goals expl 'plugin prefix colon goal' _mvn_plugin_prefix_colon_goals && ret=0 - fi - return ret -} - -(( $+functions[_mvn_plugin_prefix_colon_goals] )) || -_mvn_plugin_prefix_colon_goals() { - local ret=1 - if compset -P '*:'; then - local plugin="${IPREFIX%:}" - _wanted goals expl "${plugin} plugin goal" _mvn_plugin_goals $plugin && ret=0 - else - _wanted plugin-prefixes expl 'plugin prefix' _mvn_plugin_prefixes -qS: && ret=0 - fi - return ret -} - -(( $+functions[_mvn_plugin_prefixes] )) || -_mvn_plugin_prefixes() { - local plugins - zstyle -a ":completion:${curcontext}:" plugins plugins - [[ $#plugins -eq 0 ]] && plugins=($(__mvn_get_plugin_prefix $(__mvn_get_cache_dir)/mvn/plugins/*(:t))) - _describe -t plugin-prefixes 'plugin prefix' plugins $@ -} - -(( $+functions[_mvn_full_form_plugin_colon_goals] )) || -_mvn_full_form_plugin_colon_goals() { - local ret=1 - # FIXME Duplicates _mvn_full_form_plugins - if compset -P 1 '*:'; then - local groupId="${${IPREFIX%:}##*:}" - if compset -P 1 '*:'; then - local artifactId="${${IPREFIX%:}##*:}" - if compset -P 1 '*:'; then - local version="${${IPREFIX%:}##*:}" - _wanted goals expl "${artifactId}:${version} goal" _mvn_plugin_goals "${groupId}:${artifactId}:${version}" && ret=0 - else - _alternative \ - "versions:${artifactId} version:_mvn_artifact_versions -qS: ${groupId}:${artifactId}" \ - "goals:${artifactId} goal:_mvn_plugin_goals ${groupId}:${artifactId}" \ - && ret=0 - fi - else - _wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: $groupId && ret=0 - fi - else - _wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0 - fi - return ret -} - -(( $+functions[_mvn_full_form_plugins] )) || -_mvn_full_form_plugins() { - local ret=1 chunk="${PREFIX%%:*}" - if compset -P 1 '*:'; then - local groupId="$chunk" - chunk="${PREFIX%%:*}" - if compset -P 1 '*:'; then - _wanted versions expl "${current} version" _mvn_artifact_versions $@ "${groupId}:${chunk}" && ret=0 - else - _wanted artifactIds expl "${groupId} artifactId" _mvn_groupId_artifactIds -qS: "${groupId}" && ret=0 - fi - else - _wanted groupIds expl "groupId" _mvn_groupIds -qS: && ret=0 - fi - return ret -} - -(( $+functions[_mvn_groupIds] )) || -_mvn_groupIds() { - local repository_location=$(__mvn_get_repository_location) update_policy ret=1 - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_groupIds_caching_policy - - if [[ -d $repository_location ]]; then - unset _groupIds - if ( [[ ${+_groupIds} -eq 0 ]] || _cache_invalid "mvn/repositories/${repository_location}/groupIds" ) && ! _retrieve_cache "mvn/repositories/${repository_location}/groupIds"; then - _groupIds=($repository_location/**/) - _groupIds=(${${${(u)_groupIds:h:h}#"$repository_location/"}//\//.}) - [[ $#_groupIds -gt 0 ]] && _store_cache "mvn/repositories/${repository_location}/groupIds" _groupIds - fi - - [[ $#_groupIds -gt 0 ]] && _multi_parts $@ . _groupIds && ret=0 - fi - - return ret -} - -(( $+functions[_mvn_groupId_artifactIds] )) || -_mvn_groupId_artifactIds() { - local groupId_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//\.//}" ret=1 - - if [[ -d $groupId_repository_location ]]; then - local artifactIds; artifactIds=($groupId_repository_location/*/*/*.pom(:h:h:t)) - _describe -t artifactIds "artifactId" artifactIds $@[0,-2] && ret=0 - fi - - return ret -} - -(( $+functions[_mvn_artifact_versions] )) || -_mvn_artifact_versions() { - local artifact_repository_location="${$(__mvn_get_repository_location)}/${${@[-1]}//[\.:]//}" ret=1 - - if [[ -d $artifact_repository_location ]]; then - local versions; versions=($artifact_repository_location/*/*.pom(:h:t)) - _describe -t versions "version" versions $@[0,-2] - fi - - return ret -} - -(( $+functions[_mvn_plugin_goals] )) || -_mvn_plugin_goals() { - local ret=1 plugin="$@[-1]" update_policy - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_goals_caching_policy - - unset _goals - if ( [[ ${+_goals} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin}" ) && ! _retrieve_cache "mvn/plugins/${plugin}"; then - setopt localoptions extendedglob - _goals=(${(s:,,,:)${${${(f)${${${(f)${${${${(F)${(S)${(f)"$(_call_program goals $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=$plugin)"}//#$(__mvn_get_plugin_prefix $plugin):/,,,}}:#*BUILD FAILURE*}#*This plugin has*goals#:}%For more information, run \'mvn help:describe*}}//:/\\:}}}// ##/ }// Description\\: /:}}) - [[ $#_goals -gt 0 ]] && _store_cache "mvn/plugins/${plugin}" _goals - fi - - [[ $#_goals -gt 0 ]] && _describe -t "goals" "${plugin} goal" _goals $@[0,-2] && ret=0 - - return ret -} - -(( $+functions[_mvn_profiles] )) || -_mvn_profiles() { - - # FIXME Use "mvn help:all-profiles" output instead of parsing settings and pom files... - # Blocked on http://jira.codehaus.org/browse/MPH-82 and http://jira.codehaus.org/browse/MPH-83 - local profs update_policy settings_file=$(__mvn_get_settings_file) parent_pom_file=$(__mvn_get_parent_pom_file) cache_name profiles_section ret=1 - - # TODO Should be split into _mvn_profiles/mvn_profiles_lists - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_profiles_caching_policy - - profs=() - - # Resolve profiles from settings.xml - if [[ -f $settings_file ]]; then - unset _profiles - cache_name="mvn/profiles${settings_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10 - if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then - _profiles=() - profiles_section="${(M)${(f)$(<$settings_file)}:#**}" - if [[ -n "$profiles_section" ]]; then - for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*}%*}//*<\/repositories>}//*<\/pluginRepositories>}//*<\/build>}//<\/id>*/,,,}##*}%%*}}; do - [[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in settings file"']') - done - fi - [[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles - fi - profs+=($_profiles) - fi - - # Resolve project profiles - if [[ -f $parent_pom_file ]]; then - unset _profiles - cache_name="mvn/profiles${parent_pom_file:A}" # FIXME Don't use A modifier, it is only available on Zsh >= 4.3.10 - if ( [[ ${+_profiles} -eq 0 ]] || _cache_invalid "$cache_name" ) && ! _retrieve_cache "$cache_name"; then - _profiles=() - setopt localoptions extendedglob - for file in ${parent_pom_file:h}/**/pom.xml~*target\/*; do # FIXME project.build.directory is not always target/ - profiles_section="${(M)${(f)$(<$file)}:#**}" - if [[ -n "$profiles_section" ]]; then - for profile in ${(s:,,,:)${${${(S)${(S)${(S)${(S)${${profiles_section#*}%*}//*<\/repositories>}//*<\/pluginRepositories>}//*<\/build>}//<\/id>*/,,,}##*}%%*}}; do - [[ -z ${(M)profiles:#"$profile"*} ]] && _profiles+=("$profile"'['"in ${file#${parent_pom_file:h}\/}"']') - done - fi - done - [[ $#_profiles -gt 0 ]] && _store_cache "$cache_name" _profiles - fi - profs+=($_profiles) - fi - - compset -P '-'; compset -P '+'; compset -P '!' # FIXME Only works for the first profile - - [[ $#profs -gt 0 ]] && _values $@ 'profile' "${profs[@]}" && ret=0 - - return ret -} - -(( $+functions[_mvn_projects] )) || -_mvn_projects() { - # TODO Projects can also be given in the form [groupId:]artifactId. - # TODO Should be split into _mvn_projects/mvn_projects_lists - local pom_file=$(__mvn_get_parent_pom_file) ret=1 - - if [[ -f $pom_file ]]; then - setopt localoptions extendedglob - local projects; projects=(${pom_file:h}/*/**/pom.xml~*target\/*) # FIXME project.build.directory is not always target/ - projects=(${${projects#.\/}:h}) - [[ $#projects -gt 0 ]] && _values "$@" 'project' "${projects[@]}" && ret=0 - fi - - return ret -} - -(( $+functions[_mvn_properties] )) || -_mvn_properties() { - local ret=1 - if compset -P '*='; then - _wanted property-values expl 'property value' _mvn_property_values ${${IPREFIX%=}#-D} && ret=0 - else - _wanted property-names expl 'property name' _mvn_property_names -qS= && ret=0 - fi - return ret -} - -(( $+functions[_mvn_property_names] )) || -_mvn_property_names() { - # FIXME "-qS=" should be inherited from _mvn_properties - local alternatives; alternatives=( - "common-property-names:common property name:_mvn_common_property_names -qS=" - ) - for plugin_colon_goal in ${(M)words:#[^-]*:*}; do - alternatives+=("plugin-property-names:plugin property name:_mvn_plugin_goal_property_names -qS= ${plugin_colon_goal}") - done - _alternative "${alternatives[@]}" -} - -(( $+functions[_mvn_common_property_names] )) || -_mvn_common_property_names() { - local properties; properties=( - 'skipTests:skip tests execution' - 'maven.test.skip:skip tests compilation and execution' - 'gpg.passphrase:gpg passphrase' - 'tycho.mode:enable maven mode for Tycho projects to disable p2 resolution' - ) - _describe -t 'common-property-names' 'common property name' properties $@ -} - -(( $+functions[_mvn_plugin_goal_property_names] )) || -_mvn_plugin_goal_property_names() { - local plugin_colon_goal="$@[-1]" update_policy ret=1 - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _mvn_properties_caching_policy - - unset _properties - if ( [[ ${+_properties} -eq 0 ]] || _cache_invalid "mvn/plugins/${plugin_colon_goal}" ) && ! _retrieve_cache "mvn/plugins/${plugin_colon_goal}"; then - # FIXME Does not work for: - # android:apk (new line before expression) - # ear:ear (unknown cause) - _properties=(${(M)${(ps:,,,:)${${${${(pj: :)${${${(f)${"$(_call_program properties $words[1] -N org.apache.maven.plugins:maven-help-plugin:2.1.1:describe -Dplugin=${plugin_colon_goal%:*} -Dgoal=${plugin_colon_goal##*:} -Ddetail)"#*Available parameters:}%%\[INFO\]*}//# [a-z]*/,,,}##*Expression: \$\{}}//\}[[:space:]]##/:}//[[:space:]]##/ }//[[:space:]]#,,,[[:space:]]#/,,,}}:#[a-zA-Z]##:*}) - [[ $#_properties -gt 0 ]] && _store_cache "mvn/plugins/${plugin_colon_goal}" _properties - fi - - [[ $#_properties -gt 0 ]] && _describe -t "${plugin_colon_goal//:/-}-property-names" "${plugin_colon_goal} property name" _properties $@[0,-2] && ret=0 - - return ret -} - -(( $+functions[_mvn_property_values] )) || -_mvn_property_values() { - local ret=1 - setopt localoptions extendedglob - case $@[-1] in - ((#i)*pomFile*) _wanted pom-files expl 'POM file' _mvn_pom_files && ret=0;; - ((#i)*file*) _wanted files expl 'file' _files && ret=0;; - ((#i)*groupId*) _wanted groupIds expl 'groupId' _mvn_groupIds && ret=0;; - ((#i)*artifactId*) _wanted artifactIds expl 'artifactId' _mvn_groupId_artifactIds ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=} && ret=0;; - ((#i)*version*) _wanted versions expl 'version' _mvn_artifact_versions ${${(M)${(ps.:.)opt_args[(K)-D]}:#groupId=*}#groupId=}:${${(M)${(ps.:.)opt_args[(K)-D]}:#artifactId=*}#artifactId=} && ret=0;; - ((#i)*repositoryId*) _message -e repositoryIds 'repositoryId' && ret=0;; # TODO Not implemented - ((#i)*classifier*) _message -e classifiers 'classifier' && ret=0;; - ((#i)*scope*) _wanted scopes expl 'scope' _mvn_scopes && ret=0;; - ((#i)*url*) _wanted urls expl 'url' _urls && ret=0;; # TODO Use _alternative and add repository urls from settings + projects - ((#i)*(password|passphrase)*) _wanted passwords expl password _mvn_passwords && ret=0;; - ((#i)*(createChecksum|generatePom|maven.test.skip)*) _wanted booleans expl 'boolean' _mvn_booleans && ret=0;; - ((#i)*user*) _wanted users expl 'user' _users && ret=0;; # TODO Use _alternative and add repository usernames from settings + projects - ((#i)*plugin*) _wanted plugin expl 'plugin' _mvn_plugins && ret=0;; - ((#i)*tycho.mode*) _wanted tychomodes expl 'tychomode' _mvn_tycho_modes && ret=0;; - (*) _default && ret=0;; - esac - return ret -} - -(( $+functions[_mvn_scopes] )) || -_mvn_scopes() { - local scopes; scopes=( - 'compile:default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.' - 'provided:much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.' - 'runtime:indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.' - 'test:indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.' - 'system:similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.' - 'import:only used on a dependency of type pom in the section. It indicates that the specified POM should be replaced with the dependencies in that POM'\''s section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.' - ) - _describe -t scopes 'scope' scopes -} - -(( $+functions[_mvn_thread_counts] )) || -_mvn_thread_counts() { - local thread_counts; thread_counts=( - '1:build with 1 thread' '1C:build with 1 thread per CPU core' - '2:build with 2 threads' '2C:build with 2 threads per CPU core' - '3:build with 3 threads' '3C:build with 3 threads per CPU core' - '4:build with 4 threads' '4C:build with 4 threads per CPU core' - '5:build with 5 threads' '5C:build with 5 threads per CPU core' - '6:build with 6 threads' '6C:build with 6 threads per CPU core' - '7:build with 7 threads' '7C:build with 7 threads per CPU core' - '8:build with 8 threads' '8C:build with 8 threads per CPU core' - ) - _describe -t thread-counts 'thread count' thread_counts -} - -(( $+functions[_mvn_reactors] )) || -_mvn_reactors() { - _message -e reactors 'reactor' # FIXME No idea what kind of value the "--reactor" option is supposed to take -} - -(( $+functions[_mvn_passwords] )) || -_mvn_passwords() { - _message -e passwords 'password' -} - -(( $+functions[_mvn_pom_files] )) || -_mvn_pom_files() { - _files -g '*pom*\.xml*' -} - -(( $+functions[_mvn_toolchains_files] )) || -_mvn_toolchains_files() { - _files -g '*toolchains*\.xml*' -} - -(( $+functions[_mvn_settings_files] )) || -_mvn_settings_files() { - _files -g '*settings*\.xml*' -} - -(( $+functions[_mvn_log_files] )) || -_mvn_log_files() { - _files -} - -(( $+functions[_mvn_booleans] )) || -_mvn_booleans() { - local booleans; booleans=( - 'true:"true" boolean value' - 'false:"false" boolean value' - ) - _describe -t booleans 'boolean' booleans -} - - -(( $+functions[_mvn_tycho_modes] )) || -_mvn_tycho_modes() { - local tychomodes; tychomodes=( - 'maven:maven mode, Tycho will not do any p2 dependency resolution' - ) - _describe -t tychomodes 'boolean' tychomodes -} - -# ------------------------------------------------------------------------------ -# Helper functions -# ------------------------------------------------------------------------------ - -__mvn_get_pom_file() { - print ${~opt_args[-f]:-${opt_args[--file]:-pom.xml}} -} - -__mvn_get_parent_pom_file() { - local pom_file=$(__mvn_get_pom_file) - while [[ -f ${pom_file:a:h:h}/pom.xml ]]; do - pom_file=${pom_file:a:h:h}/pom.xml; - done - print $pom_file -} - -__mvn_get_settings_file() { - print ${~opt_args[-s]:-${opt_args[--settings]:-$HOME/.m2/settings.xml}} -} - -__mvn_get_repository_location() { - print ${${${${(M)"$(<$(__mvn_get_settings_file))":#**}:-$HOME/.m2/repository}##*}%%<\/localRepository>*} -} - -__mvn_get_plugin_prefix() { - print ${${${${@#*.*:}%%:*}%-plugin}/-#maven-#} -} - -__mvn_get_cache_dir() { - local cache_dir - zstyle -s ":completion:${curcontext}:" cache-path cache_dir - print ${cache_dir:-${ZDOTDIR:-$HOME}/.zcompcache} -} - - -# ------------------------------------------------------------------------------ -# Caching policies -# ------------------------------------------------------------------------------ - -(( $+functions[_mvn_goals_caching_policy] )) || -_mvn_goals_caching_policy() { - # Rebuild if cache is older than one month. - local -a oldp - oldp=( "$1"(NmM+1) ) - (( $#oldp )) -} - -(( $+functions[_mvn_properties_caching_policy] )) || -_mvn_properties_caching_policy() { - _mvn_goals_caching_policy -} - -(( $+functions[_mvn_groupIds_caching_policy] )) || -_mvn_groupIds_caching_policy() { - _mvn_goals_caching_policy -} - -(( $+functions[_mvn_profiles_caching_policy] )) || -_mvn_profiles_caching_policy() { - # Rebuild if cached file more recent than cache. - local cached_file="${1#$(__mvn_get_cache_dir)}" - [[ -f $cached_file && $cached_file -nt "$1" ]] && return 0 - - # Rebuild if cache is older than one week. - local -a oldp - oldp=( "$1"(Nmw+1) ) - (( $#oldp )) && return 0 - - return 1 -} - -_mvn "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_node b/.zprezto/modules/completion/external/src/_node deleted file mode 100644 index 36c58ff..0000000 --- a/.zprezto/modules/completion/external/src/_node +++ /dev/null @@ -1,106 +0,0 @@ -#compdef node -# ------------------------------------------------------------------------------ -# Copyright (c) 2018 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Node.js v10.4.1 (https://nodejs.org) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Mario Fernandez (https://github.com/sirech) -# * Nicholas Penree (https://github.com/drudge) -# * Masafumi Koba (https://github.com/ybiquitous) -# -# ------------------------------------------------------------------------------ - -_node_files() { - _files -g "*.(js|mjs)" -} - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_arguments -C \ - '-[script read from stdin (default; interactive mode if a tty)]' \ - '--[indicate the end of node options]' \ - '--abort-on-uncaught-exception[aborting instead of exiting causes a core file to be generated for analysis]' \ - '--experimental-modules[experimental ES Module support and caching modules]' \ - '--experimental-repl-await[experimental await keyword support in REPL]' \ - '--experimental-vm-modules[experimental ES Module support in vm module]' \ - '--icu-data-dir=[set ICU data load path to dir (overrides NODE_ICU_DATA) note: linked-in ICU data is present]: :_directories' \ - '--inspect-brk=-[activate inspector on host:port and break at start of user script]:[host\:]port' \ - '--inspect-port=[set host:port for inspector]:[host\:]port' \ - '--inspect=-[activate inspector on host:port (default: 127.0.0.1:9229)]:[host\:]port' \ - '--napi-modules[load N-API modules (no-op - option kept for compatibility)]' \ - '--no-deprecation[silence deprecation warnings]' \ - '--no-force-async-hooks-checks[disable checks for async_hooks]' \ - '--no-warnings[silence all process warnings]' \ - '--openssl-config=[load OpenSSL configuration from the specified file (overrides OPENSSL_CONF)]:file:_files' \ - '--pending-deprecation[emit pending deprecation warnings]' \ - '--preserve-symlinks[preserve symbolic links when resolving]' \ - '--preserve-symlinks-main[preserve symbolic links when resolving the main module]' \ - '--prof[generate V8 profiler output]' \ - '--prof-process[process V8 profiler output generated using --prof]' \ - '--redirect-warnings=[write warnings to file instead of stderr]: :_files' \ - '--throw-deprecation[throw an exception on deprecations]' \ - '--tls-cipher-list=[use an alternative default TLS cipher list]:cipher list string' \ - '--trace-deprecation[show stack traces on deprecations]' \ - '--trace-event-categories[comma separated list of trace event categories to record]: :{_values -s , categories node node.async_hooks node.bootstrap node.perf node.perf.usertiming node.perf.timerify node.fs.sync node.vm.script v8}' \ - '--trace-event-file-pattern[Template string specifying the filepath for the trace-events data, it supports ${rotation} and ${pid} log-rotation id. %2$u is the pid.]:template string' \ - '--trace-events-enabled[track trace events]' \ - '--trace-sync-io[show stack trace when use of sync IO is detected after the first tick]' \ - '--trace-warnings[show stack traces on process warnings]' \ - '--track-heap-objects[track heap object allocations for heap snapshots]' \ - '--use-bundled-ca[use bundled CA store (default)]' \ - "--use-openssl-ca[use OpenSSL's default CA store]" \ - '(- 1 *)--v8-options[print v8 command line options]' \ - "--v8-pool-size=[set v8's thread pool size]:number" \ - '--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \ - {-c,--check}'[syntax check script without executing]' \ - '(- 1 *)'{-e,--eval}'[evaluate script]:inline JavaScript' \ - '(- 1 *)'{-h,--help}'[print node command line options]' \ - {-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \ - '(- 1 *)'{-p,--print}'[evaluate script and print result]:inline JavaScript' \ - '*'{-r,--require}'[module to preload (option can be repeated)]: :_node_files' \ - '(- 1 *)'{-v,--version}'[print Node.js version]' \ - '*: :_node_files' && ret=0 - -_values 'commands' \ - 'inspect[enable inspector for debugging]' && ret=0 - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_nvm b/.zprezto/modules/completion/external/src/_nvm deleted file mode 100644 index 05b4cf1..0000000 --- a/.zprezto/modules/completion/external/src/_nvm +++ /dev/null @@ -1,110 +0,0 @@ -#compdef nvm -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for nvm (https://github.com/creationix/nvm). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Changwoo Park (https://github.com/pismute) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 - -local -a _1st_arguments -_1st_arguments=( - 'help:Show this message' - 'install:Download and install a ' - 'uninstall:Uninstall a ' - 'use:Modify PATH to use ' - 'run:Run with as arguments' - 'ls:List installed [versions]' - 'ls-remote:List remote versions available for install' - 'deactivate:Undo effects of NVM on current shell' - 'alias:Set an alias named pointing to . Show all aliases beginning with [].' - 'unalias:Deletes the alias named ' - 'copy-packages:Install global NPM packages contained in to current version' - 'clear-cache:Clear cache' - 'version:Show current node version' -) - -_arguments -C \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -__nvm_aliases(){ - local aliases - aliases="" - if [ -d $NVM_DIR/alias ]; then - aliases="`cd $NVM_DIR/alias && ls`" - fi - echo "${aliases}" -} - -__nvm_versions(){ - echo "$(nvm_ls) $(__nvm_aliases)" -} - -case $state in - cmds) - _describe -t commands 'nvm command' _1st_arguments && ret=0 - ;; - - args) - case $words[2] in - (use|run|ls|list|install|uninstall|copy-packages) - - _values 'version' $(__nvm_versions) && ret=0 - ;; - - (alias|unalias) - - _values 'aliases' $(__nvm_aliases) && ret=0 - ;; - - *) - (( ret )) && _message 'no more arguments' - ;; - - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_openssl b/.zprezto/modules/completion/external/src/_openssl deleted file mode 100644 index 1d5ec38..0000000 --- a/.zprezto/modules/completion/external/src/_openssl +++ /dev/null @@ -1,1685 +0,0 @@ -#compdef openssl -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ - -# openssl command [ command_opts ] [ command_args ] - -_openssl() { - local openssl_commands cmd cmds - if [[ "$CURRENT" -lt 2 ]]; then - # I do not think this can happen... - return - elif [[ "$CURRENT" -eq 2 ]]; then - # first parameter, the command - openssl_commands=(${(z)${${(f)"$(openssl help 2>&1)"}:#([A-Z]|openssl:Error:)*}}) - _describe 'openssl commands' openssl_commands - else - # $CURRENT -gt 2 - cmd="${words[2]}" - # Note: we could use ${(k)functions} to get a list of all functions and - # filter those that start with _openssl_ - # but that would mean defining a new function *somewhere* might mess with - # the completion... - cmds=(asn1parse ca ciphers cms crl crl2pkcs7 dgst dh dhparam dsa dsaparam \ - ec ecparam enc engine errstr gendh gendsa genpkey genrsa nseq ocsp \ - passwd pkcs12 pkcs7 pkcs8 pkey pkeyparam pkeyutl prime rand req rsa \ - rsautl s_client s_server s_time sess_id smime speed spkac srp ts \ - verify version x509) - # check if $cmd is in $cmds, the list of supported commands - if [[ "${cmds[(r)$cmd]}" == "${cmd}" ]]; then - # we should be able to complete $cmd - # run _openssl_$cmd with the remaining words from the command line - shift words - (( CURRENT-- )) - _openssl_${cmd} - elif [[ ${${=${"$(openssl help 2>&1)"/*Cipher commands[^)]#)/}}[(re)$cmd]} == "$cmd" ]]; then - # $cmd is a cipher command, which is practically an alias to enc - shift words - (( CURRENT-- )) - _openssl_enc - elif [[ ${${=${${"$(openssl help 2>&1)"%%Cipher commands*}/*Message Digest commands[^)]#)/}}[(re)$cmd]} == "$cmd" ]]; then - # $cmd is a message digest command, which is practically an alias to dgst - shift words - (( CURRENT-- )) - _openssl_dgst - fi - fi -} - - -_openssl_asn1parse() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format - one of DER PEM]:format:(DER PEM)' \ - '-in[input file]:file:_files' \ - '-out[output file (output format is always DER]:file:_files' \ - "-noout[don't produce any output]" \ - '-offset[offset into file]:number: ' \ - '-length[length of section in file]:number: ' \ - '-i[indent entries]' \ - '-dump[dump unknown data in hex form]' \ - '-dlimit[dump the first arg bytes of unknown data in hex form]:number: ' \ - '-oid[file of extra oid definitions]:file:_files' \ - "-strparse[a series of these can be used to 'dig' into multiple ASN1 blob wrappings]:offset:" \ - '-genstr[string to generate ASN1 structure from]:str:' \ - '-genconf[file to generate ASN1 structure from]:file:_files' -} - - -_openssl_ca() { - # written for openssl 1.0.1k - _arguments -C \ - '-verbose[talk alot while doing things]' \ - '-config[a config file]:file:_files' \ - '-name[the particular CA definition to use]:section: ' \ - '-gencrl[generate a new CRL]' \ - '-crldays[days is when the next CRL is due]:days: ' \ - '-crlhours[hours is when the next CRL is due]:hours: ' \ - '-startdate[certificate validity notBefore]:date: ' \ - '-enddate[certificate validity notAfter (overrides -days)]:date: ' \ - '-days[number of days to certify the certificate for]:days: ' \ - '-md[md to use, one of md2, md5, sha or sha1]:alg:(md2 md5 sha sha1)' \ - "-policy[the CA 'policy' to support]:policy: " \ - '-keyfile[private key file]:file:_files' \ - '-keyform[private key file format (PEM or ENGINE)]:format:(PEM ENGINE)' \ - '-key[key to decode the private key if it is encrypted]:password: ' \ - '-cert[the CA certificate]:file:_files' \ - '-selfsign[sign a certificate with the key associated with it]' \ - '-in[the input PEM encoded certificate request(s)]:file:_files' \ - '-out[where to put the output file(s)]:file:_files' \ - '-outdir[where to put output certificates]:dir:_files -/' \ - '-infiles[the last argument, requests to process]:*:files:_files' \ - '-spkac[file contains DN and signed public key and challenge]:file:_files' \ - '-ss_cert[file contains a self signed cert to sign]:file:_files' \ - "-preserveDN[don't re-order the DN]" \ - "-noemailDN[don't add the EMAIL field into certificate' subject]" \ - "-batch[don't ask questions]" \ - '-msie_hack[msie modifications to handle all those universal strings]' \ - '-revoke[revoke a certificate (given in file)]:file:_files' \ - "-subj[use arg instead of request's subject]:subject: " \ - '-utf8[input characters are UTF8 (default ASCII)]' \ - '-multivalue-rdn[enable support for multivalued RDNs]' \ - '-extensions[extension section (override value in config file)]:section: ' \ - '-extfile[configuration file with X509v3 extentions to add]:file:_files' \ - '-crlexts[CRL extension section (override value in config file)]:section: ' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-status[shows certificate status given the serial number]:serial: ' \ - '-updatedb[updates db for expired certificates]' -} - - -_openssl_ciphers() { - # written for openssl 1.0.1k - _arguments -C \ - '-v[verbose mode, a textual listing of the SSL/TLS ciphers in OpenSSL]' \ - '-V[even more verbose]' \ - '-ssl2[SSL2 mode]' \ - '-ssl3[SSL3 mode]' \ - '-tls1[TLS1 mode]' \ - ':cipher suite:_list_ciphers' -} - - -_openssl_cms() { - # written for openssl 1.0.1k - _arguments -C \ - '-encrypt[encrypt message]' \ - '-decrypt[decrypt encrypted message]' \ - '-sign[sign message]' \ - '-verify[verify signed message]' \ - '-cmsout[output CMS structure]' \ - '-des3[encrypt with triple DES]' \ - '-des[encrypt with DES]' \ - '-seed[encrypt with SEED]' \ - '-rc2-40[encrypt with RC2-40 (default)]' \ - '-rc2-64[encrypt with RC2-64]' \ - '-rc2-128[encrypt with RC2-128]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - "-nointern[don't search certificates in message for signer]" \ - "-nosigs[don't verify message signature]" \ - "-noverify[don't verify signers certificate]" \ - "-nocerts[don't include signers certificate when signing]" \ - '-nodetach[use opaque signing]' \ - "-noattr[don't include any signed attributes]" \ - "-binary[don't translate message to text]" \ - '-certfile[other certificates file]:file:_files' \ - '-certsout[certificate output file]:file:_files' \ - '-signer[signer certificate file]:file:_files' \ - '-recip[recipient certificate file for decryption]:file:_files' \ - '-keyid[use subject key identifier]' \ - '-in[input file]:file:_files' \ - '-inform[input format SMIME (default), PEM or DER]:format:(SMIME PEM DER)' \ - '-inkey[input private key (if not signer or recipient)]:file:_files' \ - '-keyform[input private key format (PEM or ENGINE)]:format:(PEM ENGINE)' \ - '-out[output file]:file:_files' \ - '-outform[output format SMIME (default), PEM or DER]:format:(SMIME PEM DER)' \ - '-content[supply or override content for detached signature]:file:_files' \ - '-to[to address mail head]:address: ' \ - '-from[from address mail head]:address: ' \ - '-subject[subject mail head]:subject: ' \ - '-text[include or delete text MIME headers]' \ - '-CApath[trusted certificates directory]:dir:_files -/' \ - '-CAfile[trusted certificates file]:file:_files' \ - "-crl_check[check revocation status of signer's certificate using CRLs]" \ - "-crl_check_all[check revocation status of signer's certificate chain using CRLs]" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '*:certificate:_files' -} - - -_openssl_crl() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format - default PEM (DER or PEM)]:format:(PEM DER)' \ - '-outform[output format - default PEM]:format:(PEM DER)' \ - '-text[print out a text format version]' \ - '-in[input file - default stdin]:file:_files' \ - '-out[output file - default stdout]:file:_files' \ - '-hash[print hash value]' \ - '-hash_old[print old-style (MD5) hash value]' \ - '-fingerprint[print the crl fingerprint]' \ - '-issuer[print issuer DN]' \ - '-lastupdate[print lastUpdate field]' \ - '-nextupdate[print nextUpdate field]' \ - '-crlnumber[print CRL number]' \ - '-noout[no CRL output]' \ - '-CAfile[verify CRL using certificates in the specified file]:file:_files' \ - '-CApath[verify CRL using certificates in the specified directory]:dir:_files -/' \ - '*-nameopt[various certificate name options]:options:_nameopts' -} - - -_openssl_crl2pkcs7() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format - DER or PEM]:format:(PEM DER)' \ - '-outform[output format - DER or PEM]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-certfile[certificates file of chain to a trusted CA (can be used more than once)]:file:_files' \ - "-nocrl[no crl to load, just certs from '-certfile']" -} - - -_openssl_dgst() { - # written for openssl 1.0.1k - local digests - digests=(-dss1 -md4 -md5 -mdc2 -ripemd160 -sha -sha1 -sha224 -sha256 -sha384 -sha512 -whirlpool) - # -hmac is listed twice because it's documented twice by openssl - _arguments -C -A '-*' \ - '(-r -hex -binary)-c[to output the digest with separating colons]' \ - '(-c -hex -binary)-r[to output the digest in coreutils format]' \ - '-d[to output debug info]' \ - '(-c -r -binary)-hex[output as hex dump]' \ - '(-c -r -hex)-binary[output in binary form]' \ - '-hmac[set the HMAC key to arg]:key: ' \ - '-non-fips-allow[allow use of non FIPS digest]' \ - '-sign[sign digest using private key in the specified file]:file:_files' \ - '-verify[verify a signature using public key in the specified file]:file:_files' \ - '-prverify[verify a signature using private key in the specified file]:file:_files' \ - '-keyform[key file format (PEM or ENGINE)]:format:(PEM ENGINE)' \ - '-out[output to filename rather than stdout]:file:_files' \ - '-signature[signature to verify]:file:_files' \ - '-sigopt[signature parameter]:nm\:v: ' \ - '-hmac[create hashed MAC with key]:key: ' \ - '-mac[create MAC (not neccessarily HMAC)]:algorithm: ' \ - '-macopt[MAC algorithm parameters or key]:nm\:v: ' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - "($digests)-dss1[use the dss1 message digest algorithm]" \ - "($digests)-md4[to use the md4 message digest algorithm]" \ - "($digests)-md5[to use the md5 message digest algorithm]" \ - "($digests)-mdc2[to use the mdc2 message digest algorithm]" \ - "($digests)-ripemd160[to use the ripemd160 message digest algorithm]" \ - "($digests)-sha[to use the sha message digest algorithm]" \ - "($digests)-sha1[to use the sha1 message digest algorithm]" \ - "($digests)-sha224[to use the sha224 message digest algorithm]" \ - "($digests)-sha256[to use the sha256 message digest algorithm]" \ - "($digests)-sha384[to use the sha384 message digest algorithm]" \ - "($digests)-sha512[to use the sha512 message digest algorithm]" \ - "($digests)-whirlpool[to use the whirlpool message digest algorithm]" \ - '*:file:_files' -} - - -_openssl_dh() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-check[check the DH parameters]' \ - '-text[print a text form of the DH parameters]' \ - '-C[output C code]' \ - '-noout[no output]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_dhparam() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-dsaparam[read or generate DSA parameters, convert to DH]' \ - '-check[check the DH parameters]' \ - '-text[print a text form of the DH parameters]' \ - '-C[output C code]' \ - '-2[generate parameters using 2 as the generator value]' \ - '-5[generate parameters using 5 as the generator value]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-noout[no output]' \ - ':numbits: ' -} - - -_openssl_dsa() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-passin[input file pass phrase source]:file:_files' \ - '-out[output file]:file:_files' \ - '-passout[output file pass phrase source]:file:_files' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-des[encrypt PEM output with cbc des]' \ - '-des3[encrypt PEM output with ede cbc des using 168 bit key]' \ - '-idea[encrypt PEM output with cbc idea]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - '-seed[encrypt PEM output with cbc seed]' \ - '-text[print the key in text]' \ - "-noout[don't print key out]" \ - '-modulus[print the DSA public value]' -} - - -_openssl_dsaparam() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-text[print as text]' \ - '-C[output C code]' \ - '-noout[no output]' \ - '-genkey[generate a DSA key]' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - ':numbits: ' -} - - -_openssl_ec() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-passin[input file pass phrase source]:file:_files' \ - '-out[output file]:file:_files' \ - '-passout[output file pass phrase source]:file:_files' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - "-des[encrypt PEM output, instead of 'des' every other cipher supported by OpenSSL can be used]" \ - '-text[print the key]' \ - "-noout[don't print key out]" \ - '-param_out[print the elliptic curve parameters]' \ - '-conv_form[specifies the point conversion form]:form:(compressed uncompressed hybrid)' \ - '-param_enc[specifies the way the ec parameters are encoded in the asn1 der encoding]:encoding:(named_curve explicit)' -} - - -_openssl_ecparam() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file - default stdin]:file:_files' \ - '-out[output file - default stdout]:file:_files' \ - '-noout[do not print the ec parameter]' \ - '-text[print the ec parameters in text form]' \ - '-check[validate the ec parameters]' \ - "-C[print a 'C' function creating the parameters]" \ - "-name[use the ec parameters with 'short name' name]:name: " \ - "-list_curves[prints a list of all currently available curve 'short names']" \ - '-conv_form[specifies the point conversion form]:form:(compressed uncompressed hybrid)' \ - '-param_enc[specifies the way the ec parameters are encoded in the asn1 der encoding]:encoding:(named_curve explicit)' \ - "-no_seed[if 'explicit' parameters are chosen do not use the seed]" \ - '-genkey[generate ec key]' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_enc() { - # written for openssl 1.0.1k - local ciphers - ciphers=(-aes-128-cbc -aes-128-cbc-hmac-sha1 -aes-128-cfb -aes-128-cfb1 \ - -aes-128-cfb8 -aes-128-ctr -aes-128-ecb -aes-128-gcm -aes-128-ofb \ - -aes-128-xts -aes-192-cbc -aes-192-cfb -aes-192-cfb1 -aes-192-cfb8 \ - -aes-192-ctr -aes-192-ecb -aes-192-gcm -aes-192-ofb -aes-256-cbc \ - -aes-256-cbc-hmac-sha1 -aes-256-cfb -aes-256-cfb1 -aes-256-cfb8 \ - -aes-256-ctr -aes-256-ecb -aes-256-gcm -aes-256-ofb -aes-256-xts \ - -aes128 -aes192 -aes256 -bf -bf-cbc -bf-cfb -bf-ecb -bf-ofb \ - -blowfish -camellia-128-cbc -camellia-128-cfb -camellia-128-cfb1 \ - -camellia-128-cfb8 -camellia-128-ecb -camellia-128-ofb \ - -camellia-192-cbc -camellia-192-cfb -camellia-192-cfb1 \ - -camellia-192-cfb8 -camellia-192-ecb -camellia-192-ofb \ - -camellia-256-cbc -camellia-256-cfb -camellia-256-cfb1 \ - -camellia-256-cfb8 -camellia-256-ecb -camellia-256-ofb \ - -camellia128 -camellia192 -camellia256 -cast -cast-cbc -cast5-cbc \ - -cast5-cfb -cast5-ecb -cast5-ofb -des -des-cbc -des-cfb -des-cfb1 \ - -des-cfb8 -des-ecb -des-ede -des-ede-cbc -des-ede-cfb -des-ede-ofb \ - -des-ede3 -des-ede3-cbc -des-ede3-cfb -des-ede3-cfb1 \ - -des-ede3-cfb8 -des-ede3-ofb -des-ofb -des3 -desx -desx-cbc \ - -id-aes128-GCM -id-aes192-GCM -id-aes256-GCM -idea -idea-cbc \ - -idea-cfb -idea-ecb -idea-ofb -rc2 -rc2-40-cbc -rc2-64-cbc \ - -rc2-cbc -rc2-cfb -rc2-ecb -rc2-ofb -rc4 -rc4-40 -rc4-hmac-md5 \ - -rc5 -rc5-cbc -rc5-cfb -rc5-ecb -rc5-ofb -seed -seed-cbc -seed-cfb \ - -seed-ecb -seed-ofb) - _arguments -C \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-pass[pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-e[encrypt]' \ - '-d[decrypt]' \ - '(-a -base64)'{-a,-base64}'[base64 encode/decode, depending on encryption flag]' \ - '-k[the password to derive the key from]:password: ' \ - '-kfile[read the password to derive the key from the first line of the file]:file:_files' \ - '-md[the md to use to create a key from a passphrase]:alg:(md2 md5 sha sha1)' \ - '-S[the actual salt to use]:salt: ' \ - '-K[the actual key to use]:key: ' \ - '-iv[the actual IV to use]:IV: ' \ - '-p[print out the key and IV used]' \ - '-P[print out the key and IV used the exit]' \ - '-bufsize[set the buffer size for I/O]:size: ' \ - '-nopad[disable standard block padding]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - "(${ciphers})-aes-128-cbc[cipher types]" \ - "(${ciphers})-aes-128-cbc-hmac-sha1[cipher types]" \ - "(${ciphers})-aes-128-cfb[cipher types]" \ - "(${ciphers})-aes-128-cfb1[cipher types]" \ - "(${ciphers})-aes-128-cfb8[cipher types]" \ - "(${ciphers})-aes-128-ctr[cipher types]" \ - "(${ciphers})-aes-128-ecb[cipher types]" \ - "(${ciphers})-aes-128-gcm[cipher types]" \ - "(${ciphers})-aes-128-ofb[cipher types]" \ - "(${ciphers})-aes-128-xts[cipher types]" \ - "(${ciphers})-aes-192-cbc[cipher types]" \ - "(${ciphers})-aes-192-cfb[cipher types]" \ - "(${ciphers})-aes-192-cfb1[cipher types]" \ - "(${ciphers})-aes-192-cfb8[cipher types]" \ - "(${ciphers})-aes-192-ctr[cipher types]" \ - "(${ciphers})-aes-192-ecb[cipher types]" \ - "(${ciphers})-aes-192-gcm[cipher types]" \ - "(${ciphers})-aes-192-ofb[cipher types]" \ - "(${ciphers})-aes-256-cbc[cipher types]" \ - "(${ciphers})-aes-256-cbc-hmac-sha1[cipher types]" \ - "(${ciphers})-aes-256-cfb[cipher types]" \ - "(${ciphers})-aes-256-cfb1[cipher types]" \ - "(${ciphers})-aes-256-cfb8[cipher types]" \ - "(${ciphers})-aes-256-ctr[cipher types]" \ - "(${ciphers})-aes-256-ecb[cipher types]" \ - "(${ciphers})-aes-256-gcm[cipher types]" \ - "(${ciphers})-aes-256-ofb[cipher types]" \ - "(${ciphers})-aes-256-xts[cipher types]" \ - "(${ciphers})-aes128[cipher types]" \ - "(${ciphers})-aes192[cipher types]" \ - "(${ciphers})-aes256[cipher types]" \ - "(${ciphers})-bf[cipher types]" \ - "(${ciphers})-bf-cbc[cipher types]" \ - "(${ciphers})-bf-cfb[cipher types]" \ - "(${ciphers})-bf-ecb[cipher types]" \ - "(${ciphers})-bf-ofb[cipher types]" \ - "(${ciphers})-blowfish[cipher types]" \ - "(${ciphers})-camellia-128-cbc[cipher types]" \ - "(${ciphers})-camellia-128-cfb[cipher types]" \ - "(${ciphers})-camellia-128-cfb1[cipher types]" \ - "(${ciphers})-camellia-128-cfb8[cipher types]" \ - "(${ciphers})-camellia-128-ecb[cipher types]" \ - "(${ciphers})-camellia-128-ofb[cipher types]" \ - "(${ciphers})-camellia-192-cbc[cipher types]" \ - "(${ciphers})-camellia-192-cfb[cipher types]" \ - "(${ciphers})-camellia-192-cfb1[cipher types]" \ - "(${ciphers})-camellia-192-cfb8[cipher types]" \ - "(${ciphers})-camellia-192-ecb[cipher types]" \ - "(${ciphers})-camellia-192-ofb[cipher types]" \ - "(${ciphers})-camellia-256-cbc[cipher types]" \ - "(${ciphers})-camellia-256-cfb[cipher types]" \ - "(${ciphers})-camellia-256-cfb1[cipher types]" \ - "(${ciphers})-camellia-256-cfb8[cipher types]" \ - "(${ciphers})-camellia-256-ecb[cipher types]" \ - "(${ciphers})-camellia-256-ofb[cipher types]" \ - "(${ciphers})-camellia128[cipher types]" \ - "(${ciphers})-camellia192[cipher types]" \ - "(${ciphers})-camellia256[cipher types]" \ - "(${ciphers})-cast[cipher types]" \ - "(${ciphers})-cast-cbc[cipher types]" \ - "(${ciphers})-cast5-cbc[cipher types]" \ - "(${ciphers})-cast5-cfb[cipher types]" \ - "(${ciphers})-cast5-ecb[cipher types]" \ - "(${ciphers})-cast5-ofb[cipher types]" \ - "(${ciphers})-des[cipher types]" \ - "(${ciphers})-des-cbc[cipher types]" \ - "(${ciphers})-des-cfb[cipher types]" \ - "(${ciphers})-des-cfb1[cipher types]" \ - "(${ciphers})-des-cfb8[cipher types]" \ - "(${ciphers})-des-ecb[cipher types]" \ - "(${ciphers})-des-ede[cipher types]" \ - "(${ciphers})-des-ede-cbc[cipher types]" \ - "(${ciphers})-des-ede-cfb[cipher types]" \ - "(${ciphers})-des-ede-ofb[cipher types]" \ - "(${ciphers})-des-ede3[cipher types]" \ - "(${ciphers})-des-ede3-cbc[cipher types]" \ - "(${ciphers})-des-ede3-cfb[cipher types]" \ - "(${ciphers})-des-ede3-cfb1[cipher types]" \ - "(${ciphers})-des-ede3-cfb8[cipher types]" \ - "(${ciphers})-des-ede3-ofb[cipher types]" \ - "(${ciphers})-des-ofb[cipher types]" \ - "(${ciphers})-des3[cipher types]" \ - "(${ciphers})-desx[cipher types]" \ - "(${ciphers})-desx-cbc[cipher types]" \ - "(${ciphers})-id-aes128-GCM[cipher types]" \ - "(${ciphers})-id-aes192-GCM[cipher types]" \ - "(${ciphers})-id-aes256-GCM[cipher types]" \ - "(${ciphers})-idea[cipher types]" \ - "(${ciphers})-idea-cbc[cipher types]" \ - "(${ciphers})-idea-cfb[cipher types]" \ - "(${ciphers})-idea-ecb[cipher types]" \ - "(${ciphers})-idea-ofb[cipher types]" \ - "(${ciphers})-rc2[cipher types]" \ - "(${ciphers})-rc2-40-cbc[cipher types]" \ - "(${ciphers})-rc2-64-cbc[cipher types]" \ - "(${ciphers})-rc2-cbc[cipher types]" \ - "(${ciphers})-rc2-cfb[cipher types]" \ - "(${ciphers})-rc2-ecb[cipher types]" \ - "(${ciphers})-rc2-ofb[cipher types]" \ - "(${ciphers})-rc4[cipher types]" \ - "(${ciphers})-rc4-40[cipher types]" \ - "(${ciphers})-rc4-hmac-md5[cipher types]" \ - "(${ciphers})-rc5[cipher types]" \ - "(${ciphers})-rc5-cbc[cipher types]" \ - "(${ciphers})-rc5-cfb[cipher types]" \ - "(${ciphers})-rc5-ecb[cipher types]" \ - "(${ciphers})-rc5-ofb[cipher types]" \ - "(${ciphers})-seed[cipher types]" \ - "(${ciphers})-seed-cbc[cipher types]" \ - "(${ciphers})-seed-cfb[cipher types]" \ - "(${ciphers})-seed-ecb[cipher types]" \ - "(${ciphers})-seed-ofb[cipher types]" -} - - -_openssl_engine() { - # written for openssl 1.0.1k - _arguments -C \ - '(-vv -vvv -vvvv)-v[verbose mode, for each engine, list its "control commands"]' \ - "(-v -vvv -vvvv)-vv[like -v, but additionally display each command's description]" \ - '(-v -vv -vvvv)-vvv[like -vv, but also add the input flags for each command]' \ - '(-v -vv -vvv)-vvvv[like -vvv, but also show internal input flags]' \ - '-c[for each engine, also list the capabilities]' \ - '(-tt)-t[for each engine, check that they are really available]' \ - '(-t)-tt[display error trace for unavailable engines]' \ - "-pre[runs command 'cmd' against the ENGINE before any attempts to load it (if -t is used)]:cmd: " \ - "-post[runs command 'cmd' against the ENGINE after loading it (only used if -t is also provided)]:cmd: " \ - '*:engine:_engines' - # TODO: can cmd (for -pre and -post) be completed? -} - - -_openssl_errstr() { - # written for openssl 1.0.1k - # written for openssl 1.0.2a - _arguments -C \ - '-stats' \ - ':errno: ' -} - - -_openssl_gendh() { - # written for openssl 1.0.1k - _arguments -C \ - "-out[output the key to 'file']:file:_files" \ - '-2[use 2 as the generator value]' \ - '-5[use 5 as the generator value]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - ':numbits: ' -} - - -_openssl_gendsa() { - # written for openssl 1.0.1k - _arguments -C \ - "-out[output the key to 'file']:file:_files" \ - '-des[encrypt the generated key with DES in cbc mode]' \ - '-des3[encrypt the generated key with DES in ede cbc mode (168 bit key)]' \ - '-idea[encrypt the generated key with IDEA in cbc mode]' \ - '-seed[encrypt PEM output with cbc seed]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - ':dsaparam-file:_files' -} - - -_openssl_genpkey() { - # written for openssl 1.0.1k - local ciphers cipher_opts - ciphers=( ${$(openssl list-cipher-algorithms | cut -d' ' -f1)} ) - cipher_opts=() - for alg in ${ciphers}; do - cipher_opts=(${cipher_opts} "(${${(l:32:: ::-:)ciphers[@]}// / })-${alg}[use this cipher to encrypt the key]") - done - _arguments -C \ - '-out[output file]:file:_files' \ - '-outform[output format]:format:(PEM DER)' \ - '-pass[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - $cipher_opts \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '(-algorithm)-paramfile[parameters file]:file:_files' \ - '(-paramfile)-algorithm[the public key algorithm]:algorithm:(EC RSA DSA DH)' \ - '-pkeyopt[public key options]:option\:value: ' \ - '-genparam[generate parameters, not key]' \ - '-text[print the in text]' - # NB: options order may be important! See the manual page. - # TODO: complete pkeyopts - # However: "The precise set of options supported depends on the public key - # algorithm used and its implementation." -} - - -_openssl_genrsa() { - # written for openssl 1.0.1k - _arguments -C \ - '-des[encrypt the generated key with DES in cbc mode]' \ - '-des3[encrypt the generated key with DES in ede cbc mode (168 bit key)]' \ - '-idea[encrypt the generated key with IDEA in cbc mode]' \ - '-seed[encrypt PEM output with cbc seed]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - '-out[output the key to file]:file:_files' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-f4[use F4 (0x10001) for the E value]' \ - '-3[use 3 for the E value]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - ':numbits: ' -} - - -_openssl_nseq() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-toseq[output NS Sequence file]' -} - - -_openssl_ocsp() { - # written for openssl 1.0.1k - _arguments -C \ - '-out[output filename]:file:_files' \ - '-issuer[issuer certificate]:file:_files' \ - '-cert[certificate to check]:file:_files' \ - '-serial[serial number to check]:serial: ' \ - '-signer[certificate to sign OCSP request with]:file:_files' \ - '-signkey[private key to sign OCSP request with]:file:_files' \ - '-sign_other[additional certificates to include in signed request]:file:_files' \ - "-no_certs[don't include any certificates in signed request]" \ - '-req_text[print text form of request]' \ - '-resp_text[print text form of response]' \ - '-text[print text form of request and response]' \ - '-reqout[write DER encoded OCSP request to "file"]:file:_files' \ - '-respout[write DER encoded OCSP reponse to "file"]:file:_files' \ - '-reqin[read DER encoded OCSP request from "file"]:file:_files' \ - '-respin[read DER encoded OCSP reponse from "file"]:file:_files' \ - '-nonce[add OCSP nonce to request]' \ - "-no_nonce[don't add OCSP nonce to request]" \ - '-url[OCSP responder URL]:URL: ' \ - '-host[send OCSP request to given host on given port]:host\:port: ' \ - '-path[path to use in OCSP request]' \ - '-CApath[trusted certificates directory]:directory:_files -/' \ - '-CAfile[trusted certificates file]:file:_files' \ - '-VAfile[validator certificates file]:file:_files' \ - '-validity_period[maximum validity discrepancy in seconds]:seconds: ' \ - '-status_age[maximum status age in seconds]:seconds: ' \ - "-noverify[don't verify response at all]" \ - '-verify_other[additional certificates to search for signer]:file:_files' \ - "-trust_other[don't verify additional certificates]" \ - "-no_intern[don't search certificates contained in response for signer]" \ - "-no_signature_verify[don't check signature on response]" \ - "-no_cert_verify[don't check signing certificate]" \ - "-no_chain[don't chain verify response]" \ - "-no_cert_checks[don't do additional checks on signing certificate]" \ - '-port[port to run responder on]:port: ' \ - '-index[certificate status index file]:file:_files' \ - '-CA[CA certificate]:file:_files' \ - '-rsigner[responder certificate to sign responses with]:file:_files' \ - '-rkey[responder key to sign responses with]:file:_files' \ - '-rother[other certificates to include in response]:file:_files' \ - "-resp_no_certs[don't include any certificates in response]" \ - '-nmin[number of minutes before next update]:minutes: ' \ - '-ndays[number of days before next update]:days: ' \ - '-resp_key_id[identify reponse by signing certificate key ID]' \ - '-nrequest[number of requests to accept (default unlimited)]:limit: ' \ - '-dss1[use specified digest in the request]' \ - '-md4[use specified digest in the request]' \ - '-md5[use specified digest in the request]' \ - '-mdc2[use specified digest in the request]' \ - '-ripemd160[use specified digest in the request]' \ - '-ripemd[use specified digest in the request]' \ - '-rmd160[use specified digest in the request]' \ - '-sha1[use specified digest in the request]' \ - '-sha224[use specified digest in the request]' \ - '-sha256[use specified digest in the request]' \ - '-sha384[use specified digest in the request]' \ - '-sha512[use specified digest in the request]' \ - '-sha[use specified digest in the request]' \ - '-ssl2-md5[use specified digest in the request]' \ - '-ssl3-md5[use specified digest in the request]' \ - '-ssl3-sha1[use specified digest in the request]' \ - '-whirlpool[use specified digest in the request]' \ - '-timeout[timeout connection to OCSP responder after n seconds]:seconds: ' -} - - -_openssl_passwd() { - # written for openssl 1.0.1k - _arguments -C \ - '-crypt[standard Unix password algorithm (default)]' \ - '-1[MD5-based password algorithm]' \ - '-apr1[MD5-based password algorithm, Apache variant]' \ - '-salt[use provided salt]:salt: ' \ - '-in[read passwords from file]:file:_files' \ - '-stdin[read passwords from stdin]' \ - '-noverify[never verify when reading password from terminal]' \ - '-quiet[no warnings]' \ - '-table[format output as table]' \ - '-reverse[switch table columns]' \ - '*:password:' -} - - -_openssl_pkcs12() { - # written for openssl 1.0.2d - local algorithms - algorithms=(aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb aes-256-cbc \ - aes-256-ecb bf-cbc bf-cfb bf-ecb bf-ofb camellia-128-cbc \ - camellia-128-ecb camellia-192-cbc camellia-192-ecb \ - camellia-256-cbc camellia-256-ecb cast-cbc cast5-cbc cast5-cfb \ - cast5-ecb cast5-ofb des-cbc des-cfb des-ecb des-ede des-ede-cbc \ - des-ede-cfb des-ede-ofb des-ede3 des-ede3-cbc des-ede3-cfb \ - des-ede3-ofb des-ofb idea-cbc idea-cfb idea-ecb idea-ofb \ - rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb rc4 \ - rc4-40 rc5-cbc rc5-cfb rc5-ecb rc5-ofb seed-cbc seed-cfb \ - seed-ecb seed-ofb PBE-MD2-DES PBE-MD5-DES PBE-SHA1-RC2-64 \ - PBE-MD2-RC2-64 PBE-MD5-RC2-64 PBE-SHA1-DES PBE-SHA1-RC4-128 \ - PBE-SHA1-RC4-40 PBE-SHA1-3DES PBE-SHA1-2DES PBE-SHA1-RC2-128 \ - PBE-SHA1-RC2-40) - _arguments -C \ - '-export[output PKCS12 file]' \ - '-chain[add certificate chain]' \ - '-inkey[private key if not infile]:file:_files' \ - '-certfile[add all certs in the specified file]:file:_files' \ - "-CApath[PEM format directory of CA's]:file:_files" \ - "-CAfile[PEM format file of CA's]:file:_files" \ - '-name[use specified friendly name]:name: ' \ - '*-caname[use specified CA friendly name]:name: ' \ - '-in[input filename]:file:_files' \ - '-out[output filename]:file:_files' \ - "-noout[don't output anything, just verify]" \ - "-nomacver[don't verify MAC]" \ - "-nocerts[don't output certificates]" \ - '-clcerts[only output client certificates]' \ - '-cacerts[only output CA certificates]' \ - "-nokeys[don't output private keys]" \ - '-info[give info about PKCS#12 structure]' \ - '-des[encrypt private keys with DES]' \ - '-des3[encrypt private keys with triple DES (default)]' \ - '-idea[encrypt private keys with idea]' \ - '-seed[encrypt private keys with seed]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - "-nodes[don't encrypt private keys]" \ - "-noiter[don't use encryption iteration]" \ - "-nomaciter[don't use MAC iteration]" \ - '-maciter[use MAC iteration]' \ - "-nomac[don't generate MAC]" \ - '-twopass[separate MAC, encryption passwords]' \ - '-descert[encrypt PKCS#12 certificates with triple DES (default RC2-40)]' \ - "-certpbe[specify certificate PBE algorithm (default RC2-40)]:alg:(${algorithms})" \ - '-keypbe[specify private key PBE algorithm (default 3DES)]:alg:(${algorithms})' \ - '-macalg[digest algorithm used in MAC (default SHA1)]:alg:_list_message_digest_algorithms' \ - '-keyex[set MS key exchange type]' \ - '-keysig[set MS key signature type]' \ - '-password[set import/export password source]:pass phrase source:_pass_phrase_source' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-CSP[Microsoft CSP name]:name: ' \ - '-LMK[add local machine keyset attribute to private key]' -} - - -_openssl_pkcs7() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-print_certs[print any certs or crl in the input]' \ - '-text[print full details of certificates]' \ - "-noout[don't output encoded data]" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_pkcs8() { - # written for openssl 1.0.2d - _arguments -C \ - '-in[input file]:file:_files' \ - '-inform[input format]:format:(PEM DER)' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-outform[output format]:format:(PEM DER)' \ - '-out[output file]:file:_files' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-topk8[output PKCS8 file]' \ - '-nooct[use (nonstandard) no octet format]' \ - '-embed[use (nonstandard) embedded DSA parameters format]' \ - '-nsdb[use (nonstandard) DSA Netscape DB format]' \ - '-noiter[use 1 as iteration count]' \ - '-nocrypt[use or expect unencrypted private key]' \ - '-v2[use PKCS#5 v2.0 and given cipher]:alg:(aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb aes-256-cbc aes-256-ecb bf bf-cbc bf-cfb bf-ecb bf-ofb camellia-128-cbc camellia-128-ecb camellia-192-cbc camellia-192-ecb camellia-256-cbc camellia-256-ecb cast cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb des3 desx idea idea-cbc idea-cfb idea-ecb idea-ofb rc2 rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb rc4 rc4-40 rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb seed seed-cbc seed-cfb seed-ecb seed-ofb)' \ - '-v2prf[set the PRF algorithm to use with PKCS#5 v2.0]:alg:(hmacWithMD5 hmacWithRMD160 hmacWithSHA1 hmacWithSHA224 hmacWithSHA256 hmacWithSHA384 hmacWithSHA512)' \ - '-v1[use PKCS#5 v1.5 and given cipher]:obj:(PBE-MD2-DES PBE-MD5-DES PBE-SHA1-RC2-64 PBE-MD2-RC2-64 PBE-MD5-RC2-64 PBE-SHA1-DES PBE-SHA1-RC4-128 PBE-SHA1-RC4-40 PBE-SHA1-3DES PBE-SHA1-2DES PBE-SHA1-RC2-128 PBE-SHA1-RC2-40)' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_pkey() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[input file]:file:_files' \ - '-inform[input format]:format:(PEM DER)' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-outform[output format]:format:(PEM DER)' \ - '-out[output file]:file:_files' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_pkeyparam() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[the input filename to read parameters from]:file:_files' \ - '-out[the output filename to write parameters]:file:_files' \ - '-text[prints out the parameters in plain text in addition to the encoded version]' \ - '-noout[do not output the encoded version of the parameters]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_pkeyutl() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-sigfile[signature file (verify operation only)]:file:_files' \ - '-inkey[input key]:file:_files' \ - '-keyform[private key format]:format:(PEM DER)' \ - '-pubin[input is a public key]' \ - '-certin[input is a certificate carrying a public key]' \ - '-pkeyopt[public key options]:option\:value:_pkeyopts' \ - '-sign[sign with private key]' \ - '-verify[verify with public key]' \ - '-verifyrecover[verify with public key, recover original data]' \ - '-encrypt[encrypt with public key]' \ - '-decrypt[decrypt with private key]' \ - '-derive[derive shared secret]' \ - '-hexdump[hex dump output]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-passin[pass phrase source]:pass phrase source:_pass_phrase_source' -} - - -_openssl_prime() { - # written for openssl 1.0.1k - _arguments -C \ - '-hex[hex]' \ - '-checks[number of checks]:checks: ' \ - ':number:' -} - - -_openssl_rand() { - # written for openssl 1.0.1k - _arguments -C \ - '-out[write to file]:file:_files' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-base64[base64 encode output]' \ - '-hex[hex encode output]' \ - ':num:' -} - - -_openssl_req() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-text[text form of request]' \ - '-pubkey[output public key]' \ - '-noout[do not output REQ]' \ - '-verify[verify signature on REQ]' \ - '-modulus[RSA modulus]' \ - "-nodes[don't encrypt the output key]" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - "-subject[output the request's subject]" \ - '-passin[private key pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-key[use the private key contained in the specified file]:file:_files' \ - '-keyform[key file format]:format:(PEM DER)' \ - '-keyout[file to send the key to]:file:_files' \ - '-rand[files to use for random number input]:file:_rand_files' \ - "-newkey rsa\:-[generate a new RSA key of the specified number of bits in size]:bits: " \ - "-newkey dsa\:[generate a new DSA key, parameters taken from CA in the specified file]:file:_files" \ - "-newkey ec\:[generate a new EC key, parameters taken from CA in the specified file]:file:_files" \ - '-md2[digest to sign with]' \ - '-md4[digest to sign with]' \ - '-md5[digest to sign with]' \ - '-mdc2[digest to sign with]' \ - '-sha1[digest to sign with]' \ - '-config[request template file]:file:_files' \ - '-subj[set or modify request subject]:subject: ' \ - '-multivalue-rdn[enable support for multivalued RDNs]' \ - '-new[new request]' \ - '-batch[do not ask anything during request generation]' \ - '-x509[output a x509 structure instead of a certificate request]' \ - '-days[number of days a certificate generated by -x509 is valid for]:days: ' \ - '-set_serial[serial number to use for a certificate generated by -x509]:serial: ' \ - '-newhdr[output "NEW" in the header lines]' \ - "-asn1-kludge[output the 'request' in a format that is wrong but some CA's have been reported as requiring]" \ - '-extensions[specify certificate extension section (override value in config file)]:section: ' \ - '-reqexts[specify request extension section (override value in config file)]:section: ' \ - '-utf8[input characters are UTF8 (default ASCII)]' \ - '*-nameopt[various certificate name options]:options:_nameopts' \ - '*-reqopt[- various request text options]:options:_certopts' - # TODO: complete -extensions and -reqexts -} - - -_openssl_rsa() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER NET)' \ - '-outform[output format]:format:(PEM DER NET)' \ - '-in[input file]:file:_files' \ - '-sgckey[use IIS SGC key format]' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-out[output file]:file:_files' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-des[encrypt PEM output with cbc des]' \ - '-des3[encrypt PEM output with ede cbc des using 168 bit key]' \ - '-idea[encrypt PEM output with cbc idea]' \ - '-seed[encrypt PEM output with cbc seed]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - '-text[print the key in text]' \ - "-noout[don't print key out]" \ - '-modulus[print the RSA key modulus]' \ - '-check[verify key consistency]' \ - '-pubin[expect a public key in input file]' \ - '-pubout[output a public key]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_rsautl() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-inkey[input key]:file:_files' \ - '-keyform[private key format]:format:(PEM DER)' \ - '-pubin[input is an RSA public]' \ - '-certin[input is a certificate carrying an RSA public key]' \ - '-ssl[use SSL v2 padding]' \ - '-raw[use no padding]' \ - '-pkcs[use PKCS#1 v1.5 padding (default)]' \ - '-oaep[use PKCS#1 OAEP]' \ - '-sign[sign with private key]' \ - '-verify[verify with public key]' \ - '-encrypt[encrypt with public key]' \ - '-decrypt[decrypt with private key]' \ - '-hexdump[hex dump output]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-passin[pass phrase source]:pass phrase source:_pass_phrase_source' -} - - -_openssl_s_client() { - # written for openssl 1.0.1k - _arguments -C \ - '(-6)-4[use IPv4 only]' \ - '(-4)-6[use IPv6 only]' \ - '(-connect)-host[use -connect instead]:host: ' \ - '(-connect)-port[use -connect instead]:port: ' \ - '(-host -port)-connect[who to connect to (default is localhost:4433)]:host\:port: ' \ - '-verify[turn on peer certificate verification]:depth: ' \ - '-verify_return_error[return verification errors]' \ - '-cert[certificate file to use, PEM format assumed]:file:_files' \ - '-certform[certificate format (PEM or DER) PEM default]:format:(PEM DER)' \ - '-key[private key file to use, in cert file if not specified but cert file is]:file:_files' \ - '-keyform[key format (PEM or DER) PEM default]:format:(PEM DER)' \ - '-pass[private key file pass phrase source]:pass phrase source:_pass_phrase_source' \ - "-CApath[PEM format directory of CA's]:directory:_files -/" \ - "-CAfile[PEM format file of CA's]:file:_files" \ - '-reconnect[drop and re-make the connection with the same Session-ID]' \ - '-pause[sleep(1) after each read(2) and write(2) system call]' \ - '-prexit[print session information even on connection failure]' \ - '-showcerts[show all certificates in the chain]' \ - '-debug[extra output]' \ - '-msg[show protocol messages]' \ - '-nbio_test[more ssl protocol testing]' \ - "-state[print the 'ssl' states]" \ - '-nbio[run with non-blocking IO]' \ - '-crlf[convert LF from terminal into CRLF]' \ - '-quiet[no s_client output]' \ - '(-no_ign_eof)-ign_eof[ignore input eof (default when -quiet)]' \ - "(-ign_eof)-no_ign_eof[don't ignore input eof]" \ - '-psk_identity[PSK identity]:identity: ' \ - '-psk[PSK in hex (without 0x)]:key: ' \ - "-srpuser[SRP authentification for 'user']:user: " \ - "-srppass[password for 'user']:password: " \ - '-srp_lateuser[SRP username into second ClientHello message]' \ - '-srp_moregroups[tolerate other than the known g N values]' \ - '-srp_strength[minimal length in bits for N (default 1024)]:int: ' \ - '(-no_ssl2 -ssl3 -tls1 -tls1_1 -tls1_2 -dtls1)-ssl2[just use SSLv2]' \ - '(-no_ssl3 -ssl2 -tls1 -tls1_1 -tls1_2 -dtls1)-ssl3[just use SSLv3]' \ - '(-no_tls1_2 -ssl2 -ssl3 -tls1 -tls1_1 -dtls1)-tls1_2[just use TLSv1.2]' \ - '(-no_tls1_1 -ssl2 -ssl3 -tls1 -tls1_1 -dtls1)-tls1_1[just use TLSv1.1]' \ - '(-no_tls1 -ssl2 -ssl3 -tls1 -tls1_1 -dtls1)-tls1[just use TLSv1.0]' \ - '(-no_dtls1 -ssl2 -ssl3 -tls1 -tls1_1 -tls1_2)-dtls1[just use DTLSv1]' \ - '-fallback_scsv[send TLS_FALLBACK_SCSV]' \ - '-mtu[set the link layer MTU]' \ - '(-tls1_2)-no_tls1_2[turn off TLSv1.2]' \ - '(-tls1_1)-no_tls1_1[turn off TLSv1.1]' \ - '(-tls1)-no_tls1[turn off TLSv1.0]' \ - '(-ssl3)-no_ssl3[turn off SSLv3]' \ - '(-ssl2)-no_ssl2[turn off SSLv2]' \ - '-bugs[switch on all SSL implementation bug workarounds]' \ - "-serverpref[use server's cipher preferences (only SSLv2)]" \ - '-cipher[preferred cipher to use]:cipher suite:_list_ciphers' \ - "-starttls[use the STARTTLS command before starting TLS for those protocols that support it]:protocol:(smtp pop3 imap ftp xmpp)" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-sess_out[file to write SSL session to]:file:_files' \ - '-sess_in[file to read SSL session from]:file:_files' \ - '-servername[set TLS extension servername in ClientHello]:host: ' \ - '-tlsextdebug[hex dump of all TLS extensions received]' \ - '-status[request certificate status from server]' \ - '-no_ticket[disable use of RFC4507bis session tickets]' \ - '-nextprotoneg[enable NPN extension, considering named protocols supported (comma-separated list)]:protocols: ' \ - '-legacy_renegotiation[enable use of legacy renegotiation (dangerous)]' \ - '-use_srtp[offer SRTP key management with a colon-separated profile list]:profiles: ' \ - '-keymatexport[export keying material using label]:label: ' \ - '-keymatexportlen[export len bytes of keying material (default 20)]:len: ' -} - - -_openssl_s_server() { - # written for openssl 1.0.1k - _arguments -C \ - '-accept[port to accept on (default is 4433)]:port: ' \ - '-context[set session ID context]:id: ' \ - '-verify[turn on peer certificate verification]:depth: ' \ - '-Verify[turn on peer certificate verification, must have a cert]:depth: ' \ - '-verify_return_error[return verification errors]' \ - '-cert[certificate file to use (default is server.pem)]:file:_files' \ - '-crl_check[check the peer certificate has not been revoked by its CA]' \ - '-crl_check_all[check the peer certificate has not been revoked by its CA or any other CRL in the CA chain]' \ - '-certform[certificate format]:format:(PEM DER)' \ - '-key[Private Key file to use, in cert file if not specified (default is server.pem)]:file:_files' \ - '-keyform[key format]:format:(PEM DER ENGINE)' \ - '-pass[private key file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-dcert[second certificate file to use (usually for DSA)]:file:_files' \ - '-dcertform[second certificate format]:format:(PEM DER)' \ - '-dkey[second private key file to use (usually for DSA)]:file:_files' \ - '-dkeyform[second key format]:format:(PEM DER ENGINE)' \ - '-dpass[second private key file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-dhparam[DH parameter file to use, in cert file if not specified or a default set of parameters is used]:file:_files' \ - '-named_curve[elliptic curve name to use for ephemeral ECDH keys. (default is nistp256)]:named curve:_list_curves' \ - '-nbio[run with non-blocking IO]' \ - '-nbio_test[test with the non-blocking test bio]' \ - '-crlf[convert LF from terminal into CRLF]' \ - '-debug[print more output]' \ - '-msg[show protocol messages]' \ - '-state[print the SSL states]' \ - "-CApath[PEM format directory of CA's]:file:_files -/" \ - "-CAfile[PEM format file of CA's]:file:_files" \ - "-nocert[don't use any certificates (Anon-DH)]" \ - '-cipher[preferred cipher to use]:cipher suite:_list_ciphers' \ - "-serverpref[use server's cipher preferences]" \ - '-quiet[no server output]' \ - '-no_tmp_rsa[do not generate a tmp RSA key]' \ - '-psk_hint[PSK identity hint to use]:hint: ' \ - '-psk[PSK in hex (without 0x)]:PSK: ' \ - '-srpvfile[the verifier file for SRP]:file:_files' \ - '-srpuserseed[a seed string for a default user salt]:seed: ' \ - '-ssl2[just talk SSLv2]' \ - '-ssl3[just talk SSLv3]' \ - '-tls1_2[just talk TLSv1.2]' \ - '-tls1_1[just talk TLSv1.1]' \ - '-tls1[just talk TLSv1]' \ - '-dtls1[just talk DTLSv1]' \ - '-timeout[enable timeouts]' \ - '-mtu[set link layer MTU]' \ - '-chain[read a certificate chain]' \ - '-no_ssl2[just disable SSLv2]' \ - '-no_ssl3[just disable SSLv3]' \ - '-no_tls1[just disable TLSv1]' \ - '-no_tls1_1[just disable TLSv1.1]' \ - '-no_tls1_2[just disable TLSv1.2]' \ - '-no_dhe[disable ephemeral DH]' \ - '-no_ecdhe[disable ephemeral ECDH]' \ - '-bugs[turn on SSL bug compatibility]' \ - '-hack[workaround for early Netscape code]' \ - "-www[respond to a 'GET /' with a status page]" \ - "-WWW[respond to a 'GET / HTTP/1.0' with file ./]" \ - "-HTTP[respond to a 'GET / HTTP/1.0' with file ./ with the assumption it contains a complete HTTP response]" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-id_prefix[generate SSL/TLS session IDs prefixed by arg]:prefix: ' \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-servername[servername for HostName TLS extension]:hostname: ' \ - '-servername_fatal[on mismatch send fatal alert (default warning alert)]' \ - '-cert2[certificate file to use for servername (default is server2.pem)]:file:_files' \ - '-key2[Private Key file to use for servername, in cert file if not specified (default is server2.pem)]:file:_files' \ - '-tlsextdebug[hex dump of all TLS extensions received]' \ - '-no_ticket[disable use of RFC4507bis session tickets]' \ - '-legacy_renegotiation[enable use of legacy renegotiation (dangerous)]' \ - '-nextprotoneg[set the advertised protocols for the NPN extension (comma-separated list)]:protocol:(http/1.0 http/1.1)' \ - '-use_srtp[offer SRTP key management with a colon-separated profile list]:profiles: ' \ - '-4[use IPv4 only]' \ - '-6[use IPv6 only]' \ - '-keymatexport[export keying material using label]:label: ' \ - '-keymatexportlen[export len bytes of keying material (default 20)]:length: ' \ - '-status[respond to certificate status requests]' \ - '-status_verbose[enable status request verbose printout]' \ - '-status_timeout[status request responder timeout]:seconds: ' \ - '-status_url[status request fallback URL]:URL: ' - # TODO: srtp profiles -} - - -_openssl_s_time() { - # written for openssl 1.0.1k - _arguments -C \ - '-connect[host:port to connect to (default is localhost:4433)]:host\:port: ' \ - '-nbio[run with non-blocking IO]' \ - '-ssl2[just use SSLv2]' \ - '-ssl3[just use SSLv3]' \ - '-bugs[turn on SSL bug compatibility]' \ - '-new[just time new connections]' \ - '-reuse[just time connection reuse]' \ - "-www[retrieve the specified page from the site]:page: " \ - '-time[max number of seconds to collect data, default 30]:seconds: ' \ - '-verify[turn on peer certificate verification]:depth: ' \ - '-cert[certificate file to use, PEM format assumed]:file:_files' \ - '-key[RSA file to use, PEM format assumed, key is in cert file]:file:_files' \ - "-CApath[PEM format directory of CA's]:file:_files -/" \ - "-CAfile[PEM format file of CA's]:file:_files" \ - '-cipher[preferred cipher to use]:cipher suite:_list_ciphers' -} - - -_openssl_sess_id() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format]:format:(PEM DER)' \ - '-outform[output format]:format:(PEM DER)' \ - '-in[input file (default stdin)]:file:_files' \ - '-out[output file (default stdout)]:file:_files' \ - '-text[print ssl session id details]' \ - '-cert[output certificate ]' \ - '-noout[no CRL output]' \ - '-context[set the session ID context]:id: ' -} - - -_openssl_smime() { - # written for openssl 1.0.1k - _arguments -C \ - '-encrypt[encrypt message]' \ - '-decrypt[decrypt encrypted message]' \ - '-sign[sign message]' \ - '-verify[verify signed message]' \ - '-pk7out[output PKCS#7 structure]' \ - '-des3[encrypt with triple DES]' \ - '-des[encrypt with DES]' \ - '-seed[encrypt with SEED]' \ - '-rc2-40[encrypt with RC2-40 (default)]' \ - '-rc2-64[encrypt with RC2-64]' \ - '-rc2-128[encrypt with RC2-128]' \ - '-aes128[encrypt PEM output with cbc aes]' \ - '-aes192[encrypt PEM output with cbc aes]' \ - '-aes256[encrypt PEM output with cbc aes]' \ - '-camellia128[encrypt PEM output with cbc camellia]' \ - '-camellia192[encrypt PEM output with cbc camellia]' \ - '-camellia256[encrypt PEM output with cbc camellia]' \ - "-nointern[don't search certificates in message for signer]" \ - "-nosigs[don't verify message signature]" \ - "-noverify[don't verify signers certificate]" \ - "-nocerts[don't include signers certificate when signing]" \ - '-nodetach[use opaque signing]' \ - "-noattr[don't include any signed attributes]" \ - "-binary[don't translate message to text]" \ - '-certfile[other certificates file]:file:_files' \ - '-signer[signer certificate file]:file:_files' \ - '-recip[recipient certificate file for decryption]:file:_files' \ - '-in[input file]:file:_files' \ - '-inform[input format]:format:(SMIME PEM DER)' \ - '-inkey[input private key (if not signer or recipient)]:file:_files' \ - '-keyform[input private key format]:format:(PEM ENGINE)' \ - '-out[output file]:file:_files' \ - '-outform[output format]:format:(SMIME PEM DER)' \ - '-content[supply or override content for detached signature]:file:_files' \ - '-to[to address]:address: ' \ - '-from[from address]:address: ' \ - '-subject[subject]:subject: ' \ - '-text[include or delete text MIME headers]' \ - '-CApath[trusted certificates directory]:directory:_files -/' \ - '-CAfile[trusted certificates file]:file:_files' \ - "-crl_check[check revocation status of signer's certificate using CRLs]" \ - "-crl_check_all[check revocation status of signer's certificate chain using CRLs]" \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-rand[files to use for random number input]:file:_rand_files' \ - ':certificate:_files' -} - - -_openssl_speed() { - # written for openssl 1.0.1k - local algorithms - algorithms=(mdc2 md4 md5 hmac sha1 sha256 sha512 whirlpoolrmd160 idea-cbc \ - seed-cbc rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 aes-128-cbc \ - aes-192-cbc aes-256-cbc aes-128-ige aes-192-ige aes-256-ige \ - camellia-128-cbc camellia-192-cbc camellia-256-cbc rc4 rsa512 \ - rsa1024 rsa2048 rsa4096 dsa512 dsa1024 dsa2048 ecdsap160 \ - ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521 ecdsak163 \ - ecdsak233 ecdsak283 ecdsak409 ecdsak571 ecdsab163 ecdsab233 \ - ecdsab283 ecdsab409 ecdsab571 ecdsa ecdhp160 ecdhp192 ecdhp224 \ - ecdhp256 ecdhp384 ecdhp521 ecdhk163 ecdhk233 ecdhk283 ecdhk409 \ - ecdhk571 ecdhb163 ecdhb233 ecdhb283 ecdhb409 ecdhb571 ecdh idea \ - seed rc2 des aes camellia rsa blowfish) - _arguments -C \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-evp[use the specified EVP]:EVP: ' \ - '-decrypt[time decryption instead of encryption (only EVP)]' \ - '-mr[produce machine readable output]' \ - '-multi[run n benchmarks in parallel]:benchmarks: ' \ - "*:algorithm:(${algorithms})" -} - - -_openssl_spkac() { - # written for openssl 1.0.1k - _arguments -C \ - '-in[input file]:file:_files' \ - '-out[output file]:file:_files' \ - '-key[create SPKAC using private key]:file:_files' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-challenge[challenge string]:string: ' \ - '-spkac[alternative SPKAC name]:spkacname: ' \ - '-spksect[alternative section name]:section: ' \ - "-noout[don't print SPKAC]" \ - '-pubkey[output public key]' \ - '-verify[verify SPKAC signature]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' -} - - -_openssl_srp() { - # written for openssl 1.0.1k - _arguments -C \ - '-verbose[talk alot while doing things]' \ - '-config[a config file]:file:_files' \ - '-name[the particular srp definition to use]:definition: ' \ - '-srpvfile[the srp verifier file name]:file:_files' \ - '(-modify -delete -list)-add[add an user and srp verifier]' \ - '(-add -delete -list)-modify[modify the srp verifier of an existing user]' \ - '(-add -modify -list)-delete[delete user from verifier file]' \ - '(-add -modify -delete)-list[list user]' \ - '-gn[g and N values to be used for new verifier]:g and N: ' \ - '-userinfo[additional info to be set for user]:userinfo: ' \ - '-passin[input file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-passout[output file pass phrase source]:pass phrase source:_pass_phrase_source' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '-rand[files to use for random number input]:file:_rand_files' \ - ':user:' -} - - -_openssl_ts() { - # written for openssl 1.0.1k - # written for openssl 1.0.2e - local action digests - digests=(-dss1 -md4 -md5 -mdc2 -ripemd160 -sha -sha1 -sha224 -sha256 \ - -sha384 -sha512 -whirlpool) - if [[ "${CURRENT}" -eq 2 ]]; then - # first parameter to ts - _values 'openssl time stamp action' '-query[time stamp request generation]' '-reply[time stamp response generation]' '-verify[time stamp response verification]' - else - action="${words[2]}" - case "${action}" in - -query) - _arguments -C \ - '-rand[files to use for random number input]:file:_rand_files' \ - '-config[config file to use]:file:_files' \ - '(-digest)-data[data file for which the time stamp request needs to be created]:file:_files' \ - '(-data)-digest[digest of the data file]:bytes: ' \ - "($digests)-dss1[use the dss1 message digest algorithm]" \ - "($digests)-md4[to use the md4 message digest algorithm]" \ - "($digests)-md5[to use the md5 message digest algorithm]" \ - "($digests)-mdc2[to use the mdc2 message digest algorithm]" \ - "($digests)-ripemd160[to use the ripemd160 message digest algorithm]" \ - "($digests)-sha[to use the sha message digest algorithm]" \ - "($digests)-sha1[to use the sha1 message digest algorithm]" \ - "($digests)-sha224[to use the sha224 message digest algorithm]" \ - "($digests)-sha256[to use the sha256 message digest algorithm]" \ - "($digests)-sha384[to use the sha384 message digest algorithm]" \ - "($digests)-sha512[to use the sha512 message digest algorithm]" \ - "($digests)-whirlpool[to use the whirlpool message digest algorithm]" \ - '-policy[policy to use for creating the time stamp token]:policy ID: ' \ - '-no_nonce[do not include a nonce in the request]' \ - '-cert[request a signing certificate in the response]' \ - '-in[use the previously created time stamp request]:file:_files' \ - '-out[name of the output file to which the request will be written]:file:_files' \ - '-text[output in human-readable format instead of DER]' - ;; - -reply) - _arguments -C \ - '-config[config file to use]:file:_files' \ - '-section[config file section for response generation]:section: ' \ - '-queryfile[file containing a DER encoded time stamp request]:file:_files' \ - '-passin[private key password source]:pass phrase source:_pass_phrase_source' \ - '-signer[signer certificate of the TSA in PEM format]:file:_files' \ - '-inkey[signer private key in PEM format]:file:_files' \ - '-chain[signer certificate chain in PEM format]:file:_files' \ - '-policy[default policy to use for response]:policy ID: ' \ - '-in[use the previously created time stamp response in DER format]:file:_files' \ - '-token_in[the paramter to -in is a time stamp token in DER format]' \ - '-out[name of the output file to which the response will be written]:file:_files' \ - '-token_out[output a time stamp token instead of a time stamp response]' \ - '-text[output in human-readable format instead of DER]' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' - ;; - -verify) - _arguments -C \ - '(-digest -queryfile)-data[verify response against the specified file]:file:_files' \ - '(-data -queryfile)-digest[verify the response against the specified message digest]:digest bytes: ' \ - '(-data -digest)-queryfile[the original time stamp request in DER format]:file:_files' \ - '-in[time stamp response that needs to be verified in DER format]:file:_files' \ - '-token_in[the paramter to -in is a time stamp token in DER format]' \ - '-CApath[directory containing the trused CA certificates of the client]:directory:_files -/' \ - '-CAFile[file containing a set of trusted self-signed CA certificates in PEM format]:file:_files' \ - '-untrusted[set of additional untrusted certificates in PEM format which may be needed when building the certificate chain]:file:_files' - ;; - esac - fi -} - - -_openssl_verify() { - # written for openssl 1.0.1k - _arguments -C \ - '-CApath[a directory of trusted certificates]:directory:_files -/' \ - '-CAfile[file A file of trusted certificates]:file:_files' \ - '-purpose[the intended use for the certificate]:purpose:(sslclient sslserver nssslserver smimesign smimeencrypt crlsign any ocsphelper timestampsign)' \ - '*-policy[enable policy processing and add arg to the user-initial-policy-set]:object name or OID: ' \ - '-ignore_critical[ignore critical extensions]' \ - '-attime[perform validation checks using the given time]:timestamp: ' \ - '-check_ss_sig[verify the signature on the self-signed root CA]' \ - "-crlfile[file containing one or more CRL's (in PEM format) to load]:file:_files" \ - '-crl_check[check end entity certificate in CRL]' \ - '-crl_check_all[check all certificates in CRL]' \ - '-policy_check[enables certificate policy processing]' \ - '-explicit_policy[set policy variable require-explicit-policy]' \ - '-inhibit_any[set policy variable inhibit-any-policy]' \ - '-inhibit_map[set policy variable inhibit-policy-mapping]' \ - '-x509_strict[strict X.509-compliance]' \ - '-extended_crl[enable extended CRL features]' \ - '-use_deltas[enable support for delta CRLs]' \ - '-policy_print[print out diagnostics related to policy processing]' \ - '-untrusted[a file of untrusted certificates]:file:_files' \ - '(-*)-help[print out a usage message]' \ - '-issuer_checks[print out diagnostics relating to searches for the issuer certificate of the current certificate]' \ - '-verbose[print extra information about the operations being performed]' \ - '*:certificate:_files' - # TODO: - may be used to separate certificates from options - # TODO: Do not hardcode purposes -} - - -_openssl_version() { - # written for openssl 1.0.1k - _arguments -C \ - '-a[all information, this is the same as setting all the other flags]' \ - '-v[the current OpenSSL version]' \ - '-b[the date the current version of OpenSSL was built]' \ - '-o[option information: various options set when the library was built]' \ - '-f[compilation flags]' \ - '-p[platform setting]' \ - '-d[OPENSSLDIR setting]' -} - - -_openssl_x509() { - # written for openssl 1.0.1k - _arguments -C \ - '-inform[input format - default PEM (one of DER, NET or PEM)]:format:(DER NET PEM)' \ - '-outform[output format - default PEM (one of DER, NET or PEM)]:arg:(DER NET PEM)' \ - '-keyform[private key format - default PEM]:arg:(DER PEM)' \ - '-CAform[CA format - default PEM]:arg:(DER PEM)' \ - '-CAkeyform[CA key format - default PEM]:arg:(DER PEM)' \ - '-in[input file - default stdin]:file:_files' \ - '-out[output file - default stdout]:file:_files' \ - '-passin[private key password source]:pass phrase source:_pass_phrase_source' \ - '-serial[print serial number value]' \ - '-subject_hash[print subject hash value]' \ - '-subject_hash_old[print old-style (MD5) subject hash value]' \ - '-issuer_hash[print issuer hash value]' \ - '-issuer_hash_old[print old-style (MD5) issuer hash value]' \ - '-hash[synonym for -subject_hash]' \ - '-subject[print subject DN]' \ - '-issuer[print issuer DN]' \ - '-email[print email address(es)]' \ - '-startdate[notBefore field]' \ - '-enddate[notAfter field]' \ - '-purpose[print out certificate purposes]' \ - '-dates[both Before and After dates]' \ - '-modulus[print the RSA key modulus]' \ - '-pubkey[output the public key]' \ - '-fingerprint[print the certificate fingerprint]' \ - '-alias[output certificate alias]' \ - '-noout[no certificate output]' \ - '-ocspid[print OCSP hash values for the subject name and public key]' \ - '-ocsp_uri[print OCSP Responder URL(s)]' \ - '-trustout[output a "trusted" certificate]' \ - '-clrtrust[clear all trusted purposes]' \ - '-clrreject[clear all rejected purposes]' \ - '-addtrust[trust certificate for a given purpose]:purpose:(clientAuth serverAuth emailProtection)' \ - '-addreject[reject certificate for a given purpose]:purpose:(clientAuth serverAuth emailProtection)' \ - '-setalias[set certificate alias]:alias: ' \ - '-days[how long till expiry of a signed certificate (default 30 days)]:days: ' \ - '-checkend[check whether the cert expires in the specified time]:seconds: ' \ - '-signkey[self sign cert with arg]:file:_files' \ - '-x509toreq[output a certification request object]' \ - '-req[input is a certificate request, sign and output]' \ - '-CA[set the CA certificate, must be PEM format]:file:_files' \ - '-CAkey[set the CA key, must be PEM format]:file:_files' \ - '-CAcreateserial[create serial number file if it does not exist]' \ - '-CAserial[serial file]:file:_files' \ - '-set_serial[serial number to use]' \ - '-text[print the certificate in text form]' \ - '-C[print out C code forms]' \ - '(-md5 -sha1 -mdc2)-md2[digest to use]' \ - '(-md2 -sha1 -mdc2)-md5[digest to use]' \ - '(-md2 -md5 -mdc2)-sha1[digest to use]' \ - '(-md2 -md5 -sha1)-mdc2[digest to use]' \ - '-extfile[configuration file with X509V3 extensions to add]' \ - '-extensions[section from config file with X509V3 extensions to add]' \ - '-clrext[delete extensions before signing and input certificate]' \ - '*-nameopt[various certificate name options]:options:_nameopts' \ - '-engine[use the specified engine, possibly a hardware device]:engine:_engines' \ - '*-certopt[various certificate text options]:options:_certopts' -} - - -_pass_phrase_source() { - # pass:password - # env:var - # file:pathname - # fd:number - # stdin - _values -S : 'pass phrase source' \ - 'pass[obtain the password from the command line]:password: ' \ - 'env[obtain the password from the environment variable var]:var:_parameters -g "*export*"' \ - 'file[obtain the password from a file]:file:_files' \ - 'fd[read the password from the file descriptor number]:number: ' \ - 'stdin[read the password from standard input]' -} - - -_rand_files() { - # FIXME: this does not allow using multiple files separated by : - # the following would probably work, but how to generate $files? - #_values -s : -S ' ' 'random source file or directory' ${files} - _files -} - - -_engines() { - # openssl engines - local engines - engines=(${${${(@f)"$(_call_program engines openssl engine)"}%)*}#\(}) - _values 'engines' ${engines} -} - - -_list_ciphers() { - # openssl ciphers - local ciphers - # add cipher suites - ciphers=(${(@s/:/)"$(_call_program ciphers openssl ciphers)"}) - # add static cipher strings - ciphers=(${ciphers} \ - 'DEFAULT[the default cipher list]' \ - 'COMPLEMENTOFDEFAULT[the ciphers included in ALL but not enabled by default]' \ - 'ALL[all cipher suites except the eNULL ciphers]' \ - 'COMPLEMENTOFALL[the cipher suites not enabled by ALL]' \ - 'HIGH["high" encryption cipher suites]' \ - 'MEDIUM["medium" encryption cipher suites]' \ - 'LOW["low" encryption cipher suites]' \ - {EXP,EXPORT}'[export encryption algorithms]' \ - 'EXPORT40[40 bit export encryption algorithms]' \ - 'EXPORT56[56 bit export encryption algorithms]' \ - {eNULL,NULL}'[ciphers offering no encryption]' \ - 'aNULL[ciphers offering no authentication]' \ - {kRSA,RSA}'[cipher suites rusing RSA key exchange]' \ - 'kDHr[cipher suites using DH key agreement signed by CAs with RSA keys]' \ - 'kDHd[cipher suites using DH key agreement signed by CAs with DSS keys]' \ - 'kDH[cipher suites using DH key agreement]' \ - {kDHE,kEDH}'[cipher suites using ephemeral DH key agreement, including anonymous cipher suites]' \ - {DHE,EDH}'[cipher suites using authenticated ephemeral DH key agreement]' \ - 'ADH[anonymous DH cipher suites, not including anonymous ECDH ciphers]' \ - 'DH[cipher suites using DH, including anonymous DH, ephemeral DH and fixed DH]' \ - 'kECDHr[cipher suites using fixed ECDH key agreement signed by CAs with RSA keys]' \ - 'kECDHe[cipher suites using fixed ECDH key agreement signed by CAs with ECDSA keys]' \ - 'kECDH[cipher suites using fixed ECDH key agreement]' \ - {kECDHE,kEECDH}'[cipher suites using ephemeral ECDH key agreement, including anonymous cipher suites]' \ - {ECDHE,kEECDH}'[cipher suites using authenticated ephemeral ECDH key agreement]' \ - 'AECDH[anonymous Elliptic Curve Diffie Hellman cipher suites]' \ - 'ECDH[cipher suites using ECDH key exchange, including anonymous, ephemeral and fixed ECDH]' \ - 'aRSA[cipher suites using RSA authentication]' \ - {aDSS,DSS}'[cipher suites using DSS authentication]' \ - 'aDH[cipher suites effectively using DH authentication]' \ - 'aECDH[cipher suites effectively using ECDH authentication]' \ - {aECDSA,ECDSA}'[cipher suites using ECDSA authentication]' \ - 'TLSv1.2[TLSv1.2 cipher suites]' \ - 'TLSv1[TLSv1.0 cipher suites]' \ - 'SSLv3[SSLv3.0 cipher suites]' \ - 'SSLv2[SSLv2.0 cipher suites]' \ - 'AES128[cipher suites using 128 bit AES]' \ - 'AES256[cipher suites using 256 bit AES]' \ - 'AES[cipher suites using AES]' \ - 'AESGCM[AES in Galois Counter Mode (GCM)]' \ - 'CAMELLIA128[cipher suites using 128 bit CAMELLIA]' \ - 'CAMELLIA256[cipher suites using 256 bit CAMELLIA]' \ - 'CAMELLIA[cipher suites using CAMELLIA]' \ - '3DES[cipher suites using triple DES]' \ - 'DES[cipher suites using DES (not triple DES)]' \ - 'RC4[cipher suites using RC4]' \ - 'RC2[cipher suites using RC2]' \ - 'IDEA[cipher suites using IDEA]' \ - 'SEED[cipher suites using SEED]' \ - 'MD5[cipher suites using MD5]' \ - {SHA1,SHA}'[cipher suites using SHA1]' \ - 'SHA256[cipher suites using SHA256]' \ - 'SHA384[cipher suites using SHA284]' \ - 'aGOST[cipher suites using GOST R 34.10 for authenticaction]' \ - 'aGOST01[cipher suites using GOST R 34.10-2001 authentication]' \ - 'aGOST94[cipher suites using GOST R 34.10-94 authentication]' \ - 'kGOST[cipher suites, using VKO 34.10 key exchange]' \ - 'GOST94[cipher suites, using HMAC based on GOST R 34.11-94]' \ - 'GOST89MAC[cipher suites using GOST 28147-89 MAC instead of HMAC]' \ - 'PSK[cipher suites using pre-shared keys (PSK)]' \ - 'SUITEB128[suite B mode operation using 128 or 192 bit level of security]' \ - 'SUITEB128ONLY[suite B mode operation using 128 bit level of security]' \ - 'SUITEB192[suite B mode operation using 192 bit level of security]' \ - ) - # FIXME: support !, + and - before each cipher suite - _values -s : 'cipher suite' ${ciphers} -} - - -_list_curves() { - # openssl ecparam -list_curves - local curves not_curves - curves="$(_call_program list_curves openssl ecparam -list_curves)" - # identify lines that do not contain curve names but only descriptions - not_curves=(${${(f)curves[@]}:#*:*}) - # remove non-curve lines, trailing descriptions and leading spaces - curves=(${${${${(f)curves[@]}:|not_curves}%:*}##* }) - _values 'named curves' ${curves} -} - - -_list_message_digest_algorithms() { - # openssl list-message-digest-algorithms - local algorithms - algorithms=(${${(@f)"$(_call_program message_digest_algorithms openssl list-message-digest-algorithms)"}%% *}) - _values 'message digest algorithms' ${algorithms} -} - - -_nameopts() { - _values -s ',' -w 'nameopts' \ - '(-compat compat)'{-compat,compat}'[use the old format. This is equivalent to specifying no name options at all]' \ - '(-RFC2253 RFC2253)'{-RFC2253,RFC2253}'[displays names compatible with RFC2253 equivalent to esc_2253, esc_ctrl, esc_msb, utf8, dump_nostr, dump_unknown, dump_der, sep_comma_plus, dn_rev and sname]' \ - '(-oneline oneline)'{-oneline,oneline}'[a oneline format which is more readable than RFC2253. Equivalent to esc_2253, esc_ctrl, esc_msb, utf8, dump_nostr, dump_der, use_quote, sep_comma_plus_space, space_eq and sname options]' \ - '(-multiline multiline)'{-multiline,multiline}'[a multiline format. Equivalent to esc_ctrl, esc_msb, sep_multiline, space_eq, lname and align]' \ - '(-esc_2253 esc_2253)'{-esc_2253,esc_2253}'[escape the "special" characters required by RFC2253 in a field]' \ - '(-esc_ctrl esc_ctrl)'{-esc_ctrl,esc_ctrl}'[escape control characters]' \ - '(-esc_msb esc_msb)'{-esc_msb,esc_msb}'[escape characters with the MSB set]' \ - '(-use_quote use_quote)'{-use_quote,use_quote}'[escapes some characters by surrounding the whole string with " characters]' \ - '(-utf8 utf8)'{-utf8,utf8}'[convert all strings to UTF8 format first]' \ - '(-ignore_type ignore_type)'{-ignore_type,ignore_type}'[this option does not attempt to interpret multibyte characters in any way]' \ - '(-show_type show_type)'{-show_type,show_type}'[show the type of the ASN1 character string]' \ - '(-dump_der dump_der)'{-dump_der,dump_der}'[use DER encoding when hexdumping fields]' \ - '(-dump_nostr dump_nostr)'{-dump_nostr,dump_nostr}'[dump non character string types]' \ - '(-dump_all dump_all)'{-dump_all,dump_all}'[dump all fields]' \ - '(-dump_unknown dump_unknown)'{-dump_unknown,dump_unknown}'[dump any field whose OID is not recognised by OpenSSL]' \ - '(-sep_comma_plus sep_comma_plus)'{-sep_comma_plus,sep_comma_plus}'[these options determine the field separators]' \ - '(-sep_comma_plus_space sep_comma_plus_space)'{-sep_comma_plus_space,sep_comma_plus_space}'[these options determine the field separators]' \ - '(-sep_semi_plus_space sep_semi_plus_space)'{-sep_semi_plus_space,sep_semi_plus_space}'[these options determine the field separators]' \ - '(-sep_multiline sep_multiline)'{-sep_multiline,sep_multiline}'[these options determine the field separators]' \ - '(-dn_rev dn_rev)'{-dn_rev,dn_rev}'[reverse the fields of the DN]' \ - '(-nofname nofname)'{-nofname,nofname}'[do not display field names]' \ - '(-sname sname)'{-sname,sname}'[display field names in short form]' \ - '(-lname lname)'{-lname,lname}'[display field names in long form]' \ - '(-oid oid)'{-oid,oid}'[display field names in numerical form]' \ - '(-align align)'{-align,align}'[align field values for a more readable output. Only usable with sep_multiline]' \ - '(-space_eq space_eq)'{-space_eq,space_eq}'[places spaces around the = character which follows the field name]' -} - - -_certopts() { - _values -s ',' -w 'certopts' \ - 'compatible[use the old format. This is equivalent to specifying no output options at all]' \ - "no_header[don't print header information: that is the lines saying \"Certificate\" and \"Data\"]" \ - "no_version[don't print out the version number]" \ - "no_serial[don't print out the serial number]" \ - "no_signame[don't print out the signature algorithm used]" \ - "no_validity[don't print the validity, that is the notBefore and notAfter fields]" \ - "no_subject[don't print out the subject name]" \ - "no_issuer[don't print out the issuer name]" \ - "no_pubkey[don't print out the public key]" \ - "no_sigdump[don't give a hexadecimal dump of the certificate signature]" \ - "no_aux[don't print out certificate trust information]" \ - "no_extensions[don't print out any X509V3 extensions]" \ - 'ext_default[retain default extension behaviour: attempt to print out unsupported certificate extensions]' \ - 'ext_error[print an error message for unsupported certificate extensions]' \ - 'ext_parse[ASN1 parse unsupported extensions]' \ - 'ext_dump[hex dump unsupported extensions]' \ - '(no_issuer no_pubkey no_header no_version no_sigdump no_signame)ca_default[the value used by the ca utility, equivalent to no_issuer, no_pubkey, no_header, no_version, no_sigdump and no_signame]' -} - - -_openssl "$@" - -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_optirun b/.zprezto/modules/completion/external/src/_optirun deleted file mode 100644 index ebc0e00..0000000 --- a/.zprezto/modules/completion/external/src/_optirun +++ /dev/null @@ -1,75 +0,0 @@ -#compdef optirun -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for the optirun command from bumblebee -# (https://github.com/Bumblebee-Project/Bumblebee). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Christophe-Marie Duquesne -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line -typeset -A opt_args - -local -a arguments - -arguments=( - '--version[output version information]' - '(-h --help)'{-h,--help}'[show help]' - '(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)' - '--failsafe[run a program even if the nvidia card is unavailable]:boolean:(true false)' - '--no-failsafe[do not run a program if the nvidia card is unavailable]' - '--vgl-options[options to be passed to vglrun (example: +tr)]' - '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all logging messages]' - '(-v --verbose)'{-v,--verbose}'[increase the verbosity level of log messages]' - '--debug[set the verbosity level to the maximum]' - '(-b --bridge)'{-b,--bridge}'[specify bridge library to use: VirtualGL, Primus or auto]:method:(auto primus virtualgl none)' - '(-d --display)'{-d,--display}'[the X display number to use]' - '(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files' - '(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files' - '--primus-ldpath[a colon-separated list of paths which are searched for the primus libGL.so.1]:file:_files' - '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files' - '--no-xorg[do not start secondary X server (implies -b none)]' - '*::arguments: _normal' -) - -_arguments $arguments - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_patool b/.zprezto/modules/completion/external/src/_patool deleted file mode 100644 index d132a6c..0000000 --- a/.zprezto/modules/completion/external/src/_patool +++ /dev/null @@ -1,95 +0,0 @@ -#compdef patool -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for patool (https://github.com/wummel/patool). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Sergei Eremenko (https://github.com/SmartFinn) -# -# ------------------------------------------------------------------------------ - -local state line ret=1 - -_arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(--non-interactive)'--non-interactive'[do not query for user input]' \ - '(-v --verbose)'{-v,--verbose}'[verbose operation]' \ - '1:cmd:->cmds' \ - '*:arg:->args' && ret=0 - -case $state in - (cmds) - local -a cmds - - cmds=( - 'create:create an archive from given files' - 'diff:show differences between two archives' - 'extract:extract files from given archives' - 'formats:show all supported archive formats' - 'list:list files in archives' - 'repack:repackage archive to a different format' - 'recompress:recompress an archive to smaller size' - 'search:search in archive contents for given pattern' - 'test:test the given archives' - ) - - _describe -t commands 'patool commands' cmds && ret=0 - ;; - (args) - case $line[1] in - (extract) - _arguments \ - '--outdir[extract to the given output directory]:select directory:_files -/' \ - '*:files:_files' && ret=0 - ;; - (formats) - _message 'no more arguments' && ret=0 - ;; - (search) - _arguments \ - '2:search pattern:' \ - '*:files:_files' && ret=0 - ;; - (*) - _arguments \ - '*:files:_files' && ret=0 - ;; - esac - ;; -esac - -return $ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_perf b/.zprezto/modules/completion/external/src/_perf deleted file mode 100644 index 74035d2..0000000 --- a/.zprezto/modules/completion/external/src/_perf +++ /dev/null @@ -1,254 +0,0 @@ -#compdef perf -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Linux performance counters 3.3 (perf.wiki.kernel.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_perf() { - local context curcontext="$curcontext" state line - typeset -A opt_args - - local ret=1 - - _arguments -C \ - '(- : *)--version[show version number and exit]' \ - '(- : *)--help[show help]: :_perf_cmds' \ - '1: :_perf_cmds' \ - '*::arg:->args' \ - && ret=0 - - case $state in - (args) - curcontext="${curcontext%:*:*}:perf-cmd-$words[1]:" - case $line[1] in - (annotate) - # TODO Complete CPU list - # TODO Complete disassembler style - _arguments \ - '(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \ - '(-s --symbol)'{-s,--symbol=}'[symbol to annotate]:symbol' \ - '(-f --force)'{-f,--force}'[do not complain, do it]' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \ - '(-k --vmlinux)'{-k,--vmlinux=}'[vmlinux pathname]: :_files' \ - '(-m --modules)'{-m,--modules}'[load module symbols]' \ - '(-l --print-line)'{-l,--print-line}'[print matching source lines]' \ - '(-P --full-paths)'{-P,--full-paths}'[don'\''t shorten the displayed pathnames]' \ - '--stdio[use the stdio interface]' \ - '--tui[use the TUI interface]' \ - '(-C --cpu)'{-C,--cpu}'[only report samples for the list of CPUs provided]:CPU list' \ - '--asm-raw[show raw instruction encoding of assembly instructions]' \ - '(--no-source)--source[interleave source code with assembly code]' \ - '(--source)--no-source[don'\''t interleave source code with assembly code]' \ - '--symfs=[look for files with symbols relative to this directory]: :_files -/' \ - '(-M --disassembler-style)'{-M,--disassembler-style=}'[set disassembler style for objdump]:disassembler style' \ - '1::symbol name' \ - && ret=0 - ;; - (archive) - _arguments \ - '1: :_files' \ - && ret=0 - ;; - (bench) - # TODO Complete subsystems - # TODO Complete suites - _arguments \ - '(-f --format)'{-f,--format=}'[specify format style]: :((default\:mainly\ for\ human\ reading simple\:friendly\ for\ automated\ processing\ by\ scripts))' \ - '1::subsystem' \ - '2::suite' \ - && ret=0 - ;; - (buildid-cache) - _arguments \ - '(-a --add)'{-a,--add=}'[add specified file to the cache]: :_files' \ - '(-r --remove)'{-r,--remove=}'[remove specified file from the cache]: :_files' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - && ret=0 - ;; - (buildid-list) - _arguments \ - '(-H --with-hits)'{-H,--with-hits}'[show only DSOs with hits]' \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-f --force)'{-f,--force}'[don'\''t do ownership validation]' \ - '(-k --kernel)'{-k,--kernel}'[show running kernel build id]' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - && ret=0 - ;; - (diff) - _arguments \ - '(-M --displacement)'{-M,--displacement}'[show position displacement relative to baseline]' \ - '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \ - '(-m --modules)'{-m,--modules}'[load module symbols]' \ - '(-d --dsos)'{-d,--dsos=}'[only consider symbols in these dsos]:dso list' \ - '(-C --comms)'{-C,--comms=}'[only consider symbols in these comms]:comm list' \ - '(-S --symbols)'{-S,--symbols=}'[only consider these symbols]:symbol list' \ - '(-s --sort)'{-s,--sort=}'[sort by key(s)]: :_values -s , key pid comm dso symbol' \ - '(-t --field-separator)'{-t,--field-separator=}'[use a special separator character and don'\''t pad with spaces]:separator' \ - '(-v --verbose)'{-v,--verbose}'[be verbose, for instance, show the raw counts in addition to the diff]' \ - '(-f --force)'{-f,--force}'[don'\''t complain, do it]' \ - '--symfs=[look for files with symbols relative to this directory]: :_files -/' \ - '1:old file:_files' \ - '2:new file:_files' \ - && ret=0 - ;; - (evlist) - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - && ret=0 - ;; - (inject) - _arguments \ - '(-b --build-ids)'{-b,--build-ids=}'[inject build-ids into the output stream]:build-id list' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - && ret=0 - ;; - (kmem) - # TODO Complete 'record' command - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '--caller[show per-callsite statistics]' \ - '--alloc[show per-allocation statistics]' \ - '(-s --sort)'{-s,--sort=}'[sort by output]: :_values -s , key frag hit bytes' \ - '(-n --lines)'{-n,--lines}'[print n lines only]:number' \ - '1:command:((record\:record\ the\ kmem\ events\ of\ an\ arbitrary\ workload stat\:report\ kernel\ memory\ statistics))' \ - && ret=0 - ;; - (kvm) - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-o --output)'{-o,--output=}'[output file name]: :_files' \ - '--host=[collect host side performance profile]:host' \ - '--guest=[collect guest side performance profile]:guest' \ - '--guestmount=[guest os root file system mount directory]: :_files -/' \ - '--guestkallsyms=[guest os /proc/kallsyms file copy]: :_files' \ - '--guestmodules=[guest os /proc/modules file copy]: :_files' \ - '--guestvmlinux=[guest os kernel vmlinux]: :_files' \ - '1:command:((top record report diff buildid-list))' \ - && ret=0 - ;; - (list) - _arguments \ - '1:event type:((hw\:hardware\ events hardware\:hardware\ events sw\:software\ events software\:software\ events cache\:cache\ events hwcache\:cache\ events tracepoint\:tracepoint\ events))' \ - && ret=0 - ;; - (lock) - # TODO Complete 'record' command - # TODO Complete 'report' command options - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \ - '1:command:((record\:record\ lock\ events trace\:show\ raw\ lock\ events report\:report\ statistical\ data))' \ - && ret=0 - ;; - (probe) - # TODO not implemented - ;; - (record) - # TODO not implemented - ;; - (report) - # TODO not implemented - ;; - (sched) - # TODO Complete 'record' command - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - '(-D --dump-raw-trace)'{-D,--dump-raw-trace}'[dump raw trace in ASCII]' \ - '1:command:((record\:record\ scheduling\ events script\:see\ a\ detailed\ trace replay\:simulate\ the\ workload map\:print\ a\ textual\ context-switching\ outline))' \ - && ret=0 - ;; - (script) - # TODO not implemented - ;; - (stat) - # TODO not implemented - ;; - (test) - _arguments \ - '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ - && ret=0 - ;; - (timechart) - # TODO Complete 'record' command - _arguments \ - '(-i --input)'{-i,--input=}'[input file name]: :_files' \ - '(-o --output)'{-o,--output=}'[output file name]: :_files' \ - '(-w --width)'{-w,--width=}'[select the width of the SVG file]:width' \ - '(-P --power-only)'{-P,--power-only}'[only output the CPU power section of the diagram]' \ - '(-p --process)'{-p,--process}'[select the processes to display, by name or PID]:process' \ - '--symfs=[look for files with symbols relative to this directory]: :_files -/' \ - '1:command:((record))' \ - && ret=0 - ;; - (top) - # TODO not implemented - ;; - (help) - _arguments \ - '(- : *)'{-a,--all}'[prints all the available commands on the standard output]' \ - '1: :_perf_cmds' \ - && ret=0 - ;; - *) - _call_function ret _perf_cmd_$words[1] && ret=0 - (( ret )) && _message 'no more arguments' - ;; - esac - ;; - esac -} - -# FIXME Parse 'perf --help' instead of hard-coding. -(( $+functions[_perf_cmds] )) || -_perf_cmds() { - local commands; commands=( - 'annotate:read perf.data (created by perf record) and display annotated code' - 'archive:create archive with object files with build-ids found in perf.data file' - 'bench:general framework for benchmark suites' - 'buildid-cache:manage build-id cache' - 'buildid-list:list the buildids in a perf.data file' - 'diff:read two perf.data files and display the differential profile' - 'evlist:list the event names in a perf.data file' - 'inject:filter to augment the events stream with additional information' - 'kmem:tool to trace/measure kernel memory(slab) properties' - 'kvm:tool to trace/measure kvm guest os' - 'list:list all symbolic event types' - 'lock:analyze lock events' - 'probe:define new dynamic tracepoints' - 'record:run a command and record its profile into perf.data' - 'report:read perf.data (created by perf record) and display the profile' - 'sched:tool to trace/measure scheduler properties (latencies)' - 'script:read perf.data (created by perf record) and display trace output' - 'stat:run a command and gather performance counter statistics' - 'test:runs sanity tests' - 'timechart:tool to visualize total system behavior during a workload' - 'top:system profiling tool' - 'help:show command usage information' - ) - _describe -t commands 'command' commands "$@" -} - -_perf "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_periscope b/.zprezto/modules/completion/external/src/_periscope deleted file mode 100644 index 588c4ef..0000000 --- a/.zprezto/modules/completion/external/src/_periscope +++ /dev/null @@ -1,36 +0,0 @@ -#compdef periscope -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Periscope (http://code.google.com/p/periscope). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '(- : *)'{-h,--help}'[show help message and exit]' \ - '(- : *)--version[show version number and exit]' \ - '*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \ - '(-f --force)'{-f,--force}'[replace existing subtitle file]' \ - '(-q --query)'{-q,--query}'[query to send to the subtitles website]:queries' \ - '--list-plugins[list all plugins supported by periscope]' \ - '--list-active-plugins[list all plugins used to search subtitles]' \ - '--cache-folder[cache/config directory to use]: :_files -/' \ - '--quiet[run in quiet mode (only show warn and error messages)]' \ - '--debug[set the logging level to debug]' \ - '*: :_files' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_pgsql_utils b/.zprezto/modules/completion/external/src/_pgsql_utils deleted file mode 100644 index ae44844..0000000 --- a/.zprezto/modules/completion/external/src/_pgsql_utils +++ /dev/null @@ -1,506 +0,0 @@ -#compdef psql pg_dump pg_dumpall pg_restore createdb dropdb vacuumdb createuser dropuser initdb -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users, Dominic Mitchell, Johann 'Myrkraverk' Oskarsson, Daniel Serodio, J Smith -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for PostgreSQL utils (http://postgresql.org). -# -# Source: http://www.zsh.org/mla/users/2004/msg01006.html -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Dominic Mitchell -# -# * Johann 'Myrkraverk' Oskarsson -# -# * Daniel Serodio pg_dumpall completion -# -# * J Smith pg_restore completion -# -# ------------------------------------------------------------------------------ - - -_pgsql_get_identity () { - _pgsql_user=${(v)opt_args[(i)-U|--username]} - _pgsql_port=${(v)opt_args[(i)-p|--port]} - _pgsql_host=${(v)opt_args[(i)-h|--host]} - - _pgsql_params=( - ${_pgsql_user:+"--username=$_pgsql_user"} - ${_pgsql_port:+"--port=$_pgsql_port"} - ${_pgsql_host:+"--host=$_pgsql_host"} - ) -} - -# Postgres Allows specifying the path to the directory containing the -# socket as well as a hostname. -_pgsql_host_or_dir() { - _alternative \ - 'hosts:host:_hosts' \ - 'directories:directory:_directories' -} - -# This creates a port completion list based on socket files on the -# local computer. Be default, Postgres puts them in /tmp/ but Debian -# changed that to /var/run/postgresql/ in their packages. -_pgsql_ports() { - compadd "$@" - /tmp/.s.PGSQL.<->(N:e) /var/run/postgresql/.s.PGSQL.<->(N:e) -} - -_pgsql_users () { - local _pgsql_user _pgsql_port _pgsql_host _pgsql_params - local _pgsql_user_sql - _pgsql_get_identity - - # We use _pgsql_port and _pgsql_host directly here instead of - # _pgsql_params so as to not pick up a partially completed - # username. - _pgsql_params=( - ${_pgsql_port:+"--port=$_pgsql_port"} - ${_pgsql_host:+"--host=$_pgsql_host"} - ) - - _pgsql_user_sql='select r.rolname from pg_catalog.pg_roles r where r.rolcanlogin = true' - - compadd "$@" - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_user_sql template1 2>/dev/null ) - -} - -_pgsql_tables () { - local _pgsql_user _pgsql_port _pgsql_host _pgsql_params - _pgsql_get_identity - - # Need to pull out the database name from the existing arguments. - # This is going to vary between commands. Thankfully, it's only - # used by pg_dump, which always has the dbname in arg1. If it's - # not present it defaults to ${PGDATABASE:-$LOGNAME}, which - # matches (I think) the PostgreSQL behaviour. - - local db - db=${line[1]:-${PGDATABASE:-$LOGNAME}} - - ## Instead of parsing the output of the psql \ commands, we look - ## up the tables ourselves. The following query has been tested - ## with Postgres 8.2 - 9.2. - - local _pgsql_table_sql - _pgsql_table_sql="select n.nspname || '.' || c.relname \ - from pg_catalog.pg_class c \ - left join pg_catalog.pg_namespace n on n.oid = c.relnamespace \ - where c.relkind in ('r', '') \ - and n.nspname <> 'pg_catalog' \ - and n.nspname <> 'information_schema' \ - and n.nspname !~ '^pg_toast' \ - and pg_catalog.pg_table_is_visible( c.oid ) \ - order by 1" - - compadd "$@" - \ - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_table_sql $db 2>/dev/null ) -} - -_pgsql_schemas () { - local _pgsql_user _pgsql_port _pgsql_host _pgsql_params - _pgsql_get_identity - - local db - db=${line[1]:-${PGDATABASE:-$LOGNAME}} - - local _pgsql_schema_sql="select n.nspname \ - from pg_catalog.pg_namespace n \ - where n.nspname !~ '^pg_' \ - and n.nspname <> 'information_schema' \ - order by 1;" - - compadd "$@" - \ - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_schema_sql $db 2>/dev/null ) -} - -_pgsql_databases () { - local _pgsql_user _pgsql_port _pgsql_host _pgsql_params - _pgsql_get_identity - - local _pgsql_services _pgsql_service_files - _pgsql_service_files=( - ~/.pg_service.conf - $(pg_config --sysconfdir)/pg_service.conf - ) - _pgsql_services=$( grep -h '^\[.*\]' $_pgsql_service_files 2>/dev/null \ - | sed -e 's/^\[/service=/' -e 's/\].*$//' ) - - local _pgsql_db_sql - _pgsql_db_sql="select d.datname from pg_catalog.pg_database d \ - where d.datname <> 'template0'" - - compadd "$@" - \ - ${(f)_pgsql_services} \ - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 2>/dev/null ) -} - -_pgsql_encodings () { - local _pgsql_user - _pgsql_get_identity - - local _pgsql_db_sql - _pgsql_db_sql="select pg_encoding_to_char(i) from generate_series(0,100) i;" - - compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 ) -} - - -## -## The actual completion code for the commands -## - -_psql () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s "-*" \ - "$_pgsql_common_opts[@]" \ - {-V,--version}'[display client version]' \ - {-a,--echo-all}'[print commands read]' \ - {-A,--no-align}'[unaligned output mode]' \ - {-c+,--command=}':execute SQL command:' \ - {-d+,--dbname=}':database to connect to:_pgsql_databases' \ - {-b,--echo-errors}'[echo failed commands]' \ - {-e,--echo-queries}'[display queries submitted]' \ - {-E,--echo-hidden}'[display hidden queries]' \ - {-L,--log-file=}'[send session log to file]' \ - {-n,--no-readline}'[disable enhanced command line editing (readline)]' \ - {-f+,--file=}':SQL file to read:_files' \ - {-F+,--field-separator=}':field separator char:' \ - {-H,--html}'[HTML output]' \ - {-l,--list}'[list databases]' \ - {-o+,--output=}':query output:_files' \ - {-P+,--pset=}':set psql variable:' \ - {-q,--quiet}'[non verbose mode]' \ - {-R+,--record-separator=}':record separator char:' \ - {-s,--single-step}'[prompt before each query]' \ - {-S,--single-line}'[newline sends query]' \ - {-t,--tuples-only}'[dont display header/footer]' \ - {-T+,--table-attr=}':HTML table options:' \ - -u'[prompt for username/password]' \ - {-v+,--set=,--variable=}':set SQL variable:' \ - {-x,--expanded}'[one column per line]' \ - {-z,--field-separator-zero}'[set field separator for unaligned output to zero byte]' \ - {-0,--record-separator-zero}'[set record separator for unaligned output to zero byte]' \ - {-X,--no-psqlrc}'[dont read ~/.psqlrc]' \ - ':PostgreSQL database:_pgsql_databases' \ - ':PostgreSQL user:_pgsql_users' -} - -_pg_dump () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-a,--data-only}'[dump only data]' \ - {-b,--blobs}'[dump blobs as well]' \ - {-c,--clean}'[include clean cmds in dump]' \ - {-C,--create}'[include createdb cmds in dump]' \ - {-E+,--encoding=}':database encoding:_pgsql_encodings' \ - {-d,--inserts}'[use INSERT not COPY]' \ - {-D,--{attribute,column}-inserts}'[use INSERT (cols) not COPY]' \ - {-f+,--file=}':output file:_files' \ - {-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \ - {-j,--jobs=}'[use this many parallel jobs to dump]' \ - {-i,--ignore-version}'[ignore version mismatch]' \ - {-n+,--schema=}':schema to dump:_pgsql_schemas' \ - {-N+,--exclude-schema=}':schema to NOT dump:_pgsql_schemas' \ - {-o,--oids}'[dump objects identifiers for every table]' \ - {-O,--no-owner}'[dont recreate as same owner]' \ - {-R,--no-reconnect}'[dont output connect]' \ - {-s,--schema-only}'[no data, only schema]' \ - {-S+,--superuser=}':superuser name:_pgsql_users' \ - {-t+,--table=}':table to dump:_pgsql_tables' \ - {-T+,--exclude-table=}':table to NOT dump:_pgsql_tables' \ - {-v,--verbose}'[verbose mode]' \ - {-V,--version}'[display client version]' \ - {-x,--no-{acl,privileges}}'[dont dump ACLs]' \ - -X+':option:_values "option" use-set-session-authorization disable-triggers' \ - {-Z+,--compress=}':compression level:_values "level" 9 8 7 6 5 4 3 2 1 0' \ - ':PostgreSQL database:_pgsql_databases' \ - --section=':dump named section:_values "section" pre-data data post-data' \ - --binary-upgrade'[for use by upgrade utilities only]' \ - --column-inserts'[dump data as INSERT commands with column names]' \ - --disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \ - --disable-triggers'[disable triggers during data-only restore]' \ - --enable-row-security'[enable row security (dump only content user has access to)]' \ - --exclude-table-data='[do NOT dump data for the named table(s)]' \ - --if-exists'[use IF EXISTS when dropping objects]' \ - --inserts'[dump data as INSERT commands, rather than COPY]' \ - --lock-wait-timeout='[fail after waiting TIMEOUT for a table lock]' \ - --no-security-labels'[do not dump security label assignments]' \ - --no-synchronized-snapshots'[do not use synchronized snapshots in parallel jobs]' \ - --no-tablespaces'[do not dump tablespace assignments]' \ - --no-unlogged-table-data'[do not dump unlogged table data]' \ - --quote-all-identifiers'[quote all identifiers, even if not key words]' \ - --serializable-deferrable'[wait until the dump can run without anomalies]' \ - --snapshot='[use given snapshot for the dump]' \ - --strict-names'[require table and/or schema include patterns to match at least one entity each]' \ - --use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER]' -} - -_pg_restore () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-d+,--dbname=}':database to connect to:_pgsql_databases' \ - {-f+,--file=}':output file:_files' \ - {-F+,--format=}':output format:_values "format" "p[plain text]" "t[tar]" "c[custom]"' \ - {-l,--list}'[list databases]' \ - {-a,--data-only}'[dump only data]' \ - {-c,--clean}'[include clean (drop) cmds before recreating]' \ - {-C,--create}'[include createdb cmds in dump]' \ - {-e,--exit-on-error}'[exit on error, default is to continue]' \ - {-I,--index=}':index name:' \ - {-j,--jobs=}':use this many parallel jobs to restore:' \ - {-L,--use-list=}':use table of contents from this file for selecting/ordering output:' \ - {-n,--schema=}':restore only objects in this schema:' \ - {-O,--no-owner}'[skip restoration of object ownership]' \ - {-P,--function=}':restore named function:' \ - {-s,--schema-only}'[restore only the schema, no data]' \ - {-S,--superuser=}':superuser user name to use for disabling triggers:' \ - {-t,--table=}':restore named table:' \ - {-T,--trigger=}':restore named trigger:' \ - {-x,--no-privileges}'[skip restoration of access privileges (grant/revoke)]' \ - {-1,--single-transaction}'[restore as a single transaction]' \ - {-v,--verbose}'[verbose mode]' \ - {-V,--version}'[display client version]' \ - --disable-triggers'[disable triggers during data-only restore]' \ - --if-exists'[use IF EXISTS when dropping objects]' \ - --no-data-for-failed-tables'[do not restore data of tables that could not be created]' \ - --no-security-labels'[do not restore security labels]' \ - --no-tablespaces'[do not restore tablespace assignments]' \ - --section=':dump named section:_values "section" pre-data data post-data' \ - --use-set-session-authorization'[use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership]' \ - "1: :_files" -} - -_pg_dumpall () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-a,--data-only}'[dump only data]' \ - {-c,--clean}'[include clean (drop) cmds before recreating]' \ - {-g,--globals-only}'[dump only global objects, no databases]' \ - {-f+,--file=}':output file:_files' \ - {-o,--oids}'[dump objects identifiers for every table]' \ - {-O,--no-owner}'[dont recreate as same owner]' \ - {-r,--roles-only}'[no databases or tablespaces, only roles]' \ - {-s,--schema-only}'[no data, only schema]' \ - {-S+,--superuser=}':superuser name:_pgsql_users' \ - {-t,--tablespaces-only}'[no databases or roles, only tablespaces]' \ - {-x,--no-privileges}'[dont dump ACLs]' \ - --binary-upgrade'[for use by upgrade utilities only]' \ - --column-inserts'[use INSERT with column names not COPY]' \ - --disable-dollar-quoting'[disable dollar quoting, use SQL standard quoting]' \ - --disable-triggers'[disable triggers during data-only restore]' \ - --inserts'[use INSERT not COPY]' \ - --no-security-labels'[do not dump security label assignments]' \ - --no-tablespaces'[do not dump tablespace assignments]' \ - --no-unlogged-table-data'[do not dump unlogged table data]' \ - --quote-all-identifiers'[quote all identifiers, even if not key words]' \ - --use-set-session-authorization'[use SET SESSION AUTHORIZATION cmds instead of ALTER OWNER]' -} - -_createdb () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-e,--echo}'[display SQL queries]' \ - {-q,--quiet}'[non verbose mode]' \ - {-D+,--location=}':database location:_directories' \ - {-T+,--template=}':database template:_pgsql_databases' \ - {-E+,--encoding=}':database encoding:_pgsql_encodings' \ - ':PostgreSQL database:' \ - ':comment:' -} - -_dropdb () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-e,--echo}'[display SQL queries]' \ - {-q,--quiet}'[non verbose mode]' \ - {-i,--interactive}'[confirm before drop]' \ - ':PostgreSQL database:_pgsql_databases' -} - -_vacuumdb () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-a,--all}'[vacuum all databases]' \ - {-d+,--dbname=}':database to connect to:_pgsql_databases' \ - {-t+,--table=}':table to dump:_pgsql_tables' \ - {-f,--full}'[do full vacuuming]' \ - {-z,--analyze}'[update optimizer hints]' \ - {-e,--echo}'[show the commands being sent to the server]' \ - {-q,--quiet}'[do not write any messages]' \ - {-v,--verbose}'[write a lot of output]' \ - '--help[show this help, then exit]' \ - '--version[output version information, then exit]' \ - '1:PostgreSQL database:_pgsql_databases' -} - -_createuser () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-e,--echo}'[display SQL queries]' \ - {-c,--connection-limit=}'[connection limit for role (default: no limit)]' \ - {-d,--createdb}'[role can create new databases]' \ - {-D,--no-createdb}'[role cannot create databases]' \ - {-E,--encrypted}'[encrypt stored password]' \ - {-g,--role=}'[new role will be a member of this role]' \ - {-i,--inherit}'[role inherits privileges of roles it is a member of (default)]' \ - {-I,--no-inherit}'[role does not inherit privileges]' \ - {-l,--login}'[role can login (default)]' \ - {-L,--no-login}'[role cannot login]' \ - {-N,--unencrypted}'[do not encrypt stored password]' \ - {-P,--pwprompt}'[assign a password to new role]' \ - {-r,--createrole}'[role can create new roles]' \ - {-R,--no-createrole}'[role cannot create roles]' \ - {-s,--superuser}'[role will be superuser]' \ - {-S,--no-superuser}'[role will not be superuser]' \ - {--interactive}'[prompt for missing role name and attributes rather than using defaults]' \ - {--replication}'[role can initiate replication]' \ - {--no-replication}'[role cannot initiate replication]' \ -} - -_dropuser () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - "$_pgsql_common_opts[@]" \ - {-e,--echo}'[display SQL queries]' \ - {-q,--quiet}'[non verbose mode]' \ - {-i,--interactive}'[prompt before deleting anything, and prompt for role name if not specified]' \ - ':PostgreSQL user:_pgsql_users' -} - -_initdb () { - local curcontext="$curcontext" state line expl - typeset -A opt_args - - _arguments -C -s \ - {--auth=,-A+}':default authentication method for local connections:_values "auth methods" $_pgsql_auth_methods[@]' \ - --auth-host=':default authentication method for local TCP/IP connections:_values "auth methods" $_pgsql_auth_methods[@]' \ - --auth-local=':default authentication method for local-socket connections:_values "auth methods" $_pgsql_auth_methods[@]' \ - {-D+,--pgdata=}':location for this database cluster:_files' \ - {-E+,--encoding=}':set default encoding for new databases:' \ - --locale=':set default locale for new databases:' \ - --lc-collate=':set the default locale for collate:' \ - --lc-ctype=':set the default locale for ctype:' \ - --lc-messages=':set the default locale for messages:' \ - --lc-monetary=':set the default locale for monetary:' \ - --lc-numeric=':set the default locale for numeric:' \ - --lc-time=':set the default local for time:' \ - --no-locale'[equivalent to --locale=C]' \ - --pwfile=':read password for the new superuser from file:_files' \ - {-T+,--text-search-config=}'[default text search configuration]' \ - {-U+,--username=NAME}':database superuser name:' \ - {-W,--pwprompt}'[prompt for a password for the new superuser]' \ - {-X+,--xlogdir=}':location for the transaction log directory:_files' \ - {-d,--debug}'[generate lots of debugging output]' \ - -L+':where to find the input files:_files' \ - {-k,--data-checksums}':use data page checksums:' \ - {-n,--noclean}'[do not clean up after errors]' \ - {-N,--nosync}':do not wait for changes to be written safely to disk:' \ - {-s,--show}'[show internal settings]' \ - {-S,--sync-only}'[only sync data directory]' \ - ':location for this database cluster:_files' -} - -_pgsql_utils () { - local _pgsql_common_opts _pgsql_auth_methods - - _pgsql_common_opts=( - {-\?,--help}'[display help]' - {-h+,--host=}':database host:_pgsql_host_or_dir' - {-p+,--port=}':database port number:_pgsql_ports' - {-U+,--username=}':connect as user:_pgsql_users' - {-W,--password}'[prompt for password]' - --role='[do SET ROLE before restore]' - ) - - _pgsql_auth_methods=( - trust - reject - md5 - password - gss - sspi - krb5 - ident - peer - ldap - radius - cert - pam - ) - - case "$service" in - psql) _psql "$@" ;; - pg_dump) _pg_dump "$@" ;; - pg_restore) _pg_restore "$@" ;; - createdb) _createdb "$@" ;; - dropdb) _dropdb "$@" ;; - vacuumdb) _vacuumdb "$@" ;; - createuser) _createuser "$@" ;; - dropuser) _dropuser "$@" ;; - initdb) _initdb "$@" ;; - esac -} - -_pgsql_utils "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_phing b/.zprezto/modules/completion/external/src/_phing deleted file mode 100644 index afdaf3e..0000000 --- a/.zprezto/modules/completion/external/src/_phing +++ /dev/null @@ -1,94 +0,0 @@ -#compdef phing -# ------------------------------------------------------------------------------ -# Copyright (c) Igor M. Timoshenko -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is furnished -# to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Phing (http://phing.info). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Igor Timoshenko -# -# ------------------------------------------------------------------------------ - -_phing() { - local context curcontext="$curcontext" state line ret=1 - integer NORMARG - typeset -A opt_args - - # Follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information - _arguments \ - '(-h -help)'{-h,-help}'[display the help screen]' \ - '(-v -version)'{-v,-version}'[print version information and exit]' \ - '(-l -list)'{-l,-list}'[list all available targets in buildfile (excluding targets that have their hidden attribute set to true)]' \ - '(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \ - '-verbose[verbose, give some more output]' \ - '-debug[output debug information]' \ - '-logfile [use given file for log]:file:_files' \ - '-D[set the property to the specified value to be used in the buildfile]' \ - '-find []:file:_files' \ - '-buildfile [specify an alternate buildfile name. Default is build.xml]:file:_files' \ - '-logger [specify an alternate logger. Default is phing.listener.DefaultLogger. Other options include phing.listener.NoBannerLogger, phing.listener.AnsiColorLogger, phing.listener.XmlLogger, phing.listener.TargetLogger and phing.listener.HtmlColorLogger]' \ - '-propertyfile [load properties from the specified file]:file:_files' \ - '(-v --version)'{-v,--version}'[show version]' \ - '1: :->targets' \ - '*:: :->args' \ - && ret=0 - - case $state in - targets) - local buildfile; buildfile=build.xml - if [[ ! -f $buildfile ]] - then - ret=0 - else - local targets; targets=($(sed -nE "/xzfiles" \ - '(- 1 *)'-x"[Extract one file very fast]:filepath:->filepath" \ - '(- 1 *)'-d"[Decompress]:file:->xzfiles" \ - "-i[Input]:file:->files" \ - "-o[Output]:output:->outputxz" \ - "-p[Use a maximum of NUM CPU-intensive threads]:cpu:->cpus" \ - "-t[Don't assume input is in tar format]" \ - "-k[Keep original input (do not remove it)]" \ - "-e[Use "extreme" compression, which is much slower]" \ - "-f[Set the size of each compression block, relative to the LZMA dictionary size (default is 2.0)]:num" \ - "-q[Set the number of blocks to allocate for the compression queue (default is 1.3 * cores + 2)]:num" \ - '1:inputfile:->files' \ - '2:outputfile' \ - '*: : :->args' \ - - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (xzfiles) - _pixz_compressed_files - _describe -t files 'files' files - ;; - (files) - _files - ;; - (cpus) - local num_cpus cores - num_cpus=$(nproc) - cores=() - for i in {1..$num_cpus}; do - cores+=($i) - done - _describe -t cores 'cores' cores - ;; - (filepath) - ;; - (*) - ;; - esac -} - -_pixz - diff --git a/.zprezto/modules/completion/external/src/_pkcon b/.zprezto/modules/completion/external/src/_pkcon deleted file mode 100644 index 440a7fe..0000000 --- a/.zprezto/modules/completion/external/src/_pkcon +++ /dev/null @@ -1,137 +0,0 @@ -#compdef pkcon -# ------------------------------------------------------------------------------ -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for pkcon (http://www.packagekit.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# -# ------------------------------------------------------------------------------ - - -local -a options -options=( - '--version[Show the program version and exit]' - '--filter[Set the filter, e.g. installed]' - "--root[Set the install root, e.g. '/' or '/mnt/ltsp']" - '(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]' - '(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]' - '--background[Run the command using idle network bandwidth and also using less power]' - '(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]' - '(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]" - '(-h --help)'{-h,--help}'[Show help options.]' - '(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]' -) - -local -a actions -actions=( - 'accept-eula' - 'get-roles' - 'get-distro-upgrades' - 'get-categories' - 'get-actions' - 'get-groups' - 'get-filters' - 'get-transactions' - 'get-time' - 'search' - 'install' - 'install-local' - 'download' - 'remove' - 'update' - 'refresh' - 'resolve' - 'get-updates' - 'get-depends' - 'get-requires' - 'get-details' - 'get-files' - 'get-update-detail' - 'get-packages' - 'repo-list' - 'repo-enable' - 'repo-disable' - 'repo-set-data' - 'what-provides' - 'upgrade-system' -) - -local context state line expl cmd -local -A opt_args - -integer i=2 -while (( i < $#words )); do - case "$words[$i]" in - -*) - # skip option - (( i++ )) - continue - ;; - esac - - if [[ -z "$cmd" ]]; then - cmd="$words[$i]" - words[$i]=() - (( CURRENT-- )) - fi - (( i++ )) -done - -if [[ -z "$cmd" ]] -then - _arguments -s -w : $options \ - ":action:($actions)" - return -fi - -case "$cmd" in - search) - _arguments : $options \ - ':type:(name details group file)' \ - ':data: :' - ;; - refresh) - _arguments -s -w : $options \ - '--force' - ;; - *) - _arguments -s -w : $options - ;; -esac -return 1 - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_play b/.zprezto/modules/completion/external/src/_play deleted file mode 100644 index fb2cf59..0000000 --- a/.zprezto/modules/completion/external/src/_play +++ /dev/null @@ -1,190 +0,0 @@ -#compdef play -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Play! framework 1.2.2 (http://www.playframework.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# * Mario Fernandez (https://github.com/sirech) -# -# ------------------------------------------------------------------------------ - - -_play() { - local context curcontext="$curcontext" state line - typeset -A opt_args - - local ret=1 - - _arguments -C \ - '1: :_play_cmds' \ - '*::arg:->args' \ - && ret=0 - - case $state in - (args) - curcontext="${curcontext%:*:*}:play-cmd-$words[1]:" - case $line[1] in - (build-module|list-modules|lm|check|id) - _message 'no more arguments' && ret=0 - ;; - (dependencies|deps) - _arguments \ - '1:: :_play_apps' \ - '(--debug)--debug[Debug mode (even more informations logged than in verbose mode)]' \ - '(--jpda)--jpda[Listen for JPDA connection. The process will suspended until a client is plugged to the JPDA port.]' \ - '(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknown dependencies.]' \ - '(--verbose)--verbose[Verbose Mode]' \ - && ret=0 - ;; - (clean|javadoc|jd|out|pid|secret|stop) - _arguments '1:: :_play_apps' && ret=0 - ;; - (help) - _arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0 - ;; - (status|st) - _arguments \ - '1:: :_play_apps' \ - '(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \ - '(--secret)--secret[You can provide your own secret key using this option]:Secret key' \ - && ret=0 - ;; - (new) - _arguments \ - '1: :_play_apps' \ - '(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \ - && ret=0 - ;; - (install) - _arguments '1:Play! module:_play_modules_dash_versions' && ret=0 - ;; - (new-module) - _arguments '1:Module directory:_files -/' && ret=0 - ;; - (test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb) - local cmd_args; cmd_args=( - '1:: :_play_apps' - '(--deps)--deps[Resolve and install dependencies before running the command]' - ) - case $line[1] in - (precompile|run|start|restart|war) - local app_dir="$line[2]" - [[ -d "$app_dir" ]] || app_dir=. - [[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]') - ;| - (test|run) - cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]') - ;| - (war) - cmd_args+=( - '(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/' - '(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]' - '(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list' - ) - ;| - (test|run|start|restart|war) - cmd_args+=('*:Java option') - ;; - esac - _arguments "$cmd_args[@]" && ret=0 - ;; - *) - _call_function ret _play_cmd_$words[1] && ret=0 - (( ret )) && _message 'no more arguments' - ;; - esac - ;; - esac -} - -# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ? -# FIXME Parse 'play help' and 'play help ' (for aliases) instead of hard-coding. -(( $+functions[_play_cmds] )) || -_play_cmds() { - local commands; commands=( - 'antify:Create a build.xml file for this project' - 'auto-test:Automatically run all application tests' - 'build-module:Build and package a module' - 'check:Check for a release newer than the current one' - {classpath,cp}':Display the computed classpath' - 'clean:Delete temporary files (including the bytecode cache)' - {dependencies,deps}':Resolve and retrieve project dependencies' - {eclipsify,ec}':Create all Eclipse configuration files' - 'evolutions:Run the evolution check' - 'evolutions\:apply:Automatically apply pending evolutions' - 'evolutions\:mark:AppliedMark pending evolutions as manually applied' - 'evolutions\:resolve:Resolve partially applied evolution' - 'help:Display help on a specific command' - 'id:Define the framework ID' - {idealize,idea}':Create all IntelliJ Idea configuration files' - 'install:Install a module' - {javadoc,jd}':Generate your application Javadoc' - {list-modules,lm}':List modules available from the central modules repository' - 'modules:Display the computed modules list' - {netbeansify,nb}':Create all NetBeans configuration files' - 'new:Create a new application' - {new-module,nm}':Create a module' - 'out:Follow logs/system.out file' - 'pid:Show the PID of the running application' - 'precompile:Precompile all Java sources and templates to speed up application start-up' - 'restart:Restart the running application' - 'run:Run the application in the current shell' - 'secret:Generate a new secret key' - 'start:Start the application in the background' - {status,st}':Display the running application status' - 'stop:Stop the running application' - 'test:Run the application in test mode in the current shell' - 'war:Export the application as a standalone WAR archive' - ) - _describe -t commands 'Play! command' commands "$@" -} - -(( $+functions[_play_apps] )) || -_play_apps() { - _wanted application expl 'Play! application directory' _files -/ -} - -(( $+functions[_play_modules] )) || -_play_modules() { - local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}}) - _describe -t modules 'Play! module' modules "$@" -} - -(( $+functions[_play_modules_dash_versions] )) || -_play_modules_dash_versions() { - local ret=1 - if compset -P '*-'; then - local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}}) - _describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0 - else - _wanted modules expl 'Play! module' _play_modules -qS- && ret=0 - fi -} - -(( $+functions[_play_modules_list] )) || -_play_modules_list() { - compset -P '*,'; compset -S ',*' - _wanted module-list expl 'Play! modules list' _play_modules -qS, -} - -(( $+functions[_play_colon_dirs_list] )) || -_play_colon_dirs_list() { - compset -P '*:'; compset -S ':*' - _wanted directories-list expl 'Directories list' _files -/ -qS: -} - -_play "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_port b/.zprezto/modules/completion/external/src/_port deleted file mode 100644 index d186ef9..0000000 --- a/.zprezto/modules/completion/external/src/_port +++ /dev/null @@ -1,275 +0,0 @@ -#compdef port -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for MacPorts (http://www.macports.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Matt Cable -# * Sorin Ionescu -# * Aljaž Srebrnič -# ----------------------------------------------------------------------------- -# License -# ------- -# -# Copyright (c) 2016, Matt Cable, Sorin Ionescu, Aljaž Srebrnič -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the 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 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. -# -# ------------------------------------------------------------------------------ - -_port() { - local -a upgrade_options revupgrade_options select_options \ - actions pseudo_common pseudo_advanced port_prefix - - port_prefix=$(which port | sed 's|/bin/port||') - - actions=( - 'activate\:Activate\ the\ given\ ports' - 'archive\:Archive\ the\ given\ ports,\ i.e.\ install\ the\ port\ image\ but\ do\ not\ activate' - 'archivefetch\:Fetch\ archive\ for\ the\ given\ ports' - 'build\:Build\ the\ given\ ports' - 'cat\:Writes\ the\ Portfiles\ of\ the\ given\ ports\ to\ stdout' - 'checksum\:Compares\ the\ checksums\ for\ the\ downloaded\ files\ of\ the\ given\ ports' - 'clean\:Removes\ files\ associated\ with\ the\ given\ ports' - 'configure\:Configure\ the\ given\ ports' - 'contents\:\Returns\ a\ list\ of\ files\ installed\ by\ given\ ports' - 'deactivate\:Deactivates\ the\ given\ ports' - 'dependents\:Returns\ a\ list\ of\ installed\ dependents\ for\ each\ of\ the\ given\ ports' - 'deps\:Display\ a\ dependency\ listing\ for\ the\ given\ ports' - 'destroot\:Destroot\ the\ given\ ports' - 'dir\:Returns\ the\ directories\ of\ the\ given\ ports' - 'distcheck\:Checks\ if\ the\ given\ ports\ can\ be\ fetched\ from\ all\ of\ its\ master_sites' - 'distfiles\:Returns\ a\ list\ of\ distfiles\ for\ the\ given\ port' - 'dmg\:Creates\ a\ dmg\ for\ each\ of\ the\ given\ ports' - 'dpkg\:Creates\ a\ dpkg\ for\ each\ of\ the\ given\ ports' - 'echo\:Returns\ the\ list\ of\ ports\ the\ argument\ expands\ to' - 'edit\:Edit\ given\ ports' - 'extract\:Extract\ the\ downloaded\ files\ of\ the\ given\ ports' - 'fetch\:Downloaded\ distfiles\ for\ the\ given\ ports' - 'file\:Returns\ the\ path\ to\ the\ Portfile\ for\ each\ of\ the\ given\ ports' - 'gohome\:Opens\ the\ homepages\ of\ the\ given\ ports\ in\ your\ browser' - 'help\:Displays\ short\ help\ texts\ for\ the\ given\ actions' - 'info\:Returns\ information\ about\ the\ given\ ports ' - 'install\:Installs\ the\ given\ ports' - 'installed\:List\ installed\ versions\ of\ the\ given\ port,\ or\ all\ installed\ ports\ if\ no\ port\ is\ given' - 'lint\:Checks\ if\ the\ Portfile\ is\ lint-free\ for\ each\ of\ the\ given\ ports' - 'list\:List\ the\ available\ version\ for\ each\ of\ the\ given\ ports' - 'livecheck\:Checks\ if\ a\ new\ version\ of\ the\ software\ is\ available' - 'load\:Interface\ to\ launchctl(1)\ for\ ports\ providing\ startup\ items' - 'location\:Returns\ the\ install\ location\ for\ each\ of\ the\ given\ ports' - 'log\:Shows\ main\ log\ for\ given\ ports' - 'logfile\:Returns\ the\ log\ file\ path\ for\ each\ of\ the\ given\ ports' - 'mdmg\:Creates\ a\ dmg\ containing\ an\ mpkg\ for\ each\ of\ the\ given\ ports\ and\ their\ dependencies' - 'mirror\:Fetches\ distfiles\ for\ the\ given\ ports' - 'mpkg\:Creates\ an\ mpkg\ for\ each\ of\ the\ given\ ports\ and\ their\ dependencies' - 'notes\:Displays\ informational\ notes\ for\ each\ of\ the\ given\ ports' - 'outdated\:Returns\ a\ list\ of\ outdated\ ports' - 'patch\:Applies\ patches\ to\ each\ of\ the\ given\ ports' - 'pkg\:Creates\ a\ pkg\ for\ each\ of\ the\ given\ ports' - 'platform\:Returns\ the\ current\ platform\ that\ port\ is\ running\ on' - 'provides\:Return\ which\ port\ provides\ each\ of\ the\ files\ given' - 'rdependents\:Recursive\ version\ of\ dependents' - 'rdeps\:Display\ a\ recursive\ dependency\ listing\ for\ the\ given\ ports' - 'rev-upgrade\:Scan\ for\ broken\ binaries\ in\ the\ installed\ ports\ and\ rebuild\ them\ as\ needed' - 'rpm\:Creates\ a\ rpm\ for\ each\ of\ the\ given\ ports' - 'search\:Search\ for\ a\ port' - 'select\:Select\ between\ multiple\ versions\ of\ a\ versioned\ port' - 'selfupdate\:Upgrade\ MacPorts\ itself\ and\ run\ the\ sync\ target' - 'setrequested\:Marks\ each\ of\ the\ given\ ports\ as\ requested' - 'space\:Show\ the\ disk\ space\ used\ by\ the\ given\ ports' - 'srpm\:Creates\ a\ srpm\ for\ each\ of\ the\ given\ ports' - 'sync\:Synchronize\ the\ set\ of\ Portfiles' - 'test\:Run\ tests\ on\ each\ of\ the\ given\ ports' - 'unarchive\:Unarchive\ the\ destroot\ of\ the\ given\ ports\ from\ installed\ images' - 'uninstall\:Uninstall\ the\ given\ ports' - 'unload\:Interface\ to\ launchctl(1)\ for\ ports\ providing\ startup\ items' - 'unsetrequested\:Marks\ each\ of\ the\ given\ ports\ as\ unrequested' - 'upgrade\:Upgrades\ the\ given\ ports\ to\ the\ latest\ version' - 'url\:Returns\ the\ URL\ for\ each\ of\ the\ given\ ports' - 'usage\:Returns\ basic\ usage\ of\ the\ port\ command' - 'variants\:Returns\ a\ list\ of\ variants\ provided\ by\ the\ given\ ports,\ with\ descriptions\ if\ present' - 'version\:Returns\ the\ version\ of\ MacPorts' - 'work\:Returns\ the\ path\ to\ the\ work\ directory\ for\ each\ of\ the\ given\ ports' - ) - - pseudo_common=(all current active inactive actinact installed uninstalled outdated - obsolete requested unrequested leaves rleaves) - - pseudo_advanced=('variants:' 'variant:' 'description:' 'depends:' - 'depends_lib:' 'depends_run:' 'depends_build:' 'depends_fetch:' 'depends_extract:' - 'portdir:' 'homepage:' 'epoch:' 'platforms:' 'platform:' 'name:' 'long_description:' - 'maintainers:' 'maintainer:' 'categories:' 'category:' 'version:' 'revision:' 'license:') - - select_options=( - '--summary:Display sumamry of selected options' - '--list:List available versions for the group' - '--set:Select the given version for the group' - '--show:Show which version is currently selected for the group (default if none given)' - ) - - revupgrade_options=('--id-loadcmd-check:Run more checks against a special loadcommand in Mach-O binaries') - - upgrade_options=( - '--force\:Ignore\ circumstances\ that\ would\ normally\ cause\ ports\ to\ be\ skipped\ \(e.g.\ not\ outdated\).' \ - '--enforce-variants\:If\ the\ installed\ variants\ do\ not\ match\ those\ requested,\ upgrade\ even\ if\ the\ port\ is\ not\ outdated.' \ - '--no-replace\:Do\ not\ replace\ one\ port\ with\ another\ according\ to\ the\ replaced_by\ field.' \ - ) - - _arguments -s -C \ - '-v[Verbose mode (generate verbose messages)]' \ - '-d[Debug mode (generate debugging messages, implies -v)]' \ - '-q[Quiet mode (suppress messages)]' \ - "-n[Don't upgrade dependencies (affects upgrade and install)]" \ - "-R[Also upgrade dependents (only affects upgrade) - note that this does not upgrade dependents' dependencies]" \ - '-u[Uninstall non-active ports when upgrading and uninstalling]' \ - '-f[Force mode (ignore state file)]' \ - '-o[Honor state files even if the Portfile has been modified since (called -o because it used to mean "older")]' \ - '-s[Source-only mode (build and install from source, do not attempt to fetch binary archives)]' \ - '-b[Binary-only mode (build and install from binary archives, ignore source, abort if no archive available)]' \ - '-c[Autoclean mode (execute clean after install)]' \ - "-k[Keep mode (don't autoclean after install)]" \ - '-D[Specify portdir]' \ - '-F[Read and process the file of commands specified by the argument.]' \ - '-p[Despite any errors encountered, proceed to process multiple ports and commands.]' \ - '-y[Perform a dry run.]' \ - '-t[Enable trace mode debug facilities on platforms that support it (macOS).]' \ - "1:Port actions:(($actions))" \ - '::Per-action arguments:_port_dispatch' \ - && return 0 -} - -_port_dispatch() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - zstyle ":completion:${curcontext}:" cache-policy ${cache_policy:-_port_caching_policy} - - case "$words[2]" in - provides) - _files - ;; - search) - _message 'pattern' - ;; - help) - _describe -t actions 'Port actions' actions - ;; - select) - _call_function - _port_select - ;; - contents|deactivate|setrequested|space|uninstall|unsetrequested) - # Cache the list of installed ports. - if ( [[ ${+_port_installed_packages} -eq 0 ]] || _cache_invalid PORT_INSTALLED_PACKAGES ) && - ! _retrieve_cache PORT_INSTALLED_PACKAGES; - then - _port_installed_packages=( $(_call_program path-all "port -q echo installed") ) - _store_cache PORT_INSTALLED_PACKAGES _port_installed_packages - fi - _alternative \ - "ports:Installed ports:($_port_installed_packages)" \ - "pseudo-common:Common Pseudo-portnames:($pseudo_common)" \ - "pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)" - ;; - upgrade) - # No good reason to actually cache outdated ports list - local outdated_packages - outdated_packages=( $(_call_program path-outdated "port -q echo outdated") ) - _alternative -- \ - "upgrade-options:Upgrade options:(($upgrade_options))" \ - "ports:Outdated ports:($outdated_packages)" \ - "pseudo-common:Common Pseudo-portnames:($pseudo_common)" \ - "pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)" - ;; - rev-upgrade) - if (( CURRENT == 3 )); then - _describe 'Rev-upgrade options' revupgrade_options - fi - ;; - outdated|sync) - # No need to complete anything more here. - return 0; - ;; - selfupdate) - _all_labels 'Selfupdate options' '--nosync' - ;; - *) - # Cache the list of all ports. - if ( [[ ${+_port_available_packages} -eq 0 ]] || _cache_invalid PORT_AVAILABLE_PACKAGES ) && - ! _retrieve_cache PORT_AVAILABLE_PACKAGES; - then - _port_available_packages=( $(_call_program path-all "port -q echo all") ) - _store_cache PORT_AVAILABLE_PACKAGES _port_available_packages - fi - _alternative \ - "ports:Available ports:($_port_available_packages)" \ - "pseudo-common:Common Pseudo-portnames:($pseudo_common)" \ - "pseudo-advanced:Advanced Pseudo-portnames:($pseudo_advanced)" - ;; - esac -} - -_port_select() { - if (( CURRENT == 3 )); then - _describe 'Port select options' select_options - elif (( CURRENT == 4 )); then - local select_group - select_group=() - for f in $port_prefix/etc/select/*; do - select_group+=$(basename $f) - done - _describe "Port select groups" select_group - elif [[ $CURRENT -eq 5 && $words[3] == '--set' ]]; then - local select_variants - select_variants=("${(f)$(port select --list $words[4] | sed -e '1 d' -e 's/^[ \t]*//' -e 's/ (active)$//')}") - _describe "Port select group $words[4] variants" select_variants - fi -} - -stat -f%m . > /dev/null 2>&1 -if [ "$?" = 0 ]; then - stat_cmd=(stat -f%Z) -else - stat_cmd=(stat --format=%Z) -fi - -_port_caching_policy() { - local reg_time comp_time check_file - case "${1##*/}" in - PORT_INSTALLED_PACKAGES) - check_file=$port_prefix/var/macports/registry/registry.db - ;; - PORT_AVAILABLE_PACKAGES) - check_file=${$(port dir MacPorts)%/*/*}/PortIndex - ;; - esac - reg_time=$($stat_cmd $check_file) - comp_time=$($stat_cmd $1) - return $(( reg_time < comp_time )) -} - -_port "$@" diff --git a/.zprezto/modules/completion/external/src/_pygmentize b/.zprezto/modules/completion/external/src/_pygmentize deleted file mode 100644 index bc62304..0000000 --- a/.zprezto/modules/completion/external/src/_pygmentize +++ /dev/null @@ -1,147 +0,0 @@ -#compdef pygmentize -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for pygmentize. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Hideo Hattori -# -# ------------------------------------------------------------------------------ - -_pygmentize() { - local context state line - - _arguments -s -S \ - '-h[prints help]:' \ - '-V[prints the package version]:' \ - '-L[lists lexers, formatters, styles or filters]:args:(lexers formatters styles filters):' \ - '-f[formatter]:FORMATTER:_get_formatters' \ - '-o[output file]:FILENAME:_gnu_generic' \ - '(-h -V -L -f -o -S -F -H -g -l)-N[guesses and prints out a lexer name based solely on given filename]:FILENAME:_files:' \ - '(-h -V -L -o -F -H -g -l -N)-S[style]:STYLE:_get_styles' \ - '-F[filter]:STYLE:_get_filters' \ - '-H[prints detailed help for the object of type ]:' \ - '(-g)-l[lexer]::LEXER:_get_lexers:' \ - '(-l)-g[attempt to guess the lexer from the file contents]' \ - '*:args:_gnu_generic' -} - - -_get_filters() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy - fi - - if ( [[ ${+_pygmentize_filters} -eq 0 ]] || _cache_invalid pygmentize_filters ) \ - && ! _retrieve_cache pygmentize_filters; then - _pygmentize_filters=(${${(f)"$(pygmentize -L filters | grep '* ' | cut -c3- | sed -e 's/:$//')"}}) - _store_cache pygmentize_filters _pygmentize_filters - fi - - local expl - _wanted pygmentize_filters expl 'pygmentize filters' compadd -a _pygmentize_filters -} - - -(( $+functions[_pygmentize_get_formatters] )) || -_get_formatters() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy - fi - - if ( [[ ${+_pygmentize_formatter} -eq 0 ]] || _cache_invalid pygmentize_formatter ) \ - && ! _retrieve_cache pygmentize_formatter; then - _pygmentize_formatter=(${${(f)"$(pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}}) - _store_cache pygmentize_formatter _pygmentize_formatter - fi - - local expl - _wanted pygmentize_formatter expl 'pygmentize formatters' compadd -a _pygmentize_formatter -} - - -_get_lexers() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy - fi - - if ( [[ ${+_pygmentize_lexer} -eq 0 ]] || _cache_invalid pygmentize_lexer ) \ - && ! _retrieve_cache pygmentize_lexer; then - _pygmentize_lexer=(${${(f)"$(pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/, /\n/g' -e 's/:$//')"}}) - _store_cache pygmentize_lexer _pygmentize_lexer - fi - - local expl - _wanted pygmentize_lexer expl 'pygmentize lexers' compadd -a _pygmentize_lexer -} - - -_get_styles() { - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - if [[ -z "$cache_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _pygmentize_caching_policy - fi - - if ( [[ ${+_pygmentize_style} -eq 0 ]] || _cache_invalid pygmentize_style ) \ - && ! _retrieve_cache pygmentize_style; then - _pygmentize_style=(${${(f)"$(pygmentize -L styles | grep '* ' | cut -c3- | sed -e 's/:$//')"}}) - _store_cache pygmentize_style _pygmentize_style - fi - - local expl - _wanted pygmentize_style expl 'pygmentize styles' compadd -a _pygmentize_style -} - - -_pygmentize_caching_policy() { - local -a oldp - oldp=( "$1"(Nmh+24) ) # 24 hour - (( $#oldp )) -} - -_pygmentize "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_rails b/.zprezto/modules/completion/external/src/_rails deleted file mode 100644 index 6dc85d4..0000000 --- a/.zprezto/modules/completion/external/src/_rails +++ /dev/null @@ -1,624 +0,0 @@ -#compdef rails -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Ruby on Rails (http://rubyonrails.org/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Kazuya Takeshima (https://github.com/mitukiii) -# -# ------------------------------------------------------------------------------ - - -_rails() { - local context state line curcontext="$curcontext" - - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_${words[1]}" || _nothing - else - __rails_commands - fi -} - -__rails_commands() { - local context state line curcontext="$curcontext" - - local -a rails_options - __rails_setup_rails_options - - _arguments -C \ - $rails_options \ - ': :->command' - - case "$state" in - command) - local -a commands - local application_directory - __rails_setup_application_directory - - if [ -n "$application_directory" ]; then - commands=( - {generate,g}'[Generate new code]' - {console,c}'[Start the Rails console]' - {server,s}'[Start the Rails server]' - {dbconsole,db}'[Start a console for the database specified in config/database.yml]' - application'[Generate the Rails application code]' - {destroy,d}'[Undo code generated with "generate"]' - benchmarker'[See how fast a piece of code runs]' - profiler'[Get profile information from a piece of code]' - plugin'[Install a plugin]' - {runner,r}'[Run a piece of code in the application environment]' - {test,t}'[Run tests]' - ) - else - commands=( - new'[Create a new Rails application]' - ) - fi - - _values 'command' $commands - ;; - esac -} - -__rails_setup_application_directory() { - application_directory="$(pwd)" - - while [ -n "$application_directory" ]; do - if [ -f "${application_directory}/script/rails" -o -f "${application_directory}/bin/rails" ]; then - return - fi - application_directory="${application_directory%/*}" - done - - application_directory= -} - -__rails_setup_rails_options() { - rails_options=( - {-h,--help}'[Show this help message and quit]' - {-v,--version}'[Show Rails version number and quit]' - ) -} - -__rails_setup_runtime_options() { - runtime_options=( - '(-f --force)'{-f,--force}'[Overwrite files that already exist]' - '(-p --pretend)'{-p,--pretend}'[Run but do not make any changes]' - '(-q --quiet)'{-q,--quiet}'[Suppress status output]' - '(-s --skip)'{-s,--skip}'[Skip files that already exist]' - ) -} - -__rails_setup_generators_options() { - local -a runtime_options - __rails_setup_runtime_options - - generators_options=( - $runtime_options - --skip-namespace'[Skip namespace (affects only isolated applications)]' - --old-style-hash"[Force using old style hash (:foo => 'bar') on Ruby >= 1.9]" - ) -} - -__rails_setup_model_generators_options() { - local -a generators_options - __rails_setup_generators_options - - model_generators_options=( - $generators_options - '(-o --orm)'{-o,--orm=}'[Orm to be invoked]:orm' - ) -} - -__rails_setup_resource_generators_options() { - local -a model_generators_options - __rails_setup_model_generators_options - - resource_generators_options=( - $model_generators_options - --force-plural'[Forces the use of a plural ModelName]' - --resource-route'[Indicates when to generate resource route]: :__rails_boolean' - ) -} - -__rails_boolean() { - _values 'boolean' 'true' 'false' -} - -__rails_migration_fields() { - if compset -P '*:*:'; then - _values 'index' 'index' 'uniq' - else - if compset -P '*:'; then - _values -s ':' 'type' 'string' 'text' 'integer' 'float' 'decimal' 'datetime' 'timestamp' 'time' 'date' 'binary' 'boolean' 'references' - else - _guard '[[:alnum:]_]#' 'field' - fi - fi -} - -_rails_generate() { - local context state line curcontext="$curcontext" - - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_generate_${words[1]}" || _rails_generate_default - else - __rails_generate_commands - fi -} - -_rails_g() { - _rails_generate -} - -__rails_generate_commands() { - local context curcontext="$curcontext" update_policy - - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [ -z "$update_policy" ]; then - zstyle ":completion:${curcontext}:" cache-policy _rails_generate_commands_caching_policy - fi - - local application_directory - __rails_setup_application_directory - local cache_name - cache_name="rails/${application_directory##*/}/all_generators" - if ! _retrieve_cache ${cache_name}; then - local -a all_generators - all_generators=($(_call_program rails_generators rails generate 2> /dev/null | awk '/^ [a-zA-Z_]+/{ print $1 }')) - _store_cache ${cache_name} all_generators - fi - - local -a rails_generators - rails_generators=(${all_generators:#*:*}) - _describe -t rails_generators 'rails generator' rails_generators - - local -a -U namespaces - local namespace - local -a generators - namespaces=(${(R)${(M)all_generators:#*:*}%:*}) - for namespace in $namespaces; do - generators=(${${(M)all_generators:#${namespace}:*}/:/\\:}) - _describe -t ${namespace}_generators "${namespace/_/ } generator" generators - done -} - -_rails_generate_commands_caching_policy() { - local application_directory - __rails_setup_application_directory - - if [ "${application_directory}/Gemfile" -nt "$1" ]; then - return 0 - fi - - local -a oldp - oldp=( "$1"(Nmw+1) ) - (( $#oldp )) -} - -_rails_generate_default() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '*:argument' -} - -_rails_generate_assets() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-j --javascripts)'{-j,--javascripts}'[Generate JavaScripts]: :__rails_boolean' \ - '(-y --stylesheets)'{-y,--stylesheets}'[Generate Stylesheets]: :__rails_boolean' \ - '(-je --javascript-engine)'{-je,--javascript-engine=}'[Engine for JavaScripts]:javascript engine' \ - '(-se --stylesheet-engine)'{-se,--stylesheet-engine=}'[Engine for Stylesheets]:stylesheet engine' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_controller() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - --helper'[Indicates when to generate helper]: :__rails_boolean' \ - --assets'[Indicates when to generate assets]: :__rails_boolean' \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "action"' -} - -_rails_generate_generator() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --namespace'[Namespace generator under lib/generators/name]: :__rails_boolean' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_helper() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_integration_test() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --integration-tool='[Integration tool to be invoke]:integration tool' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_jbuilder() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_mailer() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "method"' -} - -_rails_generate_migration() { - local -a modelgenerators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_model() { - _rails_generate_migration -} - -_rails_generate_observer() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' -} - -_rails_generate_performance_test() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - --performance-tool='[Performance tool to be invoked]:performance tool' \ - ': :_guard "^-*" "name"' \ -} - -_rails_generate_resource() { - local context state line curcontext="$curcontext" - - local -a resource_generators_options - __rails_setup_resource_generators_options - - _arguments -C \ - $resource_generators_options \ - '(-c --resource-controller)'{-c,--resource-controller=}'[Resource controller to be invoked]:name' \ - '(-a --actions)'{-a,--actions=}'[Actions for the resource controller]: :->actions' \ - ': :->name' \ - '*: :->fields' - - if (( words[(I)(--actions=*|-a)] > 0 && words[(I)(--actions=*|-a)] == words[(I)-*] )); then - state=actions - fi - - case "$state" in - actions) - _guard "[[:alnum:]_]#" "actions" - ;; - name) - _guard "^-*" "name" - ;; - fields) - __rails_migration_fields - ;; - esac -} - -_rails_generate_scaffold() { - local -a resource_generators_options - __rails_setup_resource_generators_options - - _arguments \ - $resource_generators_options \ - '(-y --stylesheets)'{-y,--stylesheets}'[Generate Stylesheets]: :__rails_boolean' \ - '(-se --stylesheet-engine)'{-se,--stylesheet-engine=}'[Engine for Stylesheets]:stylesheet engine' \ - '(-c --scaffold-controller)'{-c,--scaffold-controller=}'[Scaffold controller to be invoked]:name' \ - --assets'[Indicates when to generate assets]:boolean:(true false)' \ - ': :_guard "^-*" "name"' \ - '*: :__rails_migration_fields' -} - -_rails_generate_scaffold_controller() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - '(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:template engine' \ - '(-t --test-framework)'{-t,--test-framework=}'[Test framework to be invoked]:test framework' \ - --helper'[Indicates when to generate helper]: :__rails_boolean' \ - ': :_guard "^-*" "name"' -} - -_rails_generate_session_migration() { - local -a model_generators_options - __rails_setup_model_generators_options - - _arguments \ - $model_generators_options \ - ': :_guard "^-*" "name"' -} - -_rails_generate_task() { - local -a generators_options - __rails_setup_generators_options - - _arguments \ - $generators_options \ - ': :_guard "^-*" "name"' \ - '*: :_guard "^-*" "action"' -} - -_rails_console() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-s --sandbox)'{-s,--sandbox}'[Rollback database modifications on exit]' \ - --debugger'[Enable ruby-debugging for the console]' -} - -_rails_c() { - _rails_console -} - -_rails_server() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-p --port)'{-p,--port=}'[Runs Rails on the specified port]: :_guard "[[\:digit\:]]#" "port"' \ - '(-b --binding)'{-b,--binding=}'[Binds Rails to the specified ip]:ip:_hosts' \ - '(-c --config)'{-c,--config=}'[Use custom rackup configuration file]:file:_files -g "*.ru"' \ - '(-d --daemon)'{-d,--daemon}'[Make server run as a Daemon]' \ - '(-u --debugger)'{-u,--debugger}'[Enable ruby-debugging for the server]' \ - '(-e --environment)'{-e,--environment=}'[Specifies the environment to run this server under (test/development/production)]:name:(test development production)' \ - '(-P --pid)'{-P,--pid=}'[Specifies the PID file]:pid:_files -g "*.pid"' -} - -_rails_s() { - _rails_server -} - -_rails_dbconsole() { - _arguments \ - '(- *)'--help'[Show this help message]' \ - '(-p --include-password)'{-p,--include-password}'[Automatically provide the password from database.yml]' \ - --mode'[Automatically put the sqlite3 database in the specified mode (html, list, line, column)]:mode:(html list line column)' \ - --header -} - -_rails_new() { - local context state line curcontext="$curcontext" - - local _a rails_options runtime_options - __rails_setup_rails_options - __rails_setup_runtime_options - - _arguments -C \ - $rails_options \ - $runtime_options \ - '(-r --ruby)'{-r,--ruby=}'[Path to the Ruby binary of your choice]:path' \ - '(-b --builder)'{-b,--builder=}'[Path to a application builder (can be a filesystem path or URL)]: :->path_or_url' \ - '(-m --template)'{-m,--template=}'[Path to an application template (can be a filesystem path or URL)]: :->path_or_url' \ - --skip-gemfile"[Don't create a Gemfile]" \ - --skip-bundle"[Don't run bundle install]" \ - '(-G --skip-git)'{-G,--skip-git}'[Skip Git ignores and keeps]' \ - '(-O --skip-active-record)'{-O,--skip-active-record}'[Skip Active Record files]' \ - '(-S --skip-sprockets)'{-S,--skip-sprockets}'[Skip Sprockets files]' \ - '(-d --database)'{-d,--database=}'[Preconfigure for selected database]:database:(mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc)' \ - '(-j --javascript)'{-j,--javascript=}'[Preconfigure for selected JavaScript library]:javascript' \ - '(-J --skip-javascript)'{-J,--skip-javascript}'[Skip JavaScript files]' \ - --dev'[Setup the application with Gemfile pointing to your Rails checkout]' \ - --edge'[Setup the application with Gemfile pointing to Rails repository]' \ - '(-T --skip-test-unit)'{-T,--skip-test-unit}'[Skip Test::Unit files]' \ - --old-style-hash"[Force using old style hash (:foo => 'bar') on Ruby >= 1.9]" \ - ':app path:_directories' - - case "$state" in - path_or_url) - _alternative \ - 'files:path:_files -g "*.rb"' \ - 'url:url:_urls' - ;; - esac -} - -_rails_application() { - _rails_new -} - -_rails_db() { - _rails_dbconsole -} - -_rails_destroy() { - _rails_generate -} - -_rails_d() { - _rails_destroy -} - -_rails_benchmarker() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-r --runs)'{-r,--runs}'[Number of runs]: :_guard "[[\:digit\:]]#" "number"' \ - '(-o --output)'{-o,--output}'[Directory to use when writing the results]:directory:_directories' \ - '(-m --metrics)'{-m,--metrics}'[Metrics to use]: :_values -s "," "metrics" "wall_time" "memory" "objects" "gc_runs" "gc_time"' \ - '*: :_guard "^-*" "ruby code"' -} - -_rails_profiler() { - _arguments \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-r --runs)'{-r,--runs}'[Number of runs]: :_guard "[[\:digit\:]]#" "number"' \ - '(-o --output)'{-o,--output}'[Directory to use when writing the results]:directory:_directories' \ - '(-m --metrics)'{-m,--metrics}'[Metrics to use]: :_values -s "," "metrics" "process_time" "memory" "objects"' \ - '(-f --formats)'{-f,--formats}'[Formats to output to]: :_values -s "," "formats" "flat" "graph" "html" "call_tree" "call_stack"' \ - '*: :_guard "^-*" "ruby code"' -} - -_rails_plugin() { - local context state line curcontext="$curcontext" - - if (( CURRENT > 2 )); then - (( CURRENT-- )) - shift words - _call_function - "_rails_plugin_${words[1]}" || _nothing - else - __rails_plugin_commands - fi -} - -__rails_plugin_commands() { - _values 'plugin command' \ - install'[Install plugin(s) from known repositories or URLs]' \ - remove'[Uninstall plugins]' \ - new -} - -_rails_plugin_install() { - _arguments \ - '(-x --externals)'{-x,--externals}'[Use svn:externals to grab the plugin. Enables plugin updates and plugin versioning]' \ - '(-o --checkout)'{-o,--checkout}'[Use svn checkout to grab the plugin. Enables updating but does not add a svn:externals entry]' \ - '(-e --export)'{-e,--export}'[Use svn export to grab the plugin. Exports the plugin, allowing you to check it into your local repository. Does not enable updates or add an svn:externals entry]' \ - '(-q --quiet)'{-q,--quiet}'[Suppresses the output from installation. Ignored if -v is passed (rails plugin -v install ...)]' \ - '(-r --revision)'{-r,--revision=}'[Checks out the given revision from subversion or git. Ignored if subversion/git is not used]:revision' \ - '(-f --force)'{-f,--force}"[Reinstalls a plugin if it's already installed]" \ - '*:plugin:_urls' -} - -_rails_plugin_remove() { - local -a plugins - - plugins=($(_call_program rails_plugins ls -1 vendor/plugins)) - - _describe -t plugins 'plugin' plugins -} - -_rails_plugin_new() { - _rails_new -} - -_rails_runner() { - local context state line curcontext="$curcontext" - - _arguments -C \ - '(- *)'{-h,--help}'[Show this help message]' \ - '(-e --environment)'{-e,--environment=}'[Specifies the environment for the runner to operate under (test/development/production)]:name:(test development production)' \ - ': :->code_or_path' - - case "$state" in - code_or_path) - _alternative \ - 'files:filename:_files -g "*.rb"' \ - 'codes:ruby code:_guard "^-*" "ruby code"' - ;; - esac -} - -_rails_r() { - _rails_runner -} - -_rails_test() { - local context state line curcontext="$curcontext" - - _arguments -C \ - ': :->path' - - case "$state" in - path) - _alternative \ - 'files:filename:_files -g "*.rb"' - ;; - esac -} - -_rails_t() { - _rails_test -} - -_rails "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_ralio b/.zprezto/modules/completion/external/src/_ralio deleted file mode 100644 index cedbb02..0000000 --- a/.zprezto/modules/completion/external/src/_ralio +++ /dev/null @@ -1,146 +0,0 @@ -#compdef ralio -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for ralio (https://github.com/oesmith/ralio), a -# Rally client -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Peter Yates -# -# ------------------------------------------------------------------------------ - -_ralio () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' \ - - case $state in - (command) - - local -a subcommands - subcommands=( - "backlog:Show the product backlog" - "sprint:Show the current team iteration" - "show:Show related information for an individual story, defect or task" - "open:Open a story, defect or task in a web browser" - "start:Set a task, defect or story state to in-progress and assign it to you" - "finish:Set a task, defect or story state to completed and assign it to you" - "abandon:Set a task, defect or story state to defined and clear the owner" - "block:Set a task, defect or story state to blocked" - "unblock:Set a task, defect or story state to unblocked" - "current:Show your current tasks and stories" - "point:Set the points for a story or defect" - "task:Allow you to create and delete story tasks." - "configure:Set your Rally configurations." - ) - _describe -t commands 'ralio commands' subcommands - - _arguments -C \ - {-V,--version}"[display version information]" \ - {-h,--help}"[output usage information]" - ;; - - (options) - case $line[1] in - - - (sprint) - _arguments \ - "-t[Show tasks]" \ - "-p[Project name]" \ - "-f[Filter results]" - ;; - - (start | finish) - _arguments \ - '--pair[Pair programming partner]' \ - "--resolution[Resolution status]" \ - "--rootcause[Root cause]" - ;; - - (task) - __ralio-task - ;; - - esac - ;; - esac -} - -__ralio-task () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - - local -a subcommands - subcommands=( - "create:Create a new task" - "delete:Delete a task" - ) - _describe -t commands 'ralio task' subcommands - ;; - - (options) - case $line[1] in - - (create|delete) - _arguments \ - -n"[Name of the new task]" \ - -t"[Name of the parent task]" - ;; - - esac - ;; - esac -} - -_ralio "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_redis-cli b/.zprezto/modules/completion/external/src/_redis-cli deleted file mode 100644 index d11c06f..0000000 --- a/.zprezto/modules/completion/external/src/_redis-cli +++ /dev/null @@ -1,184 +0,0 @@ -#compdef redis-cli rec -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Redis (http://redis.io). -# -# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/redis-cli -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Alexandru Totolici (https://github.com/totolici) -# -# ------------------------------------------------------------------------------ - - -local -a _1st_arguments -_1st_arguments=( - 'append:append a value to a key' - 'auth:authenticate to the server' - 'bgrewriteeaof:asynchronously rewrite the append-only file' - 'bgsave:asynchornously save the dataset to disk' - 'blpop:remove and get the first element in a list, or block until one is available' - 'brpop:remove and get the last element in a list, or block until one is available' - 'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available' - # 'config get:get the value of a configuration parameter' - # 'config set:set a configuration parameter to the given value' - # 'config resetstat: reset the stats returned by INFO' - 'dbsize:return the number of keys in the selected database' - # 'debug object:get debugging information about a key' - # 'debug setgfault:make the server crash' - 'decr:decrement the integer value of a key by one' - 'decrby:decrement the integer value of a key by the given number' - 'del:delete a key' - 'discard:discard all commands issued after MULTI' - 'echo:echo the given string' - 'exec:execute all commands issued after a MULTI' - 'exists:determine if a key exists' - 'expire:set the time to live for a key, in seconds' - 'expireat:set the expiration for a key as a UNIX timestamp' - 'flushall:remove all keys from all databases' - 'flushdb:remove all keys from the current database' - 'get:get the value of a key' - 'getbit:returns the bit value at offset in the string value stored at key' - 'getrange:get a substring of the string stored at a key' - 'getset:set the string value of a key and return its old value' - 'hdel:delete a hash field' - 'hexists:determine if a hash field exists' - 'hget:get the value of a hash field' - 'hgetall:get all the fields and values in a hash' - 'hincrby:increment the integer value of a hash field by the given number' - 'hkeys:get all the fields in a hash' - 'hlen:get the number of fields in a hash' - 'hmget:get the values of all the given hash fields' - 'hmset:set multiple hash fields to multiple values' - 'hset:set the string value of a hash field' - 'hsetnx:set the value of a hash field, only if the field does not exist' - 'hvals:get all the values in a hash' - 'incr:increment the integer value of a key by one' - 'incrby:increment the integer value of a key by the given number' - 'info:get information and statistics about the server' - 'keys:find all keys matching the given pattern' - 'lastsave:get the UNIX timestamp of the last successful save to disk' - 'lindex:get an element from a list by its index' - 'linsert:insert an element before or after another element in a list' - 'llen:get the length of a list' - 'lpop:remove and get the first element in a list' - 'lpush:prepend a value to a list' - 'lpushx:prepend a value to a list, only if the list exists' - 'lrange:get a range of elements from a list' - 'lrem:remove elements from a list' - 'lset:set the value of an element in a list by its index' - 'ltrim:trim a list to the specified range' - 'mget:get the values of all the given keys' - 'monitor:listen for all requests received by the server in real time' - 'move:move a key to another database' - 'mset:set multiple keys to multiple values' - 'msetnx:set multiple keys to multiple values, only if none of the keys exist' - 'multi:mark the start of a transaction block' - 'object:inspect the internals of Redis objects' - 'persist:remove the expiration from a key' - 'ping:ping the server' - 'psubscribe:listen for messages published to channels matching the given patterns' - 'publish:post a message to a channel' - 'punsubscribe:stop listening for messages posted to channels matching the given patterns' - 'quit:close the connection' - 'randomkey:return a random key from the keyspace' - 'rename:rename a key' - 'renamenx:rename a key, only if the new key does not exist' - 'rpop:remove and get the last element in a list' - 'rpoplpush:remove the last element in a list, append it to another list and return it' - 'rpush:append a value to a list' - 'rpushx:append a value to a list, only if the list exists' - 'sadd:add a member to a set' - 'save:synchronously save the dataset to disk' - 'scard:get the number of members in a set' - 'sdiff:subtract multiple sets' - 'sdiffstore:subtract multiple sets and store the resulting set in a key' - 'select:change the selected database for the current connection' - 'set:set the string value of a key' - 'setbit:sets or clears the bit at offset in the string value stored at key' - 'setex:set the value and expiration of a key' - 'setnx:set the value of a key, only if the key does not exist' - 'setrange:overwrite part of a string at key starting at the specified offset' - 'shutdown:synchronously save the dataset to disk and then shut down the server' - 'sinter:intersect multiple sets' - 'sinterstore:intersect multiple sets and store the resulting set in a key' - 'sismember:determine if a given value is a member of a set' - 'slaveof:make the server a slave of another instance, or promote it as master' - 'smembers:get all the members in a set' - 'smove:move a member from one set to another' - 'sort:sort the elements in a list, set or sorted set' - 'spop:remove and return a random member from a set' - 'srandmember:get a random member from a set' - 'srem:remove a member from a set' - 'strlen:get the length of the value stored in a key' - 'subscribe:listen for messages published to the given channels' - 'sunion:add multiple sets' - 'sunionstore:add multiple sets and store the resulting set in a key' - 'ttl:get the time to live for a key' - 'type:determine the type stored at key' - 'unsubscribe:stop listening for messages posted to the given channels' - 'unwatch:forget about all watched keys' - 'watch:watch the given keys to determine execution of the MULTI/EXEC block' - 'zadd:add a member to a sorted set, or update its score if it already exists' - 'zcard:get the number of members in a sorted set' - 'zcount:count the members in a sorted set with scores within the given values' - 'zincrby:increment the score of a member in a sorted set' - 'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key' - 'zrange:return a range of members in a sorted set, by index' - 'zrangebyscore:return a range of members in a sorted set, by score' - 'zrank:determine the index of a member in a sorted set' - 'zrem:remove a member from a sorted set' - 'zremrangebyrank:remove all members in a sorted set within the given indexes' - 'zremrangebyscore:remove all members in a sorted set within the given scores' - 'zrevrange:return a range of members in a sorted set, by index, with scores ordered from high to low' - 'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low' - 'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low' - 'zscore:get the score associated with the given member in a sorted set' - 'zunionstore:add multiple sorted sets and store the resulting sorted set in a new key' -) - -local expl - -_arguments \ - '(-v --version)'{-v,--version}'[show version]' \ - '(-h --help)'{-h,--help}'[show help]' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands "redis-cli subcommand" _1st_arguments - return -fi - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_rfkill b/.zprezto/modules/completion/external/src/_rfkill deleted file mode 100644 index 1c88133..0000000 --- a/.zprezto/modules/completion/external/src/_rfkill +++ /dev/null @@ -1,102 +0,0 @@ -#compdef rfkill -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Vincent Bernat -# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rfkill (http://wireless.kernel.org/en/users/Documentation/rfkill) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Vincent Bernat -# -# ------------------------------------------------------------------------------ - -_rfkill_types() { - declare -a devicetypes - devicetypes=(all - "wifi:Wireless LAN" "wlan:Wireless LAN" - "bluetooth:Bluetooth" - "uwb:Ultrawide Band" - "ultrawideband:Ultrawide Band" - "wimax:Wimax" - "wwan:3G" - "gps:GPS" - "fm:FM Radio" - "nfc:NFC") - _describe -t device-types "device types" devicetypes -} - -_rfkill_devices() { - declare -a devices - devices=(${(M)${(f)"$(rfkill list)"}:#[0-9]*}) - _rfkill_types - _describe -t devices "devices" devices -} - -_rfkill_commands () { - declare -a subcommands - subcommands=(help event list block unblock) - _describe -t rfkill-commands "rfkill command" subcommands -} - -_rfkill_subcommand () { - case "$words[1]" in - (help|event) - ;; - (list) - _arguments ':types:_rfkill_types' - ;; - (block|unblock) - _arguments ':device:_rfkill_devices' - ;; - (*) - _message 'Unknown subcommand' - esac -} - -_rfkill () { - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - '--version[get version]:' \ - '(-): :->command' \ - '(-)*:: :->arguments' - - case $state in - (command) - _rfkill_commands - ;; - (arguments) - curcontext=${curcontext%:*:*}:rfkill-$words[1]: - _rfkill_subcommand - ;; - esac -} - -_rfkill "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_rkt b/.zprezto/modules/completion/external/src/_rkt deleted file mode 100644 index d4ce021..0000000 --- a/.zprezto/modules/completion/external/src/_rkt +++ /dev/null @@ -1,369 +0,0 @@ -#compdef rkt -# ------------------------------------------------------------------------------ -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rkt (https://coreos.com/rkt/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# -# ------------------------------------------------------------------------------ - -typeset -A opt_args -autoload -U regexp-replace - -_rkt() { - _arguments \ - '--debug[print out more debug information to stderr]' \ - '--dir=[rkt data directory]:data directory:_files -/' \ - '--insecure-options=[comma-separated list of security features to disable]:option:{_values -s , none image tls ondisk http all}' \ - '--local-config=[local configuration directory]:configuration directory:_files -/' \ - '--system-config=[system configuration directory]:configuration directory:_files -/' \ - '--trust-keys-from-https[automatically trust gpg keys fetched from https]' \ - '--user-config=[user configuration directory]:configuration directory:_files -/' \ - '--help' \ - '1: :_rkt_cmds' \ - '*:: :->rkt_cmd_args' - - case $state in - rkt_cmd_args) - case $words[1] in - help) - _arguments \ - '1: :_rkt_cmds' \ - '*:: :->rkt_help_args' \ - ;; - - api-service) - _arguments \ - '--listen=[address to listen for client API requests]:address' \ - ;; - - cat-manifest) - _arguments \ - '--pretty-print[apply indent to format the output]' \ - '--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \ - '1:POD:_rkt_pods' \ - ;; - - config) - _arguments \ - '--pretty-print[apply indent to format the output]' \ - ;; - - enter) - _arguments \ - '--app=:appname' \ - '1:POD:_rkt_pods' \ - ;; - - export) - _arguments \ - '--app=:appname' \ - '--overwrite[overwrite output ACI]' \ - '1:POD:_rkt_pods' \ - '2:OUTPUT_ACI_FILE:_files' \ - ;; - - fetch) - _arguments \ - '--full[print the full image hash after fetching]' \ - '--no-store[fetch images ignoring the local store]' \ - '--signature=[local signature file to use in validating the preceding image]:signature:_files' \ - '--store-only[use only available images in the store]' \ - ;; - - gc) - _arguments \ - '--grace-period=[duration to wait before discarding inactive pods from garbage]:duration' \ - '--expire-prepared=[duration to wait before expiring prepared pods]:duration' \ - '--mark-only[move to the garbage directories without actually deleting]' \ - ;; - - image) - _arguments \ - '1: :_rkt_image_cmds' \ - '*:: :->rkt_image_args' - ;; - - list) - _arguments \ - '--full[use long output format]' \ - '--no-legend[suppress a legend with the list]' \ - ;; - - metadata-service) - _arguments \ - '--listen-port=[listen port]:port' \ - ;; - - prepare) - # TODO: autocomplete stage1 images - _arguments \ - '--caps-remove=[capability to remove]:capability' \ - '--caps-retain=[capability to retain]:capability' \ - '--cpu=[cpu limit for the preceding image]:cpu limit' \ - '--cpu-shares=[assign the specified CPU time share weight]:weight' \ - "--environment=[set the app's environment variables]:variable key=value" \ - '--exec=[override the exec command for the preceding image]:command' \ - '--group=[group override for the preceding image]:group' \ - '--inherit-env[inherit all environment variables not set by apps]' \ - '--memory=[memory limit for the preceding image]:memory' \ - '--mount=[mount point binding a volume to a path within an app]:mount point' \ - '--name=[set the name of the app]:name' \ - '--no-overlay[disable overlay filesystem]' \ - '--oom-score-adj=[oom-score-adj isolator override]:oom-score-adj' \ - '--pod-manifest=[the path to the pod manifest]:manifest:_files' \ - '--port=[ports to expose on the host]:NAME\:HOSTPORT' \ - '--private-users[run within user namespaces]' \ - '--quiet[suppress superfluous output on stdout, print only the UUID on success]' \ - '--readonly-rootfs=[mount rootfs read-only]:fs' \ - '--set-env=[an environment variable to set for apps]:NAME=VALUE' \ - '--set-env-file=[the path to an environment variables file]:file:_files' \ - '--signature=[local signature file to use in validating the preceding image]:signature:_files' \ - '--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \ - '--stage1-hash=[a hash of an image to use as stage1]:image hash' \ - '--stage1-name=[a name of an image to use as stage1]:image name' \ - '--stage1-path=[a path to an image to use as stage1]:image path:_files' \ - '--stage1-url=[a URL to an image to use as stage1]:image url' \ - '--supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \ - '--user=[user override for the preceding image]:user' \ - "--user-annotation=[set the app's annotations]:annotation key=value" \ - "--user-label=[set the app's labels]:label key=value" \ - '--volume=[volumes to make available in the pod]:volume' \ - '--working-dir=[override the working directory of the preceding image]:working directory:_files -/' \ - '1:IMAGE:_rkt_images' \ - ;; - - rm) - _arguments \ - '--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \ - '1:POD:_rkt_pods' \ - ;; - - run) - _arguments \ - '--caps-remove=[capability to remove]:capability' \ - '--caps-retain=[capability to retain]:capability' \ - '--cpu=[cpu limit for the preceding image]:cpu limit' \ - '--cpu-shares=[assign the specified CPU time share weight]:weight' \ - '--dns=[name servers to write in /etc/resolv.conf]:name servers' \ - '--dns-domain=[DNS domain to write in]:domain' \ - '--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \ - '--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \ - "--environment=[set the app's environment variables]:variable key=value" \ - '--exec=[override the exec command for the preceding image]:command' \ - '--group=[group override for the preceding image]:group' \ - "--hostname=[pod's hostname]:hostname" \ - "--hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \ - '--inherit-env[inherit all environment variables not set by apps]' \ - '--interactive[run pod interactively]' \ - '--mds-register[register pod with metadata service]' \ - '--memory=[memory limit for the preceding image]:memory limit' \ - '--mount=[mount point binding a volume to a path within an app]:mount point' \ - '--name=[set the name of the app]:name' \ - "--net=[configure the pod's networking]:networks" \ - '--no-overlay[disable overlay filesystem]' \ - '--pod-manifest=[the path to the pod manifest]:manifest:_files' \ - '--port=[ports to expose on the host]:NAME\:HOSTPORT' \ - '--private-users[run within user namespaces]' \ - '--set-env=[an environment variable to set for apps]:NAME=VALUE' \ - '--set-env-file=[the path to an environment variables file]:file:_files' \ - '--signature=[local signature file to use in validating the preceding image]:signature:_files' \ - '--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \ - '--stage1-hash=[a hash of an image to use as stage1]:image hash' \ - '--stage1-name=[a name of an image to use as stage1]:image name' \ - '--stage1-path=[a path to an image to use as stage1]:image path:_files' \ - '--stage1-url=[a URL to an image to use as stage1]:image url' \ - '--supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \ - '--user=[user override for the preceding image]:user' \ - "--user-annotation=[set the app's annotations]:annotation key=value" \ - "--user-label=[set the app's labels]:label key=value" \ - '--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \ - '--volume=[volumes to make available in the pod]:volume' \ - '--working-dir=[override the working directory of the preceding image]:working directory:_files -/' \ - '1:IMAGE:_rkt_images' \ - ;; - - run-prepared) - _arguments \ - '--dns=[name servers to write in /etc/resolv.conf]:name servers' \ - '--dns-domain=[DNS domain to write in]:domain' \ - '--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \ - '--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \ - "--hostname=[pod's hostname]:hostname" \ - "--hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \ - '--interactive[run pod interactively]' \ - '--mds-register[register pod with metadata service]' \ - "--net=[configure the pod's networking]:networks" \ - '1:POD:_rkt_pods' \ - ;; - - status) - _arguments \ - '--format=[choose the output format]:format:(json json-pretty)' \ - '--wait[toggles waiting for the pod to exit]' \ - '--wait-ready[toggles waiting until the pod is ready]' \ - '1:POD:_rkt_pods' \ - ;; - - stop) - _arguments \ - '--force[forced stopping]' \ - '--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \ - '1:POD:_rkt_pods' \ - ;; - - trust) - _arguments \ - '--insecure-allow-http[allow HTTP use for key discovery and/or retrieval]' \ - '--prefix=[prefix to limit trust to]:prefix' \ - '--root[add root key from filesystem without a prefix]' \ - '--skip-fingerprint-review[accept key without fingerprint confirmation]' \ - ;; - esac - ;; - esac - - case $state in - rkt_help_args) - case $words[1] in - image) - _arguments \ - '1: :_rkt_image_cmds' - ;; - esac - ;; - - rkt_image_args) - case $words[1] in - cat-manifest) - _arguments \ - '--pretty-print[apply indent to format the output]' \ - '1:IMAGE:_rkt_images' \ - ;; - - export) - _arguments \ - '--overwrite[overwrite output ACI]' \ - '1:IMAGE:_rkt_images' \ - '2:OUTPUT_ACI_FILE:_files' \ - ;; - - extract|render) - _arguments \ - '--overwrite[overwrite output ACI]' \ - '--rootfs-only[extract rootfs only]' \ - '1:IMAGE:_rkt_images' \ - '2:OUTPUT_DIR:_files -/' \ - ;; - - gc) - _arguments \ - '--grace-period=[duration to wait before discarding inactive pods from garbage]:duration' \ - ;; - - list) - _arguments \ - '--fields=[comma-separated list of fields to display]:fields:{_values -s , id name importtime lastused size latest}' \ - '--full[use long output format]' \ - '--no-legend[suppress a legend with the list]' \ - ;; - - rm) - _arguments \ - '*:IMAGE:_rkt_images' \ - ;; - esac - ;; - esac -} - -_rkt_cmds() { - local -a commands - commands=( - 'api-service:Run API service' - 'cat-manifest:Inspect and print the pod manifest' - 'config:Print configuration for each stage in JSON format' - 'enter:Enter the namespaces of an app within a rkt pod' - 'export:Export an app from an exited pod to an ACI file' - 'fetch:Fetch image(s) and store them in the local store' - 'gc:Garbage collect rkt pods no longer in use' - 'image:Operate on image(s) in the local store' - 'list:List pods' - 'metadata-service:Run metadata service' - 'prepare:Prepare to run image(s) in a pod in rkt' - 'rm:Remove all files and resources associated with an exited pod' - 'run:Run image(s) in a pod in rkt' - 'run-prepared:Run a prepared application pod in rkt' - 'status:Check the status of a rkt pod' - 'stop:Stop a pod' - 'trust:Trust a key for image verification' - 'version:Print the version and exit' - 'help:Help about any command' - ) - _describe 'command' commands -} - -_rkt_image_cmds() { - local -a commands - commands=( - 'cat-manifest:Inspect and print the image manifest' - 'export:Export a stored image to an ACI file' - 'extract:Extract a stored image to a directory' - 'gc:Garbage collect local store' - 'list:List images in the local store' - 'render:Render a stored image to a directory with all its dependencies' - 'rm:Remove image(s) with the given ID(s) or name(s) from the local store' - ) - _describe 'command' commands -} - -_rkt_images() { - local -a images - images=($(rkt image list --fields id,name --no-legend | sed 's/\t/\n/;s/:/\\:/g' | sort | uniq)) - _describe 'IMAGE' images -} - -_rkt_pods() { - local -a pods - IFS=$'\n' - pods=($(rkt list --full --no-legend | sed 's/:/\\:/g;s/\t/:/;s/\t/ /g')) - _describe 'POD' pods -} - -_rkt "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_rslsync b/.zprezto/modules/completion/external/src/_rslsync deleted file mode 100644 index d1cd5bc..0000000 --- a/.zprezto/modules/completion/external/src/_rslsync +++ /dev/null @@ -1,61 +0,0 @@ -#compdef rslsync -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for resilio sync (https://getsync.com/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Fabian Klötzl (https://github.com/kloetzl) -# -# ------------------------------------------------------------------------------ - -_rslsync(){ - integer ret=1 - local -a args - args+=( - '(-)--help[Print help]' - '(--help)--config[Use a configuration file]:file:_files' - '(--help)--dump-sample-config[Print a sample configuration file]' - '(--help)--generate-secret[Generate a read/write key]::version:(2)' - '(--help)--get-ro-secret[Get the read-only key associated to a read/write key]:key:' - '(--help)--identity[Creates user identity]:name:' - '(--help)--license[Apply owner license]:file:_files' - '(--help)--log[Set log file]:file:_files' - '(--help)--nodaemon[Do not daemonize]' - '(--help)--storage[Storage path for identity and license]:path:_files -/' - '(--help)--webui.listen[Set the webui listening interface]:ip\:port:' - ) - _arguments $args[@] && ret=0 - return ret -} - -_rslsync diff --git a/.zprezto/modules/completion/external/src/_rspec b/.zprezto/modules/completion/external/src/_rspec deleted file mode 100644 index 7bef11c..0000000 --- a/.zprezto/modules/completion/external/src/_rspec +++ /dev/null @@ -1,108 +0,0 @@ -#compdef rspec -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for RSpec (http://rspec.info/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Kazuya Takeshima (https://github.com/mitukiii) -# -# ------------------------------------------------------------------------------ - - -_rspec() { - local context state line curcontext="$curcontext" - - _arguments -C \ - -I'[Specify PATH to add to $LOAD_PATH (may be used more than once)]:PATH:_files' \ - '*'{-r,--require}'[Require a file]:PATH:_files' \ - '*'{-O,--options}'[Specify the path to a custom options file]:PATH:_files' \ - --order'[Run examples by the specified order type]: :->order' \ - --seed'[Equivalent of --order rand:SEED]: :_guard "[[\:digit\:]]#" "SEED"' \ - --bisect'[Repeatedly runs the suite in order to isolate the failures to the smallest reproducible case]' \ - --only-failures'[Filter to just the examples that failed the last time they ran]' \ - '(-n --next-failure)'{-n,--next-failure}'[Apply `--only-failures` and abort after one failure (equivalent to `--only-failures --fail-fast --order defined`)]' \ - --fail-fast'[Abort the run on first failure]' \ - --no-fail-fast'[Do not abort the run on first failure]' \ - --failure-exit-code'[Override the exit code used when there are failing specs]: :_guard "[[\:digit\:]]#" "CODE"' \ - --dry-run'[Print the formatter output of your suite without running any examples or hooks]' \ - '(-X --drb)'{-X,--drb}'[Run examples via DRb]' \ - --drb-port'[Port to connect to the DRb server]: :_guard "[[\:digit\:]]#" "PORT"' \ - '(-f --format)'{-f,--format}'[Choose a formatter]:FORMATTER:(progress documentation html json)' \ - '(-o --out)'{-o,--out}'[Write output to a file instead of $stdout]:FILE:_files' \ - --deprecation-out'[Write deprecation warnings to a file instead of $stderr]:FILE:_files' \ - '(-b --backtrace)'{-b,--backtrace}'[Enable full backtrace]' \ - --force-color'[Force the output to be in color, even if the output is not a TTY]' \ - --no-color'[Force the output to not be in color, even if the output is a TTY]' \ - '(-p --profile)'{-p,--profile}'[Enable profiling of examples and list the slowest examples (default: 10)]: :_guard "[[\:digit\:]]#" "COUNT"' \ - --no-profile'[Disable profiling of examples]' \ - '(-w --warnings)'{-w,--warnings}'[Enable ruby warnings]' \ - '(-P --pattern)'{-P,--pattern}'[Load files matching pattern (default: "spec/**/*_spec.rb")]:PATTERN:' \ - --exclude-pattern'[Load files except those matching pattern]:PATTERN:' \ - '(-e --example)'{-e,--example}'[Run examples whose full nested names include STRING (may be used more than once)]:STRING:' \ - '(-t --tag)'{-t,--tag}'[Run examples with the specified tag, or exclude examples by adding ~ before the tag]: :->tag' \ - --default-path'[Set the default path where RSpec looks for examples (can be a path to a file or a directory)]:PATH:_files' \ - '(- *)'--init'[Initialize your project with RSpec]' \ - '(- *)'{-h,--help}"[You're looking at it]" \ - '(- *)'{-v,--version}'[Display the version]' \ - '*:files or directories:_files' - - case "$state" in - order) - if compset -P '*:'; then - _guard '[[:digit:]]#' 'SEED' - else - _values 'TYPE[:SEED]' \ - defined'[examples and groups are run in the order they are defined]' \ - rand'[randomize the order of groups and examples]' \ - random'[alias for rand]' - fi - ;; - tag) - if compset -P '*:'; then - _message 'VALUE' - else - _message 'TAG[:VALUE]' - fi - ;; - esac -} - -_rspec "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_rsvm b/.zprezto/modules/completion/external/src/_rsvm deleted file mode 100644 index d6de50c..0000000 --- a/.zprezto/modules/completion/external/src/_rsvm +++ /dev/null @@ -1,88 +0,0 @@ -#compdef rsvm -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rsvm (https://github.com/sdepold/rsvm). -# Adapted from Docker Machine completion by hhatto (https://github.com/ilkka) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * michaelmior (https://github.com/michaelmior) -# -# ------------------------------------------------------------------------------ - -# helper function for completing available rusts -__rusts() { - declare -a rusts_cmd - rusts_cmd=($(ls "$HOME/.rsvm/versions")) - _describe 'rusts' rusts_cmd -} - -# subcommands -local -a _rsvm_cmds - -_rsvm_cmds=( - 'help:Show a help message' \ - 'install:Download and install a version' \ - 'uninstall:Uninstall a version' \ - 'use:Activate a version for now and the future' \ - 'ls:List all installed versions of rust' \ - 'ls-remote:List remote versions available for install' \ - 'ls-channel:Print a channel version available for install' \ -) - -# subcommand completion functions -__uninstall() { - __rusts -} - -__use() { - __rusts -} - -# common args -_arguments \ - '--help[show help]' \ - '--version[print the version]' \ - '*:: :->command' - -# start rusts! -if (( CURRENT == 1 )); then - _describe -t commands 'rsvm command' _rsvm_cmds -fi - -local -a _command_args -case "$words[1]" in - uninstall) - __uninstall ;; - use) - __use ;; -esac diff --git a/.zprezto/modules/completion/external/src/_rubocop b/.zprezto/modules/completion/external/src/_rubocop deleted file mode 100644 index 8be7be5..0000000 --- a/.zprezto/modules/completion/external/src/_rubocop +++ /dev/null @@ -1,83 +0,0 @@ -#compdef rubocop -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rubocop (https://github.com/bbatsov/rubocop) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Akira Maeda -# -# ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_rubocop_format_params() { - _values \ - 'FORMATTER' \ - 'progress' \ - 'simple' \ - 'clang' \ - 'disabled' \ - 'fuubar' \ - 'emacs' \ - 'json' \ - 'files' \ - 'offenses' -} - -_arguments -C \ - '(--only)--only[Run only the given cop(s)]' \ - '(-c --config)'{-c,--config}'[Specify configuration file]' \ - '(--auto-gen-config)--auto-gen-config[Generate a configuration file acting as a TODO list]' \ - '(--force-exclusion)--force-exclusion[Force excluding files specified in the configuration `Exclude` even if they are explicitly passed as arguments]' \ - '(-f --format)'{-f,--format}'[Choose an output formatter.]:FORMATTER:_rubocop_format_params' \ - '(-o --out)'{-o,--out}'[Write output to a file instead of STDOUT]' \ - '(-r --require)'{-r,--require}'[Require Ruby file.]' \ - '(--fail-level)--fail-level[Minimum severity for exit with error code.]' \ - '(--show-cops)--show-cops[Shows the given cops, or all cops by default, and their configurations for the current directory.]' \ - '(-F --fail-fast)'{-f,--fail-fast}'[Inspect files in order of modification time ant stop after the first file containing offenses]' \ - '(-d --debug)'{-d,--debug}'[Display debug info]' \ - '(-D --display-cop-names)'{-D,--display-cop-names}'[Display cop names in offense messages.]' \ - '(-R --rails)'{-R,--rails}'[Run extra Rails cops.]' \ - '(-l --lint)'{-l,--lint}'[Run only lint cops.]' \ - '(-a --auto-correct)'{-a,--auto-correct}'[Auto-correct offenses.]' \ - '(-n --no-color)'{-n,--no-color}'[Disable color output.]' \ - '(-v --version)'{-v,--version}'[Disable version.]' \ - '(-V --verbose-version)'{-V,--verbose-version}'[Disable verbose version.]' \ - '(-h --help)'{-h,--help}'[Show help.]' \ - '*: :_files' && ret=0 - -return ret diff --git a/.zprezto/modules/completion/external/src/_rvm b/.zprezto/modules/completion/external/src/_rvm deleted file mode 100644 index 390e0f5..0000000 --- a/.zprezto/modules/completion/external/src/_rvm +++ /dev/null @@ -1,142 +0,0 @@ -#compdef rvm -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2011 Wayne E. Seguin -# Copyright (c) 2011-2015 Michal Papis -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rvm (https://rvm.beginrescueend.com/). -# -# Source: https://github.com/rvm/rvm/blob/master/scripts/extras/completion.zsh/_rvm -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bruno Michel (https://github.com/nono) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '(-l --level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \ - '--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \ - '--source[src directory to use (~/.rvm/src/)]:path:_files' \ - '--archives[directory for downloaded files (~/.rvm/archives/)]:path:_files' \ - '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \ - '-e[Execute code from the command line]:code' \ - '-G[root gem path to use]:path:_files' \ - '--gems[Used to set the gems_flag, use with remove to remove gems]' \ - '--archive[Used to set the archive_flag, use with remove to remove archive]' \ - '--patch[With MRI Rubies you may specify one or more full paths to patches]:paths:->patches' \ - '(-C --configure)'{-C,--configure}'=[custom configure options]' \ - '--nice[process niceness (for slow computers, default 0)]:number' \ - '--ree-options[Options passed directly to ree ./installer on the command line]:options' \ - '--head[with update, updates rvm to git head version]' \ - '--rubygems[with update, updates rubygems for selected ruby]' \ - '--default[with ruby select, sets a default ruby for new shells]' \ - '--debug[Toggle debug mode on for very verbose output]' \ - '--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \ - '--force[Force install, even given ruby is already install]' \ - '--summary[Used with rubydo to print out a summary of the commands run]' \ - '--latest[with gemset --dump skips version strings for latest gem]' \ - '--gems[with uninstall/remove removes gems with the interpreter]' \ - '--docs[with install, attempt to generate ri after installation]' \ - '--reconfigure[Force ./configure on install even if Makefile already exists]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case $state in - - patches) - compset -P '*,' - compset -S ',*' - _files -q -S , - ;; - - cmds) - - cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | __rvm_sed -e '/^== Action/,/^== Implementation/!d; / :: /!d; s/^[ *]*\([^ ]*\) *:: *\(.*\)/\1:\2/')"} ) - cmds+=( $(rvm list strings) ) - _describe -t commands 'rvm command' cmds && ret=0 - ;; - - args) - - case $line[1] in - - (use|uninstall|remove|list) - - if (( CURRENT == 3 )); then - # See if we’ve made it to the ‘@’; eg, 1.9.2@ - if ! __rvm_grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then - _values -S , 'rubies' \ - $(rvm list strings | __rvm_sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \ - default system $(rvm alias list names) && ret=0 - else - # Construct a full version string for each of the gemsets. - # Eg, 1.9.2@min 1.9.2@rail3 … - _values -S , 'gemsets' \ - $(rvm ${line[CURRENT-1]%%@*} gemset list | __rvm_awk '/^[ -_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}') - fi - fi - ;; - - (install|fetch) - - _values -S , 'rubies' $(rvm list known_strings) && ret=0 - ;; - - gemset) - - if (( CURRENT == 3 )); then - _values 'gemset_commands' $(rvm gemset help | __rvm_sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g') - else - #_values -S , 'gemsets' $(rvm gemset list | __rvm_grep -v gemset 2>/dev/null) - _values -S , 'gemsets' $(rvm gemset list | __rvm_grep -Ev '(gemset|info)' 2>/dev/null | __rvm_awk '/^[ -_[:alnum:]]+$/ {print '$1'}') - fi - ret=0 - ;; - - package) - - if (( CURRENT == 3 )); then - _values 'package_commands' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g') - else - _values 'packages' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g') - fi - ret=0 - ;; - - *) - (( ret )) && _message 'no more arguments' - ;; - - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_sbt b/.zprezto/modules/completion/external/src/_sbt deleted file mode 100644 index f2de6e9..0000000 --- a/.zprezto/modules/completion/external/src/_sbt +++ /dev/null @@ -1,93 +0,0 @@ -#compdef sbt -# ------------------------------------------------------------------------------ -# Copyright (c) 2013 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for sbt 0.12+ (http://scala-sbt.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Tony Sloane -# * Mirko Caserta -# -# ------------------------------------------------------------------------------ - -local -a _sbt_commands -_sbt_commands=( - 'clean:delete files produced by the build' - 'compile:compile sources' - 'console:start the Scala REPL with project classes on the classpath' - 'console-quick:start the Scala REPL with project deps on the classpath' - 'console-project:start the Scala REPL w/sbt+build-def on the classpath' - 'dist:generate distribution artifacts' - 'dist\:clean:clean distribution artifacts' - 'doc:generate API documentation' - 'gen-idea:generate Intellij Idea project files' - 'package:produce the main artifact, such as a binary jar' - 'package-doc:produce a doc artifact, such as a jar containing API docs' - 'package-src:produce a source artifact, such as a jar containing sources' - 'publish:publish artifacts to a repository' - 'publish-local:publish artifacts to the local repository' - 'run:run a main class' - 'run-main:run the main class selected by the first argument' - 'test:execute all tests' - 'test-only:execute the tests provided as arguments' - 'test-quick:execute previously failed tests' - 'update:resolve and optionally retrieve dependencies' -) - -local expl - -_arguments \ - '(-help)-h[prints an help message]' \ - '(-h)-help[prints an help message]' \ - '(-verbose)-v[this runner is chattier]' \ - '(-v)-verbose[this runner is chattier]' \ - '(-debug)-d[set sbt log level to debug]' \ - '(-d)-debug[set sbt log level to debug]' \ - '-no-colors[disable ANSI color codes]' \ - '-sbt-create[start even if current dir contains no sbt project]' \ - '-sbt-dir[path to global settings/plugins dir (default: ~/.sbt)]' \ - '-sbt-boot[path to shared boot dir (default: ~/.sbt/boot)]' \ - '-ivy[path to local Ivy repository (default: ~/.ivy2)]' \ - '-mem[set memory options]' \ - '-no-share[use all local caches; no sharing]' \ - '-no-global[use global caches, but do not use global ~/.sbt dir]' \ - '-jvm-debug[turn on JVM debugging, open at the given port]' \ - '-batch[disable interactive mode]' \ - '-sbt-version[use the specified version of sbt]' \ - '-sbt-jar[use the specified jar as the sbt launcher]' \ - '(-sbt-snapshot)-sbt-rc[use an RC version of sbt]' \ - '(-sbt-rc)-sbt-snapshot[use a snapshot version of sbt]' \ - '-java-home[alternate JAVA_HOME]' \ - '*:: :->subcmds' && return 0 - -_describe -t commands "sbt subcommand" _sbt_commands -return 0 diff --git a/.zprezto/modules/completion/external/src/_scala b/.zprezto/modules/completion/external/src/_scala deleted file mode 100644 index c4ccb37..0000000 --- a/.zprezto/modules/completion/external/src/_scala +++ /dev/null @@ -1,249 +0,0 @@ -#compdef scala scalac -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for scala and scalac (http://www.scala-lang.org/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Tony Sloane -# -# ------------------------------------------------------------------------------ - -typeset -A opt_args -local context state line - -_scala_features () { - compadd "postfixOps" "reflectiveCalls" "implicitConversions" "higherKinds" \ - "existentials" "experimental.macros" "_" -} - -_scala_phases () { - compadd "parser" "namer" "packageobjects" "typer" "patmat" "superaccessors" \ - "extmethods" "pickler" "refchecks" "selectiveanf" "selectivecps" "uncurry" \ - "tailcalls" "specialize" "explicitouter" "erasure" "posterasure" "lazyvals" \ - "lambdalift" "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" \ - "inlineExceptionHandlers" "closelim" "dce" "jvm" "terminal" -} - -local -a shared_opts -shared_opts=( - "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/" - "-classpath+[Specify where to find user class files]:directory:_files -/" - "-D-[Pass -Dproperty=value directly to the runtime system]" - "-d+[Destination for generated classfiles]: directory or jar file:_files" - "-dependencyfile+[Set dependency tracking file]:dependency tracking file:_files" - "-deprecation[Emit warning and location for usages of deprecated APIs]" - "-encoding+[Specify character encoding used by source files]:encoding:" - "-explaintypes[Explain type errors in more detail]" - "-extdirs+[Override location of installed extensions]:extensions directory:_files -/" - "-g\:-[Set level of generated debugging info (default\: vars)]:debugging info level:(none source line vars notailcalls)" - "-help[Print a synopsis of standard options]" - "-J-[pass argument directly to Java runtime system]:JVM argument:" - "-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/" - "-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/" - "-language\:-[Enable one or more language features]:feature:_scala_features" - "-no-specialization[Ignore @specialize annotations]" - "-nobootcp[Do not use the boot classpath for the scala jars]" - "-nowarn[Generate no warnings]" - "-optimise[Generate faster bytecode by applying optimisations to the program]" - "-P\:-[Pass an option to a plugin (written plugin\:opt)]:plugin option:" - "-print[Print program with Scala-specific features removed]" - "-sourcepath+[Specify location(s) of source files]:source file directory:_files -/" - "-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)" - "-toolcp+[Add to the runner classpath]:directory:_files -/" - "-unchecked[Enable detailed unchecked (erasure) warnings]" - "-uniqid[Uniquely tag all identifiers in debugging output]" - "-usejavacp[Utilize the java.class.path in classpath resolution]" - "-verbose[Output messages about what the compiler is doing]" - "-version[Print product version and exit]" - "-X[Print a synopsis of advanced options]" - "-Y[Print a synopsis of private options]" -) - -local -a X_opts -X_opts=( - "-Xcheck-null[Warn upon selection of nullable reference]" - "-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]" - "-Xdisable-assertions[Generate no assertions or assumptions]" - "-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]" - "-Xexperimental[Enable experimental extensions]" - "-Xfatal-warnings[Fail the compilation if there are any warnings]" - "-Xfull-lubs[Retains pre 2.10 behavior of less aggressive truncation of least upper bounds]" - "-Xfuture[Turn on future language features]" - "-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files" - "-Xlint[Enable recommended additional warnings]" - "-Xlog-free-terms[Print a message when reification creates a free term]" - "-Xlog-free-types[Print a message when reification resorts to generating a free type]" - "-Xlog-implicits[Show more detail on why some implicits are not applicable]" - "-Xlog-implicit-conversions[Print a message whenever an implicit conversion is inserted]" - "-Xlog-reflective-calls[Print a message when a reflective method call is generated]" - "-Xmacro-settings\:-[Custom settings for macros]:option" - "-Xmain-class+[Class for manifest's Main-Class entry (only useful with -d jar)]:path:" - "-Xmax-classfile-name+[Maximum filename length for generated classes]" - "-Xmigration[Warn about constructs whose behavior may have changed]" - "-Xno-forwarders[Do not generate static forwarders in mirror classes]" - "-Xno-patmat-analysis[Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation]" - "-Xno-uescape[Disable handling of \u unicode escapes]" - "-Xnojline[Do not use JLine for editing]" - "-Xoldpatmat[Use the pre-2.10 pattern matcher. Otherwise, the 'virtualizing' pattern matcher is used in 2.10]" - "-Xprint\:-[Print out program after ]:phase name:_scala_phases" - "-Xprint-icode\:-[Log internal icode to *.icode files after phase (default\: icode)]:phase name:_scala_phases" - "-Xprint-pos[Print tree positions, as offsets]" - "-Xprint-types[Print tree types (debugging option)]" - "-Xprompt[Display a prompt after each error (debugging option)]" - "-Xresident[Compiler stays resident: read source filenames from standard input]" - "-Xscript+[Treat the source file as a script and wrap it in a main method]:main object name" - "-Xshow-class+[Show internal representation of class]:class name" - "-Xshow-object+[Show internal representation of object]:object name" - "-Xshow-phases[Print a synopsis of compiler phases]" - "-Xsource-reader+[Specify a class name for a custom method of reading source files]:class name" - "-Xverify[Verify generic signatures in generated bytecode]" - - "-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/" - "-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files" - "-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files" - "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/" - - "-Xplugin\:-[Load one or more plugins from file]:plugin file:_files" - "-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/" - "-Xplugin-list[Print a synopsis of loaded plugins]" - "-Xplugin-disable\:-[Disable the given plugin(s)]" - "-Xplugin-require\:-[Abort unless the given plugin(s) are available]" -) - -local -a Y_opts -Y_opts=( - "-Y[Print a synopsis of private options]" - "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" - "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:build manager:(none refined simple)" - "-Yclosure-elim[Perform closure elimination]" - "-Ycompact-trees[Use compact tree printer when displaying trees]" - "-Ydead-code[Perform dead code elimination]" - "-Ydependent-method-types[Allow dependent method types]" - "-Ydump-classes+[Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)]:output directory:_files -/" - "-Yeta-expand-keeps-star[Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.]" - "-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/" - "-Yinfer-argument-types[Infer types for arguments of overriden methods]" - "-Yinline[Perform inlining when possible]" - "-Yinline-handlers[Perform exception handler inlining when possible]" - "-Yinline-warnings[Emit inlining warnings (normally surpressed due to high volume)]" - "-Yinvalidate+[Invalidate classpath entry before run]:classpath entry" - "-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)" - "-Ylog-classpath[Output information about what classpath is being applied]" - "-Yno-adapted-args[Do not adapt an argument list (either by inserting unit or creating a tuple) to match the receiver]" - "-Ymacro-debug-lite[Trace essential macro-related activities]" - "-Ymacro-debug-verbose[Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions]" - "-Yno-completion[Disable tab-completion in the REPL]" - "-Yno-generic-signatures[Suppress generation of generic signatures for Java]" - "-Yno-imports[Compile without any implicit imports]" - "-Yno-predef[Compile without importing Predef]" - "-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]" - "-Yno-squeeze[Disable creation of compact code in matching]" - "-Ynotnull[Enable (experimental and incomplete) scala.NotNull]" - "-Yoverride-objects[Allow member objects to be overridden]" - "-Yoverride-vars[Allow vars to be overridden]" - "-Ypmat-naive[Desugar matches as naively as possible]" - "-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]" - "-Ypresentation-log+[Log presentation compiler events into file]:log file:_files" - "-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files" - "-Ypresentation-strict[Do not report type errors in sources with syntax errors]" - "-Ypresentation-verbose[Print information about presentation compiler tasks]" - "-Yprofile-class+[Specify name of profiler class]:profiler class name" - "-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]" - "-Yrangepos[Use range positions for syntax trees]" - "-Yrecursion+[Set recursion depth used when locking symbols]" - "-Yreify-copypaste[Dump the reified trees in copypasteable representation]" - "-Yrepl-sync[Do not use asynchronous code for REPL startup]" - "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)" - "-Yself-in-annots[Include a \"self\" identifier inside of annotations]" - "-Yshow\:-[Show after (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases" - "-Yshow-syms[Print the AST symbol hierarchy after each phase]" - "-Yshow-symkinds[Print abbreviated symbol kinds next to symbol names]" - "-Yshow-trees[Print detailed ASTs (requires -Xprint\:phase)]" - "-Yshow-trees-compact[Print detailed ASTs in compact form (requires -Xprint\:)]" - "-Yshow-trees-stringified[Print stringifications along with detailed ASTs (requires -Xprint\:)]" - "-Ystatistics[Print compiler statistics]" - "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)" - - "-Ybrowse\:-[Browse the abstract syntax tree after ]:phase name:_scala_phases" - "-Ycheck\:-[Check the tree at the end of ]:phase name:_scala_phases" - "-Ylog\:-[Log operations during ]:phase name:_scala_phases" - "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases" - "-Yskip\:-[Skip ]:phase name:_scala_phases" - "-Ystop-after\:-[Stop after given phase ]:phase name:_scala_phases" - "-Ystop-before\:-[Stop before given phase ]:phase name:_scala_phases" - - "-Ywarn-adapted-args[Warn if an argument list is modified to match the receiver]" - "-Ywarn-all[Enable all -Y warnings]" - "-Ywarn-dead-code[Warn when dead code is identified]" - "-Ywarn-inaccessible[Warn about inaccessible types in method signatures]" - "-Ywarn-nullary-override[Warn when non-nullary overrides nullary, e.g. def foo() over def foo]" - "-Ywarn-nullary-unit[Warn when nullary methods return Unit]" - "-Ywarn-numeric-widen[Warn when numerics are widened]" - "-Ywarn-value-discard[Warn when non-Unit expression results are unused]" - - "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" - "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:manager:(none refined simple)" - "-Ycompletion-debug[Trace all tab completion activity]" - "-Ydebug[Increase the quantity of debugging output]" - "-Ydoc-debug[Trace all scaladoc activity]" - "-Yide-debug[Generate, validate and output trees using the interactive compiler]" - "-Yinfer-debug[Trace type inference and implicit search]" - "-Yissue-debug[Print stack traces when a context issues an error]" - "-Ypatmat-debug[Trace pattern matching translation]" - "-Ypmat-debug[Trace all pattern matcher activity]" - "-Ypos-debug[Trace position validation]" - "-Ypresentation-debug[Enable debugging output for the presentation compiler]" - "-Yreify-debug[Trace reification]" - "-Yrepl-debug[Trace all REPL activity]" - "-Ytyper-debug[Trace all type assignments]" -) - -local -a scala_opts -scala_opts=( - "-e+[execute as if entered in the repl]:string" \ - "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \ - "-i+[preload before starting the repl]:file to preload:_files" \ - "-nc[no compilation daemon\: do not use the fsc offline compiler]" \ - "-save[save the compiled script in a jar for future use]" -) - -case $words[$CURRENT] in - -X*) _arguments $X_opts;; - -Y*) _arguments $Y_opts;; - *) case $service in - scala) _arguments $scala_opts $shared_opts "*::filename:_files";; - scalac) _arguments $shared_opts "*::filename:_files";; - esac -esac - -return 0 diff --git a/.zprezto/modules/completion/external/src/_scons b/.zprezto/modules/completion/external/src/_scons deleted file mode 100644 index f9b6b8c..0000000 --- a/.zprezto/modules/completion/external/src/_scons +++ /dev/null @@ -1,72 +0,0 @@ -#compdef scons -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for SCons 2.5.1 (http://scons.org/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Oliver Kiddle -# -# ------------------------------------------------------------------------------ - -_arguments -s -S \ - '(-c --clean --remove)-'{c,-clean,-remove}'[remove specified targets and dependencies]' \ - '(-C --directory)-'{C,-directory=}'[change to specified directory first]:directory:_directories' \ - '--cache-debug=[print CacheDir debug info to file]:file:_files' \ - '(--cache-disable --no-cache)--'{cache-disable,no-cache}"[don't retrieve built targets from cache]" \ - '(--cache-force --cache-populate)--'{cache-force,cache-populate}'[copy already-built targets into cache]' \ - "--cache-readonly[don't update CacheDir with built targets]" \ - '--cache-show[print build actions for files from cache]' \ - '--config=[set Configure mode]:mode:(auto force cache)' \ - '(-u --up --search-up -U)-D[search up for SConstruct; build default targets]' \ - '--debug=[print debugging information]:type:( - count duplicate explain findlibs includes memoizer memory objects pdb prepare presub stacktrace time)' \ - '--diskcheck=[enable specific on-disk checks]:check:(all none match rcs sccs)' \ - '--duplicate=[set preferred file duplication methods]:file duplication methods:( - hard-soft-copy soft-hard-copy hard-copy soft-copy copy)' \ - '(-f --file --makefile --sconstruct)-'{f,-file=,-makefile=,-sconstruct=}'[specify SConstruct file]:file:_files' \ - '(-)-'{h,-help}'[display defined usage information]' \ - '(-)-'{H,-help-options}'[display usage information]' \ - '(-i -ignore-errors)-'{i,-ignore-errors}'[ignore errors from build actions]' \ - \*{-I,--include-dir=}'[add directory to search Python modules]:directories:_directories' \ - '(--implicit-deps-changed --implicit-deps-unchanged)--implicit-cache[cache scanned dependencies]' \ - '(--implicit-cache --implicit-deps-changed)--implicit-deps-changed[rescan dependencies]' \ - '(--implicit-cache --implicit-deps-unchanged)--implicit-deps-unchanged[ignore changes to scanned dependencies]' \ - '--interactive[start interactive mode]' \ - '(-j --jobs)-'{j,jobs=}'[specify no of jobs to run in parallel]' \ - '(-k --keep-going)-'{k,-keep-going}'[continue after an error]' \ - '--max-drift=[set the maximum clock drift]:drift (seconds)' \ - '--md5-chunksize=[set chunksize for MD5 signature computation]:size (kB)' \ - '(-n --just-print --dry-run --recon)-'{n,-just-print,-dry-run,-recon}"[print commands but don't run them]" \ - "--no-site-dir[don't use the usual site_scons directory]" \ - '--profile=[profile scons]:output file:_files' \ - '(-q --question)-'{q,question}'[query whether up-to-date]' \ - '-Q[suppress progress messages]' \ - '--random[build dependencies in random order]' \ - '(-s --silent --quiet)-'{s,-silent,-quiet}"[don't print commands]" \ - '--site-dir=[specify site_scons directory]:directory:_directories' \ - '--stack-size[set stacksize of threads]:size (kB)' \ - '--taskmastertrace=[trace node evaluation to file]:file' \ - '--tree=[print dependency tree]:format:(all derived prune status)' \ - '(-u --up --search-up -D -U)-'{u,-up,-search-up}'[search up for SConstruct; build current directory]' \ - '(-u --up --search-up -D)-U[search up for SConstruct; build Default targets]' \ - '(-)-'{v,-version}'[print version information]' \ - \*{--warn=,--warning=}'[enable or disable warnings]:type:( - all cache-write-error corrupt-sconsign dependency deprecated - deprecated-copy deprecated-source-signatures deprecated-target-signatures - duplicate-environment fortran-cxx-mix link misleading-keywords - missing-sconscript no-md5-module no-metaclass-support no-object-count - no-parallel-support python-version reserved-variable stack-size no-all - no-cache-write-error no-corrupt-sconsign no-dependency no-deprecated - no-deprecated-copy no-deprecated-source-signatures - no-deprecated-target-signatures no-duplicate-environment - no-fortran-cxx-mix no-link no-misleading-keywords no-missing-sconscript - no-no-md5-module no-no-metaclass-support no-no-object-count - no-no-parallel-support no-python-version no-reserved-variable - no-stack-size)' \ - \*{-Y,--repository}'[search specified repository for files]:repository:_files' \ - '*:target:_default' # Doesn't seem to be a simple way to get a list of targets diff --git a/.zprezto/modules/completion/external/src/_scrub b/.zprezto/modules/completion/external/src/_scrub deleted file mode 100644 index 2c473e3..0000000 --- a/.zprezto/modules/completion/external/src/_scrub +++ /dev/null @@ -1,66 +0,0 @@ -#compdef scrub -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for scrub an utility which iteratively writes patterns on files or disk devices to make retrieving the data more difficult. (http://linux.die.net/man/1/scrub). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_scrub() { - -local patterns -patterns="nnsa dod bsi gutmann schneier pfitzner7 pfitzner33 usarmy fillzero fillff random random2 old fastold" - -_arguments -C \ - "(- 1 *)"{-v,--version}"[Print scrub version and exit.]" \ - {-r,--remove}"[Remove the file after scrubbing.]" \ - {-p,--pattern}"[Select the patterns to write.]:pattern:($patterns)" \ - {-b,--blocksize}"[Perform read and write calls using the specified blocksize (in bytes).]:block size:" \ - {-f,--force}"[Scrub even if target contains signature indicating it has already been scrubbed.]" \ - {-S,--no-signature}"[Do not write scrub signature.]" \ - {-X,--freespace}"[Create specified directory and fill it with files until write returns ENOSPC (file sys‐tem full), then scrub the files as usual.]:directory name:" \ - {-D,--dirent}"[After scrubbing the file, scrub its name in the directory entry, then rename it to the new name.]:new name:" \ - {-s,--device-size}"[Override the device size (in bytes).]:size:" \ - {-L,--no-link}"[If file is a symbolic link, do not scrub the link target.]" \ - {-R,--no-hwrand}"[Don't use a hardware random number generator even if one is available.]" \ - {-t,--no-threads}"[Don't generate random data in parallel with I/O.]" \ - {-n,--dry-run}"[Do everything but write to targets.]" \ - {-h,--help}"[Print a summary of command line options on stderr.]" \ - '*:files:_files' \ -} - -_scrub - diff --git a/.zprezto/modules/completion/external/src/_sdd b/.zprezto/modules/completion/external/src/_sdd deleted file mode 100644 index c722095..0000000 --- a/.zprezto/modules/completion/external/src/_sdd +++ /dev/null @@ -1,66 +0,0 @@ -#compdef sdd -# ------------------------------------------------------------------------------ -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for sdd (http://freshmeat.net/projects/sdd/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# -# ------------------------------------------------------------------------------ - -_values -w 'option' \ - 'if[specify input file]:input file:_tilde_files' \ - 'of[specify output file]:output file:_tilde_files' \ - '(bs)ibs[input block size]:block size (bytes)' \ - '(bs)obs[output block size]:block size (bytes)' \ - '(ibs obs)bs[block size]:block size (bytes)' \ - 'cbs[conversion buffer size]:buffer size (bytes)' \ - 'skip[input/output initially skipped]:bytes' \ - 'seek[input/output initially skipped]:bytes' \ - 'count[number of input blocks to copy]:blocks' \ - '-notrunc[do not truncate existing output file]' \ - '-pg[print a dot on each write to indicate progress]' \ - '-noerror[do not stop on error]' \ - '-noerrwrite[do not write blocks not read correctly]' \ - "-noseek[don't seek]" \ - 'try[error retry count]:number' \ - '-debug[print debugging messages]' \ - '-fill[fill each record with zeros up to obs]' \ - '-swab' '-block' '-unblock' '-lcase' '-ucase' '-ascii' '-ebcdic' '-ibm' \ - '-help[show help]' \ - '-version[show version]' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_setcap b/.zprezto/modules/completion/external/src/_setcap deleted file mode 100644 index 6f34a0e..0000000 --- a/.zprezto/modules/completion/external/src/_setcap +++ /dev/null @@ -1,108 +0,0 @@ -#compdef setcap -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# -# ------------------------------------------------------------------------------ -# Description -# ------------------------------------------------------------------------------ -# Completion script for libcap's setcap: -# - https://people.redhat.com/sgrubb/libcap-ng/ -# -# ZSH provides the `zsh/cap` module that does not work on most modern systems, -# in lieu of this I have written this zsh-completion modules. -# -# Written by -# - Zephyr Pellerin (https://github.com/zv) -# ------------------------------------------------------------------------------ - -local curcontext=$curcontext state line expl ret=1 -local -a args privs operators - -args=( '*:file:->files' - '1:capability:->capability' - '-v[verify]' '-q[quiet]' ) - -_arguments -C -s "$args[@]" && ret=0 - -operators=("e:effective" "i:inheritable" "p:permitted") - -case "$state" in - capability) - if compset -P '*?[=+-]'; then - _describe -t operators "operator" operators && ret=0 - else - _values -s , capability \ - 'cap_audit_control[Enable and disable kernel auditing]' \ - 'cap_audit_read[Allow reading the audit log]' \ - 'cap_audit_write[Write records to kernel auditing log.]' \ - 'cap_block_suspend[Employ features that can block system suspend]' \ - 'cap_chown[Make arbitrary changes to file UIDs and GIDs]' \ - 'cap_dac_override[Bypass file read, write, and execute permission checks.]' \ - 'cap_dac_read_search[Bypass file read permission checks]' \ - 'cap_fowner[Bypass filesystem UID checks, set extended attrs.]' \ - "cap_fsetid[Don't clear set-user-ID and set-group-ID permission bits when a file is modified]" \ - 'cap_ipc_lock[Lock memory]' \ - 'cap_ipc_owner[Bypass checks on SySV IPC object operations.]' \ - 'cap_kill[Bypass permission checks for sending signals]' \ - 'cap_lease[Establish leases on arbitrary files]' \ - 'cap_linux_immutable[Set immutability or append only]' \ - 'cap_mac_admin[Override Mandatory Access Control]' \ - 'cap_mac_override[Allow MAC configuration or state changes.]' \ - 'cap_mknod[Create special files using mknod(2)]' \ - 'cap_net_admin[Perform various network-related operations]' \ - 'cap_net_bind_service[Bind a socket to a privileged ports.]' \ - 'cap_net_broadcast[Make socket broadcasts and listen to multicast.]' \ - 'cap_net_raw[Use raw sockets.]' \ - 'cap_setgid[Manipulate process GIDs.]' \ - 'cap_setfcap[Set file capabilities.]' \ - "cap_setpcap[Grant or remove any capability in the caller's permitted capability set to or from any other process.]" \ - 'cap_setuid[Manipulate or forge process UIDs]' \ - 'cap_sys_admin[Perform numerous administrative tasks.]' \ - 'cap_sys_boot[Reboot]' \ - 'cap_sys_chroot[Use chroot]' \ - 'cap_sys_module[Load kernel module.]' \ - 'cap_sys_nice[Nice or renice processes.]' \ - 'cap_sys_pacct[Use acct(2).]' \ - 'cap_sys_ptrace[Inspect processes with ptrace or use process_vm_writev.]' \ - 'cap_sys_rawio[Numerous device IO functions, including performing raw IO and access x86 MSRs]' \ - 'cap_sys_resource[Set numerous resource limits]' \ - 'cap_sys_time[Set system clock]' \ - 'cap_sys_tty_config[Use vhangup(2)]' \ - 'cap_syslog[Perform privileged syslog(2) operations.]' \ - 'cap_wake_alarm[Trigger something that will wake up the system]' && ret=0 - fi ;; - files) _files && ret=0 ;; -esac - -return ret - -# Local variables: -# mode: shell-script -# sh-basic-offset: 2 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: sw=2 ts=2 et filetype=sh diff --git a/.zprezto/modules/completion/external/src/_setup.py b/.zprezto/modules/completion/external/src/_setup.py deleted file mode 100644 index c7d88d3..0000000 --- a/.zprezto/modules/completion/external/src/_setup.py +++ /dev/null @@ -1,715 +0,0 @@ -#compdef setup.py -# ------------------------------------------------------------------------------ -# Copyright (C) 2015 by Hideo Hattori -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for setup.py (http://docs.python.org/distutils/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Hideo Hattori (https://github.com/hhatto) -# -# ------------------------------------------------------------------------------ - -_setup.py() { - typeset -A opt_args - local context state line - - _arguments -s -S \ - "--verbose[run verbosely (default)]" \ - "-v[run verbosely (default)]" \ - "--quiet[run quietly (turns verbosity off)]" \ - "-q[run quietly (turns verbosity off)]" \ - "--dry-run[don't actually do anything]" \ - "-n[don't actually do anything]" \ - "--help[show detailed help message]" \ - "-h[show detailed help message]" \ - "--no-user-cfg[ignore pydistutils.cfg in your home directory]" \ - "--command-packages=[list of packages that provide distutils commands]" \ - "--help-commands[list all available commands]" \ - "--name[print package name]" \ - "--version[print package version]" \ - "-V[print package version]" \ - "--fullname[print -]" \ - "--author[print the author's name]" \ - "--author-email[print the author's email address]" \ - "--maintainer[print the maintainer's name]" \ - "--maintainer-email[print the maintainer's email address]" \ - "--contact[print the maintainer's name if known, else the author's]" \ - "--contact-email[print the maintainer's email address if known, else the author's]" \ - "--url[print the URL for this package]" \ - "--license[print the license of the package]" \ - "--licence[alias for --license]" \ - "--description[print the package description]" \ - "--long-description[print the long package description]" \ - "--platforms[print the list of platforms]" \ - "--classifiers[print the list of classifiers]" \ - "--keywords[print the list of keywords]" \ - "--provides[print the list of packages/modules provided]" \ - "--requires[print the list of packages/modules required]" \ - "--obsoletes[print the list of packages/modules made obsolete]" \ - "*::setup.py commands:_setuppy_command" -} - -(( $+functions[_setuppy_command] )) || -_setuppy_command() { - local cmd ret=1 - - (( $+setuppy_cmds )) || _setuppy_cmds=( - "build:build everything needed to install" \ - "build_py:\"build\" pure Python modules (copy to build directory)" \ - "build_ext:build C/C++ extensions (compile/link to build directory)" \ - "build_clib:build C/C++ libraries used by Python extensions" \ - "build_scripts:\"build\" scripts (copy and fixup #! line)" \ - "clean:clean up temporary files from 'build' command" \ - "install:install everything from build directory" \ - "install_lib:install all Python modules (extensions and pure Python)" \ - "install_headers:install C/C++ header files" \ - "install_scripts:install scripts (Python or otherwise)" \ - "install_data:install data files" \ - "sdist:create a source distribution (tarball, zip file, etc.)" \ - "register:register the distribution with the Python package index" \ - "bdist:create a built (binary) distribution" \ - "bdist_dumb:create a \"dumb\" built distribution" \ - "bdist_rpm:create an RPM distribution" \ - "bdist_wininst:create an executable installer for MS Windows" \ - "upload:upload binary package to PyPI" \ - "check:perform some checks on the package" \ - "alias:define a shortcut to invoke one or more commands" \ - "bdist_egg:create an \"egg\" distribution" \ - "develop:install package in 'development mode'" \ - "easy_install:Find/get/install Python packages" \ - "egg_info:create a distribution's .egg-info directory" \ - "rotate:delete older distributions, keeping N newest files" \ - "saveopts:save supplied options to setup.cfg or other config file" \ - "setopt:set an option in setup.cfg or another config file" \ - "test:run unit tests after in-place build" \ - "install_egg_info:Install an .egg-info directory for the package" \ - "upload_docs:Upload documentation to PyPI" \ - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'setup.py subcommand' _setuppy_cmds || compadd "$@" - ${(s.:.)${(j.:.)_setuppy_syns}} - else - local curcontext="$curcontext" - - cmd="${${_setuppy_cmds[(r)$words[1]:*]%%:*}:-${(k)_setuppy_syns[(r)(*:|)$words[1](:*|)]}}" - if (( $#cmd )); then - curcontext="${curcontext%:*:*}:setuppy-${cmd}:" - _call_function ret _setuppy_$cmd || _message 'no more arguments' - else - _message "unknown setup.py command: $words[1]" - fi - return ret - fi -} - -(( $+functions[_setuppy_build] )) || -_setuppy_build() { - _arguments -s \ - "--build-base=[base directory for build library]" \ - "-b[base directory for build library]" \ - "--build-purelib=[build directory for platform-neutral distributions]" \ - "--build-platlib=[build directory for platform-specific distributions]" \ - "--build-lib=[build directory for all distribution (defaults to either build-purelib or build-platlib]" \ - "--build-scripts=[build directory for scripts]" \ - "--build-temp=[temporary build directory]" \ - "-t[temporary build directory]" \ - "--plat-name=[platform name to build for, if supported (default: linux-i686)]" \ - "-p[platform name to build for, if supported (default: linux-i686)]" \ - "--compiler=[specify the compiler type]" \ - "-c[specify the compiler type]" \ - "--debug[compile extensions and libraries with debugging information]" \ - "-g[compile extensions and libraries with debugging information]" \ - "--force[forcibly build everything (ignore file timestamps)]" \ - "-f[forcibly build everything (ignore file timestamps)]" \ - "--executable=[specify final destination interpreter path (build.py)]" \ - "-e[specify final destination interpreter path (build.py)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_build_py] )) || -_setuppy_build_py() { - _arguments -s \ - "--build-lib=[directory to \"build\" (copy) to]" \ - "-d[directory to \"build\" (copy) to]" \ - "--compile[compile .py to .pyc]" \ - "-c[compile .py to .pyc]" \ - "--no-compile[don't compile .py files \[default\]]" \ - "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "--force[forcibly build everything (ignore file timestamps)]" \ - "-f[forcibly build everything (ignore file timestamps)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_build_ext] )) || -_setuppy_build_ext() { - _arguments -s \ - "--build-lib=[directory for compiled extension modules]" \ - "-b[directory for compiled extension modules]" \ - "--build-temp=[directory for temporary files (build by-products)]" \ - "-t[directory for temporary files (build by-products)]" \ - "--plat-name=[platform name to cross-compile for, if supported (default: linux-i686)]" \ - "-p[platform name to cross-compile for, if supported (default: linux-i686)]" \ - "--inplace[ignore build-lib and put compiled extensions into the source directory alongside your pure Python modules]" \ - "-i[ignore build-lib and put compiled extensions into the source directory alongside your pure Python modules]" \ - "--include-dirs=[list of directories to search for header files (separated by ':')]" \ - "-I[list of directories to search for header files (separated by ':')]" \ - "--define=[C preprocessor macros to define]" \ - "-D[C preprocessor macros to define]" \ - "--undef=[C preprocessor macros to undefine]" \ - "-U[C preprocessor macros to undefine]" \ - "--libraries=[external C libraries to link with]" \ - "-l[external C libraries to link with]" \ - "--library-dirs=[directories to search for external C libraries (separated by ':')]" \ - "-L[directories to search for external C libraries (separated by ':')]" \ - "--rpath=[directories to search for shared C libraries at runtime]" \ - "-R[directories to search for shared C libraries at runtime]" \ - "--link-objects=[extra explicit link objects to include in the link]" \ - "-O[extra explicit link objects to include in the link]" \ - "--debug[compile/link with debugging information]" \ - "-g[compile/link with debugging information]" \ - "--force[forcibly build everything (ignore file timestamps)]" \ - "-f[forcibly build everything (ignore file timestamps)]" \ - "--compiler=[specify the compiler type]" \ - "-c[specify the compiler type]" \ - "--swig-cpp[make SWIG create C++ files (default is C)]" \ - "--swig-opts=[list of SWIG command line options]" \ - "--swig=[path to the SWIG executable]" \ - "--user[add user include, library and rpath]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_build_clib] )) || -_setuppy_build_clib() { - _arguments -s \ - "--build-clib=[directory to build C/C++ libraries to]" \ - "-b[directory to build C/C++ libraries to]" \ - "--build-temp=[directory to put temporary build by-products]" \ - "-t[directory to put temporary build by-products]" \ - "--debug[compile with debugging information]" \ - "-g[compile with debugging information]" \ - "--force[forcibly build everything (ignore file timestamps)]" \ - "-f[forcibly build everything (ignore file timestamps)]" \ - "--compiler=[specify the compiler type]" \ - "-c[specify the compiler type]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_build_scripts] )) || -_setuppy_build_scripts() { - _arguments -s \ - "--build-dir=[directory to \"build\" (copy) to]" \ - "-d[directory to \"build\" (copy) to]" \ - "--force[forcibly build everything (ignore file timestamps]" \ - "-f[forcibly build everything (ignore file timestamps]" \ - "--executable=[specify final destination interpreter path]" \ - "-e[specify final destination interpreter path]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_clean] )) || -_setuppy_clean() { - _arguments -s \ - "--build-base=[base build directory (default: 'build.build-base')]" \ - "-b[base build directory (default: 'build.build-base')]" \ - "--build-lib=[build directory for all modules (default: 'build.build-lib')]" \ - "--build-temp=[temporary build directory (default: 'build.build-temp')]" \ - "-t[temporary build directory (default: 'build.build-temp')]" \ - "--build-scripts=[build directory for scripts (default: 'build.build-scripts')]" \ - "--bdist-base=[temporary directory for built distributions]" \ - "--all[remove all build output, not just temporary by-products]" \ - "-a[remove all build output, not just temporary by-products]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install] )) || -_setuppy_install() { - _arguments -s \ - "--prefix=[installation prefix]" \ - "--exec-prefix=[(Unix only) prefix for platform-specific files]" \ - "--home=[(Unix only) home directory to install under]" \ - "--user[install in user site-package]" \ - "--install-base=[base installation directory (instead of --prefix or --home)]" \ - "--install-platbase=[base installation directory for platform-specific files (instead of --exec-prefix or --home)]" \ - "--root=[install everything relative to this alternate root directory]" \ - "--install-purelib=[installation directory for pure Python module distributions]" \ - "--install-platlib=[installation directory for non-pure module distributions]" \ - "--install-lib=[installation directory for all module distributions (overrides --install-purelib and --install-platlib)]" \ - "--install-headers=[installation directory for C/C++ headers]" \ - "--install-scripts=[installation directory for Python scripts]" \ - "--install-data=[installation directory for data files]" \ - "--compile[compile .py to .pyc \[default\]]" \ - "-c[compile .py to .pyc \[default\]]" \ - "--no-compile[don't compile .py files]" \ - "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "--force[force installation (overwrite any existing files)]" \ - "-f[force installation (overwrite any existing files)]" \ - "--skip-build[skip rebuilding everything (for testing/debugging)]" \ - "--record=[filename in which to record list of installed files]" \ - "--old-and-unmanageable[Try not to use this!]" \ - "--single-version-externally-managed[used by system package builders to create 'flat' eggs]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install_lib] )) || -_setuppy_install_lib() { - _arguments -s \ - "--install-dir=[directory to install to]" \ - "-d[directory to install to]" \ - "--build-dir=[build directory (where to install from)]" \ - "-b[build directory (where to install from)]" \ - "--force[force installation (overwrite existing files)]" \ - "-f[force installation (overwrite existing files)]" \ - "--compile[compile .py to .pyc \[default\]]" \ - "-c[compile .py to .pyc \[default\]]" \ - "--no-compile[don't compile .py files]" \ - "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "--skip-build[skip the build steps]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install_headers] )) || -_setuppy_install_headers() { - _arguments -s \ - "--install-dir=[directory to install header files to]" \ - "-d[directory to install header files to]" \ - "--force[force installation (overwrite existing files)]" \ - "-f[force installation (overwrite existing files)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install_scripts] )) || -_setuppy_install_scripts() { - _arguments -s \ - "--install-dir=[directory to install scripts to]" \ - "-d[directory to install scripts to]" \ - "--build-dir=[build directory (where to install from)]" \ - "-b[build directory (where to install from)]" \ - "--force[force installation (overwrite existing files)]" \ - "-f[force installation (overwrite existing files)]" \ - "--skip-build[skip the build steps]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install_data] )) || -_setuppy_install_data() { - _arguments -s \ - "--install-dir=[base directory for installing data files (default: installation base dir)]" \ - "-d[base directory for installing data files (default: installation base dir)]" \ - "--root=[install everything relative to this alternate root directory]" \ - "--force[force installation (overwrite existing files)]" \ - "-f[force installation (overwrite existing files)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_sdist] )) || -_setuppy_sdist() { - _arguments -s \ - "--formats=[formats for source distribution (comma-separated list)]" \ - "--keep-temp[keep the distribution tree around after creating archive file(s)]" \ - "-k[keep the distribution tree around after creating archive file(s)]" \ - "--dist-dir=[directory to put the source distribution archive(s) in \[default: dist\]]" \ - "-d[directory to put the source distribution archive(s) in \[default: dist\]]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_register] )) || -_setuppy_register() { - _arguments -s \ - "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "--show-response[display full response text from server]" \ - "--list-classifiers[list the valid Trove classifiers]" \ - "--strict[Will stop the registering if the meta-data are not fully compliant]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_bdist] )) || -_setuppy_bdist() { - _arguments -s \ - "--bdist-base=[temporary directory for creating built distributions]" \ - "-b[temporary directory for creating built distributions]" \ - "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \ - "-p[platform name to embed in generated filenames (default: linux-i686)]" \ - "--formats=[formats for distribution (comma-separated list)]" \ - "--dist-dir=[directory to put final built distributions in \[default: dist\]]" \ - "-d[directory to put final built distributions in \[default: dist\]]" \ - "--skip-build[skip rebuilding everything (for testing/debugging)]" \ - "--owner=[Owner name used when creating a tar file \[default: current user\]]" \ - "-u[Owner name used when creating a tar file \[default: current user\]]" \ - "--group=[Group name used when creating a tar file \[default: current group\]]" \ - "-g[Group name used when creating a tar file \[default: current group\]]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_bdist_dumb] )) || -_setuppy_bdist_dumb() { - _arguments -s \ - "--bdist-dir=[temporary directory for creating the distribution]" \ - "-d[temporary directory for creating the distribution]" \ - "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \ - "-p[platform name to embed in generated filenames (default: linux-i686)]" \ - "--format=[archive format to create (tar, ztar, gztar, zip)]" \ - "-f[archive format to create (tar, ztar, gztar, zip)]" \ - "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \ - "-k[keep the pseudo-installation tree around after creating the distribution archive]" \ - "--dist-dir=[directory to put final built distributions in]" \ - "-d[directory to put final built distributions in]" \ - "--skip-build[skip rebuilding everything (for testing/debugging)]" \ - "--relative[build the archive using relative paths(default: false)]" \ - "--owner=[Owner name used when creating a tar file \[default: current user\]]" \ - "-u[Owner name used when creating a tar file \[default: current user\]]" \ - "--group=[Group name used when creating a tar file \[default: current group\]]" \ - "-g[Group name used when creating a tar file \[default: current group\]]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_bdist_rpm] )) || -_setuppy_bdist_rpm() { - _arguments -s \ - "--bdist-base=[base directory for creating built distributions]" \ - "--rpm-base=[base directory for creating RPMs (defaults to \"rpm\" under --bdist-base; must be specified for RPM 2)]" \ - "--dist-dir=[directory to put final RPM files in (and .spec files if --spec-only)]" \ - "-d[directory to put final RPM files in (and .spec files if --spec-only)]" \ - "--python=[path to Python interpreter to hard-code in the .spec file (default: \"python\")]" \ - "--fix-python[hard-code the exact path to the current Python interpreter in the .spec file]" \ - "--spec-only[only regenerate spec file]" \ - "--source-only[only generate source RPM]" \ - "--binary-only[only generate binary RPM]" \ - "--use-bzip2[use bzip2 instead of gzip to create source distribution]" \ - "--distribution-name=[name of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!)]" \ - "--group=[package classification \[default: \"Development/Libraries\"\]]" \ - "--release=[RPM release number]" \ - "--serial=[RPM serial number]" \ - "--vendor=[RPM \"vendor\" (eg. \"Joe Blow \") \[default: maintainer or author from setup script\]]" \ - "--packager=[RPM packager (eg. \"Jane Doe \")\[default: vendor\]]" \ - "--doc-files=[list of documentation files (space or comma-separated)]" \ - "--changelog=[RPM changelog]" \ - "--icon=[name of icon file]" \ - "--provides=[capabilities provided by this package]" \ - "--requires=[capabilities required by this package]" \ - "--conflicts=[capabilities which conflict with this package]" \ - "--build-requires=[capabilities required to build this package]" \ - "--obsoletes=[capabilities made obsolete by this package]" \ - "--no-autoreq[do not automatically calculate dependencies]" \ - "--keep-temp[don't clean up RPM build directory]" \ - "-k[don't clean up RPM build directory]" \ - "--no-keep-temp[clean up RPM build directory \[default\]]" \ - "--use-rpm-opt-flags[compile with RPM_OPT_FLAGS when building from source RPM]" \ - "--no-rpm-opt-flags[do not pass any RPM CFLAGS to compiler]" \ - "--rpm3-mode[RPM 3 compatibility mode (default)]" \ - "--rpm2-mode[RPM 2 compatibility mode]" \ - "--prep-script=[Specify a script for the PREP phase of RPM building]" \ - "--build-script=[Specify a script for the BUILD phase of RPM building]" \ - "--pre-install=[Specify a script for the pre-INSTALL phase of RPM building]" \ - "--install-script=[Specify a script for the INSTALL phase of RPM building]" \ - "--post-install=[Specify a script for the post-INSTALL phase of RPM building]" \ - "--pre-uninstall=[Specify a script for the pre-UNINSTALL phase of RPM building]" \ - "--post-uninstall=[Specify a script for the post-UNINSTALL phase of RPM building]" \ - "--clean-script=[Specify a script for the CLEAN phase of RPM building]" \ - "--verify-script=[Specify a script for the VERIFY phase of the RPM build]" \ - "--force-arch=[Force an architecture onto the RPM build process]" \ - "--quiet[Run the INSTALL phase of RPM building in quiet mode]" \ - "-q[Run the INSTALL phase of RPM building in quiet mode]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_bdist_wininst] )) || -_setuppy_bdist_wininst() { - _arguments -s \ - "--bdist-dir=[temporary directory for creating the distribution]" \ - "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \ - "-p[platform name to embed in generated filenames (default: linux-i686)]" \ - "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \ - "-k[keep the pseudo-installation tree around after creating the distribution archive]" \ - "--target-version=[require a specific python version on the target system]" \ - "--no-target-compile[do not compile .py to .pyc on the target system]" \ - "-c[do not compile .py to .pyc on the target system]" \ - "--no-target-optimize[do not compile .py to .pyo (optimized)on the target system]" \ - "-o[do not compile .py to .pyo (optimized)on the target system]" \ - "--dist-dir=[directory to put final built distributions in]" \ - "-d[directory to put final built distributions in]" \ - "--bitmap=[bitmap to use for the installer instead of python-powered logo]" \ - "-b[bitmap to use for the installer instead of python-powered logo]" \ - "--title=[title to display on the installer background instead of default]" \ - "-t[title to display on the installer background instead of default]" \ - "--skip-build[skip rebuilding everything (for testing/debugging)]" \ - "--install-script=[basename of installation script to be run afterinstallation or before deinstallation]" \ - "--pre-install-script=[Fully qualified filename of a script to be run before any files are installed. This script need not be in the distribution]" \ - "--user-access-control=[specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_upload] )) || -_setuppy_upload() { - _arguments -s \ - "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "--show-response[display full response text from server]" \ - "--sign[sign files to upload using gpg]" \ - "-s[sign files to upload using gpg]" \ - "--identity=[GPG identity used to sign files]" \ - "-i[GPG identity used to sign files]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_check] )) || -_setuppy_check() { - _arguments -s \ - "--metadata[Verify meta-data]" \ - "-m[Verify meta-data]" \ - "--restructuredtext[Checks if long string meta-data syntax are reStructuredText-compliant]" \ - "-r[Checks if long string meta-data syntax are reStructuredText-compliant]" \ - "--strict[Will exit with an error if a check fails]" \ - "-s[Will exit with an error if a check fails]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_alias] )) || -_setuppy_alias() { - _arguments -s \ - "--remove[remove (unset) the alias]" \ - "-r[remove (unset) the alias]" \ - "--global-config[save options to the site-wide distutils.cfg file]" \ - "-g[save options to the site-wide distutils.cfg file]" \ - "--user-config[save options to the current user's pydistutils.cfg file]" \ - "-u[save options to the current user's pydistutils.cfg file]" \ - "--filename=[configuration file to use (default=setup.cfg)]" \ - "-f[configuration file to use (default=setup.cfg)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_bdist_egg] )) || -_setuppy_bdist_egg() { - _arguments -s \ - "--bdist-dir=[temporary directory for creating the distribution]" \ - "-b[temporary directory for creating the distribution]" \ - "--plat-name=[platform name to embed in generated filenames (default: linux-i686)]" \ - "-p[platform name to embed in generated filenames (default: linux-i686)]" \ - "--exclude-source-files[remove all .py files from the generated egg]" \ - "--keep-temp[keep the pseudo-installation tree around after creating the distribution archive]" \ - "-k[keep the pseudo-installation tree around after creating the distribution archive]" \ - "--dist-dir=[directory to put final built distributions in]" \ - "-d[directory to put final built distributions in]" \ - "--skip-build[skip rebuilding everything (for testing/debugging)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_develop] )) || -_setuppy_develop() { - _arguments -s \ - "--prefix=[installation prefix]" \ - "--zip-ok[install package as a zipfile]" \ - "-z[install package as a zipfile]" \ - "--multi-version[make apps have to require() a version]" \ - "-m[make apps have to require() a version]" \ - "--upgrade[force upgrade (searches PyPI for latest versions)]" \ - "-U[force upgrade (searches PyPI for latest versions)]" \ - "--install-dir=[install package to DIR]" \ - "-d[install package to DIR]" \ - "--script-dir=[install scripts to DIR]" \ - "-s[install scripts to DIR]" \ - "--exclude-scripts[Don't install scripts]" \ - "-x[Don't install scripts]" \ - "--always-copy[Copy all needed packages to install dir]" \ - "-a[Copy all needed packages to install dir]" \ - "--index-url=[base URL of Python Package Index]" \ - "-i[base URL of Python Package Index]" \ - "--find-links=[additional URL(s) to search for packages]" \ - "-f[additional URL(s) to search for packages]" \ - "--build-directory=[download/extract/build in DIR; keep the results]" \ - "-b[download/extract/build in DIR; keep the results]" \ - "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "--record=[filename in which to record list of installed files]" \ - "--always-unzip[don't install as a zipfile, no matter what]" \ - "-Z[don't install as a zipfile, no matter what]" \ - "--site-dirs=[list of directories where .pth files work]" \ - "-S[list of directories where .pth files work]" \ - "--editable[Install specified packages in editable form]" \ - "-e[Install specified packages in editable form]" \ - "--no-deps[don't install dependencies]" \ - "-N[don't install dependencies]" \ - "--allow-hosts=[pattern(s) that hostnames must match]" \ - "-H[pattern(s) that hostnames must match]" \ - "--local-snapshots-ok[allow building eggs from local checkouts]" \ - "-l[allow building eggs from local checkouts]" \ - "--version[print version information and exit]" \ - "--no-find-links[Don't load find-links defined in packages being installed]" \ - "--user[install in user site-package]" \ - "--uninstall[Uninstall this source package]" \ - "-u[Uninstall this source package]" \ - "--egg-path=[Set the path to be used in the .egg-link file]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_easy_install] )) || -_setuppy_easy_install() { - _arguments -s \ - "--prefix=[installation prefix]" \ - "--zip-ok[install package as a zipfile]" \ - "-z[install package as a zipfile]" \ - "--multi-version[make apps have to require() a version]" \ - "-m[make apps have to require() a version]" \ - "--upgrade[force upgrade (searches PyPI for latest versions)]" \ - "-U[force upgrade (searches PyPI for latest versions)]" \ - "--install-dir=[install package to DIR]" \ - "-d[install package to DIR]" \ - "--script-dir=[install scripts to DIR]" \ - "-s[install scripts to DIR]" \ - "--exclude-scripts[Don't install scripts]" \ - "-x[Don't install scripts]" \ - "--always-copy[Copy all needed packages to install dir]" \ - "-a[Copy all needed packages to install dir]" \ - "--index-url=[base URL of Python Package Index]" \ - "-i[base URL of Python Package Index]" \ - "--find-links=[additional URL(s) to search for packages]" \ - "-f[additional URL(s) to search for packages]" \ - "--build-directory=[download/extract/build in DIR; keep the results]" \ - "-b[download/extract/build in DIR; keep the results]" \ - "--optimize=[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "-O[also compile with optimization: -O1 for \"python -O\", -O2 for \"python -OO\", and -O0 to disable \[default: -O0\]]" \ - "--record=[filename in which to record list of installed files]" \ - "--always-unzip[don't install as a zipfile, no matter what]" \ - "-Z[don't install as a zipfile, no matter what]" \ - "--site-dirs=[list of directories where .pth files work]" \ - "-S[list of directories where .pth files work]" \ - "--editable[Install specified packages in editable form]" \ - "-e[Install specified packages in editable form]" \ - "--no-deps[don't install dependencies]" \ - "-N[don't install dependencies]" \ - "--allow-hosts=[pattern(s) that hostnames must match]" \ - "-H[pattern(s) that hostnames must match]" \ - "--local-snapshots-ok[allow building eggs from local checkouts]" \ - "-l[allow building eggs from local checkouts]" \ - "--version[print version information and exit]" \ - "--no-find-links[Don't load find-links defined in packages being installed]" \ - "--user[install in user site-package]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_egg_info] )) || -_setuppy_egg_info() { - _arguments -s \ - "--egg-base=[directory containing .egg-info directories (default: top of the source tree)]" \ - "-e[directory containing .egg-info directories (default: top of the source tree)]" \ - "--tag-svn-revision[Add subversion revision ID to version number]" \ - "-r[Add subversion revision ID to version number]" \ - "--tag-date[Add date stamp (e.g. 20050528) to version number]" \ - "-d[Add date stamp (e.g. 20050528) to version number]" \ - "--tag-build=[Specify explicit tag to add to version number]" \ - "-b[Specify explicit tag to add to version number]" \ - "--no-svn-revision[Don't add subversion revision ID \[default\]]" \ - "-R[Don't add subversion revision ID \[default\]]" \ - "--no-date[Don't include date stamp \[default\]]" \ - "-D[Don't include date stamp \[default\]]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_rotate] )) || -_setuppy_rotate() { - _arguments -s \ - "--match=[patterns to match (required)]" \ - "-m[patterns to match (required)]" \ - "--dist-dir=[directory where the distributions are]" \ - "-d[directory where the distributions are]" \ - "--keep=[number of matching distributions to keep]" \ - "-k[number of matching distributions to keep]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_saveopts] )) || -_setuppy_saveopts() { - _arguments -s \ - "--global-config[save options to the site-wide distutils.cfg file]" \ - "-g[save options to the site-wide distutils.cfg file]" \ - "--user-config[save options to the current user's pydistutils.cfg file]" \ - "-u[save options to the current user's pydistutils.cfg file]" \ - "--filename=[configuration file to use (default=setup.cfg)]" \ - "-f[configuration file to use (default=setup.cfg)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_setopt] )) || -_setuppy_setopt() { - _arguments -s \ - "--command=[command to set an option for]" \ - "-c[command to set an option for]" \ - "--option=[option to set]" \ - "-o[option to set]" \ - "--set-value=[value of the option]" \ - "-s[value of the option]" \ - "--remove[remove (unset) the value]" \ - "-r[remove (unset) the value]" \ - "--global-config[save options to the site-wide distutils.cfg file]" \ - "-g[save options to the site-wide distutils.cfg file]" \ - "--user-config[save options to the current user's pydistutils.cfg file]" \ - "-u[save options to the current user's pydistutils.cfg file]" \ - "--filename=[configuration file to use (default=setup.cfg)]" \ - "-f[configuration file to use (default=setup.cfg)]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_test] )) || -_setuppy_test() { - _arguments -s \ - "--test-module=[Run 'test_suite' in specified module]" \ - "-m[Run 'test_suite' in specified module]" \ - "--test-suite=[Test suite to run (e.g. 'some_module.test_suite')]" \ - "-s[Test suite to run (e.g. 'some_module.test_suite')]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_install_egg_info] )) || -_setuppy_install_egg_info() { - _arguments -s \ - "--install-dir=[directory to install to]" \ - "-d[directory to install to]" \ - "*::setup.py commands:_setup.py" -} - -(( $+functions[_setuppy_upload_docs] )) || -_setuppy_upload_docs() { - _arguments -s \ - "--repository=[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "-r[url of repository \[default: http://pypi.python.org/pypi\]]" \ - "--show-response[display full response text from server]" \ - "--upload-dir=[directory to upload]" \ - "*::setup.py commands:_setup.py" -} - -_setup.py "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_sfdx b/.zprezto/modules/completion/external/src/_sfdx deleted file mode 100644 index 9fbf313..0000000 --- a/.zprezto/modules/completion/external/src/_sfdx +++ /dev/null @@ -1,935 +0,0 @@ -#compdef sfdx - -# DESCRIPTION: Zsh completion script for the Salesforce CLI -# AUTHOR: Wade Wegner (@WadeWegner) -# REPO: https://github.com/wadewegner/salesforce-cli-zsh-completion -# LICENSE: https://github.com/wadewegner/salesforce-cli-zsh-completion/blob/master/LICENSE - -local -a _1st_arguments - -_1st_arguments=( - "force\:alias\:list":"list username aliases for the Salesforce CLI" - "force\:alias\:set":"set username aliases for the Salesforce CLI" - "force\:apex\:class\:create":"create an Apex class" - "force\:apex\:execute":"execute anonymous Apex code" - "force\:apex\:log\:get":"fetch a debug log" - "force\:apex\:log\:list":"list debug logs" - "force\:apex\:test\:report":"display test results" - "force\:apex\:test\:run":"invoke Apex tests" - "force\:apex\:trigger\:create":"create an Apex trigger" - "force\:auth\:jwt\:grant":"authorize an org using the JWT flow" - "force\:auth\:sfdxurl\:store":"authorize an org using an SFDX auth URL" - "force\:auth\:web\:login":"authorize an org using the web login flow" - "force\:config\:get":"get config var values for given names" - "force\:config\:list":"list config vars for the Salesforce CLI" - "force\:config\:set":"set config vars for the Salesforce CLI" - "force\:data\:bulk\:delete":"bulk delete records from a csv file" - "force\:data\:bulk\:status":"view the status of a bulk data load job or batch" - "force\:data\:bulk\:upsert":"bulk upsert records from a CSV file" - "force\:data\:record\:create":"create a record" - "force\:data\:record\:delete":"delete a record" - "force\:data\:record\:get":"view a record" - "force\:data\:record\:update":"update a record" - "force\:data\:soql\:query":"execute a SOQL query" - "force\:data\:tree\:export":"export data from an org into sObject tree format for force:data:tree:import consumption" - "force\:data\:tree\:import":"import data into an org using SObject Tree Save API" - "force\:doc\:commands\:display":"display help for force commands" - "force\:doc\:commands\:list":"list the force commands" - "force\:lightning\:app\:create":"create a Lightning app" - "force\:lightning\:component\:create":"create a Lightning component" - "force\:lightning\:event\:create":"create a Lightning event" - "force\:lightning\:interface\:create":"create a Lightning interface" - "force\:lightning\:lint":"analyse (lint) Lightning component code" - "force\:lightning\:test\:create":"create a Lightning test" - "force\:lightning\:test\:install":"install Lightning Testing Service unmanaged package in your org" - "force\:lightning\:test\:run":"invoke Lightning component tests" - "force\:limits\:api\:display":"display current org’s limits" - "force\:mdapi\:convert":"convert Metadata API source into the Salesforce DX source format" - "force\:mdapi\:deploy":"deploy metadata to an org using Metadata API" - "force\:mdapi\:deploy\:report":"check the status of a metadata deployment" - "force\:mdapi\:retrieve":"retrieve metadata from an org using Metadata API" - "force\:mdapi\:retrieve\:report":"check the status of a metadata retrieval" - "force\:org\:create":"create a scratch org" - "force\:org\:delete":"mark a scratch org for deletion" - "force\:org\:display":"get org description" - "force\:org\:list":"list all orgs you’ve created or authenticated to" - "force\:org\:open":"open an org in your browser" - "force\:org\:shape\:create":"create a snapshot of org edition, features, and licenses" - "force\:org\:shape\:delete":"delete all org shapes for a target org" - "force\:org\:shape\:list":"list all org shapes you’ve created" - "force\:package1\:version\:create":"create a first-generation package version in the release org" - "force\:package1\:version\:create\:get":"retrieve the status of a package version creation request" - "force\:package1\:version\:display":"display details about a first-generation package version" - "force\:package1\:version\:list":"list package versions for the specified first-generation package or for the org" - "force\:package2\:create":"create a second-generation package" - "force\:package2\:list":"list all second-generation packages in the Dev Hub org" - "force\:package2\:update":"update a second-generation package" - "force\:package2\:version\:create":"create a second-generation package version" - "force\:package2\:version\:create\:get":"retrieve a package version creation request" - "force\:package2\:version\:create\:list":"list package version creation requests" - "force\:package2\:version\:get":"retrieve a package version in the Dev Hub org" - "force\:package2\:version\:list":"list all package versions in the Dev Hub org" - "force\:package2\:version\:update":"update a second-generation package version" - "force\:package\:install":"install a package in the target org" - "force\:package\:install\:get":"retrieve the status of a package installation request" - "force\:package\:installed\:list":"list the org’s installed packages" - "force\:package\:uninstall":"uninstall a second-generation package from the target org" - "force\:package\:uninstall\:get":"retrieve status of package uninstall request" - "force\:project\:create":"create a new SFDX project" - "force\:project\:upgrade":"update project config files to the latest format" - "force\:schema\:sobject\:describe":"describe an object" - "force\:schema\:sobject\:list":"list all objects of a specified category" - "force\:source\:convert":"convert Salesforce DX source into the Metadata API source format" - "force\:source\:open":"edit a Lightning Page with Lightning App Builder" - "force\:source\:pull":"pull source from the scratch org to the project" - "force\:source\:push":"push source to an org from the project" - "force\:source\:status":"list local changes and/or changes in a scratch org" - "force\:user\:create":"create a user for a scratch org" - "force\:user\:display":"displays information about a user of a scratch org" - "force\:user\:list":"lists all users of a scratch org" - "force\:user\:password\:generate":"generate a password for scratch org users" - "force\:user\:permset\:assign":"assign a permission set to one or more users of an org" - "force\:visualforce\:component\:create":"create a Visualforce component" - "force\:visualforce\:page\:create":"create a Visualforce page" -) - -_arguments '*:: :->command' - -if (( CURRENT == 1 )); then - _describe -t commands "sfdx command" _1st_arguments - return -fi - -local -a _command_args -case "$words[1]" in - force:limits:api:display) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:app:create) - _command_args=( - '(-n|--appname)'{-n,--appname}'[name of the generated Lightning app]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningApp*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:bulk:delete) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records you’re deleting]' \ - '(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file containing the ids of the records to delete]:file:_files' \ - '(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:bulk:status) - _command_args=( - '(-i|--jobid)'{-i,--jobid}'[the ID of the job you want to view or of the job whose batch you want to view]' \ - '(-b|--batchid)'{-b,--batchid}'[the ID of the batch whose status you want to view]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:bulk:upsert) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the sObject type of the records you want to upsert]' \ - '(-f|--csvfile)'{-f,--csvfile}'[the path to the CSV file that defines the records to upsert]:file:_files' \ - '(-i|--externalid)'{-i,--externalid}'[the column name of the external ID; if not provided, an arbitrary ID is used]' \ - '(-w|--wait)'{-w,--wait}'[the number of minutes to wait for the command to complete before displaying the results]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:class:create) - _command_args=( - '(-n|--classname)'{-n,--classname}'[name of the generated Apex class]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultApexClass*,ApexException,ApexUnitTest,InboundEmailService)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:doc:commands:display) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:doc:commands:list) - _command_args=( - '(-u|--usage)'{-u,--usage}'[list only docopts usage strings]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:visualforce:component:create) - _command_args=( - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFComponent*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-n|--componentname)'{-n,--componentname}'[name of the generated Visualforce component]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(-l|--label)'{-l,--label}'[Visualforce component label]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:component:create) - _command_args=( - '(-n|--componentname)'{-n,--componentname}'[name of the generated Lightning component]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningCmp*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:mdapi:convert) - _command_args=( - '(-r|--rootdir)'{-r,--rootdir}'[the root directory containing the Metadata API source]:file:_files' \ - '(-d|--outputdir)'{-d,--outputdir}'[the output directory to store the sfdx source]:file:_files' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:source:convert) - _command_args=( - '(-r|--rootdir)'{-r,--rootdir}'[the source directory for the source to be converted]:file:_files' \ - '(-d|--outputdir)'{-d,--outputdir}'[the output directory to export the Metadata API source to]:file:_files' \ - '(-n|--packagename)'{-n,--packagename}'[the name of the package to associate with the Metadata API source]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:create) - _command_args=( - '(-f|--definitionfile)'{-f,--definitionfile}'[path to a scratch org definition file]:file:_files' \ - '(-j|--definitionjson)'{-j,--definitionjson}'[scratch org definition in json format ]' \ - '(-n|--nonamespace)'{-n,--nonamespace}'[creates the scratch org with no namespace]' \ - '(-c|--noancestors)'{-c,--noancestors}'[do not include second-generation package ancestors in the scratch org]' \ - '(-i|--clientid)'{-i,--clientid}'[connected app consumer key]' \ - '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the created org as the default username]' \ - '(-a|--setalias)'{-a,--setalias}'[set an alias for for the created scratch org]' \ - '(-e|--env)'{-e,--env}'[environment where the scratch org is created: \[sandbox*,virtual,prototype\] (sandbox*,virtual,prototype)]' \ - '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ - '(-d|--durationdays)'{-d,--durationdays}'[duration of the scratch org (in days) (default:7, min:1, max:30)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:create) - _command_args=( - '(-n|--name)'{-n,--name}'[package name]' \ - '(-o|--containeroptions)'{-o,--containeroptions}'[\[*Managed | Unlocked | Locked\] container options for the package (Managed=DeveloperManagedSubscriberManaged, Unlocked=DeveloperControlledSubscriberEditable, Locked=DeveloperControlledSubscriberLocked)]' \ - '(-d|--description)'{-d,--description}'[package description]' \ - '(-e|--nonamespace)'{-e,--nonamespace}'[creates the package with no namespace; available only for developer-controlled packages.]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:user:create) - _command_args=( - '(-f|--definitionfile)'{-f,--definitionfile}'[file path to a user definition]:file:_files' \ - '(-a|--setalias)'{-a,--setalias}'[set an alias for the created username to reference within the CLI]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:project:create) - _command_args=( - '(-n|--projectname)'{-n,--projectname}'[name of the generated project]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (Defaultsfdx-project.json*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-l|--loginurl)'{-l,--loginurl}'[Salesforce instance login URL (https://login.salesforce.com*)]' \ - '(-x|--sourceapiversion)'{-x,--sourceapiversion}'[source API version number (41.0*)]' \ - '(-s|--namespace)'{-s,--namespace}'[project associated namespace]' \ - '(-p|--defaultpackagedir)'{-p,--defaultpackagedir}'[default package directory name (force-app*)]:file:_files' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:delete) - _command_args=( - '(-p|--noprompt)'{-p,--noprompt}'[no prompt to confirm deletion]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:mdapi:deploy) - _command_args=( - '(-c|--checkonly)'{-c,--checkonly}'[validate deploy but don’t save to the org (default:false)]' \ - '(-d|--deploydir)'{-d,--deploydir}'[root of directory tree of files to deploy]:file:_files' \ - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \ - '(-i|--jobid)'{-i,--jobid}'[WARNING: The flag "jobid" has been deprecated and will be removed in v41.01.0 or later. Instead, use "sfdx force:mdapi:deploy:report -i ".]' \ - '(-l|--testlevel)'{-l,--testlevel}'[deployment testing level (NoTestRun,RunSpecifiedTests,RunLocalTests,RunAllTestsInOrg)]' \ - '(-r|--runtests)'{-r,--runtests}'[tests to run if --testlevel RunSpecifiedTests]' \ - '(-e|--rollbackonerror)'{-e,--rollbackonerror}'[WARNING: The flag "rollbackonerror" has been deprecated and will be removed in v41.01.0 or later. Instead, use "ignoreerrors".]' \ - '(-o|--ignoreerrors)'{-o,--ignoreerrors}'[ignore any errors and do not roll back deployment (default:false)]' \ - '(-g|--ignorewarnings)'{-g,--ignorewarnings}'[whether a warning will allow a deployment to complete successfully (default:false)]' \ - '(-f|--zipfile)'{-f,--zipfile}'[path to .zip file of metadata to deploy]:file:_files' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[verbose output of deploy results]' \ - ) - ;; - force:mdapi:deploy:report) - _command_args=( - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 0)]' \ - '(-i|--jobid)'{-i,--jobid}'[job ID of the deployment you want to check]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[verbose output of deploy results]' \ - ) - ;; - force:org:display) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[emit additional command output to stdout]' \ - ) - ;; - force:user:display) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:event:create) - _command_args=( - '(-n|--eventname)'{-n,--eventname}'[name of the generated Lightning event]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningEvt*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:execute) - _command_args=( - '(-f|--apexcodefile)'{-f,--apexcodefile}'[path to a local file containing Apex code]:file:_files' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:config:get) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[emit additional command output to stdout]' \ - ) - ;; - force:package:install) - _command_args=( - '(-i|--id)'{-i,--id}'[ID of the package version to install (starts with 04t)]' \ - '(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status]' \ - '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ - '(-p|--publishwait)'{-p,--publishwait}'[number of minutes to wait for subscriber package version ID to become available in the target org]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package:install:get) - _command_args=( - '(-i|--requestid)'{-i,--requestid}'[ID of the package install request you want to check]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package:installed:list) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:interface:create) - _command_args=( - '(-n|--interfacename)'{-n,--interfacename}'[name of the generated Lightning interface]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningIntf*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:auth:jwt:grant) - _command_args=( - '(-u|--username)'{-u,--username}'[authentication username]' \ - '(-f|--jwtkeyfile)'{-f,--jwtkeyfile}'[path to a file containing the private key]:file:_files' \ - '(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \ - '(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \ - '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ - '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ - '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:lint) - _command_args=( - '(-i|--ignore)'{-i,--ignore}'[pattern used to ignore some folders]' \ - '(--files)--files[pattern used to include specific files]:file:_files' \ - '(-j|--json)'{-j,--json}'[format output as JSON]' \ - '(--config)--config[path to a custom ESLint configuration file]:file:_files' \ - '(--verbose)--verbose[report warnings in addition to errors]' \ - '(--exit)--exit[exit with error code 1 if there are lint issues]' \ - ) - ;; - force:alias:list) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:config:list) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:list) - _command_args=( - '(--all)--all[include expired, deleted, and unknown-status scratch orgs]' \ - '(--clean)--clean[remove all local org authorizations for non-active orgs]' \ - '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[list more information about each org]' \ - ) - ;; - force:package2:list) - _command_args=( - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:user:list) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:log:get) - _command_args=( - '(-i|--logid)'{-i,--logid}'[ID of the log to display]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:log:list) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:open) - _command_args=( - '(-p|--path)'{-p,--path}'[navigation URL path]:file:_files' \ - '(-r|--urlonly)'{-r,--urlonly}'[display navigation URL, but don’t launch browser]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:source:open) - _command_args=( - '(-f|--sourcefile)'{-f,--sourcefile}'[file to edit]:file:_files' \ - '(-r|--urlonly)'{-r,--urlonly}'[generate a navigation URL; don’t launch the editor]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:visualforce:page:create) - _command_args=( - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultVFPage*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-n|--pagename)'{-n,--pagename}'[name of the generated Visualforce page]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(-l|--label)'{-l,--label}'[Visualforce page label]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:user:password:generate) - _command_args=( - '(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames for which to generate passwords]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:user:permset:assign) - _command_args=( - '(-n|--permsetname)'{-n,--permsetname}'[the name of the permission set to assign]' \ - '(-o|--onbehalfof)'{-o,--onbehalfof}'[comma-separated list of usernames or aliases to assign the permission set to]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:source:pull) - _command_args=( - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ - '(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to the project]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:source:push) - _command_args=( - '(-f|--forceoverwrite)'{-f,--forceoverwrite}'[ignore conflict warnings and overwrite changes to scratch org]' \ - '(-g|--ignorewarnings)'{-g,--ignorewarnings}'[deploy changes even if warnings are generated]' \ - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: 33) (default:33, min:1)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:record:create) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re creating]' \ - '(-v|--values)'{-v,--values}'[the = pairs you’re creating]' \ - '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[create the record with tooling api]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:record:delete) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re deleting]' \ - '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re deleting]' \ - '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ - '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[delete the record with Tooling API]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:record:get) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re retrieving]' \ - '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re retrieving]' \ - '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ - '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[retrieve the record with Tooling API]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:record:update) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the type of the record you’re updating]' \ - '(-i|--sobjectid)'{-i,--sobjectid}'[the ID of the record you’re updating]' \ - '(-w|--where)'{-w,--where}'[a list of = pairs to search for]' \ - '(-v|--values)'{-v,--values}'[the = pairs you’re updating]' \ - '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[update the record with Tooling API]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:mdapi:retrieve) - _command_args=( - '(-a|--apiversion)'{-a,--apiversion}'[target API version for the retrieve (default 41.0)]' \ - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \ - '(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \ - '(-k|--unpackaged)'{-k,--unpackaged}'[file path of manifest of components to retrieve]:file:_files' \ - '(-d|--sourcedir)'{-d,--sourcedir}'[source dir to use instead of default manifest sfdx-project.xml]' \ - '(-p|--packagenames)'{-p,--packagenames}'[a comma-separated list of packages to retrieve]' \ - '(-s|--singlepackage)'{-s,--singlepackage}'[a single-package retrieve (default: false)]' \ - '(-i|--jobid)'{-i,--jobid}'[WARNING: The flag "jobid" has been deprecated and will be removed in v41.01.0 or later. Instead, use "sfdx force:mdapi:retrieve:report -i -r ".]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[verbose output of retrieve result]' \ - ) - ;; - force:mdapi:retrieve:report) - _command_args=( - '(-w|--wait)'{-w,--wait}'[wait time for command to finish in minutes (default: -1 (no limit))]' \ - '(-r|--retrievetargetdir)'{-r,--retrievetargetdir}'[directory root for the retrieved files]:file:_files' \ - '(-i|--jobid)'{-i,--jobid}'[job ID of the retrieve you want to check]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[verbose output of retrieve result]' \ - ) - ;; - force:alias:set) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:config:set) - _command_args=( - '(-g|--global)'{-g,--global}'[set config var globally (to be used from any directory)]:file:_files' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:auth:sfdxurl:store) - _command_args=( - '(-f|--sfdxurlfile)'{-f,--sfdxurlfile}'[path to a file containing the sfdx url]:file:_files' \ - '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ - '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ - '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:shape:create) - _command_args=( - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:shape:delete) - _command_args=( - '(-p|--noprompt)'{-p,--noprompt}'[do not prompt for confirmation]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username for the target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:org:shape:list) - _command_args=( - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[list more information about each org shape]' \ - ) - ;; - force:schema:sobject:describe) - _command_args=( - '(-s|--sobjecttype)'{-s,--sobjecttype}'[the API name of the object to describe]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:schema:sobject:list) - _command_args=( - '(-c|--sobjecttypecategory)'{-c,--sobjecttypecategory}'[the type of objects to list (all|custom|standard)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:soql:query) - _command_args=( - '(-q|--query)'{-q,--query}'[SOQL query to execute]' \ - '(-t|--usetoolingapi)'{-t,--usetoolingapi}'[execute query with Tooling API]' \ - '(-r|--resultformat)'{-r,--resultformat}'[query result format emitted to stdout; --json flag overrides this parameter (human*,csv,json)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:source:status) - _command_args=( - '(-a|--all)'{-a,--all}'[list all the changes that have been made]' \ - '(-l|--local)'{-l,--local}'[list the changes that have been made locally]' \ - '(-r|--remote)'{-r,--remote}'[list the changes that have been made in the scratch org]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:test:create) - _command_args=( - '(-n|--testname)'{-n,--testname}'[name of the generated Lightning test]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (DefaultLightningTest*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:lightning:test:install) - _command_args=( - '(-w|--wait)'{-w,--wait}'[number of minutes to wait for installation status (default:2)]' \ - '(-r|--releaseversion)'{-r,--releaseversion}'[release version of Lightning Testing Service (default:latest)]' \ - '(-t|--packagetype)'{-t,--packagetype}'[type of unmanaged package. 'full' option contains both jasmine and mocha, plus examples (full*,jasmine,mocha)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:test:report) - _command_args=( - '(-i|--testrunid)'{-i,--testrunid}'[ID of test run]' \ - '(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \ - '(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \ - '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ - '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[display Apex test processing details]' \ - ) - ;; - force:apex:test:run) - _command_args=( - '(-n|--classnames)'{-n,--classnames}'[comma-separated list of Apex test class names to execute]' \ - '(-s|--suitenames)'{-s,--suitenames}'[comma-separated list of Apex test suite names to execute]' \ - '(-c|--codecoverage)'{-c,--codecoverage}'[retrieve code coverage results]' \ - '(-d|--outputdir)'{-d,--outputdir}'[directory to store test run files]:file:_files' \ - '(-l|--testlevel)'{-l,--testlevel}'[testlevel enum value (RunLocalTests,RunAllTestsInOrg,RunSpecifiedTests)]' \ - '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ - '(-w|--wait)'{-w,--wait}'[the streaming client socket timeout (in minutes) (default:6, min:2)]' \ - '(--precompilewait)--precompilewait[how long to wait (in minutes) for Apex pre-compilation (default:3, min:3)]' \ - '(-y|--synchronous)'{-y,--synchronous}'[run tests from a single class synchronously]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[display Apex test processing details]' \ - ) - ;; - force:lightning:test:run) - _command_args=( - '(-a|--appname)'{-a,--appname}'[name of your Lightning test application]' \ - '(-d|--outputdir)'{-d,--outputdir}'[directory path to store test run artifacts: for example, log files and test results]:file:_files' \ - '(-r|--resultformat)'{-r,--resultformat}'[test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)]' \ - '(-f|--configfile)'{-f,--configfile}'[path to config file for the test]:file:_files' \ - '(-o|--leavebrowseropen)'{-o,--leavebrowseropen}'[leave browser open]' \ - '(-t|--timeout)'{-t,--timeout}'[time (ms) to wait for results element in dom (default:60000)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:tree:export) - _command_args=( - '(-q|--query)'{-q,--query}'[soql query, or filepath of file containing a soql query, to retrieve records]:file:_files' \ - '(-p|--plan)'{-p,--plan}'[generate mulitple sobject tree files and a plan definition file for aggregated import]' \ - '(-x|--prefix)'{-x,--prefix}'[prefix of generated files]' \ - '(-d|--outputdir)'{-d,--outputdir}'[directory to store files]:file:_files' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:data:tree:import) - _command_args=( - '(-f|--sobjecttreefiles)'{-f,--sobjecttreefiles}'[comma-delimited, ordered paths of json files containing collection of record trees to insert]:file:_files' \ - '(-p|--plan)'{-p,--plan}'[path to plan to insert multiple data files that have master-detail relationships]:file:_files' \ - '(-c|--contenttype)'{-c,--contenttype}'[if data file extension is not .json, provide content type (applies to all files)]' \ - '(--confighelp)--confighelp[display schema information for the --plan configuration file to stdout; if you use this option, all other options except --json are ignored]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:apex:trigger:create) - _command_args=( - '(-n|--triggername)'{-n,--triggername}'[name of the generated Apex trigger]' \ - '(-t|--template)'{-t,--template}'[template to use for file creation (ApexTrigger*)]' \ - '(-d|--outputdir)'{-d,--outputdir}'[folder for saving the created files]' \ - '(-r|--reflect)'{-r,--reflect}'[switch to return flag detailed information]' \ - '(-a|--apiversion)'{-a,--apiversion}'[API version number (41.0*,40.0)]' \ - '(-s|--sobject)'{-s,--sobject}'[sObject to create a trigger on (SOBJECT*)]' \ - '(-e|--triggerevents)'{-e,--triggerevents}'[events that fire the trigger (before insert*,before upsert,before delete,after insert,after upsert,after delete,after undelete)]' \ - '(--json)--json[JSON output]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package:uninstall) - _command_args=( - '(-i|--id)'{-i,--id}'[ID of the package to uninstall (starts with 04t)]' \ - '(-w|--wait)'{-w,--wait}'[number of minutes to wait for uninstall status]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package:uninstall:get) - _command_args=( - '(-i|--requestid)'{-i,--requestid}'[ID of the package uninstall request you want to check]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:update) - _command_args=( - '(-i|--package2id)'{-i,--package2id}'[id of the package (starts with 0Ho)]' \ - '(-n|--name)'{-n,--name}'[package name]' \ - '(-d|--description)'{-d,--description}'[package description]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:project:upgrade) - _command_args=( - '(-f|--forceupgrade)'{-f,--forceupgrade}'[run all upgrades even if project has already been upgraded]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package1:version:create) - _command_args=( - '(-i|--packageid)'{-i,--packageid}'[ID of the metadata package (starts with 033) of which you’re creating a new version]' \ - '(-n|--name)'{-n,--name}'[package version name]' \ - '(-d|--description)'{-d,--description}'[package version description]' \ - '(-v|--version)'{-v,--version}'[package version in major.minor format, for example, 3.2]' \ - '(-m|--managedreleased)'{-m,--managedreleased}'[create a managed package version]' \ - '(-r|--releasenotesurl)'{-r,--releasenotesurl}'[release notes URL]' \ - '(-p|--postinstallurl)'{-p,--postinstallurl}'[post install URL]' \ - '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ - '(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default: 2 minutes)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:version:create) - _command_args=( - '(-i|--package2id)'{-i,--package2id}'[ID of the parent package (starts with 0Ho)]' \ - '(-d|--directory)'{-d,--directory}'[path to directory that contains the contents of the package version]:file:_files' \ - '(-b|--branch)'{-b,--branch}'[the package version’s branch]' \ - '(-t|--tag)'{-t,--tag}'[the package version’s tag]' \ - '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ - '(-p|--preserve)'{-p,--preserve}'[temp files are preserved that would otherwise be deleted]' \ - '(-j|--validateschema)'{-j,--validateschema}'[sfdx-project.json is validated against JSON schema]' \ - '(-w|--wait)'{-w,--wait}'[minutes to wait for the package version to be created (default:0)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package1:version:create:get) - _command_args=( - '(-i|--requestid)'{-i,--requestid}'[PackageUploadRequest ID]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:version:create:get) - _command_args=( - '(-i|--package2createrequestid)'{-i,--package2createrequestid}'[package2 version creation request ID (starts with 08c)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:version:create:list) - _command_args=( - '(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ - '(-s|--status)'{-s,--status}'[filter the list by version creation request status (Queued,InProgress,Success,Error)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package1:version:display) - _command_args=( - '(-i|--packageversionid)'{-i,--packageversionid}'[metadata package version ID (starts with 04t)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:version:get) - _command_args=( - '(-i|--package2versionid)'{-i,--package2versionid}'[the package version ID (starts wtih 05i)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package1:version:list) - _command_args=( - '(-i|--packageid)'{-i,--packageid}'[metadata package ID (starts with 033)]' \ - '(-u|--targetusername)'{-u,--targetusername}'[username or alias for the target org; overrides default target org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:package2:version:list) - _command_args=( - '(-c|--createdlastdays)'{-c,--createdlastdays}'[created in the last specified number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ - '(-m|--modifiedlastdays)'{-m,--modifiedlastdays}'[list items modified in the specified last number of days (starting at 00:00:00 of first day to now; 0 for today)]' \ - '(-i|--package2ids)'{-i,--package2ids}'[filter results on specified comma-delimited package2 ids (start with 0Ho)]' \ - '(-r|--released)'{-r,--released}'[display released versions only]' \ - '(-o|--orderby)'{-o,--orderby}'[order by the specified package2 version fields]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--concise)--concise[display limited package2 version details]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - '(--verbose)--verbose[display extended package2 versions detail]' \ - ) - ;; - force:package2:version:update) - _command_args=( - '(-i|--package2versionid)'{-i,--package2versionid}'[the package version ID (starts wtih 05i)]' \ - '(-n|--name)'{-n,--name}'[the package version name]' \ - '(-d|--description)'{-d,--description}'[the package version description]' \ - '(-b|--branch)'{-b,--branch}'[the package version branch]' \ - '(-t|--tag)'{-t,--tag}'[the package version tag]' \ - '(-k|--installationkey)'{-k,--installationkey}'[installation key for key-protected package (default: null)]' \ - '(-s|--setasreleased)'{-s,--setasreleased}'[set the package version as released (can’t be undone)]' \ - '(-v|--targetdevhubusername)'{-v,--targetdevhubusername}'[username or alias for the dev hub org; overrides default dev hub org]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - force:auth:web:login) - _command_args=( - '(-i|--clientid)'{-i,--clientid}'[OAuth client ID (sometimes called the consumer key)]' \ - '(-r|--instanceurl)'{-r,--instanceurl}'[the login URL of the instance the org lives on]' \ - '(-d|--setdefaultdevhubusername)'{-d,--setdefaultdevhubusername}'[set the authenticated org as the default dev hub org for scratch org creation]' \ - '(-s|--setdefaultusername)'{-s,--setdefaultusername}'[set the authenticated org as the default username that all commands run against]' \ - '(-a|--setalias)'{-a,--setalias}'[set an alias for the authenticated org]' \ - '(--disablemasking)--disablemasking[disable masking of user input (for use with problematic terminals)]' \ - '(--json)--json[format output as json]' \ - '(--loglevel)--loglevel[logging level for this command invocation (error*,trace,debug,info,warn,fatal)]' \ - ) - ;; - esac - -_arguments \ - $_command_args \ - && return 0 diff --git a/.zprezto/modules/completion/external/src/_showoff b/.zprezto/modules/completion/external/src/_showoff deleted file mode 100644 index f470141..0000000 --- a/.zprezto/modules/completion/external/src/_showoff +++ /dev/null @@ -1,109 +0,0 @@ -#compdef showoff -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Showoff (https://github.com/schacon/showoff). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bruno Michel (https://github.com/nono) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case $state in - cmds) - cmds=( - 'add:Add a new slide at the end in a given dir' - 'new:Add a new slide at the end in a given dir' - 'create:Create new showoff presentation' - 'init:Create new showoff presentation' - 'help:Shows list of commands or help for one command' - 'heroku:Setup your presentation to serve on Heroku' - 'serve:Serves the showoff presentation in the current directory' - 'static:Generate static version of presentation' - ) - _describe -t commands 'showoff command' cmds && ret=0 - ;; - args) - case $line[1] in - (add|new) - _arguments \ - '(-d --dir)'{-d,--dir}'=[Slide dir (where to put a new slide file)]:directory:_files' \ - '(-n --name)'{-n,--name}'=[Slide name (name of the new slide file)]:basename' \ - {-s,--source}'=[Include code from the given file as the slide body]:file:_files' \ - '(-t --style --type)'{-t,--style,--type}'=[Slide Type/Style (default: title)]:style' \ - '(-u --no-number)'{-u,--no-number}'[Dont number the slide, use the given name verbatim]' \ - '1:title' && ret=0 - ;; - (create|init) - _arguments \ - '(-d --slidedir)'{-d,--slidedir}'=[Sample slide directory name (default: one)]:arg' \ - '(-n --nosamples)'{-n,--nosamples}'=[Dont create sample slides]' \ - '1:dir_name' && ret=0 - ;; - help) - _values 'commands' add new create init help heroku serve static && ret=0 - ;; - heroku) - _message 'please entrer an heroku_name' && ret=0 - ;; - serve) - _arguments \ - '(-h --host)'{-h,--host}'=[Host or ip to run on (default: localhost)]:host' \ - '(-p --port)'{-p,--port}'=[Port on which to run (default: 9090)]:port' \ - '1:title' && ret=0 - ;; - static) - _message 'please entrer a name' && ret=0 - ;; - *) - (( ret )) && _message 'no more arguments' - ;; - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_shutdown b/.zprezto/modules/completion/external/src/_shutdown deleted file mode 100644 index f695b9d..0000000 --- a/.zprezto/modules/completion/external/src/_shutdown +++ /dev/null @@ -1,71 +0,0 @@ -#compdef shutdown -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for shutdown - Shut down the system -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Timofey Titovets -# -# ------------------------------------------------------------------------------ -_shutdown(){ - local -a _1st_arguments - _1st_arguments=( - "--help:Show help" - "-H:Halt the machine" "--halt:Halt the machine" - "-P:Power-off the machine" "--poweroff:Power-off the machine" - "-r:Reboot the machine" "--reboot:Reboot the machine" - "-h:Equivalent to --poweroff, overridden by --halt" - "-k:Dont halt/power-off/reboot, just send warnings" - "--no-wall:Dont send wall message before halt/power-off/reboot" - "-c:Cancel a pending shutdown" - ) - - local context state line expl - local -A opt_args - - _arguments '*:: :->subcmds' && return 0 - - if (( CURRENT == 1 )); then - _describe -t commands "shutdown commands" _1st_arguments -V1 - return - fi - - case "$words[1]" in - *) - _arguments \ - ':list option:(now +{0,5,10,15,30} hh:mm)' - ;; - esac -} - -_shutdown "$@" diff --git a/.zprezto/modules/completion/external/src/_smartmontools b/.zprezto/modules/completion/external/src/_smartmontools deleted file mode 100644 index 5e8c788..0000000 --- a/.zprezto/modules/completion/external/src/_smartmontools +++ /dev/null @@ -1,115 +0,0 @@ -#compdef smartctl smartd -# ------------------------------------------------------------------------------ -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for smartmontools (http://smartmontools.sourceforge.net). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# -# ------------------------------------------------------------------------------ - -_smartctl() { - local context state line expl - local -A opt_args - - _arguments -A "-*" \ - '(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \ - '(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \ - '(-i --info)'{-i,--info}'[Show identity information for device]' \ - '(-a --all)'{-a,--all}"[Show all SMART information for device]" \ - '(-x --xall)'{-xa,--xall}"[Show all information for device]" \ - '--scan[Scan for devices]' \ - '--scan-open[Scan for devices and try to open each device]' \ - \ - '(-q --quietmode)'{-q,--quietmode}'[Set smartctl quiet mode]:TYPE:(errorsonly silent noserial)' \ - '(-d --device)'{-d,--device}'[Specify device type]:TYPE:(ata scsi sat usbcypress usbjmicron usbsunplus marvell areca 3ware hpt megaraid cciss auto test)' \ - '(-T --tolerance)'{-T,--tolerance}'[Set tolerance]:TOLERANCE:(normal conservative permissive verypermissive)' \ - '(-b --badsum)'{-q,--badsum}'[Set action on bad checksum]:TYPE:(warn exit ignore)' \ - '(-r --report)'{-r,--report}'[Report transactions]:TYPE:' \ - '(-n --nocheck)'{-n,--nocheck}'[No check if MODE]:MODE:(never sleep standby idle)' \ - \ - '(-s --smart)'{-s,--smart}'[Enable/disable SMART on device]:VALUE:(on off)' \ - '(-o --offlineauto)'{-o,--offlineauto}'[Enable/disable automatic offline testing on device]:VALUE:(on off)' \ - '(-S --saveauto)'{-S,--saveauto}'[Enable/disable attribute autosave on device]:VALUE:(on off)' \ - \ - '(-H --health)'{-H,--health}'[Show device SMART health status]' \ - '(-c --capabilities)'{-c,--capabilities}'[Show device SMART capabilities]' \ - '(-A --attributes)'{-A,--attributes}'[Show device SMART vendor-specific attributes and values]' \ - '(-f --format)'{-f,--format}'[Set output format for attributes]:FORMAT:(old brief)' \ - '(-l --log)'{-l,--log}'[Show device log]:TYPE:(error selftest selective directory background sasphy sataphy scttemp scterc gplog smartlog xerror xselftest)' \ - '(-v --vendorattribute)'{-v,--vendorattribute}'[Set display option for vendor attribute]:N,OPTION:' \ - '(-F --firmwarebug)'{-F,--firmwarebug}'[Use firmware bug workaround]:TYPE:(none samsung samsung2 samsung3 swapid)' \ - '(-P --presets)'{-P,--presets}'[Drive-specific presets]:TYPE:(use ignore show showall)' \ - '(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \ - \ - '(-t --test)'{-t,--test}'[Run test]:TEST:(offline short long conveyance vendor select pending afterselect,on afterselect,off scttempint)' \ - '(-C --captive)'{-C,--captive}'[Do test in captive mode]' \ - '(-X --abort)'{-X,--abort}'[Abort any non-captive test on device]' \ - \ - '1:Device:_files' -} - -_smartd() { - local context state line expl - local -A opt_args - - _arguments -A "-*" \ - '(-h --help --usage)'{-h,--help,--usage}'[Show help message]' \ - '(-V --version --copyright --license)'{-v,--version,--copyright,--license}'[Print license, copyright, and version information and exit]' \ - \ - '(-A --attributelog)'{-A,--attributelog}'[Log ATA attribute information to {PREFIX}MODEL-SERIAL.ata.csv]:PREFIX:' \ - '(-B --drivedb)'{-B,--drivedb}'[Read and replace drive database from file]:FILE:_files' \ - '(-c --configfile)'{-c,--configfile}'[Read configuration file or stdin]:FILE:_files' \ - '(-d --debug)'{-d,--debug}'[Start smartd in debug mode]' \ - '(-D --showdirectives)'{-D,--showdirectives}'[Print the configuration file directives and exit]' \ - '(-i --interval)'{-i,--interval}'[Set interval between disk checks to N seconds, where N >= 10]:Seconds >= 10:' \ - '(-l --logfacility)'{-l,--logfacility}'[Use syslogfacility local0 - local7 or daemon]:FACILITY:(local0 local1 local2 local3 local4 local5 local6 local7)' \ - '(-n --no-fork)'{-n,--no-fork}'[Do not fork into background]' \ - '(-p --pidfile)'{-p,--pidfile}'[Write PID file]:FILE:_files' \ - '(-q --quit)'{-q,--quit}'[Quit on...]:WHEN:(nodev errors nodevstartup never onecheck showtests)' \ - '(-r --report)'{-r,--report}'[Report transactions for...]:TYPE:(ioctl ataioctl scsiioctl)' \ - '(-s --savestates)'{-s,--savestates}'[Save disk states to {PREFIX}MODEL-SERIAL.TYPE.state]:TYPE:' -} - -_smartmontools() { - local ret=1 - _call_function ret _$service - return ret -} - -_smartmontools "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_srm b/.zprezto/modules/completion/external/src/_srm deleted file mode 100644 index 08d2a32..0000000 --- a/.zprezto/modules/completion/external/src/_srm +++ /dev/null @@ -1,84 +0,0 @@ -#compdef srm -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for srm. -# -# It is based on the rm completion script from Zsh. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Sorin Ionescu -# -# ------------------------------------------------------------------------------ - -local -a opts args -args=( - '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]' - '(-r --interactive)'{-i,--interactive}'[prompt before any removal]' - '(-r -R --recursive)'{-r,-R,--recursive}'[remove the contents of directories recursively]' - '(-s --simple)'{-s,--simple}'[only overwrite with a single pass of random data]' - '(-v --verbose)'{-v,--verbose}'[explain what is being done]' - '(- *)--help[display help message and exit]' - '(- *)--version[output version information and exit]' - '*::files:->file' -) - -if _pick_variant gnu=gnu unix --help; then - args+=( - '(-x --one-file-system)'{-x,--one-file-system}'[stay within filesystems of files given as arguments]' - '(-P --openbsd)'{-P,--openbsd}'[overwrite the file 3 times (0xff, 0x00, 0xff)]' - '(-D --dod)'{-D,--dod}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]' - '(-E --doe)'{-E,--doe}'[overwrite the file with 3 US DoE compliant passes (random, random, DoE)]' - ) -else - args+=( - '(-m --medium)'{-m,--medium}'[overwrite the file with 7 US DoD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, random)]' - '(-z --zero)'{-z,--zero}'[after overwriting, zero blocks used by file]' - '(-n --nounlink)'{-n,--nounlink}'[overwrite file, but do not rename or unlink it]' - ) -fi - -local curcontext=$curcontext state line ret=1 -local -A opt_args - -_arguments -s -S -C $opts \ - $args && ret=0 - -case $state in - (file) - local -a ignored - ignored=() - ((CURRENT > 1)) && - ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - ((CURRENT < $#line)) && - ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - _files -F ignored && ret=0 - ;; -esac - -return $ret diff --git a/.zprezto/modules/completion/external/src/_stack b/.zprezto/modules/completion/external/src/_stack deleted file mode 100644 index b6d1abe..0000000 --- a/.zprezto/modules/completion/external/src/_stack +++ /dev/null @@ -1,95 +0,0 @@ -#compdef stack -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for stack (https://github.com/commercialhaskell/stack). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Toshiki Teramura -# -# ------------------------------------------------------------------------------ - -_stack () { - _arguments \ - --version'[display version information]' \ - --help'[display usage information]' \ - '--docker*''[run "stack --docker-help" for details]' \ - --verbosity'[verbosity: silent, error, warn, info, debug]' \ - {-v,--verbose}'[enable verbose mode: verbosity level "debug"]' \ - --system-ghc'[enable using the system installed GHC (on the PATH) if available and a matching version]' \ - --no-system-ghc'[disable using the system installed GHC (on the PATH) if available and a matching version]' \ - --install-ghc'[enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \ - --no-install-ghc'[disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \ - --arch'[system architecture, e.g. i386, x86_64]' \ - --os'[operating system, e.g. linux, windows]' \ - {-j,--jobs}'[number of concurrent jobs to run]' \ - --extra-include-dirs'[extra directories to check for C header files]' \ - --extra-lib-dirs'[extra directories to check for libraries]' \ - --skip-ghc-check'[enable skipping the GHC version and architecture check]' \ - --no-skip-ghc-check'[disable skipping the GHC version and architecture check]' \ - --skip-msys'[enable skipping the local MSYS installation (Windows only)]' \ - --no-skip-msys'[disable skipping the local MSYS installation (Windows only)]' \ - --resolver'[override resolver in project file]' \ - --no-terminal'[override terminal detection in the case of running in a false terminal]' \ - --stack-yaml'[override project stack.yaml file (overrides any STACK_YAML environment variable)]' \ - '*: :__stack_modes' -} - -__stack_modes () { - _values \ - 'subcommand' \ - 'build[build the project(s) in this directory/configuration]' \ - 'install[build executables and install to a user path]' \ - 'test[build and test the project(s) in this directory/configuration]' \ - 'bench[build and benchmark the project(s) in this directory/configuration]' \ - 'haddock[generate haddocks for the project(s) in this directory/configuration]' \ - 'new[create a brand new project]' \ - 'init[initialize a stack project based on one or more cabal packages]' \ - 'solver[use a dependency solver to try and determine missing extra-deps]' \ - 'setup[get the appropriate ghc for your project]' \ - 'path[print out handy path information]' \ - 'unpack[unpack one or more packages locally]' \ - 'update[update the package index]' \ - 'upgrade[upgrade to the latest stack (experimental)]' \ - 'upload[upload a package to Hackage]' \ - 'dot[visualize your projects dependency graph using Graphviz dot]' \ - 'exec[execute a command]' \ - 'ghc[run ghc]' \ - 'ghci[run ghci in the context of project(s)]' \ - 'ide[run ide-backend-client with the correct arguments]' \ - 'runghc[run runghc]' \ - 'clean[clean the local packages]' \ - 'docker[subcommands specific to Docker use]' - -} - -_stack "$@" diff --git a/.zprezto/modules/completion/external/src/_subl b/.zprezto/modules/completion/external/src/_subl deleted file mode 100644 index 9cb3471..0000000 --- a/.zprezto/modules/completion/external/src/_subl +++ /dev/null @@ -1,55 +0,0 @@ -#compdef subl -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Sublime Text (https://www.sublimetext.com/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Fabian Klötzl (https://github.com/kloetzl) -# -# ------------------------------------------------------------------------------ - - -local I="-h --help -v --version" -local -a args -args+=( - "(- *)"{-h,--help}'[display usage information]' - "(- *)"{-v,--version}'[display version information]' - "($I)--project[load the given project]:project" - "($I)--command[run the given command]:command" - "($I -n --new-window)"{-n,--new-window}'[open a new window]' - "($I -a --add)"{-a,--add}'[add folders to the current window]' - "($I -w --wait)"{-w,--wait}'[wait for the files to be closed before returning]' - "($I -b --background)"{-b,--background}"[don't activate the application]" -) -_arguments "$args[@]" '*:file:_files' - diff --git a/.zprezto/modules/completion/external/src/_subliminal b/.zprezto/modules/completion/external/src/_subliminal deleted file mode 100644 index 9534de8..0000000 --- a/.zprezto/modules/completion/external/src/_subliminal +++ /dev/null @@ -1,38 +0,0 @@ -#compdef subliminal -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Subliminal (https://github.com/Diaoul/subliminal). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '(- : *)'{-h,--help}'[show help message and exit]' \ - '(- : *)--version[show version number and exit]' \ - '*'{-l,--language}'[wanted language]: :_language_codes ISO-639-1' \ - '*'{-p,--plugin}'[plugin to use]:plugin name:((OpenSubtitles BierDopje TheSubDB SubsWiki Subtitulos))' \ - '(-m --multi)'{-m,--multi}'[download multiple subtitle languages]' \ - '(-f --force)'{-f,--force}'[replace existing subtitle file]' \ - '(-w --workers)'{-w,--workers}'[number of threads to use]:number' \ - '(-c --compatibility)'{-c,--compatibility}'[try not to use unicode]' \ - '(-q --quiet -v --verbose)'{-q,--quiet}'[disable output]' \ - '(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \ - '(--no-cache-dir)--cache-dir[cache directory to use]: :_files -/' \ - '(--cache-dir)--no-cache-dir[do not use cache directory]' \ - '*: :_files' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_supervisorctl b/.zprezto/modules/completion/external/src/_supervisorctl deleted file mode 100644 index b48ce13..0000000 --- a/.zprezto/modules/completion/external/src/_supervisorctl +++ /dev/null @@ -1,174 +0,0 @@ -#compdef supervisorctl -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for supervisorctl from Supervisord (http://supervisord.org) -# -# Sources: -# https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/supervisor -# https://github.com/zsh-users/zsh-completions/blob/master/src/_brew -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Matt Black (https://github.com/mafrosis) -# * dongweiming (https://github.com/dongweiming) -# -# ------------------------------------------------------------------------------ - - -_supervisorctl_list_procs() { - procs=(${(f)"$(_call_program supervisor_procs supervisorctl avail | awk '{print $1}')"}) -} -_supervisorctl_list_groups() { - groups=(${(f)"$(_call_program supervisor_procs supervisorctl avail | awk '$1 ~ /:/ { print substr($1,1,index($1,":")) }' | uniq)"}) -} - -_supervisorctl_list_procs_stopped() { - procs=(${(f)"$(_call_program supervisor_procs supervisorctl status | awk '/STOPPED/ {print $1}')"}) -} -_supervisorctl_list_groups_stopped() { - groups=(${(f)"$(_call_program supervisor_procs supervisorctl status | awk '$1$2 ~ /:(.*)STOPPED/ { print substr($1,1,index($1,":")) }' | uniq)"}) -} - -_supervisorctl_list_procs_running() { - procs=(${(f)"$(_call_program supervisor_procs supervisorctl status | awk '/RUNNING/ {print $1}')"}) -} -_supervisorctl_list_groups_running() { - groups=(${(f)"$(_call_program supervisor_procs supervisorctl status | awk '$1$2 ~ /:(.*)RUNNING/ { print substr($1,1,index($1,":")) }' | uniq)"}) -} - -local -a _1st_arguments -_1st_arguments=( - 'add:Activates any updates in config for process/group' - 'avail:Display all configured processes' - 'clear:Clear single/multiple/all process log files' - 'exit:Exit the supervisor shell' - 'fg:Connect to a process in foreground mode' - 'maintail:tail of supervisor main log file' - 'open:Connect to a remote supervisord process. (for UNIX domain socket, use unix:///socket/path)' - 'pid:Get the PID of process/supervisord' - 'quit:Exit the supervisor shell' - 'reload:Restart the remote supervisord' - 'remove:Removes process/group from active config' - "reread:Reload the daemon's configuration files" - 'restart:Restart process, group or all' - 'shutdown:Shut the remote supervisord down' - 'start:Start process, group or all' - 'status:Get process/group status info' - 'stop:Stop process, group or all' - 'tail:tail of process stdout' - 'update:Reload config and add/remove as necessary' - 'version:Show the version of the remote supervisord process' - 'help:Show help' -) - -local expl -local -a procs - -_arguments \ - {--configuration,-c}='[configuration file path (default /etc/supervisor.conf)]:filename:_files' \ - {--help,-h}'[print usage message and exit]:' \ - {--interactive,-i}'[start an interactive shell after executing commands]' \ - {--serverurl,-s}='[URL on which supervisord server is listening (default "http://localhost:9001")]' \ - {--username,-u}='[username to use for authentication with server]:username:_users' \ - {--password,-p}='[password to use for authentication with server]:password:' \ - {--history-file,-r}'[keep a readline history (if readline is available)]:filename:_files' \ - '*:: :->subcmds' && return 0 - -if (( CURRENT == 1 )); then - _describe -t commands 'supervisorctl subcommand' _1st_arguments - return -fi - -case "$words[1]" in - help) - tasks=(add avail clear exit fg maintail open pid quit reload remove \ - reread restart shutdown start status stop tail update version) - - _wanted tasks expl 'help' compadd $tasks ;; - - add|fg|remove) - # commands that only operate on processes - _supervisorctl_list_procs - _wanted procs expl 'process' compadd -a procs ;; - - clear|pid) - # commands that operate on processes and "all" - _supervisorctl_list_procs - procs+=('all') - _wanted procs expl 'process' compadd -a procs ;; - - status|update) - # commands that operate on processes, groups & "all" - _supervisorctl_list_procs - procs+=('all') - _wanted procs expl 'process' compadd -a procs - - _supervisorctl_list_groups - _wanted groups expl 'group' compadd -a groups ;; - - stop) - # commands that operate on RUNNING processes, groups & "all" - _supervisorctl_list_procs_running - procs+=('all') - _wanted procs expl 'process' compadd -a procs - - _supervisorctl_list_groups_running - _wanted groups expl 'group' compadd -a groups ;; - - restart|start) - # commands that operate on STOPPED processes, groups & "all" - _supervisorctl_list_procs_stopped - procs+=('all') - _wanted procs expl 'process' compadd -a procs - - _supervisorctl_list_groups_stopped - _wanted groups expl 'group' compadd -a groups ;; - - tail|maintail) - _arguments \ - '-f[Continuous tail of named process stdout]' \ - '-[last N *bytes* of process stdout]:number' \ - '1: :->forms' && return 0 - - if [[ $state == forms ]]; then - _supervisorctl_list_procs - _wanted procs expl 'processes' compadd -a procs - fi ;; -esac - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_svm b/.zprezto/modules/completion/external/src/_svm deleted file mode 100644 index d778f34..0000000 --- a/.zprezto/modules/completion/external/src/_svm +++ /dev/null @@ -1,169 +0,0 @@ -#compdef svm -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for svm (https://github.com/yuroyoro/svm) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Hideaki Miyake (https://github.com/mollifier) -# -# ------------------------------------------------------------------------------ - -local context curcontext="$curcontext" state line ret=1 -typeset -A opt_args - - -local -a _1st_arguments -_1st_arguments=( - 'help:show this usage information' - 'current:show the currently use scala version' - "list:show the scala version installed in svm_path(default is ${HOME}/.svm)" - "versions:show the available scala version not installed" - 'install:install specific scala version' - 'remove:uninstall specific scala version and remove their sources' - 'switch:setup to use a specific scala version' - 'update-latest:install or update nightly build scala version' - 'latest:setup to use nightly build scala version' - 'stable:setup to use stable(x.x.x.final) scala version' -) - -_arguments -C \ - '(-)-h[show this usage information]' \ - '-c[show the currently use scala version]' \ - "-l[show the scala version installed in svm_path(default is ${HOME}/.svm)]" \ - '-v[show the abalabe scala version not installed]' \ - '-i[install specific scala version]: :_svm_completion_not_installed_scala_versions' \ - '-r[uninstall specific scala version and remove their sources]: :_svm_completion_installed_scala_versions' \ - '(-s -u)'{-s,-u}'[setup to use a specific scala version]: :_svm_completion_not_selected_scala_versions' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - - -# installed scala versions -(( $+functions[_svm_completion_installed_scala_versions] )) || -_svm_completion_installed_scala_versions() { - local -a _installed_versions - _current_version="${$(_call_program installed svm current)#currently version is[[:space:]]*}" - - # collect lines starts with digit - _installed_versions=( ${(M)${(@f)"$(_call_program installed svm list)"}:#[[:digit:]]*} ) - - _describe -t installed "installed versions" _installed_versions -} - -# installed and not selected scala versions -(( $+functions[_svm_completion_not_selected_scala_versions] )) || -_svm_completion_not_selected_scala_versions() { - local _current_version - local -a _not_selected_versions - - _current_version="${$(_call_program installed svm current)#currently version is[[:space:]]*}" - - # collect lines starts with digit - _not_selected_versions=( ${(M)${(@f)"$(_call_program installed svm list)"}:#[[:digit:]]*} ) - - # remove current version - _not_selected_versions=( ${_not_selected_versions:#$_current_version}) - _describe -t installed "not selected versions" _not_selected_versions -} - -# not installed scala versions -(( $+functions[_svm_completion_not_installed_scala_versions] )) || -_svm_completion_not_installed_scala_versions() { - local -a _not_installed_versions - # collect lines starts with digit - _not_installed_versions=( ${(M)${(@f)"$(_call_program installed svm versions)"}:#[[:digit:]]*} ) - - _describe -t notinstalled "not installed versions" _not_installed_versions -} - - -case $state in - cmds) - # action - case $PREFIX in - u*) - # complete command synonyms - local -a _synonym_arguments - _synonym_arguments=( - 'uninstall:uninstall specific scala version and remove their sources' - 'use:setup to use a specific scala version' - 'update-latest:install or update nightly build scala version' - ) - _describe -t actions 'svm actions' _synonym_arguments && ret=0 - ;; - - *) - _describe -t actions 'svm actions' _1st_arguments - _svm_completion_not_selected_scala_versions && ret=0 - ;; - esac - ;; # end action - - args) - # scala version number - case $words[1] in - install) - # install not installed version - _arguments \ - '1: :_svm_completion_not_installed_scala_versions' \ - '--docs[with install, update-latest download scala-devel-docs.]' \ - '--sources[with install, update-latest download scala-sources.]' && ret=0 - ;; - - remove|uninstall) - # remove installed version - _arguments \ - '1: :_svm_completion_installed_scala_versions' && ret=0 - ;; - - switch|use) - # use installed version - _arguments \ - '1: :_svm_completion_not_selected_scala_versions' && ret=0 - ;; - - esac - - ;; # end args -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et - diff --git a/.zprezto/modules/completion/external/src/_tarsnap b/.zprezto/modules/completion/external/src/_tarsnap deleted file mode 100644 index 17f47f1..0000000 --- a/.zprezto/modules/completion/external/src/_tarsnap +++ /dev/null @@ -1,64 +0,0 @@ -#compdef tarsnap -# ------------------------------------------------------------------------------ -# Copyright (c) 2014-2017 Daniel Teunis - https://github.com/danteu -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for tarsnap 1.0.39 (http://tarsnap.com). -# -# ------------------------------------------------------------------------------ -# Author -# ------- -# -# * Daniel Teunis -# -# ------------------------------------------------------------------------------ - -_arguments \ - '(- 1 *)--help[prints tarsnap help]' \ - '(- 1 *)--version[prints tarsnap version number]' \ - '(- 1 *)--verify-config[checks configuration files for syntactic errors]' \ - '--fsck[performs integrity checks on the stored archives]' \ - '--fsck-prune[performs integrity checks and prunes broken data]' \ - '--list-archives[prints names of stored archives]' \ - '--nuke[deletes all stored archives]' \ - '--print-stats[prints archive statistics]' \ - '--recover[recovers partial archive]' \ - '-c[creates archive]' \ - '-d[deletes specified archive]' \ - '-r[prints content of specified archive]' \ - '-t[lists archive content]' \ - '-x[extracts specified archive]' \ - '--lowmem[reduces memory usage by not caching small files]' \ - '--quiet[silences some warnings]' \ - '--keyfile[specifies keyfile]:keyfile:->file' \ - '--cachedir[specifies cache directory]:cachedir:->directory' \ - '-f[specifies archive name]:archivename:->file' - -case "$state" in - file) - _files - ;; - directory) - _path_files -/ - ;; -esac diff --git a/.zprezto/modules/completion/external/src/_teamocil b/.zprezto/modules/completion/external/src/_teamocil deleted file mode 100644 index 30e1c2a..0000000 --- a/.zprezto/modules/completion/external/src/_teamocil +++ /dev/null @@ -1,47 +0,0 @@ -#compdef teamocil -# ------------------------------------------------------------------------------ -# Copyright (c) 2014 Github zsh-users - https://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Teamocil 0.4.5 (https://github.com/remiprev/teamocil). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Petr Zelenin -# -# ------------------------------------------------------------------------------ - -_arguments \ - '--here[set up the first window in the current window]' \ - '--edit[edit the YAML layout file instead of using it]' \ - '--layout [use a specific layout file, instead of \`~/.teamocil/.yml\`]' \ - '--list[list all available layouts in \`~/.teamocil/\`]' \ - '--show[show the content of the layout file instead of executing it]' \ - '*:teamocil layouts:_files -W ~/.teamocil -g "*.yml(:r)"' diff --git a/.zprezto/modules/completion/external/src/_thor b/.zprezto/modules/completion/external/src/_thor deleted file mode 100644 index 081de1f..0000000 --- a/.zprezto/modules/completion/external/src/_thor +++ /dev/null @@ -1,49 +0,0 @@ -#compdef thor -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for thor (https://github.com/wycats/thor). -# -# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/thor -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Andrew Hodges (https://github.com/betawaffle) -# -# ------------------------------------------------------------------------------ - - -# FIXME This should be rewritten using up-to-date ZSH completion API. -compadd `thor list | grep thor | cut -d " " -f 2` - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_tmuxinator b/.zprezto/modules/completion/external/src/_tmuxinator deleted file mode 100644 index 9fff48e..0000000 --- a/.zprezto/modules/completion/external/src/_tmuxinator +++ /dev/null @@ -1,65 +0,0 @@ -#compdef tmuxinator mux -# ------------------------------------------------------------------------------ -# Copyright (c) 2010-2016 Christopher Chow -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# ------------------------------------------------------------------------------ -# -# Description -# ----------- -# -# Completion script for tmuxinator (https://github.com/tmuxinator/tmuxinator) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Christopher Chow (https://github.com/Soliah) -# -# ------------------------------------------------------------------------------ - -_tmuxinator() { - local commands projects - commands=(${(f)"$(tmuxinator commands zsh)"}) - projects=(${(f)"$(tmuxinator completions start)"}) - - if (( CURRENT == 2 )); then - _describe -t commands "tmuxinator subcommands" commands - _describe -t projects "tmuxinator projects" projects - elif (( CURRENT == 3)); then - case $words[2] in - copy|debug|delete|open|start) - _arguments '*:projects:($projects)' - ;; - esac - fi - - return -} - -_tmuxinator - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_tmuxp b/.zprezto/modules/completion/external/src/_tmuxp deleted file mode 100644 index f42bbb2..0000000 --- a/.zprezto/modules/completion/external/src/_tmuxp +++ /dev/null @@ -1,133 +0,0 @@ -#compdef tmuxp - -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for tmuxp (https://tmuxp.git-pull.com/en/latest/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bez Hermoso -# -# ------------------------------------------------------------------------------ - -_tmuxp() { - - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ":command:->command" \ - "*::options:->options" \ - "--log_level:log level:(DEBUG INFO WARNING ERROR CRITICAL)" \ - "--help[display usage information]" - - case $state in - (command) - local -a subcommands - subcommands=( - 'convert:Convert a tmuxp config between JSON and YAML.' - 'freeze:Snapshot a session into a config.' - 'import:Import a teamocil/tmuxinator config.' - 'load:Load tmuxp workspaces.' - ) - _describe -t commands 'commands' subcommands - ;; - (options) - case $line[1] in - (load) - __tmuxp_load - ;; - (import) - __tmuxp_import - ;; - (freeze) - local sessions="$(__tmux_sessions)" - _arguments -C \ - "1::session name:compadd $sessions" - ;; - (convert) - _arguments -C \ - '1:: :_files -g "*.(json|yaml|yml)"' - ;; - esac - esac - -} - -__tmuxp_load() { - local state line - typeset -A opt_args - _arguments -C \ - '*:sessions:->sessions' \ - '--yes:yes' \ - '-d[Load the session without attaching it]' \ - '-2[Force tmux to assume the terminal supports 256 colors]' \ - '-8[Like -2, but indicates that the terminal supports 88 colors]' - - # Cant get the options to be recognized when there are sessions that has - # a dash. - - case $state in - (sessions) - local s - _alternative \ - 'sessions-user:user session:compadd -F line - ~/.tmuxp/*.(json|yml|yaml)(:r:t)' \ - 'sessions-other:session in current directory:_path_files -g "**/*.(json|yaml|yml)(-.)"' - ;; - esac -} - -__tmuxp_import() { - local state line - typeset -A opt_args - _arguments -C \ - '1::program:(tmuxinator teamocil)' \ - '2::project:->project' - - case $state in - (project) - if [[ $line[1] == 'tmuxinator' ]] - then - _wanted tmuxinator-projects exp 'tmuxinator projects' compadd $(tmuxinator completions start) - fi - ;; - esac -} - -__tmux_sessions () { - local tmux_sessions - tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"')) - echo $tmux_sessions -} - -_tmuxp "$@" - diff --git a/.zprezto/modules/completion/external/src/_tox b/.zprezto/modules/completion/external/src/_tox deleted file mode 100644 index efd0549..0000000 --- a/.zprezto/modules/completion/external/src/_tox +++ /dev/null @@ -1,61 +0,0 @@ -#compdef tox -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for tox (https://tox.readthedocs.io). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -(( $+functions[_tox_envs_list] )) || -_tox_envs_list() { - local envs; envs=($(_call_program envs $service --listenvs-all)) - if [ ${#envs} -gt 0 ]; then - _values -s , 'tox environments' "${envs[@]}" - else - _message 'tox environments (none found)' - fi -} - -_arguments \ - '(- 1 *)--version[show version and exit]' \ - '(- 1 *)'{-h,--help}'[show help options]' \ - '(- 1 *)'{--hi,--help-ini}'[show help about ini-names]' \ - '*-v[increase verbosity of reporting output]' \ - '*-q[progressively silence reporting output]' \ - '(- 1 *)--showconfig[show configuration information for all environments]' \ - '(- 1 *)'{-l,--listenvs}'[show list of test environments]' \ - '(- 1 *)'{-a,--listenvs-all}'[show list of all defined environments]' \ - '-c[config file name or directory with "tox.ini" file]:config path:_files -g "*.ini"' \ - '-e[work against specified environments]: :_tox_envs_list' \ - '--notest[skip invoking test commands]' \ - '--sdistonly[only perform the sdist packaging activity]' \ - '--parallel--safe-build[ensure two tox builds can run in parallel]' \ - '--installpkg[ensure two tox builds can run in parallel]:package path:_files -/' \ - '--develop[install package in the venv using "setup.py develop"]' \ - '(-i --index-url)'{-i,--index-url}'[set indexserver url]:index server URL:_urls' \ - '--pre[install pre-releases and development versions of dependencies]' \ - '(-r --recreate)'{-r,--recreate}'[force recreation of virtual environments]' \ - '--result-json[write a json file with detailed information about all commands and results involved]:JSON file path:_files -g "*.json"' \ - '--hashseed[set PYTHONHASHSEED to SEED before running commands]:seed' \ - '*--force-dep[forces a certain version of one of the dependencies when configuring the virtual environment]:pip requirement' \ - '--sitepackages[override sitepackages setting to True in all envs]' \ - '--alwayscopy[override alwayscopy setting to True in all envs]' \ - '--skip-missing-interpreters[do not fail tests for missing interpreters]: :(config true false)' \ - '--workdir[tox working directory]: :_files -/' \ - '*: :_guard "^-*" command positional substitution arguments' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_trash-empty b/.zprezto/modules/completion/external/src/_trash-empty deleted file mode 100644 index b25ce93..0000000 --- a/.zprezto/modules/completion/external/src/_trash-empty +++ /dev/null @@ -1,59 +0,0 @@ -#compdef trash-empty -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for trash-empty a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_trash-empty() { - - _arguments -C \ - '--version[Show programs version number and exit]' \ - {-h,--help}'[Show help message and exit]' \ - '*: :' \ - -} - -_trash-empty - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_trash-list b/.zprezto/modules/completion/external/src/_trash-list deleted file mode 100644 index c1b1004..0000000 --- a/.zprezto/modules/completion/external/src/_trash-list +++ /dev/null @@ -1,53 +0,0 @@ -#compdef trash-list -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for trash-list a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_arguments \ - '--version[show programs version number and exit]' \ - {-h,--help}'[show help message and exit]' \ - '*: :' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_trash-put b/.zprezto/modules/completion/external/src/_trash-put deleted file mode 100644 index 770158e..0000000 --- a/.zprezto/modules/completion/external/src/_trash-put +++ /dev/null @@ -1,58 +0,0 @@ -#compdef trash-put trash -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for trash-put a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_arguments -C \ - '--version[display version information]' \ - {-h,--help}'[display usage information]' \ - {-d,--directory}'[remove empty directories - ignored (for GNU rm compatibility)]' \ - {-f,--force}'[ignore nonexistent arguments and never prompt - ignored (for GNU rm compatibility)]' \ - {-i,--interactive}'[prompt before every removal - ignored (for GNU rm compabilty)]' \ - {-r,-R,--recursive}'[remove directories and their content recursively - ignored (for GNU rm compatibility)]' \ - {-v,--verbose}'[explain what is being done]' \ - '*: :_files' - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_trash-restore b/.zprezto/modules/completion/external/src/_trash-restore deleted file mode 100644 index 35e313a..0000000 --- a/.zprezto/modules/completion/external/src/_trash-restore +++ /dev/null @@ -1,58 +0,0 @@ -#compdef trash-restore -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for trash-restore a tool from trash management package trash-cli (http://code.google.com/p/trash-cli). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_trash-restore() { - - _arguments -C \ - '--version[Show programs version number and exit]' \ - '*: :' \ - -} - -_trash-restore - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_udisksctl b/.zprezto/modules/completion/external/src/_udisksctl deleted file mode 100644 index 48cc9e5..0000000 --- a/.zprezto/modules/completion/external/src/_udisksctl +++ /dev/null @@ -1,164 +0,0 @@ -#compdef udisksctl -# -# ------------------------------------------------------------------------------ -# The MIT License -# -# Copyright 2014 Damir Jelić -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for udisksctl -# (https://cgit.freedesktop.org/udisks/tree/tools) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Damir Jelić [1] -# * Ole Jørgen Brønner (minor additions) -# -# [1] https://lists.freedesktop.org/archives/devkit-devel/2014-February/001554.html -# -# ------------------------------------------------------------------------------ -# Notes -# ----- -# -# udisksctl actually provide built-in support for completion: It accepts an -# special command 'complete' that returns completeions. That is what drives the -# upstream bash completion. In the future one might condsider rewriting using -# that. (but not sure how straight forward it would be to provide descriptions?) -# - -_paths() { - local -a _path_list - - for _path in $(_call_program paths "udisksctl complete \"udisksctl $words\" $CURSOR"); do - _path_list+=$_path - done - - _describe 'path' _path_list -} - -_filesystems() { - _fs_types=( - 'adfs' 'affs' 'autofs' 'cifs' 'coda' 'coherent' 'cramfs' 'debugfs' 'devpts' - 'efs' 'ext' 'ext2' 'ext3' 'ext4' 'hfs' 'hfsplus' 'hpfs' 'iso9660' 'jfs' 'minix' - 'msdos' 'ncpfs' 'nfs' 'nfs4' 'ntfs' 'proc' 'qnx4' 'ramfs' 'reiserfs' 'romfs' - 'squashfs' 'smbfs' 'sysv' 'tmpfs' 'ubifs' 'udf' 'ufs' 'umsdos' 'usbfs' 'vfat' - 'xenix' 'xfs' 'xiafs' - ) - - _describe 'file system type' _fs_types -} - -_udisksctl() { - typeset -A opt_args - local curcontext="$curcontext" state line ret=1 - - _arguments -C \ - '1:udisksctl commands:->cmds' \ - '*:: :->cmd_args' && ret=0 - - case $state in - cmds) - local commands; commands=( - 'help:show help' - 'info:show info about an object' - 'dump:show info about all object' - 'status:shows high-level status' - 'monitor:monitor changes to objects' - 'mount:mount a filesystem' - 'unmount:unmount a filesystem' - 'unlock:unlock an encrypted device' - 'lock:lock an encrypted device' - 'loop-setup:set-up a loop device' - 'loop-delete:delete a loop device' - 'power-off:safely power off a drive' - 'smart-simulate:set SMART data for a drive' - ) - _describe -t commands 'udisksctl command' commands && ret=0 - ;; - - cmd_args) - case $words[1] in - info) - _arguments \ - {-p,--object-path}'[specify object to get information about]:object path:_paths' \ - {-b,--block-device}'[specify block device to get information about]:block device:_paths' \ - {-d,--drive}'[specify drive to get information about]:drive:_paths' && ret=0 - ;; - mount) - _arguments \ - {-p,--object-path}'[specify object to mount]:object path:_paths' \ - {-b,--block-device}'[specify block device to mount]:block device:_paths' \ - {-t,--filesystem-type}'[specify filesystem type to use]:fs type:_filesystems' \ - {-o,--options}'[mount options]' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - unmount) - _arguments \ - {-p,--object-path}'[object to unmount]:object path:_paths' \ - {-b,--block-device}'[block device to unmount]:block device:_paths' \ - {-f,--force}'[force/lazy unmount]' \ - "(--no-user-interaction)--no-user-interaction[don't auhenticate the user if needed]" && ret=0 - ;; - unlock|lock) - _arguments \ - {-p,--object-path}'[object to lock/unlock]:object path:_paths' \ - {-b,--block-device}'[block device to lock/unlock]:block device:_paths' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - loop-setup) - _arguments \ - {-f,--file}'[specify file to set-up a loop device for]:files:_files' \ - {-r,--read-only}'[setup read-only device]' \ - {-o,--offset}'[start at specified offset into file]:offset (bytes)' \ - {-s,--size}'[limit size]:limit (bytes)' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - loop-delete) - _arguments \ - {-p,--object-path}'[object for loop device to delete]:object path:_paths' \ - {-b,--block-device}'[loop device to delete]:block device:_paths' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - power-off) - _arguments \ - {-p,--object-path}'[object path for ATA device]:object path:_paths' \ - {-b,--block-device}'[device file for ATA devic]:block device:_paths' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - smart-simulate) - _arguments \ - {-f,--file}'[file with libatasmart blob]:files:_files' \ - {-p,--object-path}'[object to get information about]:object path:_paths' \ - {-b,--block-device}'[block device to get information about]:block device:_paths' \ - "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0 - ;; - esac - ;; - esac - return ret -} - -_udisksctl "$@" diff --git a/.zprezto/modules/completion/external/src/_ufw b/.zprezto/modules/completion/external/src/_ufw deleted file mode 100644 index 010a3fa..0000000 --- a/.zprezto/modules/completion/external/src/_ufw +++ /dev/null @@ -1,144 +0,0 @@ -#compdef ufw -# ------------------------------------------------------------------------------ -# Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for The Uncomplicated Firewall (ufw). (https://launchpad.net/ufw). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jindřich Pilař (https://github.com/JindrichPilar) -# -# ------------------------------------------------------------------------------ - - -_ufw_logging() { - - local params additional second - second=$words[2] - - if [ ! -z $second ]; then - return - fi - - params=( - "on" - "off" - ) - - additional=( - "low" - "medium" - "high" - "full" - ) - - _describe -t params 'on/off' params - _describe -t additional 'level' additional -} - - -_ufw_delete() { - local rules complrules second - - second=$words[2] - - if [ ! -z $second ]; then - return - fi - - complrules=() - rules=("${(f)$(ufw status | tr -s ' ' | tail -n +5 | tr -s '\n')}") - - for ((i=1; i<=${#rules[@]}; i++)); do - complrules+=("$i:$rules[i]"); - done - - _describe -t complrules 'Rules' complrules -} - -_ufw() { - local curcontext="$curcontext" ret=1 - local -a state line commands - - commands=( - "enable:enable the firewall" - "disable:disable the firewall" - "default:set default policy" - "logging:set logging level" - "allow:add allow rule" - "deny:add deny rule" - "reject:add reject rule" - "limit:add limit rule" - "delete:delete rule" - "insert:insert rule at position" - "route:add route rule" - "reload:reload firewall" - "reset:reset firewall" - "status:show firewall status" - "show:show firewall report" - "version:display version information" - ) - - _arguments -C -s -S -n \ - '(- 1 *)'--version"[display version information]: :->full" \ - '(- 1 *)'{-h,--help}'[display usage information]: :->full' \ - '(- 1 *)'--dry-run"[don't modify anything, just show the changes]: :->cmds" \ - '1:cmd:->cmds' \ - '*:: :->args' && ret=0 - - case "$state" in - (cmds) - _describe -t commands 'commands' commands - ;; - (args) - local cmd - cmd=$words[1] - case "$cmd" in - (logging) - _ufw_logging && ret=0 - ;; - (delete) - _ufw_delete && ret=0 - ;; - (*) - _default && ret=0 - ;; - esac - ;; - (*) - ;; - esac - - return ret -} - -_ufw - diff --git a/.zprezto/modules/completion/external/src/_vagrant b/.zprezto/modules/completion/external/src/_vagrant deleted file mode 100644 index 79d56fb..0000000 --- a/.zprezto/modules/completion/external/src/_vagrant +++ /dev/null @@ -1,260 +0,0 @@ -#compdef vagrant -# ------------------------------------------------------------------------------ -# Copyright (c) 2009-2015 Robby Russell and contributors (see -# https://github.com/robbyrussell/oh-my-zsh/contributors) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Vagrant (http://vagrantup.com). -# -# Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/vagrant -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Nikita Fedyashev (https://github.com/nfedyashev) -# * Mark Cornick (https://github.com/markcornick) -# -# ------------------------------------------------------------------------------ - -# vagrant zsh completion - -local -a _1st_arguments -_1st_arguments=( - 'box:Box commands' - 'connect:Connects to a shared, remote Vagrant environment' - 'destroy:Destroys the vagrant environment' - 'docker-logs:Shows Docker logs' - 'docker-run:Run one-off commands against a Docker container' - 'global-status:Reports the status of all active Vagrant environments on the system' - 'halt:Halts the currently running vagrant environment' - 'help:[TASK] Describe available tasks or one specific task' - 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' - 'list-commands:Outputs all available Vagrant subcommands' - 'login:Authenticates against a Vagrant Cloud server to access protected boxes' - 'package:Packages a vagrant environment for distribution' - 'plugin:Manage plugins' - 'provision:Run the provisioner' - 'push:Deploys code in this environment to a configured destination' - 'rdp:Connects to machine via RDP' - 'reload:Reload the vagrant environment' - 'resume:Resumes a suspend vagrant environment' - 'rsync:Syncs rsync synced folders to remote machine' - 'rsync-auto:Syncs rsync synced folders automatically when files change' - 'share:Shares the Vagrant environment and allows remote access' - 'ssh:SSH into the currently running environment' - 'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh' - 'status:Shows the status of the current Vagrant environment' - 'suspend:Suspends the currently running vagrant environment' - 'up:Creates the vagrant environment' - 'version:Prints the currently installed Vagrant version and checks for new updates' - '--version:Prints the Vagrant version information' -) - -local -a _box_arguments -_box_arguments=( - 'add:NAME URI Add a box to the system' - 'help:COMMAND Describe subcommands or one specific subcommand' - 'list:Lists all installed boxes' - 'outdated:Checks if there is a new version available for the box' - 'remove:NAME Remove a box from the system' - 'repackage:NAME Repackage an installed box into a `.box` file.' - 'update:Updates the box, if there any updates available' -) - -local -a _plugin_arguments -_plugin_arguments=( - 'install:NAME Install a plugin to the system' - 'license:NAME LICENSE_FILE Add a license for an installed plugin' - 'list:Lists all installed plugins' - 'uninstall:NAME Uninstall a plugin from the system' - 'update:[NAMES...] Update all or specified plugins' -) - -__task_list () -{ - local expl - declare -a tasks - - tasks=(box destroy global-status halt init package plugin provision \ - reload resume ssh ssh_config status suspend up version) - - _wanted tasks expl 'help' compadd $tasks -} - -__box_list () -{ - _wanted application expl 'command' compadd $(command vagrant box list | \ - awk '{print $1}' | \ - sed -e 's/ /\\ /g') -} - -__plugin_list () -{ - _wanted application expl 'command' compadd $(command vagrant plugin list \ - 2>/dev/null| cut -d' ' -f1) -} - -_vagrant_caching_policy() -{ - local reg_time comp_time check_file - - case "${1##*/}" in - VAGRANT_VMS) - if [[ -z $VAGRANT_CWD ]]; then - check_file=./Vagrantfile - else - check_file=$VAGRANT_CWD/Vagrantfile - fi - ;; - *) - echo "unknown type: $1" - return -1 - ;; - esac - - case $(uname -s) in - Darwin) STATCMD="stat -f '%c'" ;; - *) STATCMD="stat -c '%Z'" ;; - esac - reg_time=${$(${(z)STATCMD} $check_file):Q} - comp_time=${$(${(z)STATCMD} $1):Q} - - return $(( reg_time < comp_time )) -} - -__vm_list () -{ - local cache_policy - zstyle -s ":completion:${curcontext}:" cache-policy cache_policy - zstyle ":completion:${curcontext}:" cache-policy \ - ${cache_policy:-_vagrant_caching_policy} - - # Cache the list of VMs available - if ( [[ ${+_vagrant_vms} -eq 0 ]] || _cache_invalid VAGRANT_VMS ) && - ! _retrieve_cache VAGRANT_VMS; - then - _vagrant_vms=( $(_call_program path-all "vagrant status | \ - awk '{print \$1}' | \ - egrep -v '^$|^(Current|This|above|VM,)$'" ) ) - _store_cache VAGRANT_VMS _vagrant_vms - fi - - _wanted application expl 'command' compadd $_vagrant_vms -} - -__vagrant-box () -{ - local curcontext="$curcontext" state line - typeset -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "gem subcommand" _box_arguments - return - ;; - - (options) - case $line[1] in - (repackage|remove) - _arguments ':feature:__box_list' - ;; - esac - ;; - esac -} - -__vagrant-plugin () -{ - local curcontext="$curcontext" state line - local -A opt_args - - _arguments -C \ - ':command:->command' \ - '*::options:->options' - - case $state in - (command) - _describe -t commands "gem subcommand" _plugin_arguments - return - ;; - - (options) - case $line[1] in - (license) - _arguments ':feature:__plugin_list' '*:file:_files' - ;; - (uninstall) - _arguments ':feature:__plugin_list' - ;; - esac - ;; - esac -} - -local expl -local -a boxes installed_boxes - -local curcontext="$curcontext" state line -local -A opt_args - -_arguments -C \ - ':command:->command' \ - '*::options:->options' - -case $state in - (command) - _describe -t commands "gem subcommand" _1st_arguments - return - ;; - - (options) - case $line[1] in - (help) - _arguments ':feature:__task_list' - ;; - - (box) - __vagrant-box - ;; - - (plugin) - __vagrant-plugin - ;; - (up|provision|package|destroy|reload|ssh|halt|resume|status|suspend) - _arguments ':feature:__vm_list' - esac - ;; -esac - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_virtualbox b/.zprezto/modules/completion/external/src/_virtualbox deleted file mode 100644 index 49869cf..0000000 --- a/.zprezto/modules/completion/external/src/_virtualbox +++ /dev/null @@ -1,305 +0,0 @@ -#compdef VBoxManage=vboxmanage VBoxHeadless=vboxheadless -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for VirtualBox (http://www.virtualbox.org). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -_vboxmachines() { - VBoxManage list vms | egrep -o '^"[^"]+"' 2>/dev/null | sed -e 's|"||g' | while read machine; do - _wanted 'machine' expl 'machine' compadd $machine - done -} - -# Roughly guess command options -_vboxcommandoptions() { - cmd="$1" - cmdoutput=$(VBoxManage "$cmd" 2>/dev/null | tail -n +2 | grep -v 'Syntax error:' | grep -v '|' | sed 's|<[^>]\+>||g' | sed 's|VBoxManage [^ ]\+ | |') - - optcount=0 - option="" - optlines=() - echo "$cmdoutput" | egrep -o ' [\[A-Za-z0-9\-\<].*' | while read line; do - option="${option}${line}" - if [[ $line[-1] != '|' ]]; then - optcount=$(($optcount+1)) - optlines[$optcount]="$option" - option="" - fi - done - - # optionals ([abc]) - for line in $optlines; do - echo "$line" | egrep -o '\[[^]]+\]' | while read option; do - option=$(echo $option | sed 's|[]\[]||g' | cut -d ' ' -f 1) - _options=(${(s:|:)option}) - for option in $_options; do - _wanted "${cmd}_option" expl "${cmd} option" compadd -- $option - done - done - done - - # mandatory - for line in $optlines; do - echo "$line" | sed 's|\[[^]]\+\]|\n|g' | while read option; do - if [[ "$option" != "" ]]; then - _option=$(echo $option | cut -d ' ' -f 1) - _options=(${(s:|:)option}) - for option in $_options; do - _wanted "${cmd}_option" expl "${cmd} option" compadd -- $option - done - fi - done - done -} - -# List possible mediums -_vboxmediums() { - _wanted "mediums" expl "mediums" compadd -- "none" - _wanted "mediums" expl "mediums" compadd -- "emptydrive" - _wanted "mediums" expl "mediums" compadd -- "iscsi" - - _files -g '*.{iso,vmdk,vdi}' - - for CD in /dev/cd/*; do - readlink -f $CD - done | uniq | while read CD; do - _wanted "host drives" expl "host drives" compadd -- "host:$CD" - done -} - -# List available os types -_vboxostypes() { - VBoxManage list ostypes | grep '^ID' | awk '{print $2}' | while read OSTYPE; do - _wanted 'ostype' expl 'os type' compadd -- $OSTYPE - done -} - -# Guess options for this commands -_vboxopts_controlvm() { _vboxcommandoptions controlvm } -_vboxopts_modifyvm() { _vboxcommandoptions modifyvm } -_vboxopts_export() { _vboxcommandoptions export } - -_vboxmanage() { - local -a _1st_arguments - _1st_arguments=( - "list:gives information about VirtualBox's current settings" - 'showvminfo:shows information about a particular virtual machine' - 'registervm:import a virtual machine definition in an XML file into VirtualBox' - 'unregistervm:unregisters a virtual machine' - 'createvm:creates a new XML virtual machine definition file' - 'modifyvm:changes the properties of a registered virtual machine which is not running' - 'import:imports a virtual appliance in OVF format by copying the virtual disk images and creating virtual machines in VirtualBox' - 'export:exports one or more virtual machines from VirtualBox into a virtual appliance in OVF format' - 'startvm:starts a virtual machine that is currently in the "Powered off" or "Saved" states' - 'controlvm:change the state of a virtual machine that is currently running' - 'discardstate:discards the saved state of a virtual machine which is not currently running' - 'adoptstate:adopt a saved state file (.sav)' - 'snapshot:control snapshots' - 'closemedium:removes a hard disk, DVD or floppy image from a VirtualBox media registry' - 'storageattach:attaches/modifies/removes a storage medium connected to a storage controller' - 'storagectl:attaches/modifies/removes a storage controller' - 'bandwidthctl:creates/deletes/modifies bandwidth groups' - 'showhdinfo:shows information about a virtual hard disk image' - 'createhd:creates a new virtual hard disk image' - 'modifyhd:change the characteristics of a disk image after it has been created' - 'clonehd:duplicates a registered virtual hard disk image to a new image file with a new unique identifier' - 'convertfromraw:converts a raw disk image to a VirtualBox Disk Image (VDI) file' - 'getextradata:retrieve string data to a virtual machine or to a VirtualBox configuration' - 'setextradata:attach string data to a virtual machine or to a VirtualBox configuration' - 'setproperty:change global settings which affect the entire VirtualBox installation' - 'usbfilter:used for working with USB filters in virtual machines, or global filters' - 'sharedfolder:share folders on the host computer with guest operating systems' - 'guestproperty:get or set properties of a running virtual machine' - 'guestcontrol:control certain things inside a guest from the host' - 'debugvm:for experts who want to tinker with the exact details of virtual machine execution' - 'metrics:monitor the usage of system resources' - 'hostonlyif:change the IP configuration of a host-only network interface' - 'dhcpserver:control the DHCP server that is built into VirtualBox' - 'extpack:add or remove VirtualBox extension packs' - ) - - local context state line expl - local -A opt_args - - _arguments '*:: :->subcmds' && return 0 - - if (( CURRENT == 1 )); then - _describe -t commands "VBoxManage commands" _1st_arguments -V1 - return - fi - - case "$words[1]" in - list) - _arguments \ - '--long' \ - ':list option:(vms runningvms ostypes hostdvds hostfloppies bridgedifs hostonlyifs dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks)' - ;; - showvminfo) - _arguments \ - :machine:_vboxmachines \ - '--details' \ - '--machinereadable' \ - '--log: :' - ;; - unregistervm) - _arguments \ - :machine:_vboxmachines \ - '--delete' - ;; - createvm) - _arguments \ - '--name: :' \ - '--ostype:os type:_vboxostypes' \ - '--register' \ - '--basefolder:folder:_files -/' \ - '--settingsfile:file:_files' \ - '--uuid: :' - ;; - modifyvm) - _arguments \ - :machine:_vboxmachines \ - :modifyvm_option:_vboxopts_modifyvm - ;; - modifyhd) - _arguments \ - :filename:_files \ - '--type:hd type:(normal writethrough immutable shareable readonly multiattach)' \ - '--autoreset:on off:(on off)' \ - '--property: :' \ - '--compact' \ - '--resize:megabytes:' \ - '--resizebyte:bytes:' - ;; - import) - _arguments \ - ':ovf file:_files -g \*.{ovf,ova}' \ - '--dry-run' - ;; - export) - _arguments \ - :machine:_vboxmachines \ - :export_option:_vboxopts_export - ;; - startvm) - _arguments \ - :machine:_vboxmachines \ - '--type:running mode:(gui sdl headless)' - ;; - controlvm) - _arguments \ - :machine:_vboxmachines \ - :controlvm_option:_vboxopts_controlvm - ;; - adoptstate) - _arguments \ - :machine:_vboxmachines \ - ':sav file:_files -g \*.sav' - ;; - closemedium) - _arguments \ - ':type:(disk dvd floppy)' \ - ':file:_files' \ - '--delete' - ;; - discardstate|bandwidthctl|getextradata|setextradata|debugvm) - _arguments \ - :machine:_vboxmachines - ;; - storagectl) - _arguments \ - :machine:_vboxmachines \ - '--name: :' \ - '--add:type:(ide scsi floppy sas)' \ - '--controller:type:(LSILogic|LSILogicSAS|BusLogic|IntelAHCI|PIIX3|PIIX4|ICH6|I82078)' \ - --sataideemulation{1..4}":port:({1..30})" \ - "--sataportcount:num:({1..30})" \ - '--hostiocache:bool:(on off)' \ - '--bootable:bool:(on off)' \ - '--remove' #" - ;; - storageattach) - _arguments \ - :machine:_vboxmachines\ - '--storagectl:storage ctl:("IDE Controller" "SATA Controller")' \ - '--port: :' \ - '--device: :' \ - '--type:drive type:(dvddrive hdd fdd)' \ - '--medium:mediums:_vboxmediums' \ - '--mtype:behaviour:(normal writethrough immutable shareable)' \ - '--comment: :' \ - '--passthrough:enabled?:(on off)' \ - '--bandwidthgroup: :' \ - '--forceunmount' '--server: :' \ - '--target: :' \ - '--lun: :' \ - '--encodedlun: :' \ - '--username: :' \ - '--password: :' \ - '--intnet: :' - ;; - createhd) - _arguments \ - '--filename:filename:_files -g \*.{vdi,vmdk,vhd}' \ - '--size:megabytes:' \ - '--sizebyte:bytes:' \ - '--format:type:(VDI VMDK VHD)' \ - '--variant:type:(Standard Fixed Split2G Stream ESX)' - ;; - sharedfolder) - _arguments \ - ':action:(add remove)' \ - :machine:_vboxmachines \ - '--name: :' \ - '--hostpath:path:_files -/' \ - '--transient' \ - '--readonly' \ - '--automount' - ;; - esac - return 1 -} - -_vboxheadless() { - local context state line expl - local -A opt_args - - _arguments \ - '(-s -startvm --startvm)'{-s,-startvm,--startvm}'[Start given VM]:machine:_vboxmachines' \ - '(-n --vnc)'{-n,--vnc}'[Enable the built in VNC server]' \ - '(-m --vncport)'{-m,--vncport}'[TCP port number to use for the VNC server]:port:' \ - '(-o --vncpass)'{-o,--vncpass}'[Set the VNC server password]:pw:' \ - '(-v -vrde --vrde)'{-v,-vrde,--vrde}"[Enable (default) or disable the VRDE server or don't change the setting]::(on off config)" \ - '(-e -vrdeproperty --vrdeproperty)'{-e,-vrdeproperty,--vrdeproperty}'[Set a VRDE property]: :' \ - '(-c -capture --capture)'{-c,-capture,--capture}'[Record the VM screen output to a file]' \ - '(-w --width)'{-w,--width}'[Frame width when recording]:width:' \ - '(-h --height)'{-h,--height}'[Frame height when recording]:height:' \ - '(-r --bitrate)'{-r,--bitrate}'[Recording bit rate when recording]:bitrate:' \ - '(-f --filename)'{-f,--filename}'[File name when recording. The codec used will be chosen based on the file extension]:filename:_files' -} - -_virtualbox() { - local ret=1 - _call_function ret _$service - return ret -} - -_virtualbox "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_vnstat b/.zprezto/modules/completion/external/src/_vnstat deleted file mode 100644 index 5676f8b..0000000 --- a/.zprezto/modules/completion/external/src/_vnstat +++ /dev/null @@ -1,116 +0,0 @@ -#compdef vnstat -# ------------------------------------------------------------------------------ -# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for vnstat 1.10 -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Aaron Schrab -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state state_descr line ret=1 -typeset -A opt_args - -local period="-d --days -h --hours -m --months -w --weeks" - -_arguments -C : \ - '--cleartop[remove all top 10 entries]' \ - '--config[specify alternate configuration file]:file:_files' \ - "($period)"{-d,--days}'[show traffic for days]' \ - "($period)"{-h,--hours}'[show trafic for last 24 hours]' \ - "($period)"{-m,--months}'[show traffic for months]' \ - "($period)"{-w,--weeks}'[show traffic for 7 days]' \ - '--dbdir[specify database directory]:directory:_files -/' \ - '(-D --debug)'{-D,--debug}'[show additional debug output]' \ - '--delete[delete database and stop monitoring selected interface]' \ - '--dumpdb[dump database in parseable format]' \ - '(--disable)--enable[enable updates for selected interface]' \ - '(--enable)--disable[disable updates for selected interface]' \ - '(-i --iface)'{-i,--iface}'[specify interface for actions]:interface:->interface' \ - '--iflist[list available interfaces]' \ - '(-l --live)'{-l,--live}'[display current transfer rate]:mode:->live' \ - '--locale[specify locale]:locale:' \ - '--nick[set nickname for alias]:nickname:' \ - '--oneline[traffic summary in one-line, parseable format]' \ - '(-q --query)'{-q,--query}'[force database query mode]' \ - '(-r --reset)'{-r,--reset}'[reset internal counters]' \ - '--rebuildtotal[reset total trafic counters]' \ - '(-ru --rateunit)'{-ru,--rateunit}'[swap configured rate unit]' \ - '--savemerged[write result of database merge]' \ - '(-s --short)'{-s,--short}'[use short output mode]' \ - '--style[modify content and style of output]:style:->style' \ - '--sync[synchronize internal counters]' \ - '--testkernel[test kernel boot time information]' \ - '(-t --top10)'{-t,--top10}'[show all time top 10 traffic days]' \ - '-tr[calculate amount of traffic in given time]:seconds:' \ - '(-u --update)'{-u,--update}'[update databases]' \ - '--xml[show database content in XML format]' \ - '(-)'{-v,--version}'[show current version]' \ - '(-)'{-\?,--help}'[show command summary]' \ - '(-)--longhelp[show complete options list]' \ - && ret=0 - -case "$state" in - - (live) - _values 'live mode' \ - '0[packets per second]' \ - '1[traffic counters]' && ret=0 - ;; - - (style) - _values 'output style' \ - '0[narrow output]' \ - '1[enable bar column]' \ - '2[bar column with average traffic rate]' \ - '3[enable average traffic rate]' \ - '4[disable use of terminal control characters]' && ret=0 - ;; - - (interface) - local interfaces="$(_call_program interfaces 'vnstat --iflist')" - interfaces="${interfaces#*:}" - _values -s + 'interface' ${(z)interfaces} && ret=0 - ;; - -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: filetype=zsh shiftwidth=2 tabstop=2 expandtab diff --git a/.zprezto/modules/completion/external/src/_vpnc b/.zprezto/modules/completion/external/src/_vpnc deleted file mode 100644 index edda13a..0000000 --- a/.zprezto/modules/completion/external/src/_vpnc +++ /dev/null @@ -1,182 +0,0 @@ -#compdef vpnc vpnc-connect vpnc-disconnect -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for vpnc. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Julien Nicoulaud -# -# ------------------------------------------------------------------------------ - - -(( $+functions[_vpnc-connect] )) || -_vpnc-connect() { - _arguments \ - '(- : *)--version[display version information]' \ - '(- : *)--'{,long-}'help[display help information]' \ - '--gateway[IP/name of your IPSec gateway]: :_hosts' \ - '--id[your group name]: :_groups' \ - '--username[your username]: :_users' \ - '--domain[domain name for authentication]: :_domains' \ - '--xauth-inter[enable interactive extended authentication]' \ - '--vendor[vendor of your IPSec gateway]: :_vpnc_gateway_vendors' \ - '--natt-mode[NAT-Traversal method]: :_vpnc_nat_traversal_methods' \ - '--script[command executed using system() to configure the interface, routing and so on]:command path:_files' \ - '--dh[name of the IKE DH Group]: :_vpnc_ike_diffie_hellman_groups' \ - '--pfs[Diffie-Hellman group to use for PFS]: :_vpnc_pfs_diffie_hellman_groups' \ - '--enable-1des[enable weak single DES encryption]' \ - '--enable-no-encryption[enable using no encryption for data traffic (key exchanged must be encrypted)]' \ - '--application-version[application version to report]:application version' \ - '--ifname[visible name of the TUN/TAP interface]:name' \ - '--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \ - '--debug[show verbose debug messages]: :_vpnc_debug_levels' \ - "--no-detach[don't detach from the console after login]" \ - '--pid-file[store the pid of background process in the file]:pid file:_files' \ - '--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \ - '--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \ - '--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \ - '--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \ - "--non-inter[don't ask anything, exit on missing options]" \ - '--auth-mode[authentication mode]: :_vpnc_authentication_modes' \ - '--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \ - '--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \ - '--target-network[target network in dotted decimal or CIDR notation]:target network/netmask' \ - '--print-config[print your configuration; output can be used as vpnc.conf]' \ - '*: :_vpnc_confs' -} - -(( $+functions[_vpnc-disconnect] )) || -_vpnc-disconnect() { - _message 'no more arguments' -} - -(( $+functions[_vpnc_confs] )) || -_vpnc_confs() { - # FIXME /etc/vpnc/ is only accessible to root, how do we deal with this ? - local confs; confs=(/etc/vpnc/*.conf(:t:s/\.conf/)) - _describe -t confs 'VPNC conf' confs "$@" -} - -(( $+functions[_vpnc_gateway_vendors] )) || -_vpnc_gateway_vendors() { - local vendors; vendors=( - 'cisco' - 'netscreen' - ) - _describe -t vendors 'vendor' vendors "$@" -} - -(( $+functions[_vpnc_nat_traversal_methods] )) || -_vpnc_nat_traversal_methods() { - local methods; methods=( - 'natt:NAT-T as defined in RFC3947 (default)' - 'none:disable use of any NAT-T method' - 'force-natt:always use NAT-T encapsulation even without presence of a NAT device' - 'cisco-udp:Cisco proprietary UDP encapsulation, commonly over Port 10000' - ) - _describe -t methods 'NAT traversal method' methods "$@" -} - -(( $+functions[_vpnc_ike_diffie_hellman_groups] )) || -_vpnc_ike_diffie_hellman_groups() { - local groups; groups=( - 'dh1' - 'dh2' - 'dh5' - ) - _describe -t groups 'IKE Diffie Hellman group' groups "$@" -} - -(( $+functions[_vpnc_pfs_diffie_hellman_groups] )) || -_vpnc_pfs_diffie_hellman_groups() { - local groups; groups=( - 'nopfs' - 'dh1' - 'dh2' - 'dh5' - 'server' - ) - _describe -t groups 'PFS Diffie Hellman group' groups "$@" -} - -(( $+functions[_vpnc_tun_tap_modes] )) || -_vpnc_tun_tap_modes() { - local modes; modes=( - 'tun:virtual point to point interface (default)' - 'tap:virtual ethernet interface' - ) - _describe -t modes 'TUN/TAP interface mode' modes "$@" -} - -(( $+functions[_vpnc_debug_levels] )) || -_vpnc_debug_levels() { - local levels; levels=( - "0:don't print debug information" - '1:print minimal debug information' - '2:show statemachine and packet/payload type information' - '3:dump everything excluding authentication data' - '99:dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS)' - ) - _describe -t levels 'debug level' levels "$@" -} - -(( $+functions[_vpnc_isakmp_port_numbers] )) || -_vpnc_isakmp_port_numbers() { - local ports; ports=( - '0:use random port' - '1:minimum port number' - '500:default port number' - '65535:maximum port number' - ) - _describe -t ports 'ISAKMP port number' ports "$@" -} - -(( $+functions[_vpnc_udp_port_numbers] )) || -_vpnc_udp_port_numbers() { - local ports; ports=( - '0:use random port' - '1:minimum port number' - '10000:default port number' - '65535:maximum port number' - ) - _describe -t ports 'UDP port number' ports "$@" -} - -(( $+functions[_vpnc_dpd_idle_times] )) || -_vpnc_dpd_idle_times() { - local times; times=( - '0:completely disable DPD' - '10:minimum value' - '300:default value' - '86400:maximum value' - ) - _describe -t times 'DPD idle wait time (seconds)' times "$@" -} - -(( $+functions[_vpnc_authentication_modes] )) || -_vpnc_authentication_modes() { - local modes; modes=( - 'psk:pre-shared key (default)' - 'cert:server + client certificate' - 'hybrid:server certificate + xauth' - ) - _describe -t modes 'authentication mode' modes "$@" -} - -case $service in - vpnc|vpnc-connect) _call_function ret _vpnc-connect && return ret ;; - vpnc-disconnect) _call_function ret _vpnc-disconnect && return ret ;; -esac - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_wemux b/.zprezto/modules/completion/external/src/_wemux deleted file mode 100644 index d38fc28..0000000 --- a/.zprezto/modules/completion/external/src/_wemux +++ /dev/null @@ -1,82 +0,0 @@ -#compdef wemux -# ------------------------------------------------------------------------------ -# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for wemux (https://github.com/zolrath/wemux) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Akira Maeda -# -# ------------------------------------------------------------------------------ -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------ - -_wemux() { - - local -a host_commands client_commands multi_host_commands - - host_commands=( - 'start:Start the wemux server/attach to an existing wemux server.' - 'attach:Attach to an existing wemux server.' - 'stop:Kill the wemux server '\''wemux'\'', delete its socket.' - 'users:List all users currently attached to '\''wemux'\''' - 'kick:Disconnect an SSH user, remove their wemux server.' - 'config:Open the wemux configuration file in your $EDITOR.' - 'help:Display this screen.' - 'version:shows wemux version number' - ) - - client_commands=( - 'mirror:Attach to Host in read-only mode.' - 'pair:Attach to Host in pair mode, which allows editing.' - 'rogue:Attach to Host in rogue mode, which allows editing and switching to windows independently from the host.' - 'logout:Log out of the wemux rogueing session.' - 'users:List the currently attached wemux users.' - ) - - multi_host_commands=( - 'join:Join wemux server with supplied name.' - 'reset:Join default wemux server: wemux' - 'list:List all currently active wemux servers.' - ) - - if (( CURRENT == 2 )); then - _describe -t host_commands 'HOST COMMANDS' host_commands - _describe -t client_commands 'CLIENT COMMANDS' client_commands - _describe -t multi_host_commands 'MULTI-HOST COMMANDS' multi_host_commands - fi - - return 0 -} - -_wemux diff --git a/.zprezto/modules/completion/external/src/_wg-quick b/.zprezto/modules/completion/external/src/_wg-quick deleted file mode 100644 index 8de17ce..0000000 --- a/.zprezto/modules/completion/external/src/_wg-quick +++ /dev/null @@ -1,25 +0,0 @@ -#compdef wg-quick -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for wg-quick (a script for easy managemant of wireguard -# VPN tunnels) (https://www.wireguard.com/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Nicolas Lenz -# -# ------------------------------------------------------------------------------ - -# The possible modes -local modes=('up\:"bring a wireguard interface up"'\ - 'down\:"tear down and remove a wireguard interface"'\ - 'save\:"save configuration of a running wireguard interface"') - -# 1: Complete mode -# 2: Complete interface with all .conf files in /etc/wireguard without the filename extension. -_arguments "1:mode:((${modes}))"\ - '2:interface:_path_files -W /etc/wireguard -g "*.conf(^/:r)"' diff --git a/.zprezto/modules/completion/external/src/_xinput b/.zprezto/modules/completion/external/src/_xinput deleted file mode 100644 index dd99c36..0000000 --- a/.zprezto/modules/completion/external/src/_xinput +++ /dev/null @@ -1,208 +0,0 @@ -#compdef xinput -# ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for xinput -# TODO: Add property handler -# TODO: Add buttons handler -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Timofey Titovets -# -# ------------------------------------------------------------------------------ -_xinput(){ - # list of xinput arguments - local -a _1st_arguments - _1st_arguments=( - 'version:show version' '--version:show version' - 'help:show help options' '--help:show help options' - get-feedbacks - set-ptr-feedback - set-integer-feedback - get-button-map - set-button-map - set-pointer - 'set-mode:change the mode of device' '--set-mode:change the mode of device' - 'list:show devices' '--list:show devices' - query-state - test --test - create-master - remove-master - reattach - float - set-cp - test-xi2 - map-to-output - list-props - set-int-prop - set-float-prop - set-atom-prop - watch-props - delete-prop - set-prop - 'disable:disable the device' '--disable:disable the device' - 'enable:enable the device' '--enable:enable the device' - --get-feedbacks - --set-ptr-feedback - --set-integer-feedback - --get-button-map - --set-button-map - --set-pointer - --query-state - --create-master - --remove-master - --reattach - --float - --set-cp - --test-xi2 - --map-to-output - --list-props - --set-int-prop - --set-float-prop - --set-atom-prop - --watch-props - --delete-prop - --set-prop - ) - - local context state line - local -A opt_args - # Used with "-O expl" for unsorted. - local -a expl - expl=(-Vx) - - _arguments '*:: :->subcmds' && return 0 - - if (( CURRENT == 1 )); then - _describe -t commands "xinput commands" _1st_arguments -V1 - return - fi - - typeset -a xinput_devices_id xinput_devices xinput_devices_name - local i name - for i in ${(on)$(xinput list --id-only)}; do - # Removing prefixes, e.g. from "∼ 7" (floating slave). - i=${i##[^[:digit:]]#} - [[ -n "$i" ]] || continue - xinput_devices_id+=($i) - name="$(xinput list --name-only $i)" - xinput_devices_name+=($name) - xinput_devices+=($i\:$name) - done - xinput_devices+=($xinput_devices_name) - - # xinput arguments handler - case "$words[1]" in - --get-feedbacks|--set-ptr-feedback|--get-button-map|--query-state|--list-props|--watch-props|get-feedbacks|set-ptr-feedback|get-button-map|query-state|list-props|watch-props|--enable|enable|--map-to-output|map-to-output|--disable|disable) - _arguments -O expl \ - ':list option:(($xinput_devices))' - ;; - --list|list) - _arguments -O expl \ - '--short' \ - '--long' \ - '--name-only' \ - '--id-only' \ - ':list option:(($xinput_devices))' \ - ;; - --set-integer-feedback|set-integer-feedback) - _arguments -O expl \ - ':list option:(($xinput_devices))' \ - ':list option:( feedback )' \ - ':list option:( $xinput_devices_id )' - ;; - --set-button-map|set-button-map) - _arguments -O expl \ - ':list option:(($xinput_devices))' #map button 1 [map button 2 [...]] - ;; - --set-pointer|set-pointer) - _arguments -O expl \ - ':list option:(($xinput_devices))' # [x index y index] - ;; - --set-mode|set-mode) - _arguments -O expl \ - ':list option:(($xinput_devices))' \ - ':list option:(ABSOLUTE RELATIVE)' - ;; - --test|test) - _arguments -O expl \ - ':list option:(-proximity ($xinput_devices ))' \ - ':list option:(($xinput_devices))' - ;; - --reattach|reattach) - _arguments -O expl \ - ':list option:(($xinput_devices))' \ - ':list option:(master slave)' - ;; - --float|float) - _arguments -O expl \ - ':list option:(($xinput_devices))' - ;; - --test-xi2|test-xi2) - _arguments -O expl \ - ':list option:(($xinput_devices --root))' \ - ':list option:(($xinput_devices))' - ;; - --delete-prop|delete-prop) - _arguments -O expl \ - ':list option:(($xinput_devices))' #property - ;; - --create-master|create-master) - _arguments -O expl \ - ':list option:(($xinput_devices))' # [sendCore (dflt:1)] [enable (dflt:1)] - ;; - --remove-master|remove-master) - _arguments -O expl \ - ':list option:($xinput_devices_id)' # [Floating|AttachToMaster (dflt:Floating)] [returnPointer] [returnKeyboard] - ;; - # --set-cp|set-cp); window device;; - --set-prop|set-prop) - _arguments -O expl \ - ':list option:(($xinput_devices))' \ - ':list option:(--type={atom,float,int} --format={8,16,32})' \ - ':list option:(--type={atom,float,int} --format={8,16,32})' # property val [val ...] - ;; - --set-int-prop|set-int-prop) - _arguments -O expl \ - ':list option:(($xinput_devices))' # property format (8, 16, 32) val [val ...] - ;; - --set-float-prop|set-float-prop) - _arguments -O expl \ - ':list option:(($xinput_devices))' # property val [val ...] - ;; - --set-atom-prop|set-atom-prop) - _arguments -O expl \ - ':list option:(($xinput_devices))' # property val [val ...] - ;; - esac -} - -_xinput "$@" diff --git a/.zprezto/modules/completion/external/src/_xsel b/.zprezto/modules/completion/external/src/_xsel deleted file mode 100644 index 3ba249b..0000000 --- a/.zprezto/modules/completion/external/src/_xsel +++ /dev/null @@ -1,63 +0,0 @@ -#compdef xsel -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for xsel (http://www.vergenet.net/~conrad/software/xsel/). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Tomo Kazahaya (https://github.com/tomonacci) -# -# ------------------------------------------------------------------------------ - -local input='(-a --append -f --follow -i --input)' -local operation='(-c --clear -d --delete -k --keep -x --exchange)' -local selection='(-p --primary -s --secondary -b --clipboard)' - -_arguments -s \ - $input{-a,--append}'[append standard input to the selection]' \ - $input{-f,--follow}'[append to selection as standard input grows]' \ - $input{-i,--input}'[read standard input into the selection]' \ - {-o,--output}'[write the selection to standard output]' \ - $operation{-c,--clear}'[clear the selection]' \ - $operation{-d,--delete}'[request that the current selection be deleted]' \ - $selection{-p,--primary}'[operate on the PRIMARY selection (default)]' \ - $selection{-s,--secondary}'[operate on the SECONDARY selection]' \ - $selection{-b,--clipboard}'[operate on the CLIPBOARD selection]' \ - $operation{-k,--keep}'[do not modify the selections, but make the PRIMARY and SECONDARY selections persist even after the programs they were selected in exit]' \ - $operation{-x,--exchange}'[exchange the PRIMARY and SECONDARY selections]' \ - '--display[specify the server to use; see X(1)]:X display:_x_display' \ - {-t,--selectionTimeout}'[specify the timeout in milliseconds within which the selection must be retrieved]:number' \ - {-l,--logfile}'[specify the file to log errors to when detached (default $HOME/.xsel.log)]:log file:_files' \ - {-n,--nodetach}'[do not detach from the controlling terminal]' \ - {-h,--help}'[display usage information and exit]' \ - {-v,--verbose}'[print informative messages; additional instances of -v raise the debugging level]' \ - '--version[output version information and exit]' diff --git a/.zprezto/modules/completion/external/src/_yaourt b/.zprezto/modules/completion/external/src/_yaourt deleted file mode 100644 index 4727502..0000000 --- a/.zprezto/modules/completion/external/src/_yaourt +++ /dev/null @@ -1,368 +0,0 @@ -#compdef yaourt yaourt.static=yaourt -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for yaourt (https://archlinux.fr/yaourt-en) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * zsh-users mailing list -# -# ------------------------------------------------------------------------------ - -# handles --help subcommand -_yaourt_action_help() { - _arguments -s : \ - "$_yaourt_opts_commands[@]" -} - -# handles cases where no subcommand has yet been given -_yaourt_action_none() { - _arguments -s : \ - "$_yaourt_opts_commands[@]" -} - -# handles --query subcommand -_yaourt_action_query() { - local context state line - typeset -A opt_args - -# _arguments -s : \ -# "$_yaourt_opts_common[@]" \ -# "$_yaourt_opts_query_actions[@]" \ -# "$_yaourt_opts_query_modifiers[@]" - - case $state in - query_file) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:package file:_files -g "*.pkg.tar*"' - ;; - query_group) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:groups:_yaourt_completions_installed_groups' - ;; - query_owner) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:file:_files' - ;; - query_search) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:search text: ' - ;; - *) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_actions[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:package:_yaourt_completions_installed_packages' - ;; - esac -} - -# handles --remove subcommand -_yaourt_action_remove() { - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_remove[@]" -} - -# handles --sync subcommand -_yaourt_action_sync() { - local context state line - typeset -A opt_args - -# _arguments -s : \ -# "$_yaourt_opts_common[@]" \ -# "$_yaourt_opts_sync_actions[@]" #\ -# #"$_yaourt_opts_sync_modifiers[@]" - - case $state in - sync_clean) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*-c[remove old packages from cache]' \ - ;; - sync_group) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*:package group:_yaourt_completions_all_groups' - ;; - sync_search) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*:search text: ' - ;; - *) - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*:package:_yaourt_completions_all_packages' - ;; - esac -} - -# handles --upgrade subcommand -_yaourt_action_upgrade() { - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_pkgfile[@]" -} - -# handles --version subcommand -_yaourt_action_version() { - # no further arguments - return 0 -} - -# provides completions for package groups -_yaourt_completions_all_groups() { - local -a cmd groups - _yaourt_get_command - groups=( $(_call_program groups $cmd[@] -Sg) ) - typeset -U groups - compadd "$@" -a groups -} - -# provides completions for packages available from repositories -# these can be specified as either 'package' or 'repository/package' -_yaourt_completions_all_packages() { - local -a cmd packages repositories packages_long - _yaourt_get_command - - if compset -P1 '*/*'; then - packages=( $(_call_program packages $cmd[@] -Sql ${words[CURRENT]%/*}) ) - typeset -U packages - if [[ -d /var/aur ]]; then - packages=( $packages $(ls /var/aur) ) - fi - _wanted repo_packages expl "repository/package" compadd ${(@)packages} - else - packages=( $(_call_program packages $cmd[@] -Sql) ) - typeset -U packages - if [[ -d /var/aur ]]; then - packages=( $packages $(ls /var/aur) ) - fi - _wanted packages expl "packages" compadd - "${(@)packages}" - - repositories=(${(o)${${${(M)${(f)"$(query_group' - '-o[query the package that owns a file]:file:_files' - '-p[package file to query]:*:package file:->query_file' - '-s[search package names and descriptions]:*:search text:->query_search' - ) - - # options for passing to _arguments: options for --query and subcommands - typeset -a _yaourt_opts_query_modifiers - _yaourt_opts_query_modifiers=( - '-c[list package changelog]' - '-d[list packages installed as dependencies]' - '-e[list packages explicitly installed]' - '-i[view package information]' - '-ii[view package information including backup files]' - '-k[check package files]' - '-l[list package contents]' - '-m[list installed packages not found in sync db(s)]' - '-t[list packages not required by any package]' - '-u[list packages that can be upgraded]' - '--aur[install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]' - '--devel[used with -u updates all cvs/svn/git/hg/bzr packages]' - '--date[list packages sorted in ascending order (oldest first) by installation date]' - ) - - # options for passing to _arguments: options for --remove command - typeset -a _yaourt_opts_remove - _yaourt_opts_remove=( - '-c[remove all dependent packages]' - '-d[skip dependency checks]' - "-k[only remove database entry, don't remove files]" - '-n[remove protected configuration files]' - '-s[remove dependencies not required by other packages]' - '*:installed package:_yaourt_completions_installed_packages' - ) - - # options for passing to _arguments: options for --sync command - typeset -a _yaourt_opts_sync_actions - _yaourt_opts_sync_actions=( - '*-c[remove old packages from cache]:*:clean:->sync_clean' - '*-cc[remove all packages from cache]:*:clean:->sync_clean' - '-g[view all members of a package group]:*:package group:->sync_group' - '-s[search package names and descriptions]:*:search text:->sync_search' - ) - - # options for passing to _arguments: options for --sync command - typeset -a _yaourt_opts_sync_modifiers - _yaourt_opts_sync_modifiers=( - '-d[skip dependency checks]' - '-f[overwrite conflicting files]' - '-i[view package information]' - '-l[list all packages in a repository]' - '-p[print download URIs for each package to be installed]' - '-u[upgrade all out-of-date packages]' - '-w[download packages only]' - '-y[download fresh package databases]' - '*--ignore[ignore a package upgrade]:package: - _yaourt_completions_all_packages' - '*--ignoregroup[ignore a group upgrade]:package group: - _yaourt_completions_all_groups' - '--asdeps[install packages as non-explicitly installed]' - '--asexplicit[install packages as explicitly installed]' - "--needed[don't reinstall up to date packages]" - '--devel[used with -u updates all cvs/svn/git/hg/bzr packages]' - ) - - case $words[2] in - -Q*g*) # ipkg groups - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:groups:_yaourt_completions_installed_groups' - ;; - -Q*o*) # file - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:package file:_files' - ;; - -Q*p*) # file *.pkg.tar* - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_query_modifiers[@]" \ - '*:package file:_files -g "*.pkg.tar*"' - ;; - -Q*) _yaourt_action_query ;; - -R*) _yaourt_action_remove ;; - -S*c*) # no completion - return 0 - ;; - -S*l*) # repos - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*:package repo:_yaourt_completions_repositories' \ - ;; - -S*g*) # pkg groups - _arguments -s : \ - "$_yaourt_opts_common[@]" \ - "$_yaourt_opts_sync_modifiers[@]" \ - '*:package group:_yaourt_completions_all_groups' - ;; - -S*) _yaourt_action_sync ;; - -U*) _yaourt_action_upgrade ;; - -V*) _yaourt_action_version ;; - -h*) _yaourt_action_help ;; - - ) _yaourt_action_none ;; - * ) return 1 ;; - esac -} - -# run the main dispatcher -_yaourt "$@" diff --git a/.zprezto/modules/completion/external/src/_yarn b/.zprezto/modules/completion/external/src/_yarn deleted file mode 100644 index 382f58a..0000000 --- a/.zprezto/modules/completion/external/src/_yarn +++ /dev/null @@ -1,345 +0,0 @@ -#compdef yarn -# ------------------------------------------------------------------------------ -# 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-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for yarn (https://yarnpkg.com/) -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Massimiliano Torromeo -# -# ------------------------------------------------------------------------------ - -_commands=( - 'access' - 'autoclean:Clean and remove unnecessary files from package dependencies' - 'cache:List or clean every cached package' - "check:Verify package dependencies agains yarn's lock file" - 'config:Manages the yarn configuration files' - 'generate-lock-entry:Generates a lock file entry' - 'global:Install packages globally on your operating system' - 'help:Show information about a command' - 'import:Generate yarn.lock from an existing npm-installed node_modules folder' - 'info:Show information about a package' - 'init:Interactively creates or updates a package.json file' - 'install:Install all the dependencies listed within package.json' - 'licenses:List licenses for installed packages' - 'link:Symlink a package folder during development' - 'list:List installed packages' - 'login:Store registry username and email' - 'logout:Clear registry username and email' - 'outdated:Check for outdated package dependencies' - 'owner:Manage package owners' - 'pack:Create a compressed gzip archive of package dependencies' - 'publish:Publish a package to the npm registry' - 'run:Run a defined package script' - 'tag:Add, remove, or list tags on a package' - 'team:Maintain team memberships' - 'unlink:Unlink a previously created symlink for a package' - 'version:Update the package version' - 'versions:Display version information of currently installed Yarn, Node.js, and its dependencies' - 'why:Show information about why a package is installed' -) - -_global_commands=( - 'add:Installs a package and any packages that it depends on' - 'bin:Displays the location of the yarn bin folder' - 'remove:Remove installed package from dependencies updating package.json' - 'upgrade:Upgrades packages to their latest version based on the specified range' - 'upgrade-interactive' -) - -_yarn_commands_scripts() { - local -a scripts - scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g')) - _describe 'command or script' _commands -- _global_commands -- scripts -} - -_yarn_scripts() { - local -a scripts - scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g')) - _describe 'script' scripts -} - -_yarn_global_commands() { - local -a cmds - cmds=('ls:List installed packages') - _describe 'command' _global_commands -} - -_yarn_commands() { - _describe 'command' _commands -- _global_commands -} - -_yarn() { - local context state state_descr line - typeset -A opt_args - - _arguments \ - '(-h --help)'{-h,--help}'[output usage information]' \ - '(-V --version)'{-V,--version}'[output the version number]' \ - '--verbose[output verbose messages on internal operations]' \ - '--offline[trigger an error if any required dependencies are not available in local cache]' \ - '--prefer-offline[use network only if dependencies are not available in local cache]' \ - '--strict-semver' \ - '--json' \ - "--ignore-scripts[don't run lifecycle scripts]" \ - '--har[save HAR output of network traffic]' \ - '--ignore-platform[ignore platform checks]' \ - '--ignore-engines[ignore engines check]' \ - '--ignore-optional[ignore optional dependencies]' \ - '--force[install and build packages even if they were built before, overwrite lockfile]' \ - '--skip-integrity-check[run install without checking if node_modules is installed]' \ - '--check-files[install will verify file tree of packages for consistency]' \ - "--no-bin-links[don't generate bin links when setting up packages]" \ - '--flat[only allow one version of a package]' \ - '(--prod --production)'{--prod,--production} \ - "--no-lockfile[don't read or generate a lockfile]" \ - "--pure-lockfile[don't generate a lockfile]" \ - "--frozen-lockfile[don't generate a lockfile and fail if an update is needed]" \ - '--link-duplicates[create hardlinks to the repeated modules in node_modules]' \ - '--global-folder=[modules folder]:folder:_files -/' \ - '--modules-folder=[rather than installing modules into the node_modules folder relative to the cwd, output them here]:folder:_files -/' \ - '--cache-folder=[specify a custom folder to store the yarn cache]:folder:_files -/' \ - '--mutex=[use a mutex to ensure only one yarn instance is executing]:type[\:specifier]' \ - '--no-emoji[disable emoji in output]' \ - '(-s --silent)'{-s,--silent}'[skip Yarn console logs, other types of logs (script output) will be printed]' \ - '--proxy=:host:_hosts' \ - '--https-proxy=:host:_hosts' \ - '--no-progress[disable progress bar]' \ - '--network-concurrency=[maximum number of concurrent network requests]:number' \ - '--network-timeout=[TCP timeout for network requests]:milliseconds' \ - '--non-interactive[do not show interactive prompts]' \ - '1: :_yarn_commands_scripts' \ - '*:: :->command_args' - - - case $state in - command_args) - case $words[1] in - help) - _arguments \ - '1: :_yarn_commands' \ - ;; - - access) - _arguments \ - '1: :(public restricted grant revoke ls-packages ls-collaborators edit)' - ;; - - add) - _arguments \ - '(-D --dev)'{-D,--dev}'[install packages in devDependencies]' \ - '(-P --peer)'{-P,--peer}'[install packages in peerDependencies]' \ - '(-O --optional)'{-O,--optional}'[install packages in optionalDependencies]' \ - '(-E --exact)'{-E,--exact}'[install packages as exact versions]' \ - '(-T --tilde)'{-T,--tilde}'[install the most recent release of the packages that have the same minor version]' \ - '*:package-name:' - ;; - - cache) - _arguments \ - '1: :(ls dir clean)' - ;; - - check) - _arguments \ - '--integrity' \ - '--verify-tree' - ;; - - config) - _arguments \ - '1: :(set get delete list)' \ - '*:: :->config_args' - ;; - - global) - _arguments \ - '--prefix=[bin prefix to use to install binaries]' \ - '1: :_yarn_global_commands' \ - '*:: :->command_args' - ;; - - info) - _arguments \ - '1:package:' \ - '2:field' - ;; - - init) - _arguments \ - '(-y --yes)'{-y,--yes}'[install packages in devDependencies]' - ;; - - licenses) - _arguments \ - '1: :(ls generate-disclaimer)' \ - ;; - - link|unlink|outdated) - _arguments \ - '1:package' \ - ;; - - list) - _arguments \ - '--depth[Limit the depth of the shown dependencies]:depth' - ;; - - owner) - _arguments \ - '1: :(ls add rm)' \ - '*:: :->owner_args' - ;; - - pack) - _arguments \ - '(-f --filename)'{-f,--filename}':filename:_files' - ;; - - publish) - _arguments \ - '--new-version:version:' \ - '--message:message:' \ - '--no-git-tag-version' \ - '--access:access:' \ - '--tag:tag:' \ - '1: :_files' - ;; - - remove|upgrade) - _arguments \ - '*:package:' - ;; - - run) - _arguments \ - '1: :_yarn_scripts' - ;; - - tag) - _arguments \ - '1: :(ls add rm)' \ - '*:: :->tag_args' - ;; - - team) - _arguments \ - '1: :(create destroy add rm ls)' \ - '*:: :->team_args' - ;; - - version) - _arguments \ - '--new-version:version:' \ - '--message:message:' \ - '--no-git-tag-version' - ;; - - why) - _arguments \ - '1:query:_files' - ;; - esac - ;; - esac - - case $state in - config_args) - case $words[1] in - get|delete) - _arguments \ - '1:key:' - ;; - - set) - _arguments \ - '(-g --global)'{-g,--global} \ - '1:key:' \ - '2:value:' - ;; - esac - ;; - - owner_args) - case $words[1] in - ls) - _arguments \ - '1:package:' - ;; - - add|rm) - _arguments \ - '1:user:' \ - '2:package:' - ;; - esac - ;; - - tag_args) - case $words[1] in - ls) - _arguments \ - '1:package' - ;; - - add|rm) - _arguments \ - '1:package:' \ - '2:tag:' - ;; - esac - ;; - - team_args) - case $words[1] in - create|destroy|ls) - _arguments \ - '1:scope\:team:' - ;; - - add|rm) - _arguments \ - '1:scope\:team:' \ - '2:user:' - ;; - esac - ;; - esac -} - -_yarn "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/src/_zcash-cli b/.zprezto/modules/completion/external/src/_zcash-cli deleted file mode 100644 index 70ffa40..0000000 --- a/.zprezto/modules/completion/external/src/_zcash-cli +++ /dev/null @@ -1,181 +0,0 @@ -#compdef zcash-cli -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the zsh-users 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 ZSH-USERS 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. -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for zcash-cli (https://z.cash). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Jordy van Wolferen (https://github.com/jvwdev) -# -# ------------------------------------------------------------------------------ - -local state line curcontext="$curcontext" ret=1 - -_arguments -C \ - '-?[display usage information]' \ - -conf='[specify configuration file]:file [zcash.conf]:_files' \ - -datadir='[specify data directory]:directory:_directories' \ - -testnet'[use the test network]' \ - -regtest'[enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \ - -rpcconnect='[send commands to node running on specified ip]:rpcconnect [127.0.0.1]:_hosts' \ - -rpcport='[connect to JSON-RPC on specified port]: :_guard "[[\:digit\:]]#" "port [8232 or testnet\: 18232]"' \ - -rpcwait'[wait for RPC server to start]' \ - -rpcuser='[username for JSON-RPC connections]:rpcuser' \ - -rpcpassword='[password for JSON-RPC connections]:rpcpassword' \ - -rpcclienttimeout='[specify timeout during HTTP requests, or 0 for no timeout]: :_guard "[[\:digit\:]]#" "timeout (seconds) [900]"' \ - ':subcommand:->subcommand' && ret=0 - -case $state in - subcommand) - subcommands=( - 'getbestblockhash' - 'getblock' - 'getblockchaininfo' - 'getblockcount' - 'getblockhash' - 'getblockheader' - 'getchaintips' - 'getdifficulty' - 'getmempoolinfo' - 'getrawmempool' - 'gettxout' - 'gettxoutproof' - 'gettxoutsetinfo' - 'verifychain' - 'verifytxoutproof' - 'getinfo' - 'help' - 'stop' - 'generate' - 'getgenerate' - 'setgenerate' - 'getblocksubsidy' - 'getblocktemplate' - 'getlocalsolps' - 'getmininginfo' - 'getnetworkhashps' - 'getnetworksolps' - 'prioritisetransaction' - 'submitblock' - 'addnode' - 'clearbanned' - 'disconnectnode' - 'getaddednodeinfo' - 'getconnectioncount' - 'getnettotals' - 'getnetworkinfo' - 'getpeerinfo' - 'listbanned' - 'ping' - 'setban' - 'createrawtransaction' - 'decoderawtransaction' - 'decodescript' - 'fundrawtransaction' - 'getrawtransaction' - 'sendrawtransaction' - 'signrawtransaction' - 'createmultisig' - 'estimatefee' - 'estimatepriority' - 'validateaddress' - 'verifymessage' - 'z_validateaddress' - 'addmultisigaddress' - 'backupwallet' - 'dumpprivkey' - 'dumpwallet' - 'encryptwallet' - 'getaccount' - 'getaccountaddress' - 'getaddressesbyaccount' - 'getbalance' - 'getnewaddress' - 'getrawchangeaddress' - 'getreceivedbyaccount' - 'getreceivedbyaddress' - 'gettransaction' - 'getunconfirmedbalance' - 'getwalletinfo' - 'importaddress' - 'importprivkey' - 'importwallet' - 'keypoolrefill' - 'listaccounts' - 'listaddressgroupings' - 'listlockunspent' - 'listreceivedbyaccount' - 'listreceivedbyaddress' - 'listsinceblock' - 'listtransactions' - 'listunspent' - 'lockunspent' - 'move' - 'sendfrom' - 'sendmany' - 'sendtoaddress' - 'setaccount' - 'settxfee' - 'signmessage' - 'z_exportkey' - 'z_exportwallet' - 'z_getbalance' - 'z_getnewaddress' - 'z_getoperationresult' - 'z_getoperationstatus' - 'z_gettotalbalance' - 'z_importkey' - 'z_importwallet' - 'z_listaddresses' - 'z_listoperationids' - 'z_listreceivedbyaddress' - 'z_sendmany' - 'zcbenchmark' - 'zcrawjoinsplit' - 'zcrawkeygen' - 'zcrawreceive' - 'zcsamplejoinsplit' - ) - - _describe -t subcommands 'zcash-cli subcommand' subcommands && ret=0 - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/completion/external/zsh-completions-howto.org b/.zprezto/modules/completion/external/zsh-completions-howto.org deleted file mode 100644 index b996e44..0000000 --- a/.zprezto/modules/completion/external/zsh-completions-howto.org +++ /dev/null @@ -1,445 +0,0 @@ -* Intro -The official documentation for writing zsh completion functions is difficult to understand, and doesn't give many examples. -At the time of writing this document I was able to find a few other tutorials on the web, however those tutorials only -explain a small portion of the capabilities of the completion system. This document aims to cover areas not explained elsewhere, -with examples, so that you can learn how to write more advanced completion functions. I do not go into all the details, but will -give enough information and examples to get you up and running. If you need more details you can look it up for yourself in the - [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]]. - -Please make any scripts that you create publicly available for others (e.g. by forking this repo and making a [[id:64bcd501-b0f0-48c7-b8e2-07af708b95ec][pull request]]). -Also if you have any more information to add or improvements to make to this tutorial, please do. -* Getting started -** Telling zsh which function to use for completing a command -Completion functions for commands are stored in files with names beginning with an underscore _, and these files should -be placed in a directory listed in the $fpath variable. -You can add a directory to $fpath by adding a line like this to your ~/.zshrc file: -#+BEGIN_SRC sh -fpath=(~/newdir $fpath) -#+END_SRC -The first line of a completion function file can look something like this: -#+BEGIN_SRC sh -#compdef foobar -#+END_SRC -This tells zsh that the file contains code for completing the foobar command. -This is the format that you will use most often for the first line, but you can also use the same file for completing -several different functions if you want. See [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Autoloaded-files][here]] for more details. - -You can also use the compdef command directly (e.g. in your ~/.zshrc file) to tell zsh which function to use for completing -a command like this: -#+BEGIN_SRC sh -> compdef _function foobar -#+END_SRC -or to use the same completions for several commands: -#+BEGIN_SRC sh -> compdef _function foobar goocar hoodar -#+END_SRC -or if you want to supply arguments: -#+BEGIN_SRC sh -> compdef '_function arg1 arg2' foobar -#+END_SRC -See [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Functions-4][here]] for more details. -** Completing generic gnu commands -Many [[http://www.gnu.org/][gnu]] commands have a standardized way of listing option descriptions (when the --help option is used). -For these commands you can use the _gnu_generic function for automatically creating completions, like this: -#+BEGIN_SRC sh -> compdef _gnu_generic foobar -#+END_SRC -or to use _gnu_generic with several different commands: -#+BEGIN_SRC sh -> compdef _gnu_generic foobar goocar hoodar -#+END_SRC -This line can be placed in your ~/.zshrc file. -** Copying completions from another command -If you want a command, say cmd1, to have the same completions as another, say cmd2, which has already had -completions defined for it, you can do this: -#+BEGIN_SRC sh -> compdef cmd1=cmd2 -#+END_SRC -This can be useful for example if you have created an alias for a command to help you remember it. -* Writing your own completion functions -A good way to get started is to look at some already defined completion functions. -On my linux installation these are found in /usr/share/zsh/functions/Completion/Unix -and /usr/share/zsh/functions/Completion/Linux and a few other subdirs. - -You will notice that the _arguments function is used a lot in these files. -This is a utility function that makes it easy to write simple completion functions. -The _arguments function is a wrapper around the compadd builtin function. -The compadd builtin is the core function used to add completion words to the command line, and control its behaviour. -However, most of the time you will not need to use compadd, since there are many utility functions such as _arguments -and _describe which are easier to use. - -For very basic completions the _describe function should be adequate - -** Utility functions -Here is a list of some of the utility functions that may be of use. -The full list of utility functions, with full explanations, is available [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions][here]]. -Examples of how to use these functions are given in the next section. - -*** main utility functions for overall completion -| _alternative | Can be used to generate completion candidates from other utility functions or shell code. | -| _arguments | Used to specify how to complete individual options & arguments for a command with unix style options. | -| _describe | Used for creating simple completions consisting of words with descriptions (but no actions). Easier to use than _arguments | -| _gnu_generic | Can be used to complete options for commands that understand the `--help' option. | -| _regex_arguments | Creates a function for matching commandline arguments with regular expressions, and then performing actions/completions. | -*** functions for performing complex completions of single words -| _values | Used for completing arbitrary keywords (values) and their arguments, or comma separated lists of such combinations. | -| _combination | Used to complete combinations of values, for example pairs of hostnames and usernames. | -| _multi_parts | Used for completing multiple parts of words separately where each part is separated by some char, e.g. for completing partial filepaths: /u/i/sy -> /usr/include/sys | -| _sep_parts | Like _multi_parts but allows different separators at different parts of the completion. | -| _sequence | Used as a wrapper around another completion function to complete a delimited list of matches generated by that other function. -*** functions for completing specific types of objects -| _path_files | Used to complete filepaths. Take several options to control behaviour. | -| _files | Calls _path_files with all options except -g and -/. These options depend on file-patterns style setting. | -| _net_interfaces | Used for completing network interface names | -| _users | Used for completing user names | -| _groups | Used for completing group names | -| _options | Used for completing the names of shell options. | -| _parameters | Used for completing the names of shell parameters/variables (can restrict to those matching a pattern). | -*** functions for handling cached completions -If you have a very large number of completions you can save them in a cache file so that the completions load quickly. -| _cache_invalid | indicates whether the completions cache corresponding to a given cache identifier needs rebuilding | -| _retrieve_cache | retrieves completion information from a cache file | -| _store_cache | store completions corresponding to a given cache identifier in a cache file | -*** other functions -| _message | Used for displaying help messages in places where no completions can be generated. | -| _regex_words | Can be used to generate arguments for the _regex_arguments command. This is easier than writing the arguments manually. | -| _guard | Can be used in the ACTION of specifications for _arguments and similar functions to check the word being completed. | -*** Actions -Many of the utility functions such as _arguments, _regex_arguments, _alternative and _values may include an action -at the end of an option/argument specification. This action indicates how to complete the corresponding argument. -The actions can take one of the following forms: -| ( ) | Argument is required but no matches are generated for it. | -| (ITEM1 ITEM2) | List of possible matches | -| ((ITEM1\:'DESC1' ITEM2\:'DESC2')) | List of possible matches, with descriptions. Make sure to use different quotes than those around the whole specification. | -| ->STRING | Set $state to STRING and continue ($state can be checked in a case statement after the utility function call) | -| FUNCTION | Name of a function to call for generating matches or performing some other action, e.g. _files or _message | -| {EVAL-STRING} | Evaluate string as shell code to generate matches. This can be used to call a utility function with arguments, e.g. _values or _describe | -| =ACTION | Inserts a dummy word into completion command line without changing the point at which completion takes place. | -Not all action types are available for all utility functions that use them. For example the ->STRING type is not available in the -_regex_arguments or _alternative functions. -** Writing simple completion functions using _describe -The _describe function can be used for simple completions where the order and position of the options/arguments is -not important. You just need to create an array parameter to hold the options & their descriptions, and then pass -the parameter name as an argument to _describe. The following example creates completion candidates c and d, with -the descriptions (note this should be put in a file called _cmd in some directory listed in $fpath). -#+BEGIN_SRC sh -#compdef cmd -local -a subcmds -subcmds=('c:description for c command' 'd:description for d command') -_describe 'command' subcmds -#+END_SRC - -You can use several different lists separated by a double hyphen as follows but note that this mixes the matches under and single heading and is not intended to be used with different types of completion candidates: -#+BEGIN_SRC sh -local -a subcmds topics -subcmds=('c:description for c command' 'd:description for d command') -topics=('e:description for e help topic' 'f:description for f help topic') -_describe 'command' subcmds -- topics -#+END_SRC - -If two candidates have the same description, _describe collects them together on the same rowand ensures that descriptions are aligned in neatedly in columns. -The _describe function can be used in an ACTION as part of a specification for _alternative, _arguments or _regex_arguments. -In this case you will have to put it in braces with its arguments, e.g. 'TAG:DESCRIPTION:{_describe 'values' options}' -** Writing completion functions using _alternative -Like _describe, this function performs simple completions where the order and position of options/arguments is not important. -However, unlike _describe, instead of fixed matches further functions may be called to generate the completion candidates. Furthermore, _alternative allows a mix of different types of completion candidates to be mixed. - -As arguments it takes a list of specifications each in the form 'TAG:DESCRIPTION:ACTION' where TAG is a special tag that identifies the type of completion matches, -DESCRIPTION is used as a heading to describe the group of completion candidates collectively, and ACTION is one of the action types listed previously (apart from the ->STRING and =ACTION forms). -For example: -#+BEGIN_SRC sh -_alternative 'arguments:custom arg:(a b c)' 'files:filename:_files' -#+END_SRC -The first specification adds completion candidates a, b & c, and the second specification calls the _files function for completing filepaths. - -We could split the specifications over several lines with \ and add descriptions to each of the custom args like this: -#+BEGIN_SRC sh -_alternative \ - 'args:custom arg:((a\:"description a" b\:"description b" c\:"description c"))' \ - 'files:filename:_files' -#+END_SRC - -If we want to pass arguments to _files they can simply be included, like this: -#+BEGIN_SRC sh -_alternative \ - 'args:custom arg:((a\:"description a" b\:"description b" c\:"description c"))'\ - 'files:filename:_files -/' -#+END_SRC - -To use parameter expansion to create our list of completions we must use double quotes to quote the specifications, -e.g: -#+BEGIN_SRC sh -_alternative \ - "dirs:user directory:($userdirs)" \ - "pids:process ID:($(ps -A o pid=))" -#+END_SRC -In this case the first specification adds the words stored in the $userdirs variable, and the second specification -evaluates 'ps -A o pid=' to get a list of pids to use as completion candidates. In practice, we would make used of the existing _pids function for this. - -We can use other utility functions such as _values in the ACTION to perform more complex completions, e.g: -#+BEGIN_SRC sh -_alternative \ - "directories:user directory:($userdirs)" \ - 'options:comma-separated opt: _values -s , letter a b c' -#+END_SRC -this will complete the items in $userdirs, as well as a comma separated list containing a, b &/or c. Note the use of the initial space before _values. This is needed because _values doesn't understand standard compadd options for descriptions. - -As with _describe, the _alternative function can itself be used in an ACTION as part of a specification for _arguments -or _regex_arguments. -** Writing completion functions using _arguments -With a single call to the _arguments function you can create fairly sophisticated completion functions. It is intended to handle typical commands that take a variety of options along with some normal arguments. -Like the _alternative function, _arguments takes a list of specification strings as arguments. -These specification strings specify options and any corresponding option arguments (e.g. -f filename), -or command arguments. - -Basic option specifications take the form '-OPT[DESCRIPTION]', e.g. like this: -#+BEGIN_SRC sh -_arguments '-s[sort output]' '--l[long output]' '-l[long output]' -#+END_SRC -Arguments for the option can be specified after the option description in this form '-OPT[DESCRIPTION]:MESSAGE:ACTION', -where MESSAGE is a message to display and ACTION can be any of the forms mentioned in the ACTIONS section above. -For example: -#+BEGIN_SRC sh -_arguments '-f[input file]:filename:_files' -#+END_SRC - -Command argument specifications take the form 'N:MESSAGE:ACTION' where N indicates that it is the Nth command argument, -and MESSAGE & ACTION are as before. If the N is omitted then it just means the next command argument (after any that have -already been specified). If a double colon is used at the start (after N) then the argument is optional. -For example: -#+BEGIN_SRC sh -_arguments '-s[sort output]' '1:first arg:_net_interfaces' '::optional arg:_files' ':next arg:(a b c)' -#+END_SRC -here the first arg is a network interface, the next optional arg is a file name, the last arg can be either a, b or c, -and the -s option may be completed at any position. - -The _arguments function allows the full set of ACTION forms listed in the ACTION section above. -This means that you can use actions for selecting case statement branches like this: -#+BEGIN_SRC sh -_arguments '-m[music file]:filename:->files' '-f[flags]:flag:->flags' -case "$state" in - files) - local -a music_files - music_files=( Music/**/*.{mp3,wav,flac,ogg} ) - _multi_parts / music_files - ;; - flags) - _values -s , 'flags' a b c d e - ;; -esac -#+END_SRC -In this case paths to music files are completed stepwise descending down directories using the _multi_parts function, -and the flags are completed as a comma separated list using the _values function. - -I have just given you the basics of _arguments specifications here, you can also specify mutually exclusive options, -repeated options & arguments, options beginning with + instead of -, etc. For more details see the [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]]. -Also have a look at the tutorials mentioned at the end of this document, and the completion functions in the [[https://github.com/vapniks/zsh-completions/tree/master/src][src directory]]. -** Writing completion functions using _regex_arguments and _regex_words -If you have a complex command line specification with several different possible argument sequences then -the _regex_arguments function may be what you need. It typically works well where you have a series of keywords followed by a variable number of arguments. - -_regex_arguments creates a completion function whose name is given by the first argument. -Hence you need to first call _regex_arguments to create the completion function, and then call that function, -e.g. like this: -#+BEGIN_SRC sh -_regex_arguments _cmd OTHER_ARGS.. -_cmd "$@" -#+END_SRC - -The OTHER_ARGS should be sequences of specifications for matching & completing words on the command line. -These sequences can be separated by '|' to represent alternative sequences of words. -You can use bracketing to arbitrary depth to specify alternate subsequences, but the brackets must be backslashed like this \( \) -or quoted like this '(' ')'. - -For example: -#+BEGIN_SRC sh -_regex_arguments _cmd SEQ1 '|' SEQ2 \( SEQ2a '|' SEQ2b \) -_cmd "$@" -#+END_SRC -This specifies a command line matching either SEQ1, or SEQ2 followed by SEQ2a or SEQ2b. You are describing the form arguments to the command take in the form of a regular expression grammar. - -Each specification in a sequence must contain a / PATTERN/ part at the start followed by an optional ':TAG:DESCRIPTION:ACTION' -part. - -Each PATTERN is a regular expression to match a word on the command line. These patterns are processed sequentially -until we reach a pattern that doesn't match at which point any corresponding ACTION is performed to obtain completions -for that word. Note that there needs to be a pattern to match the initial command itself. -See below for further explanation about PATTERNs. - -The ':TAG:DESCRIPTION:ACTION' part is interpreted in the same way as for the _alternative function specifications, -except that it has an extra : at the start, and now all of the possible ACTION formats listed previously are allowed. - -Here is an example: -#+BEGIN_SRC sh -_regex_arguments _cmd /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(word1a word1b word1c)' '|'\ - /$'word11(a|b|c)\0'/ ':word:first word:(word11a word11b word11c)' \( /$'word2(a|b|c)\0'/ ':word:second word:(word2a word2b word2c)'\ - '|' /$'word22(a|b|c)\0'/ ':word:second word:(word22a word22b word22c)' \) \) -_cmd "$@" -#+END_SRC -in this case the first word can be word1 or word11 followed by an a, b or c, and if the first word contains 11 then a second -word is allowed which can be word2 followed by and a, b, or c, or a filename. - -If this sounds too complicated a much simpler alternative is to use the _regex_words function for creating -specifications for _regex_arguments. -*** Patterns -You may notice that the / PATTERN/ specs in the previous example don't look like normal regular expressions. -Often a string parameter in the form $'foo\0' is used. This is so that the \0 in the string is interpreted correctly -as a null char which is used to separate words in the internal representation. If you don't include the \0 at the end -of the pattern you may get problems matching the next word. If you need to use the contents of a variable in a pattern, -you can double quote it so that it gets expanded and then put a string parameter containing a null char afterwards, -like this: "$somevar"$'\0' - -The regular expression syntax for patterns seems to be a bit different from normal regular expressions, -and I can't find documentation anywhere. -However I have managed to work out what the following special chars are for: -| * | wildcard - any number of chars | -| ? | wildcard - single char | -| # | zero or more of the previous char (like * in a normal regular expression) | -| ## | one or more of the previous char (like + in a normal regular expression) | -*** _regex_words -The _regex_words function makes it much easier to create specifications for _regex_arguments. -The results of calling _regex_words can be stored in a variable which can then be used instead -of a specification for _regex_arguments. - -To create a specification using _regex_words you supply it with a tag followed by a description followed by a list -of specifications for individual words. These specifications take the form 'WORD:DESCRIPTION:SPEC' where WORD is the -word to be completed, DESCRIPTION is a description for it, and SPEC can be another variable created by _regex_words -specifying words that come after the current word or blank if there are no further words. -For example: -#+BEGIN_SRC sh -_regex_words firstword 'The first word' 'word1a:a word:' 'word1b:b word:' 'word1c:c word' -#+END_SRC -the results of this function call will be stored in the $reply array, and so we should store it in another array -before $reply gets changed again, like this: -#+BEGIN_SRC sh -local -a firstword -_regex_words word 'The first word' 'word1a:a word:' 'word1b:b word:' 'word1c:c word' -firstword="$reply[@]" -#+END_SRC -we could then use it with _regex_arguments like this: -#+BEGIN_SRC sh -_regex_arguments _cmd /$'[^\0]##\0'/ "$firstword[@]" -_cmd "$@" -#+END_SRC -Note that I have added an extra pattern for the initial command word itself. - -Here is a more complex example where we call _regex_words for different words on the command line -#+BEGIN_SRC sh -local -a firstword firstword2 secondword secondword2 -_regex_words word1 'The second word' 'woo:tang clan' 'hoo:not me' -secondword=("$reply[@]") -_regex_words word2 'Another second word' 'yee:thou' 'haa:very funny!' -secondword2=("$reply[@]") -_regex_words commands 'The first word' 'foo:do foo' 'man:yeah man' 'chu:at chu' -firstword=("$reply[@]") -_regex_words word4 'Another first word' 'boo:scare somebody:$secondword' 'ga:baby noise:$secondword'\ - 'loo:go to the toilet:$secondword2' -firstword2=("$reply[@]") - -_regex_arguments _hello /$'[^\0]##\0'/ "${firstword[@]}" "${firstword2[@]}" -_hello "$@" -#+END_SRC -In this case the first word can be one of "foo", "man", "chu", "boo", "ga" or "loo". -If the first word is "boo" or "ga" then the second word can be "woo" or "hoo", -and if the first word is "loo" then the second word can be "yee" or "haa", in the other -cases there is no second word. - -For a good example of the usage of _regex_words have a look at the _ip function. -** complex completions with _values, _sep_parts, & _multi_parts -The _values, _sep_parts & _multi_parts functions can be used either on their own, or as ACTIONs in specifications for -_alternative, _arguments or _regex_arguments. The following examples may be instructive. -See the [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]] for more info. - -Space separated list of mp3 files: -#+BEGIN_SRC sh -_values 'mp3 files' ~/*.mp3 -#+END_SRC - -Comma separated list of session id numbers: -#+BEGIN_SRC sh -_values -s , 'session id' "${(uonzf)$(ps -A o sid=)}" -#+END_SRC - -Completes foo@news:woo, or foo@news:laa, or bar@news:woo, etc: -#+BEGIN_SRC sh -_sep_parts '(foo bar)' @ '(news ftp)' : '(woo laa)' -#+END_SRC - -Complete some MAC addresses one octet at a time: -#+BEGIN_SRC sh -_multi_parts : '(00:11:22:33:44:55 00:23:34:45:56:67 00:23:45:56:67:78)' -#+END_SRC - -** Adding completion words directly using compadd -For more fine grained control you can use the builtin compadd function to add completion words directly. -This function has many different options for controlling how completions are displayed and how text on the command line -can be altered when words are completed. Read the [[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][official documentation]] for full details. -Here I just give a few simple examples. - -Add some words to the list of possible completions: -#+BEGIN_SRC sh -compadd foo bar blah -#+END_SRC - -As above but also display an explanation: -#+BEGIN_SRC sh -compadd -X 'Some completions' foo bar blah -#+END_SRC - -As above but automatically insert a prefix of "what_" before the completed word: -#+BEGIN_SRC sh -compadd -P what_ foo bar blah -#+END_SRC - -As above but automatically insert a suffix of "_todo" after the completed word: -#+BEGIN_SRC sh -compadd -S _todo foo bar blah -#+END_SRC - -As above but automatically remove the "_todo" suffix if a blank char is typed after the suffix: -#+BEGIN_SRC sh -compadd -P _todo -q foo bar blah -#+END_SRC - -Add words in array $wordsarray to the list of possible completions -#+BEGIN_SRC sh -compadd -a wordsarray -#+END_SRC - -* Testing & debugging -To reload a completion function: -#+BEGIN_SRC sh -> unfunction _func -> autoload -U _func -#+END_SRC - -The following functions can be called to obtain useful information. -If the default keybindings don't work you can try pressing Alt+x and then enter the command name. -| Function | Default keybinding | Description | -|-----------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------| -| _complete_help | Ctrl+x h | displays information about context names, tags, and completion functions used when completing at the current cursor position | -| _complete_help | Alt+2 Ctrl+x h | as above but displays even more information | -| _complete_debug | Ctrl+x ? | performs ordinary completion, but captures in a temporary file a trace of the shell commands executed by the completion system | -* Gotchas (things to watch out for) -Remember to include a #compdef line at the beginning of the file containing the completion function. - -Take care to use the correct type of quoting for specifications to _arguments or _regex_arguments: -use double quotes if there is a parameter that needs to be expanded in the specification, single quotes otherwise, -and make sure to use different quotes around item descriptions. - -Check that you have the correct number of :'s in the correct places for specifications for _arguments, -_alternative, _regex_arguments, etc. - -Remember to include an initial pattern to match the command word when using _regex_arguments (it does not need a matching action). - -Remember to put a null char $'\0' at the end of any PATTERN argument for _regex_arguments -* Tips -Sometimes you have a situation where there is just one option that can come after a subcommand, and zsh will complete this -automatically when tab is pressed after the subcommand. If instead you want it listed with its description before completing -you can add another empty option (i.e. \:) to the ACTION like this ':TAG:DESCRIPTION:((opt1\:"description for opt1" \:))' -Note this only applies to utility functions that use ACTIONs in their specification arguments (_arguments, _regex_arguments, etc.) - -* Other resources -[[https://wikimatze.de/writing-zsh-completion-for-padrino/][Here]] is a nicely formatted short tutorial showing basic usage of the _arguments function, -and [[http://www.linux-mag.com/id/1106/][here]] is a slightly more advanced tutorial using the _arguments function. -[[http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System][Here]] is the zshcompsys man page. diff --git a/.zprezto/modules/completion/external/zsh-completions.plugin.zsh b/.zprezto/modules/completion/external/zsh-completions.plugin.zsh deleted file mode 100644 index b56f55d..0000000 --- a/.zprezto/modules/completion/external/zsh-completions.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -fpath+="${0:h}/src" diff --git a/.zprezto/modules/completion/init.zsh b/.zprezto/modules/completion/init.zsh deleted file mode 100644 index 07acf13..0000000 --- a/.zprezto/modules/completion/init.zsh +++ /dev/null @@ -1,161 +0,0 @@ -# -# Sets completion options. -# -# Authors: -# Robby Russell -# Sorin Ionescu -# - -# Return if requirements are not found. -if [[ "$TERM" == 'dumb' ]]; then - return 1 -fi - -# Add zsh-completions to $fpath. -fpath=("${0:h}/external/src" $fpath) - -# -# Options -# - -setopt COMPLETE_IN_WORD # Complete from both ends of a word. -setopt ALWAYS_TO_END # Move cursor to the end of a completed word. -setopt PATH_DIRS # Perform path search even on command names with slashes. -setopt AUTO_MENU # Show completion menu on a successive tab press. -setopt AUTO_LIST # Automatically list choices on ambiguous completion. -setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash. -setopt EXTENDED_GLOB # Needed for file modification glob modifiers with compinit -unsetopt MENU_COMPLETE # Do not autoselect the first completion entry. -unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor. - -# Load and initialize the completion system ignoring insecure directories with a -# cache time of 20 hours, so it should almost always regenerate the first time a -# shell is opened each day. -autoload -Uz compinit -_comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20)) -if (( $#_comp_files )); then - compinit -i -C -else - compinit -i -fi -unset _comp_files - -# -# Styles -# - -# Use caching to make completion for commands such as dpkg and apt usable. -zstyle ':completion::complete:*' use-cache on -zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache" - -# Case-insensitive (all), partial-word, and then substring completion. -if zstyle -t ':prezto:module:completion:*' case-sensitive; then - zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - setopt CASE_GLOB -else - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - unsetopt CASE_GLOB -fi - -# Group matches and describe. -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*:matches' group 'yes' -zstyle ':completion:*:options' description 'yes' -zstyle ':completion:*:options' auto-description '%d' -zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f' -zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f' -zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' -zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' -zstyle ':completion:*:default' list-prompt '%S%M matches%s' -zstyle ':completion:*' format ' %F{yellow}-- %d --%f' -zstyle ':completion:*' group-name '' -zstyle ':completion:*' verbose yes - -# Fuzzy match mistyped completions. -zstyle ':completion:*' completer _complete _match _approximate -zstyle ':completion:*:match:*' original only -zstyle ':completion:*:approximate:*' max-errors 1 numeric - -# Increase the number of errors based on the length of the typed word. But make -# sure to cap (at 7) the max-errors to avoid hanging. -zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' - -# Don't complete unavailable commands. -zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' - -# Array completion element sorting. -zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters - -# Directories -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories -zstyle ':completion:*:*:cd:*:directory-stack' menu yes select -zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' -zstyle ':completion:*' squeeze-slashes true - -# History -zstyle ':completion:*:history-words' stop yes -zstyle ':completion:*:history-words' remove-all-dups yes -zstyle ':completion:*:history-words' list false -zstyle ':completion:*:history-words' menu yes - -# Environment Variables -zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-} - -# Populate hostname completion. But allow ignoring custom entries from static -# */etc/hosts* which might be uninteresting. -zstyle -a ':prezto:module:completion:*:hosts' etc-host-ignores '_etc_host_ignores' - -zstyle -e ':completion:*:hosts' hosts 'reply=( - ${=${=${=${${(f)"$(cat {/etc/ssh/ssh_,~/.ssh/}known_hosts(|2)(N) 2> /dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } - ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2> /dev/null))"}%%(\#${_etc_host_ignores:+|${(j:|:)~_etc_host_ignores}})*} - ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2> /dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} -)' - -# Don't complete uninteresting users... -zstyle ':completion:*:*:*:users' ignored-patterns \ - adm amanda apache avahi beaglidx bin cacti canna clamav daemon \ - dbus distcache dovecot fax ftp games gdm gkrellmd gopher \ - hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \ - mailman mailnull mldonkey mysql nagios \ - named netdump news nfsnobody nobody nscd ntp nut nx openvpn \ - operator pcap postfix postgres privoxy pulse pvm quagga radvd \ - rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*' - -# ... unless we really want to. -zstyle '*' single-ignored show - -# Ignore multiple entries. -zstyle ':completion:*:(rm|kill|diff):*' ignore-line other -zstyle ':completion:*:rm:*' file-patterns '*:all-files' - -# Kill -zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w' -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01' -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:*:kill:*' force-list always -zstyle ':completion:*:*:kill:*' insert-ids single - -# Man -zstyle ':completion:*:manuals' separate-sections true -zstyle ':completion:*:manuals.(^1*)' insert-sections true - -# Media Players -zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories' -zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories' -zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories' -zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories' - -# Mutt -if [[ -s "$HOME/.mutt/aliases" ]]; then - zstyle ':completion:*:*:mutt:*' menu yes select - zstyle ':completion:*:mutt:*' users ${${${(f)"$(<"$HOME/.mutt/aliases")"}#alias[[:space:]]}%%[[:space:]]*} -fi - -# SSH/SCP/RSYNC -zstyle ':completion:*:(ssh|scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *' -zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr -zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr -zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost -zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' -zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' diff --git a/.zprezto/modules/directory/README.md b/.zprezto/modules/directory/README.md deleted file mode 100644 index 47c1bc2..0000000 --- a/.zprezto/modules/directory/README.md +++ /dev/null @@ -1,35 +0,0 @@ -Directory -========= - -Sets directory options and defines directory aliases. - -Options -------- - - - `AUTO_CD` auto changes to a directory without typing `cd`. - - `AUTO_PUSHD` pushes the old directory onto the stack on `cd`. - - `PUSHD_IGNORE_DUPS` does not store duplicates in the stack. - - `PUSHD_SILENT` does not print the directory stack after `pushd` or `popd`. - - `PUSHD_TO_HOME` pushes to the home directory when no argument is given. - - `CDABLE_VARS` changes directory to a path stored in a variable. - - `AUTO_NAME_DIRS` auto adds variable-stored paths to `~` list. - - `MULTIOS` writes to multiple descriptors. - - `EXTENDED_GLOB` uses extended globbing syntax. - - `CLOBBER` does not overwrite existing files with `>` and `>>`. Use `>!` and - `>>!` to bypass. - -Aliases -------- - - - `d` prints the contents of the directory stack. - - `1 ... 9` changes the directory to the **n** previous one. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [James Cox](https://github.com/imajes) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/directory/init.zsh b/.zprezto/modules/directory/init.zsh deleted file mode 100644 index 8abc1e2..0000000 --- a/.zprezto/modules/directory/init.zsh +++ /dev/null @@ -1,29 +0,0 @@ -# -# Sets directory options and defines directory aliases. -# -# Authors: -# James Cox -# Sorin Ionescu -# - -# -# Options -# - -setopt AUTO_CD # Auto changes to a directory without typing cd. -setopt AUTO_PUSHD # Push the old directory onto the stack on cd. -setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack. -setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd. -setopt PUSHD_TO_HOME # Push to home directory when no argument is given. -setopt CDABLE_VARS # Change directory to a path stored in a variable. -setopt MULTIOS # Write to multiple descriptors. -setopt EXTENDED_GLOB # Use extended globbing syntax. -unsetopt CLOBBER # Do not overwrite existing files with > and >>. - # Use >! and >>! to bypass. - -# -# Aliases -# - -alias d='dirs -v' -for index ({1..9}) alias "$index"="cd +${index}"; unset index diff --git a/.zprezto/modules/dnf/README.md b/.zprezto/modules/dnf/README.md deleted file mode 100644 index bbf1c92..0000000 --- a/.zprezto/modules/dnf/README.md +++ /dev/null @@ -1,29 +0,0 @@ -DNF -=== - -Defines [dnf][1] aliases. - -Aliases -------- - - - `dnfc` removes package(s) and leaves. - - `dnfi` installs package(s). - - `dnfh` displays history. - - `dnfl` lists packages. - - `dnfL` lists installed packages. - - `dnfq` displays package information. - - `dnfr` removes package(s). - - `dnfs` searches for a package. - - `dnfu` updates packages. - - `dnfU` upgrades packages. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://fedoraproject.org/wiki/Features/DNF -[2]: https://github.com/sorin-ionescu/prezto/issues - diff --git a/.zprezto/modules/dnf/init.zsh b/.zprezto/modules/dnf/init.zsh deleted file mode 100644 index 7a40142..0000000 --- a/.zprezto/modules/dnf/init.zsh +++ /dev/null @@ -1,28 +0,0 @@ -# -# Defines dnf aliases. -# -# Authors: -# FireWave -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[dnf] )); then - return 1 -fi - -# -# Aliases -# - -alias dnfc='sudo dnf clean all' # Cleans the cache. -alias dnfh='dnf history' # Displays history. -alias dnfi='sudo dnf install' # Installs package(s). -alias dnfl='dnf list' # Lists packages. -alias dnfL='dnf list installed' # Lists installed packages. -alias dnfq='dnf info' # Displays package information. -alias dnfr='sudo dnf remove' # Removes package(s). -alias dnfs='dnf search' # Searches for a package. -alias dnfu='sudo dnf update' # Updates packages. -alias dnfU='sudo dnf upgrade' # Upgrades packages. - diff --git a/.zprezto/modules/docker/README.md b/.zprezto/modules/docker/README.md deleted file mode 100644 index 335f77a..0000000 --- a/.zprezto/modules/docker/README.md +++ /dev/null @@ -1,190 +0,0 @@ -# ZSH Docker Aliases - -Defines [Docker][1] aliases and functions. - -## Aliases - -### Docker - -- `dk` is short for `docker` -- `dka` Attach to a running container -- `dkb` Build an image from a Dockerfile -- `dkd` Inspect changes on a container's filesystem -- `dkdf` Show docker filesystem usage -- `dke` Run a command in a running container -- `dkE` Run an interactive command in a running container -- `dkh` Show the history of an image -- `dki` List images -- `dkin` Return low-level information on a container, image or task -- `dkk` Kill a running container -- `dkl` Fetch the logs of a container -- `dkli` Log in to a Docker registry -- `dklo` Log out from a Docker registry -- `dkls` is alias for `dkps` -- `dkp` Pause all processes within one or more containers -- `dkP` Unpause all processes within one or more containers -- `dkpl` Pull an image or a repository from a registry -- `dkph` Push an image or a repository to a registry -- `dkps` List containers -- `dkpsa` List all containers (default lists just running) -- `dkr` Run a command in a new container -- `dkR` Run an interactive command in a new container and automatically remove the container when it exits -- `dkRe` like `dkR` and set entry point to `/bin/bash` -- `dkrm` Remove one or more containers -- `dkrmi` Remove one or more images -- `dkrmC` Clean up exited containers -- `dkrmI` Clean up dangling images -- `dkrmV` Clean up unused volumes ( Docker >= 1.9 ) -- `dkrn` Rename a container -- `dks` Start one or more stopped containers -- `dkS` Restart a container -- `dkss` Display a live stream of container(s) resource usage statistics -- `dksv` Save one or more images to a tar archive (streamed to STDOUT by default) -- `dkt` Tag an image into a repository -- `dktop` Display the running processes of a container -- `dkup` Update configuration of one or more containers -- `dkV` Manage Docker volumes -- `dkv` Show the Docker version information -- `dkw` Block until a container stops, then print its exit code -- `dkx` Stop a running container - -#### container (C) - -- `dkC` Manage containers -- `dkCa` Attach to a running container -- `dkCcp` Copy files/folders between a container and the local filesystem -- `dkCd` Inspect changes on a container's filesystem -- `dkCe` Run a command in a running container -- `dkCin` Display detailed information on one or more containers -- `dkCk` Kill one or more running containers -- `dkCl` Fetch the logs of a container -- `dkCls` List containers -- `dkCp` Pause all processes within one or more containers -- `dkCpr` Remove all stopped containers -- `dkCrn` Rename a container -- `dkCS` Restart one or more containers -- `dkCrm` Remove one or more containers -- `dkCr` Run a command in a new container -- `dkCR` Run an interactive command in a new container and automatically remove the container when it exits -- `dkCRe` like `dkCR` and set entry point to `/bin/bash` -- `dkCs` Start one or more stopped containers -- `dkCss` Display a live stream of container(s) resource usage statistics -- `dkCx` Stop one or more running containers -- `dkCtop` Display the running processes of a container -- `dkCP` Unpause all processes within one or more containers -- `dkCup` Update configuration of one or more containers -- `dkCw` Block until one or more containers stop, then print their exit codes - -#### image (I) - -- `dkI` Manage images -- `dkIb` Build an image from a Dockerfile -- `dkIh` Show the history of an image -- `dkIim` Import the contents from a tarball to create a filesystem image -- `dkIin` Display detailed information on one or more images -- `dkIls` List images -- `dkIpr` Remove unused images -- `dkIpl` Pull an image or a repository from a registry -- `dkIph` Push an image or a repository to a registry -- `dkIrm` Remove one or more images -- `dkIsv` Save one or more images to a tar archive (streamed to STDOUT by default) -- `dkIt` Tag an image into a repository - -#### volume (V) - -- `dkV` Manage volumes -- `dkVin` Display detailed information on one or more volumes -- `dkVls` List volumes -- `dkVpr` Remove all unused volumes -- `dkVrm` Remove one or more volumes - -#### network (N) - -- `dkN` Manage networks -- `dkNs` Connect a container to a network -- `dkNx` Disconnects a container from a network -- `dkNin` Displays detailed information on a network -- `dkNls` Lists all the networks created by the user -- `dkNpr` Remove all unused networks -- `dkNrm` Deletes one or more networks - -#### system (Y) - -- `dkY` Manage Docker -- `dkYdf` Show docker filesystem usage -- `dkYpr` Remove unused data - -#### stack (K) - -- `dkK` Manage Docker stacks -- `dkKls` List stacks -- `dkKps` List the tasks in the stack -- `dkKrm` Remove the stack - -#### swarm (W) - -- `dkW` Manage Docker Swarm - -### Docker Machine - -- `dkm` is short for `docker-machine` -- `dkma` Get or set the active machine -- `dkmcp` Copy files between machines -- `dkmd` Set up the default machine ; alowing you to use `dkme` without arguments -- `dkme` Set up the environment for the Docker client (eg: `dkme staging` to toggle to staging) -- `dkmin` Inspect information about a machine -- `dkmip` Get the IP address of a machine -- `dkmk` Kill a machine -- `dkmls` List machines -- `dkmpr` Re-provision existing machines -- `dkmps` is alias for `dkmls` -- `dkmrg` Regenerate TLS Certificates for a machine -- `dkmrm` Remove a machine -- `dkms` Start a machine -- `dkmsh` Log into or run a command on a machine with SSH -- `dkmst` Get the status of a machine -- `dkmS` Restart a machine -- `dkmu` Get the URL of a machine -- `dkmup` Upgrade a machine to the latest version of Docker -- `dkmV` Show the Docker Machine version or a machine docker version -- `dkmx` Stop a machine - -### Docker Compose - -- `dkc` is short for `docker-compose` -- `dkcb` Build or rebuild services -- `dkcB` Build or rebuild services and do not use cache when building the image -- `dkcd` Stop and remove containers, networks, images, and volumes -- `dkce` Execute a command in a running container -- `dkck` Kill containers -- `dkcl` View output from containers -- `dkcls` is alias for `dkcps` -- `dkcp` Pause services -- `dkcP` Unpause services -- `dkcpl` Pull service images -- `dkcph` Push service images -- `dkcps` List containers -- `dkcr` Run a one-off command -- `dkcR` Run a one-off command and remove container after run. -- `dkcrm` Remove stopped containers -- `dkcs` Start services -- `dkcsc` Set number of containers for a service -- `dkcS` Restart services -- `dkcu` Create and start containers -- `dkcU` Create and start containers in detached mode: - Run containers in the background, print new container names -- `dkcV` Show the Docker-Compose version information -- `dkcx` Stop services - -## Support - -If you're having problems, use the [Prezto issue tracker][2]. - -## Acknowledgements - -This module is a copy of [akarzim/zsh-docker-aliases][3] by [François Vantomme][4] (MIT License). - -[1]: https://www.docker.com/ -[2]: https://github.com/zsh-users/prezto/issues -[3]: https://github.com/akarzim/zsh-docker-aliases -[4]: https://github.com/akarzim diff --git a/.zprezto/modules/docker/alias.zsh b/.zprezto/modules/docker/alias.zsh deleted file mode 100644 index cdd9f7c..0000000 --- a/.zprezto/modules/docker/alias.zsh +++ /dev/null @@ -1,177 +0,0 @@ -# -# Defines Docker aliases. -# -# Author: -# François Vantomme -# - -# -# Aliases -# - -# Docker -alias dk='docker' -alias dka='docker attach' -alias dkb='docker build' -alias dkd='docker diff' -alias dkdf='docker system df' -alias dke='docker exec' -alias dkE='docker exec -it' -alias dkh='docker history' -alias dki='docker images' -alias dkin='docker inspect' -alias dkim='docker import' -alias dkk='docker kill' -alias dkl='docker logs' -alias dkli='docker login' -alias dklo='docker logout' -alias dkls='docker ps' -alias dkp='docker pause' -alias dkP='docker unpause' -alias dkpl='docker pull' -alias dkph='docker push' -alias dkps='docker ps' -alias dkpsa='docker ps -a' -alias dkr='docker run' -alias dkR='docker run -it --rm' -alias dkRe='docker run -it --rm --entrypoint /bin/bash' -alias dkRM='docker system prune' -alias dkrm='docker rm' -alias dkrmi='docker rmi' -alias dkrn='docker rename' -alias dks='docker start' -alias dkS='docker restart' -alias dkss='docker stats' -alias dksv='docker save' -alias dkt='docker tag' -alias dktop='docker top' -alias dkup='docker update' -alias dkV='docker volume' -alias dkv='docker version' -alias dkw='docker wait' -alias dkx='docker stop' - -## Container (C) -alias dkC='docker container' -alias dkCa='docker container attach' -alias dkCcp='docker container cp' -alias dkCd='docker container diff' -alias dkCe='docker container exec' -alias dkCin='docker container inspect' -alias dkCk='docker container kill' -alias dkCl='docker container logs' -alias dkCls='docker container ls' -alias dkCp='docker container pause' -alias dkCpr='docker container prune' -alias dkCrn='docker container rename' -alias dkCS='docker container restart' -alias dkCrm='docker container rm' -alias dkCr='docker container run' -alias dkCR='docker container run -it --rm' -alias dkCRe='docker container run -it --rm --entrypoint /bin/bash' -alias dkCs='docker container start' -alias dkCss='docker container stats' -alias dkCx='docker container stop' -alias dkCtop='docker container top' -alias dkCP='docker container unpause' -alias dkCup='docker container update' -alias dkCw='docker container wait' - -## Image (I) -alias dkI='docker image' -alias dkIb='docker image build' -alias dkIh='docker image history' -alias dkIim='docker image import' -alias dkIin='docker image inspect' -alias dkIls='docker image ls' -alias dkIpr='docker image prune' -alias dkIpl='docker image pull' -alias dkIph='docker image push' -alias dkIrm='docker image rm' -alias dkIsv='docker image save' -alias dkIt='docker image tag' - -## Volume (V) -alias dkV='docker volume' -alias dkVin='docker volume inspect' -alias dkVls='docker volume ls' -alias dkVpr='docker volume prune' -alias dkVrm='docker volume rm' - -## Network (N) -alias dkN='docker network' -alias dkNs='docker network connect' -alias dkNx='docker network disconnect' -alias dkNin='docker network inspect' -alias dkNls='docker network ls' -alias dkNpr='docker network prune' -alias dkNrm='docker network rm' - -## System (Y) -alias dkY='docker system' -alias dkYdf='docker system df' -alias dkYpr='docker system prune' - -## Stack (K) -alias dkK='docker stack' -alias dkKls='docker stack ls' -alias dkKps='docker stack ps' -alias dkKrm='docker stack rm' - -## Swarm (W) -alias dkW='docker swarm' - -## CleanUp (rm) -# Clean up exited containers (docker < 1.13) -alias dkrmC='docker rm $(docker ps -qaf status=exited)' -# Clean up dangling images (docker < 1.13) -alias dkrmI='docker rmi $(docker images -qf dangling=true)' -# Clean up dangling volumes (docker < 1.13) -alias dkrmV='docker volume rm $(docker volume ls -qf dangling=true)' - - -# Docker Machine (m) -alias dkm='docker-machine' -alias dkma='docker-machine active' -alias dkmcp='docker-machine scp' -alias dkmin='docker-machine inspect' -alias dkmip='docker-machine ip' -alias dkmk='docker-machine kill' -alias dkmls='docker-machine ls' -alias dkmpr='docker-machine provision' -alias dkmps='docker-machine ps' -alias dkmrg='docker-machine regenerate-certs' -alias dkmrm='docker-machine rm' -alias dkms='docker-machine start' -alias dkmsh='docker-machine ssh' -alias dkmst='docker-machine status' -alias dkmS='docker-machine restart' -alias dkmu='docker-machine url' -alias dkmup='docker-machine upgrade' -alias dkmv='docker-machine version' -alias dkmx='docker-machine stop' - -# Docker Compose (c) -alias dkc='docker-compose' -alias dkcb='docker-compose build' -alias dkcB='docker-compose build --no-cache' -alias dkcd='docker-compose down' -alias dkce='docker-compose exec' -alias dkck='docker-compose kill' -alias dkcl='docker-compose logs' -alias dkcls='docker-compose ps' -alias dkcp='docker-compose pause' -alias dkcP='docker-compose unpause' -alias dkcpl='docker-compose pull' -alias dkcph='docker-compose push' -alias dkcps='docker-compose ps' -alias dkcr='docker-compose run' -alias dkcR='docker-compose run --rm' -alias dkcrm='docker-compose rm' -alias dkcs='docker-compose start' -alias dkcsc='docker-compose scale' -alias dkcS='docker-compose restart' -alias dkcu='docker-compose up' -alias dkcU='docker-compose up -d' -alias dkcv='docker-compose version' -alias dkcx='docker-compose stop' diff --git a/.zprezto/modules/docker/init.zsh b/.zprezto/modules/docker/init.zsh deleted file mode 100644 index 8ad6bfd..0000000 --- a/.zprezto/modules/docker/init.zsh +++ /dev/null @@ -1,57 +0,0 @@ -# -# Defines Docker aliases. -# -# Author: -# François Vantomme -# - -# Return if requirements are not found. -if (( ! $+commands[docker] )); then - return 1 -fi - -# -# Functions -# - -# Set Docker Machine environment -function dkme { - if (( ! $+commands[docker-machine] )); then - return 1 - fi - - eval $(docker-machine env $1) -} - -# Set Docker Machine default machine -function dkmd { - if (( ! $+commands[docker-machine] )); then - return 1 - fi - - pushd ~/.docker/machine/machines - - if [[ ! -d $1 ]]; then - echo "Docker machine '$1' does not exists. Abort." - popd - return 1 - fi - - if [[ -L default ]]; then - eval $(rm -f default) - elif [[ -d default ]]; then - echo "A default machine already exists. Abort." - popd - return 1 - elif [[ -e default ]]; then - echo "A file named 'default' already exists. Abort." - popd - return 1 - fi - - eval $(ln -s $1 default) - popd -} - -# Source module files. -source "${0:h}/alias.zsh" diff --git a/.zprezto/modules/dpkg/README.md b/.zprezto/modules/dpkg/README.md deleted file mode 100644 index 6290c05..0000000 --- a/.zprezto/modules/dpkg/README.md +++ /dev/null @@ -1,41 +0,0 @@ -Dpkg -==== - -Defines [dpkg][1] aliases and functions. - -Aliases -------- - -- `debc` cleans the cache. -- `debf` displays a file's package. -- `debi` installs packages from repositories. -- `debI` installs packages from files. -- `debq` displays package information. -- `debu` updates the package lists. -- `debU` upgrades outdated packages. -- `debx` removes packages. -- `debX` removes packages, their configuration, and unneeded dependencies. -- `debs` searches for packages. -- `deb-build` creates a basic deb package. -- `deb-kclean` removes all kernel images and headers, except for the ones in - use. - -Functions ---------- - -- `deb-clone` generates a script that can be used to duplicate a dpkg-based - system. -- `deb-history` displays dpkg history. -- `deb-kbuild` makes a dpkg Linux kernel package. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Daniel Bolton](https://github.com/dbb) - - [Benjamin Boudreau](https://github.com/dreur) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://wiki.debian.org/Teams/Dpkg -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/dpkg/functions/deb-clone b/.zprezto/modules/dpkg/functions/deb-clone deleted file mode 100644 index a767bd3..0000000 --- a/.zprezto/modules/dpkg/functions/deb-clone +++ /dev/null @@ -1,29 +0,0 @@ -# -# Generates a script that can be used to duplicate a dpkg-based system. -# -# Authors: -# Daniel Bolton -# Sorin Ionescu -# - -# function deb-clone { - -local clone_script="${0}.sh" -local package_list=$( - perl \ - -m 'AptPkg::Cache' \ - -e ' - $c=AptPkg::Cache->new; - for (keys %$c) { - push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed'; - } - print "$_ " for sort @a; - ' -) - -rm "$clone_script" -print '#!/bin/sh\n' > "$clone_script" -print "aptitude install ${package_list}\n" >> "$clone_script" -chmod +x "$clone_script" - -# } diff --git a/.zprezto/modules/dpkg/functions/deb-history b/.zprezto/modules/dpkg/functions/deb-history deleted file mode 100644 index a1369de..0000000 --- a/.zprezto/modules/dpkg/functions/deb-history +++ /dev/null @@ -1,40 +0,0 @@ -# -# Displays dpkg history. -# -# Authors: -# Peter Leung -# Benjamin Boudreau -# Sorin Ionescu -# - -# function deb-history { - -case "$1" in - (install) - zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*) - ;; - (upgrade|remove) - zgrep --no-filename "$1" $(ls -rt /var/log/dpkg*) - ;; - (rollback) - zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) \ - | grep "$2" -A10000000 \ - | grep "$3" -B10000000 \ - | awk '{print $4"="$5}' - ;; - (list) - zcat $(ls -rt /var/log/dpkg*) - ;; - (*) - cat >&2 < -# Sorin Ionescu -# - -# function deb-kbuild { - -make-kpkg clean -MAKEFLAGS='' time fakeroot make-kpkg \ - --append-to-version '-custom' \ - --revision "$(date +"%Y%m%d")" \ - kernel_image \ - kernel_headers - -# } diff --git a/.zprezto/modules/dpkg/init.zsh b/.zprezto/modules/dpkg/init.zsh deleted file mode 100644 index 69d524f..0000000 --- a/.zprezto/modules/dpkg/init.zsh +++ /dev/null @@ -1,57 +0,0 @@ -# -# Defines dpkg aliases. -# -# Authors: -# Daniel Bolton -# Benjamin Boudreau -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[dpkg] && ! $+commands[apt-get] )); then - return 1 -fi - -# -# Aliases -# - -# Cleans the cache. -alias debc='sudo apt-get clean && sudo apt-get autoclean' - -# Displays a file's package. -alias debf='apt-file search --regexp' - -# Installs packages from repositories. -alias debi='sudo apt-get install' - -# Installs packages from files. -alias debI='sudo dpkg -i' - -# Displays package information. -alias debq='apt-cache show' - -# Updates the package lists. -alias debu='sudo apt-get update' - -# Upgrades outdated packages. -alias debU='sudo apt-get update && sudo apt-get dist-upgrade' - -# Removes packages. -alias debx='sudo apt-get remove' - -# Removes packages, their configuration, and unneeded dependencies. -alias debX='sudo apt-get remove --purge && sudo apt-get autoremove --purge' - -# Searches for packages. -if (( $+commands[aptitude] )); then - alias debs='aptitude -F "* %p -> %d \n(%v/%V)" --no-gui --disable-columns search' -else - alias debs='apt-cache search' -fi - -# Creates a basic deb package. -alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc' - -# Removes all kernel images and headers, except for the ones in use. -alias deb-kclean='sudo aptitude remove -P "?and(~i~nlinux-(ima|hea) ?not(~n$(uname -r)))"' diff --git a/.zprezto/modules/editor/README.md b/.zprezto/modules/editor/README.md deleted file mode 100644 index d5280c4..0000000 --- a/.zprezto/modules/editor/README.md +++ /dev/null @@ -1,109 +0,0 @@ -Editor -====== - -Sets editor specific key bindings options and variables. - -Options -------- - - - `BEEP` beep on error in line editor. - -Variables ---------- - - - `WORDCHARS` treat a given set of characters as part of a word. - -Settings --------- - -### Key bindings - -To enable key bindings, add the following to *zpreztorc*, and replace 'bindings' -with 'emacs' or 'vi'. - -```sh -zstyle ':prezto:module:editor' key-bindings 'bindings' -``` - -### Dot Expansion - -To enable the auto conversion of .... to ../.., add the following to -*zpreztorc*. - -```sh -zstyle ':prezto:module:editor' dot-expansion 'yes' -``` - -### PS Context - -To enable the prompt context to be set, add the following to your -*zpreztorc*. - -```sh -zstyle ':prezto:module:editor' ps-context 'yes' -``` - -Theming -------- - -To indicate when the editor is in the primary keymap (emacs or viins), add -the following to your `theme_prompt_setup` function. - -```sh -zstyle ':prezto:module:editor:info:keymap:primary' format '>>>' -``` - -To indicate when the editor is in the primary keymap (emacs or viins) insert -mode, add the following to your `theme_prompt_setup` function. - -```sh -zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I' -``` - -To indicate when the editor is in the primary keymap (emacs or viins) overwrite -mode, add the following to your `theme_prompt_setup` function. - -```sh -zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O' -``` - -To indicate when the editor is in the alternate keymap (vicmd), add the -following to your `theme_prompt_setup` function. - -```sh -zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<' -``` - -To indicate when the editor is completing, add the following to your -`theme_prompt_setup` function. - -```sh -zstyle ':prezto:module:editor:info:completing' format '...' -``` - -Then add `$editor_info[context]`, where context is *keymap*, *insert*, or -*overwrite*, to `$PROMPT` or `$RPROMPT`. - -Convenience Functions ---------------------- - -### bindkey-all - -Provides a function `bindkey-all` which can be useful for checking how all of the -keys are bound. Normal `bindkey` command will only list the keys bound for one -keymap, which is not as useful if you want to grep through the output. The -keymap's names go to stderr so when you grep through bindkey-all's output you -will still see the headings and can tell which keymap each binding goes to. - -It will also pass through arguments so you can use bindkey-all to set bindings -for all keymaps at once. If provided arguments it will *not* print out the -names of each of the keymaps, and just run the command for each keymap. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/oh-my-zsh/issues diff --git a/.zprezto/modules/editor/init.zsh b/.zprezto/modules/editor/init.zsh deleted file mode 100644 index 085947e..0000000 --- a/.zprezto/modules/editor/init.zsh +++ /dev/null @@ -1,449 +0,0 @@ -# -# Sets key bindings. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if [[ "$TERM" == 'dumb' ]]; then - return 1 -fi - -# -# Options -# - -setopt BEEP # Beep on error in line editor. - -# -# Variables -# - -# Treat these characters as part of a word. -WORDCHARS='*?_-.[]~&;!#$%^(){}<>' - -# Use human-friendly identifiers. -zmodload zsh/terminfo -typeset -gA key_info -key_info=( - 'Control' '\C-' - 'ControlLeft' '\e[1;5D \e[5D \e\e[D \eOd' - 'ControlRight' '\e[1;5C \e[5C \e\e[C \eOc' - 'ControlPageUp' '\e[5;5~' - 'ControlPageDown' '\e[6;5~' - 'Escape' '\e' - 'Meta' '\M-' - 'Backspace' "^?" - 'Delete' "^[[3~" - 'F1' "$terminfo[kf1]" - 'F2' "$terminfo[kf2]" - 'F3' "$terminfo[kf3]" - 'F4' "$terminfo[kf4]" - 'F5' "$terminfo[kf5]" - 'F6' "$terminfo[kf6]" - 'F7' "$terminfo[kf7]" - 'F8' "$terminfo[kf8]" - 'F9' "$terminfo[kf9]" - 'F10' "$terminfo[kf10]" - 'F11' "$terminfo[kf11]" - 'F12' "$terminfo[kf12]" - 'Insert' "$terminfo[kich1]" - 'Home' "$terminfo[khome]" - 'PageUp' "$terminfo[kpp]" - 'End' "$terminfo[kend]" - 'PageDown' "$terminfo[knp]" - 'Up' "$terminfo[kcuu1]" - 'Left' "$terminfo[kcub1]" - 'Down' "$terminfo[kcud1]" - 'Right' "$terminfo[kcuf1]" - 'BackTab' "$terminfo[kcbt]" -) - -# Set empty $key_info values to an invalid UTF-8 sequence to induce silent -# bindkey failure. -for key in "${(k)key_info[@]}"; do - if [[ -z "$key_info[$key]" ]]; then - key_info[$key]='�' - fi -done - -# -# External Editor -# - -# Allow command line editing in an external editor. -autoload -Uz edit-command-line -zle -N edit-command-line - -# -# Functions -# -# Runs bindkey but for all of the keymaps. Running it with no arguments will -# print out the mappings for all of the keymaps. -function bindkey-all { - local keymap='' - for keymap in $(bindkey -l); do - [[ "$#" -eq 0 ]] && printf "#### %s\n" "${keymap}" 1>&2 - bindkey -M "${keymap}" "$@" - done -} -# Exposes information about the Zsh Line Editor via the $editor_info associative -# array. -function editor-info { - # Clean up previous $editor_info. - unset editor_info - typeset -gA editor_info - - if [[ "$KEYMAP" == 'vicmd' ]]; then - zstyle -s ':prezto:module:editor:info:keymap:alternate' format 'REPLY' - editor_info[keymap]="$REPLY" - else - zstyle -s ':prezto:module:editor:info:keymap:primary' format 'REPLY' - editor_info[keymap]="$REPLY" - - if [[ "$ZLE_STATE" == *overwrite* ]]; then - zstyle -s ':prezto:module:editor:info:keymap:primary:overwrite' format 'REPLY' - editor_info[overwrite]="$REPLY" - else - zstyle -s ':prezto:module:editor:info:keymap:primary:insert' format 'REPLY' - editor_info[overwrite]="$REPLY" - fi - fi - - unset REPLY - zle zle-reset-prompt -} -zle -N editor-info - -# Reset the prompt based on the current context and -# the ps-context option. -function zle-reset-prompt { - if zstyle -t ':prezto:module:editor' ps-context; then - # If we aren't within one of the specified contexts, then we want to reset - # the prompt with the appropriate editor_info[keymap] if there is one. - if [[ $CONTEXT != (select|cont) ]]; then - zle reset-prompt - zle -R - fi - else - zle reset-prompt - zle -R - fi -} -zle -N zle-reset-prompt - -# Updates editor information when the keymap changes. -function zle-keymap-select { - zle editor-info -} -zle -N zle-keymap-select - -# Enables terminal application mode and updates editor information. -function zle-line-init { - # The terminal must be in application mode when ZLE is active for $terminfo - # values to be valid. - if (( $+terminfo[smkx] )); then - # Enable terminal application mode. - echoti smkx - fi - - # Update editor information. - zle editor-info -} -zle -N zle-line-init - -# Disables terminal application mode and updates editor information. -function zle-line-finish { - # The terminal must be in application mode when ZLE is active for $terminfo - # values to be valid. - if (( $+terminfo[rmkx] )); then - # Disable terminal application mode. - echoti rmkx - fi - - # Update editor information. - zle editor-info -} -zle -N zle-line-finish - -# Toggles emacs overwrite mode and updates editor information. -function overwrite-mode { - zle .overwrite-mode - zle editor-info -} -zle -N overwrite-mode - -# Enters vi insert mode and updates editor information. -function vi-insert { - zle .vi-insert - zle editor-info -} -zle -N vi-insert - -# Moves to the first non-blank character then enters vi insert mode and updates -# editor information. -function vi-insert-bol { - zle .vi-insert-bol - zle editor-info -} -zle -N vi-insert-bol - -# Enters vi replace mode and updates editor information. -function vi-replace { - zle .vi-replace - zle editor-info -} -zle -N vi-replace - -# Expands .... to ../.. -function expand-dot-to-parent-directory-path { - if [[ $LBUFFER = *.. ]]; then - LBUFFER+='/..' - else - LBUFFER+='.' - fi -} -zle -N expand-dot-to-parent-directory-path - -# Displays an indicator when completing. -function expand-or-complete-with-indicator { - local indicator - zstyle -s ':prezto:module:editor:info:completing' format 'indicator' - - # This is included to work around a bug in zsh which shows up when interacting - # with multi-line prompts. - if [[ -z "$indicator" ]]; then - zle expand-or-complete - return - fi - - print -Pn "$indicator" - zle expand-or-complete - zle redisplay -} -zle -N expand-or-complete-with-indicator - -# Inserts 'sudo ' at the beginning of the line. -function prepend-sudo { - if [[ "$BUFFER" != su(do|)\ * ]]; then - BUFFER="sudo $BUFFER" - (( CURSOR += 5 )) - fi -} -zle -N prepend-sudo - -# Expand aliases -function glob-alias { - zle _expand_alias - zle expand-word - zle magic-space -} -zle -N glob-alias - -# Toggle the comment character at the start of the line. This is meant to work -# around a buggy implementation of pound-insert in zsh. -# -# This is currently only used for the emacs keys because vi-pound-insert has -# been reported to work properly. -function pound-toggle { - if [[ "$BUFFER" = '#'* ]]; then - # Because of an oddity in how zsh handles the cursor when the buffer size - # changes, we need to make this check before we modify the buffer and let - # zsh handle moving the cursor back if it's past the end of the line. - if [[ $CURSOR != $#BUFFER ]]; then - (( CURSOR -= 1 )) - fi - BUFFER="${BUFFER:1}" - else - BUFFER="#$BUFFER" - (( CURSOR += 1 )) - fi -} -zle -N pound-toggle - -# Reset to default key bindings. -bindkey -d - -# -# Emacs Key Bindings -# - -for key in "$key_info[Escape]"{B,b} "${(s: :)key_info[ControlLeft]}" - bindkey -M emacs "$key" emacs-backward-word -for key in "$key_info[Escape]"{F,f} "${(s: :)key_info[ControlRight]}" - bindkey -M emacs "$key" emacs-forward-word - -# Kill to the beginning of the line. -for key in "$key_info[Escape]"{K,k} - bindkey -M emacs "$key" backward-kill-line - -# Redo. -bindkey -M emacs "$key_info[Escape]_" redo - -# Search previous character. -bindkey -M emacs "$key_info[Control]X$key_info[Control]B" vi-find-prev-char - -# Match bracket. -bindkey -M emacs "$key_info[Control]X$key_info[Control]]" vi-match-bracket - -# Edit command in an external editor. -bindkey -M emacs "$key_info[Control]X$key_info[Control]E" edit-command-line - -if (( $+widgets[history-incremental-pattern-search-backward] )); then - bindkey -M emacs "$key_info[Control]R" \ - history-incremental-pattern-search-backward - bindkey -M emacs "$key_info[Control]S" \ - history-incremental-pattern-search-forward -fi - -# Toggle comment at the start of the line. Note that we use pound-toggle which -# is similar to pount insert, but meant to work around some issues that were -# being seen in iTerm. -bindkey -M emacs "$key_info[Escape];" pound-toggle - - -# -# Vi Key Bindings -# - -# Edit command in an external editor emacs style (v is used for visual mode) -bindkey -M vicmd "$key_info[Control]X$key_info[Control]E" edit-command-line - -# Undo/Redo -bindkey -M vicmd "u" undo -bindkey -M vicmd "$key_info[Control]R" redo - -if (( $+widgets[history-incremental-pattern-search-backward] )); then - bindkey -M vicmd "?" history-incremental-pattern-search-backward - bindkey -M vicmd "/" history-incremental-pattern-search-forward -else - bindkey -M vicmd "?" history-incremental-search-backward - bindkey -M vicmd "/" history-incremental-search-forward -fi - -# Toggle comment at the start of the line. -bindkey -M vicmd "#" vi-pound-insert - -# -# Emacs and Vi Key Bindings -# - -# Unbound keys in vicmd and viins mode will cause really odd things to happen -# such as the casing of all the characters you have typed changing or other -# undefined things. In emacs mode they just insert a tilde, but bind these keys -# in the main keymap to a noop op so if there is no keybind in the users mode -# it will fall back and do nothing. -function _prezto-zle-noop { ; } -zle -N _prezto-zle-noop -local -a unbound_keys -unbound_keys=( - "${key_info[F1]}" - "${key_info[F2]}" - "${key_info[F3]}" - "${key_info[F4]}" - "${key_info[F5]}" - "${key_info[F6]}" - "${key_info[F7]}" - "${key_info[F8]}" - "${key_info[F9]}" - "${key_info[F10]}" - "${key_info[F11]}" - "${key_info[F12]}" - "${key_info[PageUp]}" - "${key_info[PageDown]}" - "${key_info[ControlPageUp]}" - "${key_info[ControlPageDown]}" -) -for keymap in $unbound_keys; do - bindkey -M viins "${keymap}" _prezto-zle-noop - bindkey -M vicmd "${keymap}" _prezto-zle-noop -done - -# Keybinds for all keymaps -for keymap in 'emacs' 'viins' 'vicmd'; do - bindkey -M "$keymap" "$key_info[Home]" beginning-of-line - bindkey -M "$keymap" "$key_info[End]" end-of-line -done - -# Keybinds for all vi keymaps -for keymap in viins vicmd; do - # Ctrl + Left and Ctrl + Right bindings to forward/backward word - for key in "${(s: :)key_info[ControlLeft]}" - bindkey -M "$keymap" "$key" vi-backward-word - for key in "${(s: :)key_info[ControlRight]}" - bindkey -M "$keymap" "$key" vi-forward-word -done - -# Keybinds for emacs and vi insert mode -for keymap in 'emacs' 'viins'; do - bindkey -M "$keymap" "$key_info[Insert]" overwrite-mode - bindkey -M "$keymap" "$key_info[Delete]" delete-char - bindkey -M "$keymap" "$key_info[Backspace]" backward-delete-char - - bindkey -M "$keymap" "$key_info[Left]" backward-char - bindkey -M "$keymap" "$key_info[Right]" forward-char - - # Expand history on space. - bindkey -M "$keymap" ' ' magic-space - - # Clear screen. - bindkey -M "$keymap" "$key_info[Control]L" clear-screen - - # Expand command name to full path. - for key in "$key_info[Escape]"{E,e} - bindkey -M "$keymap" "$key" expand-cmd-path - - # Duplicate the previous word. - for key in "$key_info[Escape]"{M,m} - bindkey -M "$keymap" "$key" copy-prev-shell-word - - # Use a more flexible push-line. - for key in "$key_info[Control]Q" "$key_info[Escape]"{q,Q} - bindkey -M "$keymap" "$key" push-line-or-edit - - # Bind Shift + Tab to go to the previous menu item. - bindkey -M "$keymap" "$key_info[BackTab]" reverse-menu-complete - - # Complete in the middle of word. - bindkey -M "$keymap" "$key_info[Control]I" expand-or-complete - - # Expand .... to ../.. - if zstyle -t ':prezto:module:editor' dot-expansion; then - bindkey -M "$keymap" "." expand-dot-to-parent-directory-path - fi - - # Display an indicator when completing. - bindkey -M "$keymap" "$key_info[Control]I" \ - expand-or-complete-with-indicator - - # Insert 'sudo ' at the beginning of the line. - bindkey -M "$keymap" "$key_info[Control]X$key_info[Control]S" prepend-sudo - - # control-space expands all aliases, including global - bindkey -M "$keymap" "$key_info[Control] " glob-alias -done - -# Delete key deletes character in vimcmd cmd mode instead of weird default functionality -bindkey -M vicmd "$key_info[Delete]" delete-char - -# Do not expand .... to ../.. during incremental search. -if zstyle -t ':prezto:module:editor' dot-expansion; then - bindkey -M isearch . self-insert 2> /dev/null -fi - -# -# Layout -# - -# Set the key layout. -zstyle -s ':prezto:module:editor' key-bindings 'key_bindings' -if [[ "$key_bindings" == (emacs|) ]]; then - bindkey -e -elif [[ "$key_bindings" == vi ]]; then - bindkey -v -else - print "prezto: editor: invalid key bindings: $key_bindings" >&2 -fi - -unset key{,map,_bindings} diff --git a/.zprezto/modules/emacs/README.md b/.zprezto/modules/emacs/README.md deleted file mode 100644 index fa9a514..0000000 --- a/.zprezto/modules/emacs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Emacs -===== - -Enables Emacs dependency management. - -Dependency management ---------------------- - -[Carton][1] installs and manages Emacs packages for Emacs package development -and Emacs configuration. - -This module prepends the Carton directory to the path variable to enable the -execution of `carton`. - -Aliases -------- - -### Carton - - - `cai` installs dependencies. - - `cau` updates dependencies. - - `caI` initializes the current directory for dependency management. - - `cae` executes a command which correct dependencies. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sebastian Wiesner](https://github.com/lunaryorn) - -[1]: https://github.com/rejeep/carton -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/emacs/init.zsh b/.zprezto/modules/emacs/init.zsh deleted file mode 100644 index 3acc965..0000000 --- a/.zprezto/modules/emacs/init.zsh +++ /dev/null @@ -1,25 +0,0 @@ -# -# Configures Emacs dependency management. -# -# Authors: Sebastian Wiesner -# - -# Return if requirements are not found. -if [[ ! -d "$HOME/.cask" ]]; then - return 1 -fi - -# Prepend Cask bin directory. -path=($HOME/.cask/bin $path) - -# Load Carton completion -source "$HOME/.cask/etc/cask_completion.zsh" 2> /dev/null - -# -# Aliases -# - -alias cai='cask install' -alias cau='cask update' -alias caI='cask init' -alias cae='cask exec' diff --git a/.zprezto/modules/environment/README.md b/.zprezto/modules/environment/README.md deleted file mode 100644 index 15ee959..0000000 --- a/.zprezto/modules/environment/README.md +++ /dev/null @@ -1,56 +0,0 @@ -Environment -=========== - -Sets general shell options and defines environment variables. - -This module must be loaded first. - -Contributors ------------- - -This module **MUST NOT** rely on any command not built in Zsh. - -Non-interactive environment variables should be defined in [`zshenv`][1]. - -Options -------- - -### General - - - `COMBINING_CHARS` combine zero-length punctuation characters (accents) with - the base character. - - `INTERACTIVE_COMMENTS` enable comments in interactive shell. - - `RC_QUOTES` allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. - - `MAIL_WARNING` don't print a warning message if a mail file has been accessed. - -### Jobs - - - `LONG_LIST_JOBS` list jobs in the long format by default. - - `AUTO_RESUME` attempt to resume existing job before creating a new process. - - `NOTIFY` report status of background jobs immediately. - - `BG_NICE` don't run all background jobs at a lower priority. - - `HUP` don't kill jobs on shell exit. - - `CHECK_JOBS` don't report on jobs when shell exit. - -Variables ---------- - -### Termcap - - - `LESS_TERMCAP_mb` begins blinking. - - `LESS_TERMCAP_md` begins bold. - - `LESS_TERMCAP_me` ends mode. - - `LESS_TERMCAP_se` ends standout-mode. - - `LESS_TERMCAP_so` begins standout-mode. - - `LESS_TERMCAP_ue` ends underline. - - `LESS_TERMCAP_us` begins underline. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zshenv -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/environment/init.zsh b/.zprezto/modules/environment/init.zsh deleted file mode 100644 index 7ae8c4f..0000000 --- a/.zprezto/modules/environment/init.zsh +++ /dev/null @@ -1,64 +0,0 @@ -# -# Sets general shell options and defines environment variables. -# -# Authors: -# Sorin Ionescu -# - -# -# Smart URLs -# - -# This logic comes from an old version of zim. Essentially, bracketed-paste was -# added as a requirement of url-quote-magic in 5.1, but in 5.1.1 bracketed -# paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic -# which is generally better than url-quote-magic so we load that when possible. -autoload -Uz is-at-least -if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then - if is-at-least 5.2; then - autoload -Uz bracketed-paste-url-magic - zle -N bracketed-paste bracketed-paste-url-magic - else - if is-at-least 5.1; then - autoload -Uz bracketed-paste-magic - zle -N bracketed-paste bracketed-paste-magic - fi - fi - autoload -Uz url-quote-magic - zle -N self-insert url-quote-magic -fi - -# -# General -# - -setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents) - # with the base character. -setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell. -setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. -unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. - -# -# Jobs -# - -setopt LONG_LIST_JOBS # List jobs in the long format by default. -setopt AUTO_RESUME # Attempt to resume existing job before creating a new process. -setopt NOTIFY # Report status of background jobs immediately. -unsetopt BG_NICE # Don't run all background jobs at a lower priority. -unsetopt HUP # Don't kill jobs on shell exit. -unsetopt CHECK_JOBS # Don't report on jobs when shell exit. - -# -# Termcap -# - -if zstyle -t ':prezto:environment:termcap' color; then - export LESS_TERMCAP_mb=$'\E[01;31m' # Begins blinking. - export LESS_TERMCAP_md=$'\E[01;31m' # Begins bold. - export LESS_TERMCAP_me=$'\E[0m' # Ends mode. - export LESS_TERMCAP_se=$'\E[0m' # Ends standout-mode. - export LESS_TERMCAP_so=$'\E[00;47;30m' # Begins standout-mode. - export LESS_TERMCAP_ue=$'\E[0m' # Ends underline. - export LESS_TERMCAP_us=$'\E[01;32m' # Begins underline. -fi diff --git a/.zprezto/modules/fasd/README.md b/.zprezto/modules/fasd/README.md deleted file mode 100644 index cb3fc20..0000000 --- a/.zprezto/modules/fasd/README.md +++ /dev/null @@ -1,44 +0,0 @@ -Fasd -==== - -[Fasd][1] is a command-line productivity booster, inspired by tools like -[autojump][2], [z][3] and [v][4], it offers quick access to files and -directories by keeping track of files and directories that were previously -accessed. - -For completion to work, this module must be loaded **after** the *completion* -module. - -The Prezto Fasd configuration differs from the default. The default aliases have -been disabled. - -Installation ------------- - -`fasd` is bundled with prezto as a git submodule. Alternatively, you can manually install `fasd`. -If a manual install is found, it will be used instead of the bundled version. - -Aliases -------- - - - `j` changes the current working directory interactively. - -Completion ----------- - -Type `,`, `f,`, `d,` in front of a comma-separated query or type `,,`, `,,f`, -`,,d` at the end of a comma-separated query then hit tab. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][5].* - - - [Wei Dai](https://github.com/clvv) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/clvv/fasd -[2]: https://github.com/joelthelion/autojump -[3]: https://github.com/rupa/z -[4]: https://github.com/rupa/v -[5]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/fasd/external/INSTALL.md b/.zprezto/modules/fasd/external/INSTALL.md deleted file mode 100644 index e253399..0000000 --- a/.zprezto/modules/fasd/external/INSTALL.md +++ /dev/null @@ -1,72 +0,0 @@ -Fasd is a self-contained posix shell script that can be either sourced or -executed. A Makefile is provided to install `fasd` and `fasd.1` to desired -places. - - -System-wide install: - - make install - -Install to $HOME: - - PREFIX=$HOME make install - -Or alternatively you can just copy `fasd` to anywhere you like. - -To get fasd working in a shell, some initialization code must be run. Put the -line below in your shell rc. - - eval "$(fasd --init auto)" - -This will setup a command hook that executes on every command and advanced tab -completion for zsh and bash. - -If you want more control over what gets into your shell environment, you can -pass customized set of arguments to `fasd --init`. - - zsh-hook # define _fasd_preexec and add it to zsh preexec array - zsh-ccomp # zsh command mode completion definitions - zsh-ccomp-install # setup command mode completion for zsh - zsh-wcomp # zsh word mode completion definitions - zsh-wcomp-install # setup word mode completion for zsh - bash-hook # add hook code to bash $PROMPT_COMMAND - bash-ccomp # bash command mode completion definitions - bash-ccomp-install # setup command mode completion for bash - posix-alias # define alias that applies to all posix shells - posix-hook # setup $PS1 hook for shells that's posix compatible - tcsh-alias # define aliases for tcsh - tcsh-hook # setup tcsh precmd alias - -Example for a minimal zsh setup (no tab completion): - - eval "$(fasd --init posix-alias zsh-hook)" - -Note that this method will slightly increase your shell start-up time, since -calling binaries has overhead. You can cache fasd init code if you want minimal -overhead. Example code for bash (to be put into .bashrc): - - fasd_cache="$HOME/.fasd-init-bash" - if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" - fi - source "$fasd_cache" - unset fasd_cache - -Optionally, if you can also source `fasd` if you want `fasd` to be a shell -function instead of an executable. - -You can tweak initialization code. For instance, if you want to use "c" -instead of "z" to do directory jumping. You run the code below: - - # function to execute built-in cd - fasd_cd() { - if [ $# -le 1 ]; then - fasd "$@" - else - local _fasd_ret="$(fasd -e echo "$@")" - [ -z "$_fasd_ret" ] && return - [ -d "$_fasd_ret" ] && cd "$_fasd_ret" || echo "$_fasd_ret" - fi - } - alias c='fasd_cd -d' # `-d' option present for bash completion - diff --git a/.zprezto/modules/fasd/external/LICENSE b/.zprezto/modules/fasd/external/LICENSE deleted file mode 100644 index 81af5a7..0000000 --- a/.zprezto/modules/fasd/external/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2011, 2012 by Wei Dai. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.zprezto/modules/fasd/external/Makefile b/.zprezto/modules/fasd/external/Makefile deleted file mode 100644 index 138d7c2..0000000 --- a/.zprezto/modules/fasd/external/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PREFIX?= /usr/local -BINDIR?= ${PREFIX}/bin -MANDIR?= ${PREFIX}/share/man -INSTALL?= install -INSTALLDIR= ${INSTALL} -d -INSTALLBIN= ${INSTALL} -m 755 -INSTALLMAN= ${INSTALL} -m 644 - -all: fasd.1 - -uninstall: - rm -f ${DESTDIR}${BINDIR}/fasd - rm -f ${DESTDIR}${MANDIR}/man1/fasd.1 - -install: - ${INSTALLDIR} ${DESTDIR}${BINDIR} - ${INSTALLBIN} fasd ${DESTDIR}${BINDIR} - ${INSTALLDIR} ${DESTDIR}${MANDIR}/man1 - ${INSTALLMAN} fasd.1 ${DESTDIR}${MANDIR}/man1 - -man: fasd.1 - -fasd.1: fasd.1.md - pandoc -s -w man fasd.1.md -o fasd.1 - -.PHONY: all install uninstall man - diff --git a/.zprezto/modules/fasd/external/README.md b/.zprezto/modules/fasd/external/README.md deleted file mode 100644 index 475e23e..0000000 --- a/.zprezto/modules/fasd/external/README.md +++ /dev/null @@ -1,378 +0,0 @@ -# Fasd - -Fasd (pronounced similar to "fast") is a command-line productivity booster. -Fasd offers quick access to files and directories for POSIX shells. It is -inspired by tools like [autojump](https://github.com/joelthelion/autojump), -[z](http://github.com/rupa/z) and [v](https://github.com/rupa/v). Fasd keeps -track of files and directories you have accessed, so that you can quickly -reference them in the command line. - -The name fasd comes from the default suggested aliases `f`(files), -`a`(files/directories), `s`(show/search/select), `d`(directories). - -Fasd ranks files and directories by "frecency," that is, by both "frequency" and -"recency." The term "frecency" was first coined by Mozilla and used in Firefox -([link](https://developer.mozilla.org/en/The_Places_frecency_algorithm)). - -# Introduction - -If you use your shell to navigate and launch applications, fasd can help you do -it more efficiently. With fasd, you can open files regardless of which -directory you are in. Just with a few key strings, fasd can find a "frecent" -file or directory and open it with command you specify. Below are some -hypothetical situations, where you can type in the command on the left and fasd -will "expand" your command into the right side. Pretty magic, huh? - -``` - v def conf => vim /some/awkward/path/to/type/default.conf - j abc => cd /hell/of/a/awkward/path/to/get/to/abcdef - m movie => mplayer /whatever/whatever/whatever/awesome_movie.mp4 - o eng paper => xdg-open /you/dont/remember/where/english_paper.pdf - vim `f rc lo` => vim /etc/rc.local - vim `f rc conf` => vim /etc/rc.conf -``` - -Fasd comes with some useful aliases by default: - -```sh -alias a='fasd -a' # any -alias s='fasd -si' # show / search / select -alias d='fasd -d' # directory -alias f='fasd -f' # file -alias sd='fasd -sid' # interactive directory selection -alias sf='fasd -sif' # interactive file selection -alias z='fasd_cd -d' # cd, same functionality as j in autojump -alias zz='fasd_cd -d -i' # cd with interactive selection -``` - -Fasd will smartly detect when to display a list of files or just the best -match. For instance, when you call fasd in a subshell with some search -parameters, fasd will only return the best match. This enables you to do: - -```sh -mv update.html `d www` -cp `f mov` . -``` - -# Install - -Fasd is available in various package managers. Please check -[the wiki page](https://github.com/clvv/fasd/wiki/Installing-via-Package-Managers) -for an up-to-date list. - -You can also manually obtain a copy of fasd. - -Download fasd 1.0.1 from GitHub: -[zip](https://github.com/clvv/fasd/zipball/1.0.1), -[tar.gz](https://github.com/clvv/fasd/tarball/1.0.1). - -Fasd is a self-contained POSIX shell script that can be either sourced or -executed. A Makefile is provided to install `fasd` and `fasd.1` to desired -places. - -System-wide install: - - make install - -Install to $HOME: - - PREFIX=$HOME make install - -Or alternatively you can just copy `fasd` to anywhere you like (preferably -under some directory in `$PATH`). - -To get fasd working in a shell, some initialization code must be run. Put the -line below in your shell rc. - -```sh -eval "$(fasd --init auto)" -``` - -This will setup a command hook that executes on every command and advanced tab -completion for zsh and bash. - -If you want more control over what gets into your shell environment, you can -pass customized set of arguments to `fasd --init`. - -``` -zsh-hook # define _fasd_preexec and add it to zsh preexec array -zsh-ccomp # zsh command mode completion definitions -zsh-ccomp-install # setup command mode completion for zsh -zsh-wcomp # zsh word mode completion definitions -zsh-wcomp-install # setup word mode completion for zsh -bash-hook # add hook code to bash $PROMPT_COMMAND -bash-ccomp # bash command mode completion definitions -bash-ccomp-install # setup command mode completion for bash -posix-alias # define aliases that applies to all posix shells -posix-hook # setup $PS1 hook for shells that's posix compatible -tcsh-alias # define aliases for tcsh -tcsh-hook # setup tcsh precmd alias -``` - -Example for a minimal zsh setup (no tab completion): - -```sh -eval "$(fasd --init posix-alias zsh-hook)" -``` - -Note that this method will slightly increase your shell start-up time, since -calling binaries has overhead. You can cache fasd init code if you want minimal -overhead. Example code for bash (to be put into .bashrc): - -```sh -fasd_cache="$HOME/.fasd-init-bash" -if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" -fi -source "$fasd_cache" -unset fasd_cache -``` - -Optionally, if you can also source `fasd` if you want `fasd` to be a shell -function instead of an executable. - -You can tweak initialization code. For instance, if you want to use "c" -instead of "z" to do directory jumping, you can use the alias below: - -```sh -alias c='fasd_cd -d' -# `-d` option present for bash completion -# function fasd_cd is defined in posix-alias -``` - -After you first installed fasd, open some files (with any program) or `cd` -around in your shell. Then try some examples below. - -# Examples - -```sh -f foo # list frecent files matching foo -a foo bar # list frecent files and directories matching foo and bar -f js$ # list frecent files that ends in js -f -e vim foo # run vim on the most frecent file matching foo -mplayer `f bar` # run mplayer on the most frecent file matching bar -z foo # cd into the most frecent directory matching foo -open `sf pdf` # interactively select a file matching pdf and launch `open` -``` - -You should add your own aliases to fully utilize the power of fasd. Here are -some examples to get you started: - -```sh -alias v='f -e vim' # quick opening files with vim -alias m='f -e mplayer' # quick opening files with mplayer -alias o='a -e xdg-open' # quick opening files with xdg-open -``` - -If you're using bash, you have to call `_fasd_bash_hook_cmd_complete` to make -completion work. For instance: - - _fasd_bash_hook_cmd_complete v m j o - -You could select an entry in the list of matching files. - -# Matching - -Fasd has three matching modes: default, case-insensitive, and fuzzy. - -For a given set of queries (the set of command-line arguments passed to fasd), -a path is a match if and only if: - -1. Queries match the path *in order*. -2. The last query matches the *last segment* of the path. - -If no match is found, fasd will try the same process ignoring case. If still no -match is found, fasd will allow extra characters to be placed between query -characters for fuzzy matching. - -Tips: - -* If you want your last query not to match the last segment of the path, append - `/` as the last query. -* If you want your last query to match the end of the filename, append `$` to - the last query. - -# How It Works - -When you run fasd init code or source `fasd`, fasd adds a hook which will be -executed whenever you execute a command. The hook will scan your commands' -arguments and determine if any of them refer to existing files or directories. -If yes, fasd will add them to the database. - -# Compatibility - -Fasd's basic functionalities are POSIX compliant, meaning that you should be -able to use fasd in all POSIX compliant shells. Your shell need to support -command substitution in `$PS1` in order for fasd to automatically track your -commands and files. This feature is not specified by the POSIX standard, but -it's nonetheless present in many POSIX compliant shells. In shells without -prompt command or prompt command substitution (csh for instance), you can add -entries manually with `fasd -A`. You are very welcomed to contribute shell -initialization code for not yet supported shells. - -Fasd has been tested on the following shells: bash, zsh, mksh, pdksh, dash, -busybox ash, FreeBSD 9 /bin/sh and OpenBSD /bin/sh. - -# Synopsis - - fasd [options] [query ...] - [f|a|s|d|z] [options] [query ...] - options: - -s list paths with scores - -l list paths without scores - -i interactive mode - -e set command to execute on the result file - -b only use backend - -B add additional backend - -a match files and directories - -d match directories only - -f match files only - -r match by rank only - -t match by recent access only - -R reverse listing order - -h show a brief help message - -[0-9] select the nth entry - - fasd [-A|-D] [paths ...] - -A add paths - -D delete paths - -# Tab Completion - -Fasd offers two completion modes, command mode completion and word mode -completion. Command mode completion works in bash and zsh. Word mode -completion only works in zsh. - -Command mode completion is just like completion for any other commands. It is -triggered when you hit tab on a `fasd` command or its aliases. Under this mode -your queries can be separated by a space. Tip: if you find that the completion -result overwrites your queries, type an extra space before you hit tab. - -Word mode completion can be triggered on *any* command. Word completion is -triggered by any command line argument that starts with `,` (all), `f,` -(files), or `d,` (directories), or that ends with `,,` (all), `,,f` (files), or -`,,d` (directories). Examples: - - $ vim ,rc,lo - $ vim /etc/rc.local - - $ mv index.html d,www - $ mv index.html /var/www/ - -There are also three zle widgets: `fasd-complete`, `fasd-complete-f`, -`fasd-complete-d`. You can bind them to keybindings you like: - -```sh -bindkey '^X^A' fasd-complete # C-x C-a to do fasd-complete (files and directories) -bindkey '^X^F' fasd-complete-f # C-x C-f to do fasd-complete-f (only files) -bindkey '^X^D' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories) -``` - -# Backends - -Fasd can take advantage of different sources of recent / frequent files. Most -desktop environments (such as OS X and Gtk) and some editors (such as Vim) keep -a list of accessed files. Fasd can use them as additional backends if the data -can be converted into fasd's native format. Below is a list of available -backends. - -``` -`spotlight` -OSX spotlight, provides entries that are changed today or opened within the -past month - -`recently-used` -GTK's recently-used file (Usually available on Linux) - -`current` -Provides everything in $PWD (whereever you are executing `fasd`) - -`viminfo` -Vim's editing history, useful if you want to define an alias just for editing -things in vim -``` - -You can define your own backend by declaring a function by that name in your -`.fasdrc`. You can set default backend with `_FASD_BACKENDS` variable in our -`.fasdrc`. - -Fasd can mimic [v](http://github.com/rupa/v)'s behavior by this alias: - -```sh -alias v='f -t -e vim -b viminfo' -``` - -# Tweaks - -Some shell variables that you can set before sourcing `fasd`. You can set them -in `$HOME/.fasdrc` - -``` -$_FASD_DATA -Path to the fasd data file, default "$HOME/.fasd". - -$_FASD_BLACKLIST -List of blacklisted strings. Commands matching them will not be processed. -Default is "--help". - -$_FASD_SHIFT -List of all commands that needs to be shifted, defaults to "sudo busybox". - -$_FASD_IGNORE -List of all commands that will be ignored, defaults to "fasd ls echo". - -$_FASD_TRACK_PWD -Fasd defaults to track your "$PWD". Set this to 0 to disable this behavior. - -$_FASD_AWK -Which awk to use. Fasd can detect and use a compatible awk. - -$_FASD_SINK -File to log all STDERR to, defaults to "/dev/null". - -$_FASD_MAX -Max total score / weight, defaults to 2000. - -$_FASD_SHELL -Which shell to execute. Some shells will run faster than others. fasd -runs faster with dash and ksh variants. - -$_FASD_BACKENDS -Default backends. - -$_FASD_RO -If set to any non-empty string, fasd will not add or delete entries from -database. You can set and export this variable from command line. - -$_FASD_FUZZY -Level of "fuzziness" when doing fuzzy matching. More precisely, the number of -characters that can be skipped to generate a match. Set to empty or 0 to -disable fuzzy matching. Default value is 2. - -$_FASD_VIMINFO -Path to .viminfo file for viminfo backend, defaults to "$HOME/.viminfo" - -$_FASD_RECENTLY_USED_XBEL -Path to XDG recently-used.xbel file for recently-used backend, defaults to -"$HOME/.local/share/recently-used.xbel" - -``` - -# Debugging - -If fasd does not work as expected, please file a bug report describing the -unexpected behavior along with your OS version, shell version, awk version, sed -version, and a log file. - -You can set `_FASD_SINK` in your `.fasdrc` to obtain a log. - -```sh -_FASD_SINK="$HOME/.fasd.log" -``` - -# COPYING - -Fasd is originally written based on code from [z](https://github.com/rupa/z) by -rupa deadwyler under the WTFPL license. Most if not all of the code has been -rewritten. Fasd is licensed under the "MIT/X11" license. - diff --git a/.zprezto/modules/fasd/external/fasd b/.zprezto/modules/fasd/external/fasd deleted file mode 100755 index 4275b7e..0000000 --- a/.zprezto/modules/fasd/external/fasd +++ /dev/null @@ -1,636 +0,0 @@ -#!/usr/bin/env sh - -# Fasd (this file) can be sourced or executed by any POSIX compatible shell. - -# Fasd is originally written based on code from z (https://github.com/rupa/z) -# by rupa deadwyler under the WTFPL license. Most if not all of the code has -# been rewritten. - -# Copyright (C) 2011, 2012 by Wei Dai. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -fasd() { - - # make zsh do word splitting inside this function - [ "$ZSH_VERSION" ] && emulate sh && setopt localoptions - - case $1 in - --init) shift - while [ "$1" ]; do - case $1 in - env) - { # source rc files if present - [ -s "/etc/fasdrc" ] && . "/etc/fasdrc" - [ -s "$HOME/.fasdrc" ] && . "$HOME/.fasdrc" - - # set default options - [ -z "$_FASD_DATA" ] && _FASD_DATA="$HOME/.fasd" - [ -z "$_FASD_BLACKLIST" ] && _FASD_BLACKLIST="--help" - [ -z "$_FASD_SHIFT" ] && _FASD_SHIFT="sudo busybox" - [ -z "$_FASD_IGNORE" ] && _FASD_IGNORE="fasd ls echo" - [ -z "$_FASD_SINK" ] && _FASD_SINK=/dev/null - [ -z "$_FASD_TRACK_PWD" ] && _FASD_TRACK_PWD=1 - [ -z "$_FASD_MAX" ] && _FASD_MAX=2000 - [ -z "$_FASD_BACKENDS" ] && _FASD_BACKENDS=native - [ -z "$_FASD_FUZZY" ] && _FASD_FUZZY=2 - [ -z "$_FASD_VIMINFO" ] && _FASD_VIMINFO="$HOME/.viminfo" - [ -z "$_FASD_RECENTLY_USED_XBEL" ] && \ - _FASD_RECENTLY_USED_XBEL="$HOME/.local/share/recently-used.xbel" - - if [ -z "$_FASD_AWK" ]; then - # awk preferences - local awk; for awk in mawk gawk original-awk nawk awk; do - $awk "" && _FASD_AWK=$awk && break - done - fi - } >> "${_FASD_SINK:-/dev/null}" 2>&1 - ;; - - auto) cat <> "$_FASD_SINK" 2>&1 - -EOS - ;; - - posix-alias) cat <& /dev/null || fasd -d'; -EOS - ;; - - zsh-hook) cat <> "$_FASD_SINK" 2>&1 -} -autoload -Uz add-zsh-hook -add-zsh-hook preexec _fasd_preexec - -EOS - ;; - - bash-hook) cat <> "$_FASD_SINK" 2>&1 -} - -# add bash hook -case \$PROMPT_COMMAND in - *_fasd_prompt_func*) ;; - *) PROMPT_COMMAND="_fasd_prompt_func;\$PROMPT_COMMAND";; -esac - -EOS - ;; - - posix-hook) cat <> "$_FASD_SINK" 2>&1 -} -case \$PS1 in - *_fasd_ps1_func*) ;; - *) export PS1="\\\$(_fasd_ps1_func)\$PS1";; -esac - -EOS - ;; - - tcsh-hook) cat <& /dev/null'; -EOS - - ;; - - zsh-ccomp) cat <> "$_FASD_SINK" | \\ - sort -nr | sed 's/^[^ ]*[ ]*//' | while read -r line; do - compadd -U -V fasd "\$line" - done - compstate[insert]=menu # no expand - } - _fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; } - _fasd_zsh_word_complete_d() { _fasd_zsh_word_complete d ; } - _fasd_zsh_word_complete_trigger() { - local _fasd_cur="\${words[CURRENT]}" - eval \$(fasd --word-complete-trigger _fasd_zsh_word_complete \$_fasd_cur) - } - # define zle widgets - zle -C fasd-complete complete-word _generic - zstyle ':completion:fasd-complete:*' completer _fasd_zsh_word_complete - zstyle ':completion:fasd-complete:*' menu-select - - zle -C fasd-complete-f complete-word _generic - zstyle ':completion:fasd-complete-f:*' completer _fasd_zsh_word_complete_f - zstyle ':completion:fasd-complete-f:*' menu-select - - zle -C fasd-complete-d complete-word _generic - zstyle ':completion:fasd-complete-d:*' completer _fasd_zsh_word_complete_d - zstyle ':completion:fasd-complete-d:*' menu-select -} - -EOS - ;; - - zsh-ccomp-install) cat <> "$_FASD_SINK" | sed -n "\\\$s/^.*'\\\\(.*\\\\)'/\\\\1/p") - \${COMP_LINE#* }" | while read -r line; do - quote_readline "\$line" 2>/dev/null || \\ - printf %q "\$line" 2>/dev/null && \\ - printf \\\\n - done) - local IFS=\$'\\n'; COMPREPLY=( \$RESULT ) -} -_fasd_bash_hook_cmd_complete() { - for cmd in \$*; do - complete -F _fasd_bash_cmd_complete \$cmd - done -} - -EOS - ;; - - bash-ccomp-install) cat <$`{}]\{1,\}/\1 /g' - ;; - - --proc) shift # process commands - # stop if we don't own $_FASD_DATA or $_FASD_RO is set - [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return - - # blacklists - local each; for each in $_FASD_BLACKLIST; do - case " $* " in *\ $each\ *) return;; esac - done - - # shifts - while true; do - case " $_FASD_SHIFT " in - *\ $1\ *) shift;; - *) break;; - esac - done - - # ignores - case " $_FASD_IGNORE " in - *\ $1\ *) return;; - esac - - shift; fasd --add "$@" # add all arguments except command - ;; - - --add|-A) shift # add entries - # stop if we don't own $_FASD_DATA or $_FASD_RO is set - [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return - - # find all valid path arguments, convert them to simplest absolute form - local paths="$(while [ "$1" ]; do - [ -e "$1" ] && printf %s\\n "$1"; shift - done | sed '/^[^/]/s@^@'"$PWD"'/@ - s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0 - s@[^/][^/]*//*\.\./@/@;t 0 - s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@;s@^$@/@' 2>> "$_FASD_SINK" \ - | tr '\n' '|')" - - # add current pwd if the option is set - [ "$_FASD_TRACK_PWD" = "1" -a "$PWD" != "$HOME" ] && paths="$paths|$PWD" - - [ -z "${paths##\|}" ] && return # stop if we have nothing to add - - # maintain the file - local tempfile - tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return - $_FASD_AWK -v list="$paths" -v now="$(date +%s)" -v max="$_FASD_MAX" -F"|" ' - BEGIN { - split(list, files, "|") - for(i in files) { - path = files[i] - if(path == "") continue - paths[path] = path # array for checking - rank[path] = 1 - time[path] = now - } - } - $2 >= 1 { - if($1 in paths) { - rank[$1] = $2 + 1 / $2 - time[$1] = now - } else { - rank[$1] = $2 - time[$1] = $3 - } - count += $2 - } - END { - if(count > max) - for(i in rank) print i "|" 0.9*rank[i] "|" time[i] # aging - else - for(i in rank) print i "|" rank[i] "|" time[i] - }' "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile" - if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then - env rm -f "$tempfile" - else - env mv -f "$tempfile" "$_FASD_DATA" - fi - ;; - - --delete|-D) shift # delete entries - # stop if we don't own $_FASD_DATA or $_FASD_RO is set - [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return - - # turn valid arguments into entry-deleting sed commands - local sed_cmd="$(while [ "$1" ]; do printf %s\\n "$1"; shift; done | \ - sed '/^[^/]/s@^@'"$PWD"'/@;s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0 - s@[^/][^/]*//*\.\./@/@;t 0 - s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@ - s@^$@/@;s@\([.[\/*^$]\)@\\\1@g;s@^\(.*\)$@/^\1|/d@' 2>> "$_FASD_SINK")" - - # maintain the file - local tempfile - tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return - - sed "$sed_cmd" "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile" - - if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then - env rm -f "$tempfile" - else - env mv -f "$tempfile" "$_FASD_DATA" - fi - ;; - - --query) shift # query the db, --query [$typ ["$fnd" [$mode]]] - [ -f "$_FASD_DATA" ] || return # no db yet - [ "$1" ] && local typ="$1" - [ "$2" ] && local fnd="$2" - [ "$3" ] && local mode="$3" - - # cat all backends - local each _fasd_data; for each in $_FASD_BACKENDS; do - _fasd_data="$_fasd_data -$(fasd --backend $each)" - done - [ "$_fasd_data" ] || _fasd_data="$(cat "$_FASD_DATA")" - - # set mode specific code for calculating the prior - case $mode in - rank) local prior='times[i]';; - recent) local prior='sqrt(100000/(1+t-la[i]))';; - *) local prior='times[i] * frecent(la[i])';; - esac - - if [ "$fnd" ]; then # dafault matching - local bre="$(printf %s\\n "$fnd" | sed 's/\([*\.\\\[]\)/\\\1/g - s@ @[^|]*@g;s/\$$/|/')" - bre='^[^|]*'"$bre"'[^|/]*|' - local _ret="$(printf %s\\n "$_fasd_data" | grep "$bre")" - [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do - [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" - done)" - if [ "$_ret" ]; then - _fasd_data="$_ret" - else # no case mathcing - _ret="$(printf %s\\n "$_fasd_data" | grep -i "$bre")" - [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do - [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" - done)" - if [ "$_ret" ]; then - _fasd_data="$_ret" - elif [ "${_FASD_FUZZY:-0}" -gt 0 ]; then # fuzzy matching - local fuzzy_bre="$(printf %s\\n "$fnd" | \ - sed 's/\([*\.\\\[]\)/\\\1/g;s/\$$/|/ - s@\(\\\{0,1\}[^ ]\)@\1[^|/]\\{0,'"$_FASD_FUZZY"'\\}@g - s@ @[^|]*@g')" - fuzzy_bre='^[^|]*'"$fuzzy_bre"'[^|/]*|' - _ret="$(printf %s\\n "$_fasd_data" | grep -i "$fuzzy_bre")" - [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do - [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" - done)" - [ "$_ret" ] && _fasd_data="$_ret" || _fasd_data= - fi - fi - else # no query arugments - _fasd_data="$(printf %s\\n "$_fasd_data" | while read -r line; do - [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" - done)" - fi - - # query the database - [ "$_fasd_data" ] && printf %s\\n "$_fasd_data" | \ - $_FASD_AWK -v t="$(date +%s)" -F"|" ' - function frecent(time) { - dx = t-time - if( dx < 3600 ) return 6 - if( dx < 86400 ) return 4 - if( dx < 604800 ) return 2 - return 1 - } - { - if(!paths[$1]) { - times[$1] = $2 - la[$1] = $3 - paths[$1] = 1 - } else { - times[$1] += $2 - if($3 > la[$1]) la[$1] = $3 - } - } - END { - for(i in paths) printf "%-10s %s\n", '"$prior"', i - }' - 2>> "$_FASD_SINK" - ;; - - --backend) - case $2 in - native) cat "$_FASD_DATA";; - viminfo) - < "$_FASD_VIMINFO" sed -n '/^>/{s@~@'"$HOME"'@ - s/^..// - p - }' | $_FASD_AWK -v t="$(date +%s)" '{ - t -= 60 - print $0 "|1|" t - }' - ;; - recently-used) - local nl="$(printf '\\\nX')"; nl="${nl%X}" # slash newline for sed - tr -d '\n' < "$_FASD_RECENTLY_USED_XBEL" | \ - sed 's@file:/@'"$nl"'@g;s@count="@'"$nl"'@g' | sed '1d;s/".*$//' | \ - tr '\n' '|' | sed 's@|/@'"$nl"'@g' | $_FASD_AWK -F'|' '{ - sum = 0 - for( i=2; i<=NF; i++ ) sum += $i - print $1 "|" sum - }' - ;; - current) - for path in *; do - printf "$PWD/%s|1\\n" "$path" - done - ;; - spotlight) - mdfind '(kMDItemFSContentChangeDate >= $time.today) || - kMDItemLastUsedDate >= $time.this_month' \ - | sed '/Library\//d - /\.app$/d - s/$/|2/' - ;; - *) eval "$2";; - esac - ;; - - *) # parsing logic and processing - local fnd= last= _FASD_BACKENDS="$_FASD_BACKENDS" _fasd_data= comp= exec= - while [ "$1" ]; do case $1 in - --complete) [ "$2" = "--" ] && shift; set -- $2; local lst=1 r=r comp=1;; - --query|--add|--delete|-A|-D) fasd "$@"; return $?;; - --version) [ -z "$comp" ] && echo "1.0.1" && return;; - --) while [ "$2" ]; do shift; fnd="$fnd $1"; last="$1"; done;; - -*) local o="${1#-}"; while [ "$o" ]; do case $o in - s*) local show=1;; - l*) local lst=1;; - i*) [ -z "$comp" ] && local interactive=1 show=1;; - r*) local mode=rank;; - t*) local mode=recent;; - e*) o="${o#?}"; if [ "$o" ]; then # there are characters after "-e" - local exec="$o" # anything after "-e" - else # use the next argument - local exec="${2:?"-e: Argument needed "}" - shift - fi; break;; - b*) o="${o#?}"; if [ "$o" ]; then - _FASD_BACKENDS="$o" - else - _FASD_BACKENDS="${2:?"-b: Argument needed"}" - shift - fi; break;; - B*) o="${o#?}"; if [ "$o" ]; then - _FASD_BACKENDS="$_FASD_BACKENDS $o" - else - _FASD_BACKENDS="$_FASD_BACKENDS ${2:?"-B: Argument needed"}" - shift - fi; break;; - a*) local typ=e;; - d*) local typ=d;; - f*) local typ=f;; - R*) local r=r;; - [0-9]*) local _fasd_i="$o"; break;; - h*) [ -z "$comp" ] && echo "fasd [options] [query ...] -[f|a|s|d|z] [options] [query ...] - options: - -s list paths with scores - -l list paths without scores - -i interactive mode - -e set command to execute on the result file - -b only use backend - -B add additional backend - -a match files and directories - -d match directories only - -f match files only - -r match by rank only - -t match by recent access only - -R reverse listing order - -h show a brief help message - -[0-9] select the nth entry - -fasd [-A|-D] [paths ...] - -A add paths - -D delete paths" >&2 && return;; - esac; o="${o#?}"; done;; - *) fnd="$fnd $1"; last="$1";; - esac; shift; done - - # guess whether the last query is selected from tab completion - case $last in - /?*) if [ -z "$show$lst" -a -${typ:-e} "$last" -a "$exec" ]; then - $exec "$last" - return - fi;; - esac - - local R; [ -z "$r" ] && R=r || R= # let $R be the opposite of $r - fnd="${fnd# }" - - local res - res="$(fasd --query 2>> "$_FASD_SINK")" # query the database - [ $? -gt 0 ] && return - if [ 0 -lt ${_fasd_i:-0} ] 2>> "$_FASD_SINK"; then - res="$(printf %s\\n "$res" | sort -n${R} | \ - sed -n "$_fasd_i"'s/^[^ ]*[ ]*//p')" - elif [ "$interactive" ] || [ "$exec" -a -z "$fnd$lst$show" -a -t 1 ]; then - if [ "$(printf %s "$res" | sed -n '$=')" -gt 1 ]; then - res="$(printf %s\\n "$res" | sort -n${R})" - printf %s\\n "$res" | sed = | sed 'N;s/\n/ /' | sort -nr >&2 - printf "> " >&2 - local i; read i; [ 0 -lt "${i:-0}" ] 2>> "$_FASD_SINK" || return 1 - fi - res="$(printf %s\\n "$res" | sed -n "${i:-1}"'s/^[^ ]*[ ]*//p')" - elif [ "$lst" ]; then - [ "$res" ] && printf %s\\n "$res" | sort -n${r} | sed 's/^[^ ]*[ ]*//' - return - elif [ "$show" ]; then - [ "$res" ] && printf %s\\n "$res" | sort -n${r} - return - elif [ "$fnd" ] && [ "$exec" -o ! -t 1 ]; then # exec or subshell - res="$(printf %s\\n "$res" | sort -n | sed -n '$s/^[^ ]*[ ]*//p')" - else # no args, show - [ "$res" ] && printf %s\\n "$res" | sort -n${r} - return - fi - if [ "$res" ]; then - fasd --add "$res" - [ -z "$exec" ] && exec='printf %s\n' - $exec "$res" - fi - ;; - esac -} - -fasd --init env - -case $- in - *i*) ;; # assume being sourced, do nothing - *) # assume being executed as an executable - if [ -x "$_FASD_SHELL" -a -z "$_FASD_SET" ]; then - _FASD_SET=1 exec $_FASD_SHELL "$0" "$@" - else - fasd "$@" - fi;; -esac - diff --git a/.zprezto/modules/fasd/external/fasd.1 b/.zprezto/modules/fasd/external/fasd.1 deleted file mode 100644 index 02b8c18..0000000 --- a/.zprezto/modules/fasd/external/fasd.1 +++ /dev/null @@ -1,313 +0,0 @@ -.TH "FASD" "1" "Jul 16, 2012" "fasd user manual" "" -.SH NAME -.PP -fasd \- quick access to files and directories -.SH SYNOPSIS -.PP -fasd [options] [query ...] -.PP -[f|a|s|d|z] [options] [query ...] -.PP -fasd [\-A|\-D] [paths ...] -.SH OPTIONS -.IP -.nf -\f[C] -\-s\ \ \ \ \ \ \ \ \ list\ paths\ with\ ranks -\-l\ \ \ \ \ \ \ \ \ list\ paths\ without\ ranks -\-i\ \ \ \ \ \ \ \ \ interactive\ mode -\-e\ \ \ \ set\ command\ to\ execute\ on\ the\ result\ file -\-b\ \ \ only\ use\ \ backend -\-B\ \ \ add\ additional\ backend\ -\-a\ \ \ \ \ \ \ \ \ match\ files\ and\ directories -\-d\ \ \ \ \ \ \ \ \ match\ directories\ only -\-f\ \ \ \ \ \ \ \ \ match\ files\ only -\-r\ \ \ \ \ \ \ \ \ match\ by\ rank\ only -\-t\ \ \ \ \ \ \ \ \ match\ by\ recent\ access\ only -\-R\ \ \ \ \ \ \ \ \ reverse\ listing\ order -\-h\ \ \ \ \ \ \ \ \ show\ a\ brief\ help\ message -\-[0\-9]\ \ \ \ \ select\ the\ nth\ entry -\f[] -.fi -.SH DESCRIPTION -.PP -Fasd keeps track of files and directories you access in your shell and -gives you quick access to them. -You can use fasd to reference files or directories by just a few key -identifying characters. -You can use fasd to boost your command line productivity by defining -your own aliases to launch programs on files or directories. -Fasd, by default, provides some basic aliases, including a shell -function "z" that resembles the functionality of "z" and "autojump." -.PP -The name "fasd" comes from the default suggested aliases -\f[C]f\f[](files), \f[C]a\f[](files/directories), -\f[C]s\f[](show/search/select), \f[C]d\f[](directories). -.PP -Fasd ranks files and directories by "frecency," that is, by both -"frequency" and "recency." The term "frecency" was first coined by -Mozilla and used in Firefox. -.SH EXAMPLES -.IP -.nf -\f[C] -z\ bundle -f\ \-e\ vim\ nginx\ conf -f\ \-i\ rc$ -vi\ `f\ nginx\ conf` -cp\ update.html\ `d\ www` -open\ `sf\ pdf` -\f[] -.fi -.SH SHELL INITIALIZATION -.PP -To get fasd working in a shell, some initialization code must be run. -Put lines below in your POSIX compatible shell rc. -.IP -.nf -\f[C] -eval\ "$(fasd\ \-\-init\ auto)" -\f[] -.fi -.PP -This will setup a command hook that executes on every command and -advanced tab completion for zsh and bash. -.PP -If you want more control over what gets into your shell environment, you -can pass customized set of arguments to \f[C]fasd\ \-\-init\f[]. -.IP -.nf -\f[C] -zsh\-hook\ \ \ \ \ \ \ \ \ \ \ \ \ #\ define\ _fasd_preexec\ and\ add\ it\ to\ zsh\ preexec\ array -zsh\-ccomp\ \ \ \ \ \ \ \ \ \ \ \ #\ zsh\ command\ mode\ completion\ definitions -zsh\-ccomp\-install\ \ \ \ #\ setup\ command\ mode\ completion\ for\ zsh -zsh\-wcomp\ \ \ \ \ \ \ \ \ \ \ \ #\ zsh\ word\ mode\ completion\ definitions -zsh\-wcomp\-install\ \ \ \ #\ setup\ word\ mode\ completion\ for\ zsh -bash\-hook\ \ \ \ \ \ \ \ \ \ \ \ #\ add\ hook\ code\ to\ bash\ $PROMPT_COMMAND -bash\-ccomp\ \ \ \ \ \ \ \ \ \ \ #\ bash\ command\ mode\ completion\ definitions -bash\-ccomp\-install\ \ \ #\ setup\ command\ mode\ completion\ for\ bash -posix\-alias\ \ \ \ \ \ \ \ \ \ #\ define\ aliases\ that\ applies\ to\ all\ posix\ shells -posix\-hook\ \ \ \ \ \ \ \ \ \ \ #\ setup\ $PS1\ hook\ for\ shells\ that\[aq]s\ posix\ compatible -tcsh\-alias\ \ \ \ \ \ \ \ \ \ \ #\ define\ aliases\ for\ tcsh -tcsh\-hook\ \ \ \ \ \ \ \ \ \ \ \ #\ setup\ tcsh\ precmd\ alias -\f[] -.fi -.PP -Example for a minimal zsh setup (no tab completion): -.IP -.nf -\f[C] -eval\ "$(fasd\ \-\-init\ posix\-alias\ zsh\-hook)" -\f[] -.fi -.PP -Note that this method will slightly increase your shell start\-up time, -since calling binaries has overhead. -You can cache fasd init code if you want minimal overhead. -Example code for bash (to be put into .bashrc): -.IP -.nf -\f[C] -fasd_cache="$HOME/.fasd\-init\-bash" -if\ [\ "$(command\ \-v\ fasd)"\ \-nt\ "$fasd_cache"\ \-o\ !\ \-s\ "$fasd_cache"\ ];\ then -\ \ fasd\ \-\-init\ posix\-alias\ bash\-hook\ bash\-ccomp\ bash\-ccomp\-install\ >|\ "$fasd_cache" -fi -source\ "$fasd_cache" -unset\ fasd_cache -\f[] -.fi -.PP -Optionally, if you can also source \f[C]fasd\f[] if you want -\f[C]fasd\f[] to be a shell function instead of an executable. -.PP -You can tweak initialization code. -For instance, if you want to use "c" instead of "z" to do directory -jumping, you can use the alias below: -.IP -.nf -\f[C] -alias\ c=\[aq]fasd_cd\ \-d\[aq] -#\ `\-d\[aq]\ option\ present\ for\ bash\ completion -#\ function\ fasd_cd\ is\ defined\ in\ posix\-alias -\f[] -.fi -.SH MATCHING -.PP -Fasd has three matching modes: default, case\-insensitive, and fuzzy. -.PP -For a given set of queries (the set of command\-line arguments passed to -fasd), a path is a match if and only if: -.IP "1." 3 -Queries match the path in order. -.IP "2." 3 -The last query matches the last segment of the path. -.PP -If no match is found, fasd will try the same process ignoring case. -If still no match is found, fasd will allow extra characters to be -placed between query characters for fuzzy matching. -.PP -Tips: -.IP \[bu] 2 -If you want your last query not to match the last segment of the path, -append `/\[aq] as the last query. -.IP \[bu] 2 -If you want your last query to match the end of the filename, append -`$\[aq] to the last query. -.SH COMPATIBILITY -.PP -Fasd\[aq]s basic functionalities are POSIX compliant, meaning that you -should be able to use fasd in all POSIX compliant shells. -Your shell need to support command substitution in $PS1 in order for -fasd to automatically track your commands and files. -This feature is not specified by the POSIX standard, but it\[aq]s -nonetheless present in many POSIX compliant shells. -In shells without prompt command or prompt command substitution (tcsh -for instance), you can add entries manually with "fasd \-A". -You are very welcomed to contribute shell initialization code for not -yet supported shells. -.SH TAB COMPLETION -.PP -Fasd offers two completion modes, command mode completion and word mode -completion. -Command mode completion works in bash and zsh. -Word mode completion only works in zsh. -.PP -Command mode completion is just like completion for any other commands. -It is triggered when you hit tab on a fasd command or its aliases. -Under this mode your queries can be separated by a space. -Tip: if you find that the completion result overwrites your queries, -type an extra space before you hit tab. -.PP -Word mode completion can be triggered on \f[I]any\f[] command. -Word completion is triggered by any command line argument that starts -with "," (all), "f," (files), or "d," (directories), or that ends with -",," (all), ",,f" (files), or ",,d" (directories). -Examples: -.IP -.nf -\f[C] -$\ vim\ ,rc,lo -$\ vim\ /etc/rc.local - -$\ mv\ index.html\ d,www -$\ mv\ index.html\ /var/www/ -\f[] -.fi -.PP -There are also three zle widgets: "fasd\-complete", "fasd\-complete\-f", -"fasd\-complete\-d". -You can bind them to keybindings you like: -.IP -.nf -\f[C] -bindkey\ \[aq]^X^A\[aq]\ fasd\-complete\ \ \ \ #\ C\-x\ C\-a\ to\ do\ fasd\-complete\ (files\ and\ directories) -bindkey\ \[aq]^X^F\[aq]\ fasd\-complete\-f\ \ #\ C\-x\ C\-f\ to\ do\ fasd\-complete\-f\ (only\ files) -bindkey\ \[aq]^X^D\[aq]\ fasd\-complete\-d\ \ #\ C\-x\ C\-d\ to\ do\ fasd\-complete\-d\ (only\ directories) -\f[] -.fi -.SH BACKENDS -.PP -Fasd can take advantage of different sources of recent / frequent files. -Most desktop environments (such as OS X and Gtk) and some editors (such -as Vim) keep a list of accessed files. -Fasd can use them as additional backends if the data can be converted -into fasd\[aq]s native format. -Below is a list of available backends. -.IP \[bu] 2 -spotlight: OSX spotlight, provides entries that are changed today or -opened within the past month -.IP \[bu] 2 -recently\-used: GTK\[aq]s recently\-used file (Usually available on -Linux) -.IP \[bu] 2 -current: Provides everything in $PWD (whereever you are executing -\f[C]fasd\f[]) -.IP \[bu] 2 -viminfo: Vim\[aq]s editing history, useful if you want to define an -alias just for editing things in vim -.PP -You can define your own backend by declaring a function by that name in -your \f[C]\&.fasdrc\f[]. -You can set default backend with \f[C]_FASD_BACKENDS\f[] variable in our -\f[C]\&.fasdrc\f[]. -.SH TWEAKS -.PP -Upon every execution, fasd will source "/etc/fasdrc" and "$HOME/.fasdrc" -if they are present. -Below are some variables you can set: -.IP -.nf -\f[C] -$_FASD_DATA -Path\ to\ the\ fasd\ data\ file,\ default\ "$HOME/.fasd". - -$_FASD_BLACKLIST -List\ of\ blacklisted\ strings.\ Commands\ matching\ them\ will\ not\ be\ processed. -Default\ is\ "\-\-help". - -$_FASD_SHIFT -List\ of\ all\ commands\ that\ needs\ to\ be\ shifted,\ defaults\ to\ "sudo\ busybox". - -$_FASD_IGNORE -List\ of\ all\ commands\ that\ will\ be\ ignored,\ defaults\ to\ "fasd\ ls\ echo". - -$_FASD_TRACK_PWD -Fasd\ defaults\ to\ track\ your\ "$PWD".\ Set\ this\ to\ 0\ to\ disable\ this\ behavior. - -$_FASD_AWK -Which\ awk\ to\ use.\ fasd\ can\ detect\ and\ use\ a\ compatible\ awk. - -$_FASD_SINK -File\ to\ log\ all\ STDERR\ to,\ defaults\ to\ "/dev/null". - -$_FASD_MAX -Max\ total\ score\ /\ weight,\ defaults\ to\ 2000. - -$_FASD_SHELL -Which\ shell\ to\ execute.\ Some\ shells\ will\ run\ faster\ than\ others.\ fasd -runs\ faster\ with\ dash\ and\ ksh\ variants. - -$_FASD_BACKENDS -Default\ backends. - -$_FASD_RO -If\ set\ to\ any\ non\-empty\ string,\ fasd\ will\ not\ add\ or\ delete\ entries\ from -database.\ You\ can\ set\ and\ export\ this\ variable\ from\ command\ line. - -$_FASD_FUZZY -Level\ of\ "fuzziness"\ when\ doing\ fuzzy\ matching.\ More\ precisely,\ the\ number\ of -characters\ that\ can\ be\ skipped\ to\ generate\ a\ match.\ Set\ to\ empty\ or\ 0\ to -disable\ fuzzy\ matching.\ Default\ value\ is\ 2. - -$_FASD_VIMINFO -Path\ to\ .viminfo\ file\ for\ viminfo\ backend,\ defaults\ to\ "$HOME/.viminfo" - -$_FASD_RECENTLY_USED_XBEL -Path\ to\ XDG\ recently\-used.xbel\ file\ for\ recently\-used\ backend,\ defaults\ to -"$HOME/.local/share/recently\-used.xbel" -\f[] -.fi -.SH DEBUGGING -.PP -Fasd is hosted on GitHub: https://github.com/clvv/fasd -.PP -If fasd does not work as expected, please file a bug report on GitHub -describing the unexpected behavior along with your OS version, shell -version, awk version, sed version, and a log file. -.PP -You can set \f[C]_FASD_SINK\f[] in your \f[C]\&.fasdrc\f[] to obtain a -log. -.IP -.nf -\f[C] -_FASD_SINK="$HOME/.fasd.log" -\f[] -.fi -.SH COPYING -.PP -Fasd is originally written based on code from z -(https://github.com/rupa/z) by rupa deadwyler under the WTFPL license. -Most if not all of the code has been rewritten. -Fasd is licensed under the "MIT/X11" license. -.SH AUTHORS -Wei Dai . diff --git a/.zprezto/modules/fasd/external/fasd.1.md b/.zprezto/modules/fasd/external/fasd.1.md deleted file mode 100644 index 3deacfe..0000000 --- a/.zprezto/modules/fasd/external/fasd.1.md +++ /dev/null @@ -1,263 +0,0 @@ -% FASD(1) fasd user manual -% Wei Dai -% Jul 16, 2012 - -# NAME - -fasd - quick access to files and directories - -# SYNOPSIS - -fasd [options] [query ...] - -[f|a|s|d|z] [options] [query ...] - -fasd [-A|-D] [paths ...] - -# OPTIONS - - -s list paths with ranks - -l list paths without ranks - -i interactive mode - -e set command to execute on the result file - -b only use backend - -B add additional backend - -a match files and directories - -d match directories only - -f match files only - -r match by rank only - -t match by recent access only - -R reverse listing order - -h show a brief help message - -[0-9] select the nth entry - -# DESCRIPTION - -Fasd keeps track of files and directories you access in your shell and gives you -quick access to them. You can use fasd to reference files or directories by just -a few key identifying characters. You can use fasd to boost your command line -productivity by defining your own aliases to launch programs on files or -directories. Fasd, by default, provides some basic aliases, including a shell -function "z" that resembles the functionality of "z" and "autojump." - -The name "fasd" comes from the default suggested aliases `f`(files), -`a`(files/directories), `s`(show/search/select), `d`(directories). - -Fasd ranks files and directories by "frecency," that is, by both "frequency" -and "recency." The term "frecency" was first coined by Mozilla and used in -Firefox. - -# EXAMPLES - - z bundle - f -e vim nginx conf - f -i rc$ - vi `f nginx conf` - cp update.html `d www` - open `sf pdf` - -# SHELL INITIALIZATION - -To get fasd working in a shell, some initialization code must be run. Put -lines below in your POSIX compatible shell rc. - - eval "$(fasd --init auto)" - -This will setup a command hook that executes on every command and advanced tab -completion for zsh and bash. - -If you want more control over what gets into your shell environment, you can -pass customized set of arguments to `fasd --init`. - - zsh-hook # define _fasd_preexec and add it to zsh preexec array - zsh-ccomp # zsh command mode completion definitions - zsh-ccomp-install # setup command mode completion for zsh - zsh-wcomp # zsh word mode completion definitions - zsh-wcomp-install # setup word mode completion for zsh - bash-hook # add hook code to bash $PROMPT_COMMAND - bash-ccomp # bash command mode completion definitions - bash-ccomp-install # setup command mode completion for bash - posix-alias # define aliases that applies to all posix shells - posix-hook # setup $PS1 hook for shells that's posix compatible - tcsh-alias # define aliases for tcsh - tcsh-hook # setup tcsh precmd alias - -Example for a minimal zsh setup (no tab completion): - - eval "$(fasd --init posix-alias zsh-hook)" - -Note that this method will slightly increase your shell start-up time, since -calling binaries has overhead. You can cache fasd init code if you want -minimal overhead. Example code for bash (to be put into .bashrc): - - fasd_cache="$HOME/.fasd-init-bash" - if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" - fi - source "$fasd_cache" - unset fasd_cache - -Optionally, if you can also source `fasd` if you want `fasd` to be a shell -function instead of an executable. - -You can tweak initialization code. For instance, if you want to use "c" -instead of "z" to do directory jumping, you can use the alias below: - - alias c='fasd_cd -d' - # `-d' option present for bash completion - # function fasd_cd is defined in posix-alias - -# MATCHING - -Fasd has three matching modes: default, case-insensitive, and fuzzy. - -For a given set of queries (the set of command-line arguments passed to fasd), -a path is a match if and only if: - -1. Queries match the path in order. -2. The last query matches the last segment of the path. - -If no match is found, fasd will try the same process ignoring case. If still no -match is found, fasd will allow extra characters to be placed between query -characters for fuzzy matching. - -Tips: - -* If you want your last query not to match the last segment of the path, append - `/' as the last query. -* If you want your last query to match the end of the filename, append `$' to - the last query. - -# COMPATIBILITY - -Fasd's basic functionalities are POSIX compliant, meaning that you should be -able to use fasd in all POSIX compliant shells. Your shell need to support -command substitution in $PS1 in order for fasd to automatically track your -commands and files. This feature is not specified by the POSIX standard, but -it's nonetheless present in many POSIX compliant shells. In shells without -prompt command or prompt command substitution (tcsh for instance), you can add -entries manually with "fasd -A". You are very welcomed to contribute shell -initialization code for not yet supported shells. - -# TAB COMPLETION - -Fasd offers two completion modes, command mode completion and word mode -completion. Command mode completion works in bash and zsh. Word mode -completion only works in zsh. - -Command mode completion is just like completion for any other commands. It is -triggered when you hit tab on a fasd command or its aliases. Under this mode -your queries can be separated by a space. Tip: if you find that the completion -result overwrites your queries, type an extra space before you hit tab. - -Word mode completion can be triggered on *any* command. Word completion is -triggered by any command line argument that starts with "," (all), "f," -(files), or "d," (directories), or that ends with ",," (all), ",,f" (files), -or ",,d" (directories). Examples: - - $ vim ,rc,lo - $ vim /etc/rc.local - - $ mv index.html d,www - $ mv index.html /var/www/ - -There are also three zle widgets: "fasd-complete", "fasd-complete-f", -"fasd-complete-d". You can bind them to keybindings you like: - - bindkey '^X^A' fasd-complete # C-x C-a to do fasd-complete (files and directories) - bindkey '^X^F' fasd-complete-f # C-x C-f to do fasd-complete-f (only files) - bindkey '^X^D' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories) - -# BACKENDS - -Fasd can take advantage of different sources of recent / frequent files. Most -desktop environments (such as OS X and Gtk) and some editors (such as Vim) keep -a list of accessed files. Fasd can use them as additional backends if the data -can be converted into fasd's native format. Below is a list of available -backends. - -* spotlight: OSX spotlight, provides entries that are changed today or opened - within the past month - -* recently-used: GTK's recently-used file (Usually available on Linux) - -* current: Provides everything in $PWD (whereever you are executing `fasd`) - -* viminfo: Vim's editing history, useful if you want to define an alias just - for editing things in vim - -You can define your own backend by declaring a function by that name in your -`.fasdrc`. You can set default backend with `_FASD_BACKENDS` variable in our -`.fasdrc`. - -# TWEAKS - -Upon every execution, fasd will source "/etc/fasdrc" and "$HOME/.fasdrc" if -they are present. Below are some variables you can set: - - $_FASD_DATA - Path to the fasd data file, default "$HOME/.fasd". - - $_FASD_BLACKLIST - List of blacklisted strings. Commands matching them will not be processed. - Default is "--help". - - $_FASD_SHIFT - List of all commands that needs to be shifted, defaults to "sudo busybox". - - $_FASD_IGNORE - List of all commands that will be ignored, defaults to "fasd ls echo". - - $_FASD_TRACK_PWD - Fasd defaults to track your "$PWD". Set this to 0 to disable this behavior. - - $_FASD_AWK - Which awk to use. fasd can detect and use a compatible awk. - - $_FASD_SINK - File to log all STDERR to, defaults to "/dev/null". - - $_FASD_MAX - Max total score / weight, defaults to 2000. - - $_FASD_SHELL - Which shell to execute. Some shells will run faster than others. fasd - runs faster with dash and ksh variants. - - $_FASD_BACKENDS - Default backends. - - $_FASD_RO - If set to any non-empty string, fasd will not add or delete entries from - database. You can set and export this variable from command line. - - $_FASD_FUZZY - Level of "fuzziness" when doing fuzzy matching. More precisely, the number of - characters that can be skipped to generate a match. Set to empty or 0 to - disable fuzzy matching. Default value is 2. - - $_FASD_VIMINFO - Path to .viminfo file for viminfo backend, defaults to "$HOME/.viminfo" - - $_FASD_RECENTLY_USED_XBEL - Path to XDG recently-used.xbel file for recently-used backend, defaults to - "$HOME/.local/share/recently-used.xbel" - -# DEBUGGING - -Fasd is hosted on GitHub: https://github.com/clvv/fasd - -If fasd does not work as expected, please file a bug report on GitHub describing -the unexpected behavior along with your OS version, shell version, awk version, -sed version, and a log file. - -You can set `_FASD_SINK` in your `.fasdrc` to obtain a log. - - _FASD_SINK="$HOME/.fasd.log" - -# COPYING - -Fasd is originally written based on code from z (https://github.com/rupa/z) by -rupa deadwyler under the WTFPL license. Most if not all of the code has been -rewritten. Fasd is licensed under the "MIT/X11" license. - diff --git a/.zprezto/modules/fasd/init.zsh b/.zprezto/modules/fasd/init.zsh deleted file mode 100644 index 37babd8..0000000 --- a/.zprezto/modules/fasd/init.zsh +++ /dev/null @@ -1,56 +0,0 @@ -# -# Maintains a frequently used file and directory list for fast access. -# -# Authors: -# Wei Dai -# Sorin Ionescu -# - -# Load dependencies. -pmodload 'editor' - -# If the command doesn't exist externally, we need to fall back to the bundled -# submodule. -if (( ! $+commands[fasd] )); then - source "${0:h}/external/fasd" || return 1 -fi - -# -# Initialization -# - -cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh" -if [[ "${commands[fasd]}" -nt "$cache_file" \ - || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ! -s "$cache_file" ]]; then - # Set the base init arguments. - init_args=(zsh-hook) - - # Set fasd completion init arguments, if applicable. - if zstyle -t ':prezto:module:completion' loaded; then - init_args+=(zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install) - fi - - # Cache init code. - fasd --init "$init_args[@]" >! "$cache_file" 2> /dev/null -fi - -source "$cache_file" - -unset cache_file init_args - -function fasd_cd { - local fasd_ret="$(fasd -d "$@")" - if [[ -d "$fasd_ret" ]]; then - cd "$fasd_ret" - else - print "$fasd_ret" - fi -} - -# -# Aliases -# - -# Changes the current working directory interactively. -alias j='fasd_cd -i' diff --git a/.zprezto/modules/git/README.md b/.zprezto/modules/git/README.md deleted file mode 100644 index a497826..0000000 --- a/.zprezto/modules/git/README.md +++ /dev/null @@ -1,452 +0,0 @@ -Git -=== - -Enhances the [Git][1] distributed version control system by providing aliases, -functions and by exposing repository status information to prompts. - -Git **1.7.2** is the [minimum required version][7]. - -Settings --------- - -### Log - -The format of the [git-log][8] output is configurable via the following style, -where context is *brief*, *oneline*, and *medium*, which will be passed to the -`--pretty=format:` switch. - -```sh -zstyle ':prezto:module:git:log:context' format '' -``` - -### Status - -Retrieving the status of a repository with submodules can take a long time. -Submodules may be ignored when they are *dirty*, *untracked*, *all*, or *none*. - -```sh -zstyle ':prezto:module:git:status:ignore' submodules 'all' -``` - -This setting affects all aliases and functions that call `git-status`. - -Aliases -------- - -Aliases are enabled by default. You can disable them with: - -```sh -zstyle ':prezto:module:git:alias' skip 'yes' -``` - -### Git - - - `g` is short for `git`. - -### Branch - - - `gb` lists, creates, renames, and deletes branches. - - `gbc` creates a new branch. - - `gbl` lists branches and their commits. (also `gbv`) - - `gbL` lists all local and remote branches and their commits. - - `gbr` renames a branch. (also `gbm`) - - `gbR` renames a branch even if the new branch name already exists. (also - `gbM`) - - `gbs` lists branches and their commits with ancestry graphs. - - `gbS` lists local and remote branches and their commits with ancestry - graphs. - - `gbV` lists branches with more verbose information about their commits. - - `gbx` deletes a branch. (also `gbd`) - - `gbX` deletes a branch irrespective of its merged status. (also `gbD`) - - -### Commit - - - `gc` records changes to the repository. - - `gca` stages all modified and deleted files. - - `gcm` records changes to the repository with the given message. - - `gcS` records changes to the repository. (Signed) - - `gcSa` stages all modified and deleted files. (Signed) - - `gcSm` records changes to the repository with the given message. (Signed) - `gco` checks out a branch or paths to work tree. - - `gcam` stages all modified and deleted files, and records changes to the repository with the given message. - - `gco` checks out a branch or paths to work tree. - - `gcO` checks out hunks from the index or the tree interactively. - - `gcf` amends the tip of the current branch using the same log message as *HEAD*. - - `gcSf` amends the tip of the current branch using the same log message as *HEAD*. (Signed) - - `gcF` amends the tip of the current branch. - - `gcSF` amends the tip of the current branch. (Signed) - - `gcp` applies changes introduced by existing commits. - - `gcP` applies changes introduced by existing commits without committing. - - `gcr` reverts existing commits by reverting patches and recording new - commits. - - `gcR` removes the *HEAD* commit. - - `gcs` displays various types of objects. - - `gcl` lists lost commits. - - `gcy` displays commits yet to be applied to upstream in the short format. - - `gcY` displays commits yet to be applied to upstream. - -### Conflict - - - `gCl` lists unmerged files. - - `gCa` adds unmerged file contents to the index. - - `gCe` executes merge-tool on all unmerged file. - - `gCo` checks out our changes for unmerged paths. - - `gCO` checks out our changes for all unmerged paths. - - `gCt` checks out their changes for unmerged paths. - - `gCT` checks out their changes for all unmerged paths. - -### Data - - - `gd` displays information about files in the index and the work tree. - - `gdc` lists cached files. - - `gdx` lists deleted files. - - `gdm` lists modified files. - - `gdu` lists untracked files. - - `gdk` lists killed files. - - `gdi` lists ignored files. - -### Fetch - - - `gf` downloads objects and references from another repository. - - `gfa` downloads objects and references from all remote repositories. - - `gfc` clones a repository into a new directory. - - `gfcr` clones a repository into a new directory including all submodules. - - `gfm` fetches from and merges with another repository or local branch. - - `gfr` fetches from and rebases on another repository or local branch. - -### Flow - - - `gFi` is short for `git flow init` - -#### Feature - - - `gFf` is short for `git flow feature` - - `gFfl` is short for `git flow feature list` - - `gFfs` is short for `git flow feature start` - - `gFff` is short for `git flow feature finish` - - `gFfp` is short for `git flow feature publish` - - `gFft` is short for `git flow feature track` - - `gFfd` is short for `git flow feature diff` - - `gFfr` is short for `git flow feature rebase` - - `gFfc` is short for `git flow feature checkout` - - `gFfm` is short for `git flow feature pull` - - `gFfx` is short for `git flow feature delete` - -#### Bugfix - - - `gFb` is short for `git flow bugfix` - - `gFbl` is short for `git flow bugfix list` - - `gFbs` is short for `git flow bugfix start` - - `gFbf` is short for `git flow bugfix finish` - - `gFbp` is short for `git flow bugfix publish` - - `gFbt` is short for `git flow bugfix track` - - `gFbd` is short for `git flow bugfix diff` - - `gFbr` is short for `git flow bugfix rebase` - - `gFbc` is short for `git flow bugfix checkout` - - `gFbm` is short for `git flow bugfix pull` - - `gFbx` is short for `git flow bugfix delete` - -#### Release - - - `gFl` is short for `git flow release` - - `gFll` is short for `git flow release list` - - `gFls` is short for `git flow release start` - - `gFlf` is short for `git flow release finish` - - `gFlp` is short for `git flow release publish` - - `gFlt` is short for `git flow release track` - - `gFld` is short for `git flow release diff` - - `gFlr` is short for `git flow release rebase` - - `gFlc` is short for `git flow release checkout` - - `gFlm` is short for `git flow release pull` - - `gFlx` is short for `git flow release delete` - -#### Hotfix - - - `gFh` is short for `git flow hotfix` - - `gFhl` is short for `git flow hotfix list` - - `gFhs` is short for `git flow hotfix start` - - `gFhf` is short for `git flow hotfix finish` - - `gFhp` is short for `git flow hotfix publish` - - `gFht` is short for `git flow hotfix track` - - `gFhd` is short for `git flow hotfix diff` - - `gFhr` is short for `git flow hotfix rebase` - - `gFhc` is short for `git flow hotfix checkout` - - `gFhm` is short for `git flow hotfix pull` - - `gFhx` is short for `git flow hotfix delete` - -#### Support - - - `gFs` is short for `git flow support` - - `gFsl` is short for `git flow support list` - - `gFss` is short for `git flow support start` - - `gFsf` is short for `git flow support finish` - - `gFsp` is short for `git flow support publish` - - `gFst` is short for `git flow support track` - - `gFsd` is short for `git flow support diff` - - `gFsr` is short for `git flow support rebase` - - `gFsc` is short for `git flow support checkout` - - `gFsm` is short for `git flow support pull` - - `gFsx` is short for `git flow support delete` - -### Grep - - - `gg` displays lines matching a pattern. - - `ggi` displays lines matching a pattern ignoring case. - - `ggl` lists files matching a pattern. - - `ggL` lists files that are not matching a pattern. - - `ggv` displays lines not matching a pattern. - - `ggw` displays lines matching a pattern at word boundary. - -### Index - - - `gia` adds file contents to the index. - - `giA` adds file contents to the index interactively. - - `giu` adds file contents to the index (updates only known files). - - `gid` displays changes between the index and a named commit (diff). - - `giD` displays changes between the index and a named commit (word diff). - - `gii` temporarily ignore differences in a given file. - - `giI` unignore differences in a given file. - - `gir` resets the current HEAD to the specified state. - - `giR` resets the current index interactively. - - `gix` removes files/directories from the index (recursively). - - `giX` removes files/directories from the index (recursively and forced). - -### Log - - - `gl` displays the log. - - `gls` displays the stats log. - - `gld` displays the diff log. - - `glo` displays the one line log. - - `glg` displays the graph log. - - `glb` displays the brief commit log. - - `glc` displays the commit count for each contributor in descending order. - -### Merge - - - `gm` joins two or more development histories together. - - `gmC` joins two or more development histories together but does not commit. - - `gmF` joins two or more development histories together but does not commit - generating a merge commit even if the merge resolved as a fast-forward. - - `gma` aborts the conflict resolution, and reconstructs the pre-merge state. - - `gmt` runs the merge conflict resolution tools to resolve conflicts. - -### Push - - - `gp` updates remote refs along with associated objects. - - `gpf` forcefully updates remote refs along with associated objects using the safer `--force-with-lease` option. - - `gpF` forcefully updates remote refs along with associated objects using the riskier `--force` option. - - `gpa` updates remote branches along with associated objects. - - `gpA` updates remote branches and tags along with associated objects. - - `gpt` updates remote tags along with associated objects. - - `gpc` updates remote refs along with associated objects and adds *origin* - as an upstream reference for the current branch. - - `gpp` pulls and pushes from origin to origin. - -### Rebase - - - `gr` forward-ports local commits to the updated upstream head. - - `gra` aborts the rebase. - - `grc` continues the rebase after merge conflicts are resolved. - - `gri` makes a list of commits to be rebased and opens the editor. - - `grs` skips the current patch. - -### Remote - - - `gR` manages tracked repositories. - - `gRl` lists remote names and their URLs. - - `gRa` adds a new remote. - - `gRx` removes a remote. - - `gRm` renames a remote. - - `gRu` fetches remotes updates. - - `gRp` prunes all stale remote tracking branches. - - `gRs` displays information about a given remote. - - `gRb` opens a remote on [GitHub][3] in the default browser. - -### Stash - - - `gs` stashes the changes of the dirty working directory. - - `gsa` applies the changes recorded in a stash to the working directory. - - `gsx` drops a stashed state. - - `gsX` drops all the stashed states. - - `gsl` lists stashed states. - - `gsL` lists dropped stashed states. - - `gsd` displays changes between the stash and its original parent. - - `gsp` removes and applies a single stashed state from the stash list. - - `gsr` recovers a given stashed state. - - `gss` stashes the changes of the dirty working directory, including untracked. - - `gsS` stashes the changes of the dirty working directory interactively. - - `gsw` stashes the changes of the dirty working directory retaining the index. - -### Submodule - - - `gS` initializes, updates, or inspects submodules. - - `gSa` adds given a repository as a submodule. - - `gSf` evaluates a shell command in each of checked out submodules. - - `gSi` initializes submodules. - - `gSI` initializes and clones submodules recursively. - - `gSl` lists the commits of all submodules. - - `gSm` moves a submodule. - - `gSs` synchronizes submodules' remote URL to the value specified in - .gitmodules. - - `gSu` fetches and merges the latest changes for all submodule. - - `gSx` removes a submodule. - -### Tag - - - `gt` lists tags or creates tag. - - `gtl` lists tags matching pattern. - -### Working directory - - - `gws` displays working-tree status in the short format. - - `gwS` displays working-tree status. - - `gwd` displays changes between the working tree and the index (diff). - - `gwD` displays changes between the working tree and the index (word diff). - - `gwr` resets the current HEAD to the specified state, does not touch the - index nor the working tree. - - `gwR` resets the current HEAD, index and working tree to the specified state. - - `gwc` removes untracked files from the working tree (dry-run). - - `gwC` removes untracked files from the working tree. - - `gwx` removes files from the working tree and from the index recursively. - - `gwX` removes files from the working tree and from the index recursively and - forcefully. - -### Shadows - -The following aliases may shadow system commands: - - - `gb` shadows the [GB][9]. - - `gm` shadows the [Graphics Magick image processor][11]. - - `gpt` shadows the [GUID partition table maintenance utility][4]. - - `gs` shadows the [Ghostscript interpreter and previewer][5]. - -If you frequently use the above commands, you may wish to remove said aliases -from this module or to disable them at the bottom of the zshrc with `unalias`. - -You can temporarily bypass an alias by prefixing it with a backward slash: -`\gpt`. - -Functions ---------- - - - `git-branch-current` displays the current branch. - - `git-commit-lost` lists lost commits. - - `git-dir` displays the path to the Git directory. - - `git-hub-browse` opens the [GitHub][3] repository in the default browser. - - `git-hub-shorten-url` shortens [GitHub URLs][10]. - - `git-info` exposes repository information via the `$git_info` associative - array. - - `git-root` displays the path to the working tree root. - - `git-stash-clear-interactive` asks for confirmation before clearing the stash. - - `git-stash-dropped` lists dropped stashed states. - - `git-stash-recover` recovers given dropped stashed states. - - `git-submodule-move` moves a submodule. - - `git-submodule-remove` removes a submodule. - -Theming -------- - -To display information about the current repository in a prompt, define the -following styles in the `prompt_name_setup` function, where the syntax for -setting a style is as follows. - -```sh -zstyle ':prezto:module:git:info:context:subcontext' format 'string' -``` - -### Main Contexts - -| Name | Format Code | Description -| --------- | :---------: | --------------------------------------------------- -| action | %s | Special action name -| ahead | %A | Commits ahead of remote count -| behind | %B | Commits behind of remote count -| branch | %b | Branch name -| commit | %c | Commit hash -| position | %p | Commits from the nearest tag count -| remote | %R | Remote name -| stashed | %S | Stashed states count - -### Concise Contexts - -| Name | Format Code | Description -| --------- | :---------: | --------------------------------------------------- -| clean | %C | Clean state -| dirty | %D | Dirty files count -| indexed | %i | Indexed files count -| unindexed | %I | Unindexed files count -| untracked | %u | Untracked files count - -The following contexts must be enabled with the following zstyle: - -```sh -zstyle ':prezto:module:git:info' verbose 'yes' -``` - -### Verbose Contexts - -| Name | Format Code | Description -| --------- | :---------: | --------------------------------------------------- -| added | %a | Added files count -| clean | %C | Clean state -| deleted | %d | Deleted files count -| dirty | %D | Dirty files count -| modified | %m | Modified files count -| renamed | %r | Renamed files count -| unmerged | %U | Unmerged files count -| untracked | %u | Untracked files count - -### Special Action Contexts - -| Name | Format | Description -| -------------------- | :---------: | ----------------------------------------- -| apply | value | Applying patches -| bisect | value | Binary searching for changes -| cherry-pick | value | Cherry picking -| cherry-pick-sequence | value | Cherry picking sequence -| merge | value | Merging -| rebase | value | Rebasing -| rebase-interactive | value | Rebasing interactively -| rebase-merge | value | Rebasing merge -| revert | value | Reverting -| revert-sequence | value | Reverting sequence - -First, format the repository state attributes. For example, to format the branch -and remote names, define the following styles. - -```sh -zstyle ':prezto:module:git:info:branch' format 'branch:%b' -zstyle ':prezto:module:git:info:remote' format 'remote:%R' -``` - -Second, format how the above attributes are displayed in prompts. - -```sh -zstyle ':prezto:module:git:info:keys' format \ - 'prompt' ' git(%b)' \ - 'rprompt' '[%R]' -``` - -Last, add `$git_info[prompt]` to `$PROMPT` and `$git_info[rprompt]` to -`$RPROMPT` respectively and call `git-info` in the `prompt_name_preexec` hook -function. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][6].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Colin Hebert](https://github.com/ColinHebert) - -[1]: http://www.git-scm.com -[2]: https://github.com/defunkt/hub -[3]: https://www.github.com -[4]: http://www.manpagez.com/man/8/gpt/ -[5]: http://www.manpagez.com/man/1/gs/ -[6]: https://github.com/sorin-ionescu/prezto/issues -[7]: https://github.com/sorin-ionescu/prezto/issues/219 -[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html -[9]: https://getgb.io/ -[10]: https://github.com/blog/985-git-io-github-url-shortener -[11]: http://www.manpagez.com/man/1/gm/ diff --git a/.zprezto/modules/git/alias.zsh b/.zprezto/modules/git/alias.zsh deleted file mode 100644 index dde5b35..0000000 --- a/.zprezto/modules/git/alias.zsh +++ /dev/null @@ -1,270 +0,0 @@ -# -# Defines Git aliases. -# -# Authors: -# Sorin Ionescu -# - -# -# Settings -# -# - -# Log -zstyle -s ':prezto:module:git:log:medium' format '_git_log_medium_format' \ - || _git_log_medium_format='%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B' -zstyle -s ':prezto:module:git:log:oneline' format '_git_log_oneline_format' \ - || _git_log_oneline_format='%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n' -zstyle -s ':prezto:module:git:log:brief' format '_git_log_brief_format' \ - || _git_log_brief_format='%C(green)%h%C(reset) %s%n%C(blue)(%ar by %an)%C(red)%d%C(reset)%n' - -# Status -zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_submodules' \ - || _git_status_ignore_submodules='none' - -# -# Aliases -# - -if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then - # Git - alias g='git' - - # Branch (b) - alias gb='git branch' - alias gba='git branch --all --verbose' - alias gbc='git checkout -b' - alias gbd='git branch --delete' - alias gbD='git branch --delete --force' - alias gbl='git branch --verbose' - alias gbL='git branch --all --verbose' - alias gbm='git branch --move' - alias gbM='git branch --move --force' - alias gbr='git branch --move' - alias gbR='git branch --move --force' - alias gbs='git show-branch' - alias gbS='git show-branch --all' - alias gbv='git branch --verbose' - alias gbV='git branch --verbose --verbose' - alias gbx='git branch --delete' - alias gbX='git branch --delete --force' - - # Commit (c) - alias gc='git commit --verbose' - alias gca='git commit --verbose --all' - alias gcm='git commit --message' - alias gcS='git commit -S --verbose' - alias gcSa='git commit -S --verbose --all' - alias gcSm='git commit -S --message' - alias gcam='git commit --all --message' - alias gco='git checkout' - alias gcO='git checkout --patch' - alias gcf='git commit --amend --reuse-message HEAD' - alias gcSf='git commit -S --amend --reuse-message HEAD' - alias gcF='git commit --verbose --amend' - alias gcSF='git commit -S --verbose --amend' - alias gcp='git cherry-pick --ff' - alias gcP='git cherry-pick --no-commit' - alias gcr='git revert' - alias gcR='git reset "HEAD^"' - alias gcs='git show' - alias gcl='git-commit-lost' - alias gcy='git cherry -v --abbrev' - alias gcY='git cherry -v' - - # Conflict (C) - alias gCl='git --no-pager diff --name-only --diff-filter=U' - alias gCa='git add $(gCl)' - alias gCe='git mergetool $(gCl)' - alias gCo='git checkout --ours --' - alias gCO='gCo $(gCl)' - alias gCt='git checkout --theirs --' - alias gCT='gCt $(gCl)' - - # Data (d) - alias gd='git ls-files' - alias gdc='git ls-files --cached' - alias gdx='git ls-files --deleted' - alias gdm='git ls-files --modified' - alias gdu='git ls-files --other --exclude-standard' - alias gdk='git ls-files --killed' - alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"' - - # Fetch (f) - alias gf='git fetch' - alias gfa='git fetch --all' - alias gfc='git clone' - alias gfcr='git clone --recurse-submodules' - alias gfm='git pull' - alias gfr='git pull --rebase' - - # Flow (F) - alias gFi='git flow init' - alias gFf='git flow feature' - alias gFb='git flow bugfix' - alias gFl='git flow release' - alias gFh='git flow hotfix' - alias gFs='git flow support' - - alias gFfl='git flow feature list' - alias gFfs='git flow feature start' - alias gFff='git flow feature finish' - alias gFfp='git flow feature publish' - alias gFft='git flow feature track' - alias gFfd='git flow feature diff' - alias gFfr='git flow feature rebase' - alias gFfc='git flow feature checkout' - alias gFfm='git flow feature pull' - alias gFfx='git flow feature delete' - - alias gFbl='git flow bugfix list' - alias gFbs='git flow bugfix start' - alias gFbf='git flow bugfix finish' - alias gFbp='git flow bugfix publish' - alias gFbt='git flow bugfix track' - alias gFbd='git flow bugfix diff' - alias gFbr='git flow bugfix rebase' - alias gFbc='git flow bugfix checkout' - alias gFbm='git flow bugfix pull' - alias gFbx='git flow bugfix delete' - - alias gFll='git flow release list' - alias gFls='git flow release start' - alias gFlf='git flow release finish' - alias gFlp='git flow release publish' - alias gFlt='git flow release track' - alias gFld='git flow release diff' - alias gFlr='git flow release rebase' - alias gFlc='git flow release checkout' - alias gFlm='git flow release pull' - alias gFlx='git flow release delete' - - alias gFhl='git flow hotfix list' - alias gFhs='git flow hotfix start' - alias gFhf='git flow hotfix finish' - alias gFhp='git flow hotfix publish' - alias gFht='git flow hotfix track' - alias gFhd='git flow hotfix diff' - alias gFhr='git flow hotfix rebase' - alias gFhc='git flow hotfix checkout' - alias gFhm='git flow hotfix pull' - alias gFhx='git flow hotfix delete' - - alias gFsl='git flow support list' - alias gFss='git flow support start' - alias gFsf='git flow support finish' - alias gFsp='git flow support publish' - alias gFst='git flow support track' - alias gFsd='git flow support diff' - alias gFsr='git flow support rebase' - alias gFsc='git flow support checkout' - alias gFsm='git flow support pull' - alias gFsx='git flow support delete' - - # Grep (g) - alias gg='git grep' - alias ggi='git grep --ignore-case' - alias ggl='git grep --files-with-matches' - alias ggL='git grep --files-without-matches' - alias ggv='git grep --invert-match' - alias ggw='git grep --word-regexp' - - # Index (i) - alias gia='git add' - alias giA='git add --patch' - alias giu='git add --update' - alias gid='git diff --no-ext-diff --cached' - alias giD='git diff --no-ext-diff --cached --word-diff' - alias gii='git update-index --assume-unchanged' - alias giI='git update-index --no-assume-unchanged' - alias gir='git reset' - alias giR='git reset --patch' - alias gix='git rm -r --cached' - alias giX='git rm -rf --cached' - - # Log (l) - alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"' - alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"' - alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"' - alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"' - alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' - alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' - alias glc='git shortlog --summary --numbered' - - # Merge (m) - alias gm='git merge' - alias gmC='git merge --no-commit' - alias gmF='git merge --no-ff' - alias gma='git merge --abort' - alias gmt='git mergetool' - - # Push (p) - alias gp='git push' - alias gpf='git push --force-with-lease' - alias gpF='git push --force' - alias gpa='git push --all' - alias gpA='git push --all && git push --tags' - alias gpt='git push --tags' - alias gpc='git push --set-upstream origin "$(git-branch-current 2> /dev/null)"' - alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"' - - # Rebase (r) - alias gr='git rebase' - alias gra='git rebase --abort' - alias grc='git rebase --continue' - alias gri='git rebase --interactive' - alias grs='git rebase --skip' - - # Remote (R) - alias gR='git remote' - alias gRl='git remote --verbose' - alias gRa='git remote add' - alias gRx='git remote rm' - alias gRm='git remote rename' - alias gRu='git remote update' - alias gRp='git remote prune' - alias gRs='git remote show' - alias gRb='git-hub-browse' - - # Stash (s) - alias gs='git stash' - alias gsa='git stash apply' - alias gsx='git stash drop' - alias gsX='git-stash-clear-interactive' - alias gsl='git stash list' - alias gsL='git-stash-dropped' - alias gsd='git stash show --patch --stat' - alias gsp='git stash pop' - alias gsr='git-stash-recover' - alias gss='git stash save --include-untracked' - alias gsS='git stash save --patch --no-keep-index' - alias gsw='git stash save --include-untracked --keep-index' - - # Submodule (S) - alias gS='git submodule' - alias gSa='git submodule add' - alias gSf='git submodule foreach' - alias gSi='git submodule init' - alias gSI='git submodule update --init --recursive' - alias gSl='git submodule status' - alias gSm='git-submodule-move' - alias gSs='git submodule sync' - alias gSu='git submodule foreach git pull origin master' - alias gSx='git-submodule-remove' - - # Tag (t) - alias gt='git tag' - alias gtl='git tag -l' - - # Working Copy (w) - alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short' - alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}' - alias gwd='git diff --no-ext-diff' - alias gwD='git diff --no-ext-diff --word-diff' - alias gwr='git reset --soft' - alias gwR='git reset --hard' - alias gwc='git clean -n' - alias gwC='git clean -f' - alias gwx='git rm -r' - alias gwX='git rm -rf' -fi diff --git a/.zprezto/modules/git/functions/_git-hub-browse b/.zprezto/modules/git/functions/_git-hub-browse deleted file mode 100644 index 075314b..0000000 --- a/.zprezto/modules/git/functions/_git-hub-browse +++ /dev/null @@ -1,47 +0,0 @@ -#compdef git-hub-browse -#autoload - -# -# Completes git-hub-browse. -# -# Authors: -# Sorin Ionescu -# - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - return 1 -fi - -local state expl remotes remote branches_or_tags branches tags files ret=1 - -_arguments -C -s -S \ - '1::args:->remote' \ - '2::args:->branch-or-tag' \ - '3::args:->file' && ret=0 - -case "$state" in - (remote) - remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2)) - - _describe -t branch 'remotes' remotes && ret=0 - ;; - (branch-or-tag) - remote="$words[(($CURRENT - 1))]" - - branches_or_tags=($( - command git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2 - )) - - branches=(HEAD ${${(M)branches_or_tags[@]##refs/heads/?##}##refs/heads/}) - tags=(${${(M)branches_or_tags[@]##refs/tags/?##}##refs/tags/}) - - _describe -t branch 'branches' branches && ret=0 - _describe -t tag 'tags' tags && ret=0 - ;; - (file) - files=(${(0)"$(_call_program files command git ls-files -z --exclude-standard 2> /dev/null)"}) - _wanted file expl 'file' _multi_parts - / files && ret=0 - ;; -esac - -return $ret diff --git a/.zprezto/modules/git/functions/_git-hub-shorten-url b/.zprezto/modules/git/functions/_git-hub-shorten-url deleted file mode 100644 index 7e65ded..0000000 --- a/.zprezto/modules/git/functions/_git-hub-shorten-url +++ /dev/null @@ -1,16 +0,0 @@ -#compdef git-hub-shorten-url -#autoload - -# -# Completes git-hub-shorten-url. -# -# Authors: -# Sorin Ionescu -# - -local service="$service" - -zstyle ":completion:*:${service}:*:prefixes" ignored-patterns '^http(|s)://' -zstyle ":completion:*:${service}:*:hosts" ignored-patterns '^*github.com' - -_arguments '1::GitHub URL:_urls' '2::code:' && return 0 diff --git a/.zprezto/modules/git/functions/_git-info b/.zprezto/modules/git/functions/_git-info deleted file mode 100644 index ef6d970..0000000 --- a/.zprezto/modules/git/functions/_git-info +++ /dev/null @@ -1,18 +0,0 @@ -#compdef git-info -#autoload - -# -# Completes git-info. -# -# Authors: -# Sorin Ionescu -# - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - return 1 -fi - -_arguments "1:toggle:(( - on\:'enable in-prompt information for the current repository' - off\:'disable in-prompt information for the current repository' -))" && return 0 diff --git a/.zprezto/modules/git/functions/_git-submodule-move b/.zprezto/modules/git/functions/_git-submodule-move deleted file mode 100644 index 5f2122c..0000000 --- a/.zprezto/modules/git/functions/_git-submodule-move +++ /dev/null @@ -1,40 +0,0 @@ -#compdef git-submodule-move -#autoload - -# -# Completes git-submodule-move. -# -# Authors: -# Sorin Ionescu -# - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - return 1 -fi - -local state expl ret=1 -local -a submodules -local submodule - -_arguments -C -s -S \ - '1::args:->submodule' \ - '2::args:->directory' && ret=0 - -case "$state" in - (submodule) - while IFS=$'\n' read submodule; do - submodules+=("$submodule") - done < <( - command git config --file "$(git-root)/.gitmodules" --list \ - | grep '.path=' \ - | cut -d= -f2- - ) - - _describe -t submodule 'submodules' submodules && ret=0 - ;; - (directory) - _wanted directories expl 'directory' _path_files -/ || _message 'directory' - ;; -esac - -return $ret diff --git a/.zprezto/modules/git/functions/_git-submodule-remove b/.zprezto/modules/git/functions/_git-submodule-remove deleted file mode 100644 index 819dfd8..0000000 --- a/.zprezto/modules/git/functions/_git-submodule-remove +++ /dev/null @@ -1,26 +0,0 @@ -#compdef git-submodule-remove -#autoload - -# -# Completes git-submodule-remove. -# -# Authors: -# Sorin Ionescu -# - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - return 1 -fi - -local -a submodules -local submodule - -while IFS=$'\n' read submodule; do - submodules+=("$submodule") -done < <( - command git config --file "$(git-root)/.gitmodules" --list \ - | grep '.path=' \ - | cut -d= -f2- -) - -_describe -t submodule 'submodules' submodules && return 0 diff --git a/.zprezto/modules/git/functions/git-branch-current b/.zprezto/modules/git/functions/git-branch-current deleted file mode 100644 index 3cf2e19..0000000 --- a/.zprezto/modules/git/functions/git-branch-current +++ /dev/null @@ -1,24 +0,0 @@ -# -# Displays the current Git branch. -# -# Authors: -# Sorin Ionescu -# - -# function git-branch-current { - -if ! command git rev-parse 2> /dev/null; then - print "$0: not a repository: $PWD" >&2 - return 1 -fi - -local ref="$(command git symbolic-ref HEAD 2> /dev/null)" - -if [[ -n "$ref" ]]; then - print "${ref#refs/heads/}" - return 0 -else - return 1 -fi - -# } diff --git a/.zprezto/modules/git/functions/git-commit-lost b/.zprezto/modules/git/functions/git-commit-lost deleted file mode 100644 index 1f086d3..0000000 --- a/.zprezto/modules/git/functions/git-commit-lost +++ /dev/null @@ -1,24 +0,0 @@ -# -# Lists lost Git commits. -# -# Authors: -# Sorin Ionescu -# - -# function git-commit-lost { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -command git fsck 2> /dev/null \ - | grep "^dangling commit" \ - | awk '{print $3}' \ - | command git log \ - --date-order \ - --no-walk \ - --stdin \ - --pretty=format:${_git_log_oneline_format} - -# } diff --git a/.zprezto/modules/git/functions/git-dir b/.zprezto/modules/git/functions/git-dir deleted file mode 100644 index aacaaa8..0000000 --- a/.zprezto/modules/git/functions/git-dir +++ /dev/null @@ -1,20 +0,0 @@ -# -# Displays the path to the Git directory. -# -# Authors: -# Sorin Ionescu -# - -# function git-dir { - -local git_dir="${$(command git rev-parse --git-dir):A}" - -if [[ -n "$git_dir" ]]; then - print "$git_dir" - return 0 -else - print "$0: not a repository: $PWD" >&2 - return 1 -fi - -# } diff --git a/.zprezto/modules/git/functions/git-hub-browse b/.zprezto/modules/git/functions/git-hub-browse deleted file mode 100644 index cb3fc60..0000000 --- a/.zprezto/modules/git/functions/git-hub-browse +++ /dev/null @@ -1,62 +0,0 @@ -# -# Opens a GitHub repository in the default browser. -# -# Authors: -# Sorin Ionescu -# - -# function git-hub-browse { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -local remotes remote references reference file url - -remote="${1:-origin}" -remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2)) - -if (( $remotes[(i)$remote] == $#remotes + 1 )); then - print "$0: remote not found: $remote" >&2 - return 1 -fi - -url=$( - command git config --get "remote.${remote}.url" \ - | sed -En "s/(git|https?)(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\4\/\5/p" -) - -reference="${${2:-$(git-branch-current)}:-HEAD}" -references=( - HEAD - ${$(command git ls-remote --heads --tags "$remote" | awk '{print $2}')##refs/(heads|tags)/} -) - -if (( $references[(i)$reference] == $#references + 1 )); then - print "$0: branch or tag not found: $reference" >&2 - return 1 -fi - -if [[ "$reference" == 'HEAD' ]]; then - reference="$(command git rev-parse HEAD 2> /dev/null)" -fi - -file="$3" - -if [[ -n "$url" ]]; then - url="${url}/tree/${reference}/${file}" - - if (( $+commands[$BROWSER] )); then - "$BROWSER" "$url" - return 0 - else - print "$0: browser not set or set to a non-existent browser" >&2 - return 1 - fi -else - print "$0: not a Git repository or remote not set" >&2 - return 1 -fi - -# } diff --git a/.zprezto/modules/git/functions/git-hub-shorten-url b/.zprezto/modules/git/functions/git-hub-shorten-url deleted file mode 100644 index 470c093..0000000 --- a/.zprezto/modules/git/functions/git-hub-shorten-url +++ /dev/null @@ -1,28 +0,0 @@ -# -# Shortens GitHub URLs. -# -# Authors: -# Sorin Ionescu -# - -# function git-hub-shorten-url { - -local url="$1" code="$2" - -if [[ "$url" == '-' ]]; then - read url <&0 -fi - -if [[ -z "$url" || ! "$url" =~ ^https?:\/\/.*github.com\/ ]]; then - print "usage: $0 [ url | - ] [code] ; url must be a github.com URL" >&2 - return 1 -fi - -if (( $+commands[curl] )); then - curl -s -i 'https://git.io' -F "url=$url" ${(s: :)code:+ -F "code=$code"} | sed -n 's/^Location: //p' -else - print "$0: command not found: curl" >&2 - return 1 -fi - -# } diff --git a/.zprezto/modules/git/functions/git-info b/.zprezto/modules/git/functions/git-info deleted file mode 100644 index fe8ca2a..0000000 --- a/.zprezto/modules/git/functions/git-info +++ /dev/null @@ -1,444 +0,0 @@ -# -# Exposes Git repository information via the $git_info associative array. -# -# Authors: -# Sorin Ionescu -# - -# Gets the Git special action (am, bisect, cherry, merge, rebase, revert). -# Borrowed from vcs_info and edited. -function _git-action { - local action_dir - local git_dir="$(git-dir)" - local apply_formatted - local bisect_formatted - local cherry_pick_formatted - local cherry_pick_sequence_formatted - local merge_formatted - local rebase_formatted - local rebase_interactive_formatted - local rebase_merge_formatted - local revert_formatted - local revert_sequence_formatted - - for action_dir in \ - "${git_dir}/rebase-apply" \ - "${git_dir}/rebase" \ - "${git_dir}/../.dotest" - do - if [[ -d "$action_dir" ]] ; then - zstyle -s ':prezto:module:git:info:action:apply' format 'apply_formatted' || apply_formatted='apply' - zstyle -s ':prezto:module:git:info:action:rebase' format 'rebase_formatted' || rebase_formatted='rebase' - - if [[ -f "${action_dir}/rebasing" ]] ; then - print "$rebase_formatted" - elif [[ -f "${action_dir}/applying" ]] ; then - print "$apply_formatted" - else - print "${rebase_formatted}/${apply_formatted}" - fi - - return 0 - fi - done - - for action_dir in \ - "${git_dir}/rebase-merge/interactive" \ - "${git_dir}/.dotest-merge/interactive" - do - if [[ -f "$action_dir" ]]; then - zstyle -s ':prezto:module:git:info:action:rebase-interactive' format 'rebase_interactive_formatted' || rebase_interactive_formatted='rebase-interactive' - print "$rebase_interactive_formatted" - return 0 - fi - done - - for action_dir in \ - "${git_dir}/rebase-merge" \ - "${git_dir}/.dotest-merge" - do - if [[ -d "$action_dir" ]]; then - zstyle -s ':prezto:module:git:info:action:rebase-merge' format 'rebase_merge_formatted' || rebase_merge_formatted='rebase-merge' - print "$rebase_merge_formatted" - return 0 - fi - done - - if [[ -f "${git_dir}/MERGE_HEAD" ]]; then - zstyle -s ':prezto:module:git:info:action:merge' format 'merge_formatted' || merge_formatted='merge' - print "$merge_formatted" - return 0 - fi - - if [[ -f "${git_dir}/CHERRY_PICK_HEAD" ]]; then - if [[ -d "${git_dir}/sequencer" ]] ; then - zstyle -s ':prezto:module:git:info:action:cherry-pick-sequence' format 'cherry_pick_sequence_formatted' || cherry_pick_sequence_formatted='cherry-pick-sequence' - print "$cherry_pick_sequence_formatted" - else - zstyle -s ':prezto:module:git:info:action:cherry-pick' format 'cherry_pick_formatted' || cherry_pick_formatted='cherry-pick' - print "$cherry_pick_formatted" - fi - - return 0 - fi - - if [[ -f "${git_dir}/REVERT_HEAD" ]]; then - if [[ -d "${git_dir}/sequencer" ]] ; then - zstyle -s ':prezto:module:git:info:action:revert-sequence' format 'revert_sequence_formatted' || revert_sequence_formatted='revert-sequence' - print "$revert_sequence_formatted" - else - zstyle -s ':prezto:module:git:info:action:revert' format 'revert_formatted' || revert_formatted='revert' - print "$revert_formatted" - fi - - return 0 - fi - - if [[ -f "${git_dir}/BISECT_LOG" ]]; then - zstyle -s ':prezto:module:git:info:action:bisect' format 'bisect_formatted' || bisect_formatted='bisect' - print "$bisect_formatted" - return 0 - fi - - return 1 -} - -# Gets the Git status information. -function git-info { - # Extended globbing is needed to parse repository status. - setopt LOCAL_OPTIONS - setopt EXTENDED_GLOB - - local action - local action_format - local action_formatted - local added=0 - local added_format - local added_formatted - local ahead=0 - local ahead_and_behind - local ahead_and_behind_cmd - local ahead_format - local ahead_formatted - local ahead_or_behind - local behind=0 - local behind_format - local behind_formatted - local branch - local branch_format - local branch_formatted - local branch_info - local clean - local clean_formatted - local commit - local commit_format - local commit_formatted - local deleted=0 - local deleted_format - local deleted_formatted - local dirty=0 - local dirty_format - local dirty_formatted - local ignore_submodules - local indexed=0 - local indexed_format - local indexed_formatted - local -A info_formats - local info_format - local modified=0 - local modified_format - local modified_formatted - local position - local position_format - local position_formatted - local remote - local remote_cmd - local remote_format - local remote_formatted - local renamed=0 - local renamed_format - local renamed_formatted - local stashed=0 - local stashed_format - local stashed_formatted - local status_cmd - local status_mode - local unindexed=0 - local unindexed_format - local unindexed_formatted - local unmerged=0 - local unmerged_format - local unmerged_formatted - local untracked=0 - local untracked_format - local untracked_formatted - - # Clean up previous $git_info. - unset git_info - typeset -gA git_info - - # Return if not inside a Git repository work tree. - if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - return 1 - fi - - if (( $# > 0 )); then - if [[ "$1" == [Oo][Nn] ]]; then - command git config --bool prompt.showinfo true - elif [[ "$1" == [Oo][Ff][Ff] ]]; then - command git config --bool prompt.showinfo false - else - print "usage: $0 [ on | off ]" >&2 - fi - return 0 - fi - - # Return if git-info is disabled. - if ! is-true "${$(command git config --bool prompt.showinfo):-true}"; then - return 1 - fi - - # Ignore submodule status. - zstyle -s ':prezto:module:git:status:ignore' submodules 'ignore_submodules' - - # Format commit. - zstyle -s ':prezto:module:git:info:commit' format 'commit_format' - if [[ -n "$commit_format" ]]; then - commit="$(command git rev-parse HEAD 2> /dev/null)" - if [[ -n "$commit" ]]; then - zformat -f commit_formatted "$commit_format" "c:$commit" - fi - fi - - # Format stashed. - zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format' - if [[ -n "$stashed_format" ]]; then - commondir="" - if [[ -f "$(git-dir)/commondir" ]]; then - commondir="$(<$(git-dir)/commondir)" - [[ "$commondir" =~ ^/ ]] || commondir="$(git-dir)/$commondir" - fi - if [[ -f "$(git-dir)/refs/stash" || ( -n "$commondir" && -f "$commondir/refs/stash" ) ]]; then - stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')" - if [[ -n "$stashed" ]]; then - zformat -f stashed_formatted "$stashed_format" "S:$stashed" - fi - fi - fi - - # Format action. - zstyle -s ':prezto:module:git:info:action' format 'action_format' - if [[ -n "$action_format" ]]; then - action="$(_git-action)" - if [[ -n "$action" ]]; then - zformat -f action_formatted "$action_format" "s:$action" - fi - fi - - # Get the branch. - branch="${$(command git symbolic-ref HEAD 2> /dev/null)#refs/heads/}" - - # Format branch. - zstyle -s ':prezto:module:git:info:branch' format 'branch_format' - if [[ -n "$branch" && -n "$branch_format" ]]; then - zformat -f branch_formatted "$branch_format" "b:$branch" - fi - - # Format position. - zstyle -s ':prezto:module:git:info:position' format 'position_format' - if [[ -z "$branch" && -n "$position_format" ]]; then - position="$(command git describe --contains --all HEAD 2> /dev/null)" - if [[ -n "$position" ]]; then - zformat -f position_formatted "$position_format" "p:$position" - fi - fi - - # Format remote. - zstyle -s ':prezto:module:git:info:remote' format 'remote_format' - if [[ -n "$branch" && -n "$remote_format" ]]; then - # Gets the remote name. - remote_cmd='command git rev-parse --symbolic-full-name --verify HEAD@{upstream}' - remote="${$(${(z)remote_cmd} 2> /dev/null)##refs/remotes/}" - if [[ -n "$remote" ]]; then - zformat -f remote_formatted "$remote_format" "R:$remote" - fi - fi - - zstyle -s ':prezto:module:git:info:ahead' format 'ahead_format' - zstyle -s ':prezto:module:git:info:behind' format 'behind_format' - if [[ -n "$branch" && ( -n "$ahead_format" || -n "$behind_format" ) ]]; then - # Gets the commit difference counts between local and remote. - ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}' - - # Get ahead and behind counts. - ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)" - - # Format ahead. - if [[ -n "$ahead_format" ]]; then - ahead="$ahead_and_behind[(w)1]" - if (( ahead > 0 )); then - zformat -f ahead_formatted "$ahead_format" "A:$ahead" - fi - fi - - # Format behind. - if [[ -n "$behind_format" ]]; then - behind="$ahead_and_behind[(w)2]" - if (( behind > 0 )); then - zformat -f behind_formatted "$behind_format" "B:$behind" - fi - fi - fi - - # Get status type. - if ! zstyle -t ':prezto:module:git:info' verbose; then - # Format indexed. - zstyle -s ':prezto:module:git:info:indexed' format 'indexed_format' - if [[ -n "$indexed_format" ]]; then - (( - indexed+=$( - command git diff-index \ - --no-ext-diff \ - --name-only \ - --cached \ - --ignore-submodules=${ignore_submodules:-none} \ - HEAD \ - 2> /dev/null \ - | wc -l - ) - )) - if (( indexed > 0 )); then - zformat -f indexed_formatted "$indexed_format" "i:$indexed" - fi - fi - - # Format unindexed. - zstyle -s ':prezto:module:git:info:unindexed' format 'unindexed_format' - if [[ -n "$unindexed_format" ]]; then - (( - unindexed+=$( - command git diff-files \ - --no-ext-diff \ - --name-only \ - --ignore-submodules=${ignore_submodules:-none} \ - 2> /dev/null \ - | wc -l - ) - )) - if (( unindexed > 0 )); then - zformat -f unindexed_formatted "$unindexed_format" "I:$unindexed" - fi - fi - - # Format untracked. - zstyle -s ':prezto:module:git:info:untracked' format 'untracked_format' - if [[ -n "$untracked_format" ]]; then - (( - untracked+=$( - command git ls-files \ - --other \ - --exclude-standard \ - 2> /dev/null \ - | wc -l - ) - )) - if (( untracked > 0 )); then - zformat -f untracked_formatted "$untracked_format" "u:$untracked" - fi - fi - - (( dirty = indexed + unindexed + untracked )) - else - # Use porcelain status for easy parsing. - status_cmd="command git status --porcelain --ignore-submodules=${ignore_submodules:-none}" - - # Get current status. - while IFS=$'\n' read line; do - # Count added, deleted, modified, renamed, unmerged, untracked, dirty. - # T (type change) is undocumented, see http://git.io/FnpMGw. - # For a table of scenarii, see http://i.imgur.com/2YLu1.png. - [[ "$line" == ([ACDMT][\ MT]|[ACMT]D)\ * ]] && (( added++ )) - [[ "$line" == [\ ACMRT]D\ * ]] && (( deleted++ )) - [[ "$line" == ?[MT]\ * ]] && (( modified++ )) - [[ "$line" == R?\ * ]] && (( renamed++ )) - [[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ )) - [[ "$line" == \?\?\ * ]] && (( untracked++ )) - (( dirty++ )) - done < <(${(z)status_cmd} 2> /dev/null) - - # Format added. - if (( added > 0 )); then - zstyle -s ':prezto:module:git:info:added' format 'added_format' - zformat -f added_formatted "$added_format" "a:$added" - fi - - # Format deleted. - if (( deleted > 0 )); then - zstyle -s ':prezto:module:git:info:deleted' format 'deleted_format' - zformat -f deleted_formatted "$deleted_format" "d:$deleted" - fi - - # Format modified. - if (( modified > 0 )); then - zstyle -s ':prezto:module:git:info:modified' format 'modified_format' - zformat -f modified_formatted "$modified_format" "m:$modified" - fi - - # Format renamed. - if (( renamed > 0 )); then - zstyle -s ':prezto:module:git:info:renamed' format 'renamed_format' - zformat -f renamed_formatted "$renamed_format" "r:$renamed" - fi - - # Format unmerged. - if (( unmerged > 0 )); then - zstyle -s ':prezto:module:git:info:unmerged' format 'unmerged_format' - zformat -f unmerged_formatted "$unmerged_format" "U:$unmerged" - fi - - # Format untracked. - if (( untracked > 0 )); then - zstyle -s ':prezto:module:git:info:untracked' format 'untracked_format' - zformat -f untracked_formatted "$untracked_format" "u:$untracked" - fi - fi - - # Format dirty and clean. - if (( dirty > 0 )); then - zstyle -s ':prezto:module:git:info:dirty' format 'dirty_format' - zformat -f dirty_formatted "$dirty_format" "D:$dirty" - else - zstyle -s ':prezto:module:git:info:clean' format 'clean_formatted' - fi - - # Format info. - zstyle -a ':prezto:module:git:info:keys' format 'info_formats' - for info_format in ${(k)info_formats}; do - zformat -f REPLY "$info_formats[$info_format]" \ - "a:$added_formatted" \ - "A:$ahead_formatted" \ - "B:$behind_formatted" \ - "b:$branch_formatted" \ - "C:$clean_formatted" \ - "c:$commit_formatted" \ - "d:$deleted_formatted" \ - "D:$dirty_formatted" \ - "i:$indexed_formatted" \ - "I:$unindexed_formatted" \ - "m:$modified_formatted" \ - "p:$position_formatted" \ - "R:$remote_formatted" \ - "r:$renamed_formatted" \ - "s:$action_formatted" \ - "S:$stashed_formatted" \ - "U:$unmerged_formatted" \ - "u:$untracked_formatted" - git_info[$info_format]="$REPLY" - done - - unset REPLY - - return 0 -} - -git-info "$@" diff --git a/.zprezto/modules/git/functions/git-root b/.zprezto/modules/git/functions/git-root deleted file mode 100644 index 643f346..0000000 --- a/.zprezto/modules/git/functions/git-root +++ /dev/null @@ -1,20 +0,0 @@ -# -# Displays the path to the working tree root. -# -# Authors: -# Sorin Ionescu -# - -# function git-root { - -local root="$(command git rev-parse --show-toplevel 2> /dev/null)" - -if [[ -n "$root" ]]; then - print "$root" - return 0 -else - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -# } diff --git a/.zprezto/modules/git/functions/git-stash-clear-interactive b/.zprezto/modules/git/functions/git-stash-clear-interactive deleted file mode 100644 index cc665a1..0000000 --- a/.zprezto/modules/git/functions/git-stash-clear-interactive +++ /dev/null @@ -1,26 +0,0 @@ -# -# Asks for confirmation before clearing the Git stash. -# -# Authors: -# Sorin Ionescu -# - -# function git-stash-clear-interactive { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -local stashed - -if [[ -f "$(git-dir)/refs/stash" ]]; then - stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')" - if (( $stashed > 0 )); then - if read -q "?Clear $stashed stashed state(s) [y/N]? "; then - command git stash clear - fi - fi -fi - -# } diff --git a/.zprezto/modules/git/functions/git-stash-dropped b/.zprezto/modules/git/functions/git-stash-dropped deleted file mode 100644 index d9e759e..0000000 --- a/.zprezto/modules/git/functions/git-stash-dropped +++ /dev/null @@ -1,26 +0,0 @@ -# -# Lists dropped Git stashed states. -# -# Authors: -# Sorin Ionescu -# - -# function git-stash-dropped { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -command git fsck --unreachable 2> /dev/null \ - | grep 'commit' \ - | awk '{print $3}' \ - | command git log \ - --pretty=format:${_git_log_oneline_format} \ - --extended-regexp \ - --grep="${1:-(WIP )?[Oo]n [^:]+:}" \ - --merges \ - --no-walk \ - --stdin - -# } diff --git a/.zprezto/modules/git/functions/git-stash-recover b/.zprezto/modules/git/functions/git-stash-recover deleted file mode 100644 index 6cb5416..0000000 --- a/.zprezto/modules/git/functions/git-stash-recover +++ /dev/null @@ -1,22 +0,0 @@ -# -# Recovers dropped Git stashed states. -# -# Authors: -# Sorin Ionescu -# - -# function git-stash-recover { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -fi - -local commit - -for commit in "$@"; do - command git update-ref \ - -m "$(command git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit" -done - -# } diff --git a/.zprezto/modules/git/functions/git-submodule-move b/.zprezto/modules/git/functions/git-submodule-move deleted file mode 100644 index 746f46e..0000000 --- a/.zprezto/modules/git/functions/git-submodule-move +++ /dev/null @@ -1,36 +0,0 @@ -# -# Moves a Git submodule. -# -# Authors: -# Sorin Ionescu -# - -# function git-submodule-move { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -elif [[ "$PWD" != "$(git-root)" ]]; then - print "$0: must be run from the root of the work tree" >&2 - return 1 -fi - -local src="$1" -local dst="$2" -local url - -url="$(command git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")" - -if [[ -z "$url" ]]; then - print "$0: submodule not found: $src" >&2 - return 1 -fi - -mkdir -p "${dst:h}" - -git-submodule-remove "$src" -command git submodule add "$url" "$dst" - -return 0 - -# } diff --git a/.zprezto/modules/git/functions/git-submodule-remove b/.zprezto/modules/git/functions/git-submodule-remove deleted file mode 100644 index c8c11aa..0000000 --- a/.zprezto/modules/git/functions/git-submodule-remove +++ /dev/null @@ -1,31 +0,0 @@ -# -# Removes a Git submodule. -# -# Authors: -# Sorin Ionescu -# - -# function git-submodule-remove { - -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then - print "$0: not a repository work tree: $PWD" >&2 - return 1 -elif [[ "$PWD" != "$(git-root)" ]]; then - print "$0: must be run from the root of the work tree" >&2 - return 1 -elif ! command git config --file .gitmodules --get "submodule.${1}.path" &> /dev/null; then - print "$0: submodule not found: $1" >&2 - return 1 -fi - -command git config --file "$(git-dir)/config" --remove-section "submodule.${1}" &> /dev/null -command git config --file "$(git-root)/.gitmodules" --remove-section "submodule.${1}" &> /dev/null -command git add .gitmodules - -command git rm --cached -rf "${1}" -rm -rf "${1}" -rm -rf "$(git-dir)/modules/${1}" - -return 0 - -# } diff --git a/.zprezto/modules/git/init.zsh b/.zprezto/modules/git/init.zsh deleted file mode 100644 index ba54082..0000000 --- a/.zprezto/modules/git/init.zsh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Provides Git aliases and functions. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[git] )); then - return 1 -fi - -# Load dependencies. -pmodload 'helper' - -# Source module files. -source "${0:h}/alias.zsh" diff --git a/.zprezto/modules/gnu-utility/README.md b/.zprezto/modules/gnu-utility/README.md deleted file mode 100644 index 7e62a17..0000000 --- a/.zprezto/modules/gnu-utility/README.md +++ /dev/null @@ -1,34 +0,0 @@ -GNU Utility -=========== - -Provides for the interactive use of GNU utilities on BSD systems. - -Installing GNU utilities on non-GNU systems in `$PATH` without a prefix, i.e. -`ls` instead of `gls`, is not recommended since scripts that target other -utilities will be broken. - -This module wraps GNU utilities in functions without a prefix for interactive -use. - -This module must be loaded **before** the *utility* module. - -Settings --------- - -### Prefix - -To use a different prefix, add the following to *zpreztorc*, and replace 'g' with -the desired prefix: - -```sh -zstyle ':prezto:module:gnu-utility' prefix 'g' -``` - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/gnu-utility/init.zsh b/.zprezto/modules/gnu-utility/init.zsh deleted file mode 100644 index 4675a3c..0000000 --- a/.zprezto/modules/gnu-utility/init.zsh +++ /dev/null @@ -1,60 +0,0 @@ -# -# Provides for the interactive use of GNU utilities on BSD systems. -# -# Authors: -# Sorin Ionescu -# - -# Get the prefix or use the default. -zstyle -s ':prezto:module:gnu-utility' prefix '_gnu_utility_p' || _gnu_utility_p='g' - -# Return if requirements are not found. -if (( ! ${+commands[${_gnu_utility_p}whoami]} )); then - return 1 -fi - -_gnu_utility_cmds=( - # Coreutils - '[' 'b2sum' 'base32' 'base64' 'basename' 'cat' 'chcon' 'chgrp' 'chmod' 'chown' - 'chroot' 'cksum' 'comm' 'cp' 'csplit' 'cut' 'date' 'dd' 'df' - 'dir' 'dircolors' 'dirname' 'du' 'echo' 'env' 'expand' 'expr' - 'factor' 'false' 'fmt' 'fold' 'groups' 'head' 'hostid' 'id' - 'install' 'join' 'kill' 'link' 'ln' 'logname' 'ls' 'md5sum' 'mkdir' - 'mkfifo' 'mknod' 'mktemp' 'mv' 'nice' 'nl' 'nohup' 'nproc' - 'numfmt' 'od' 'paste' 'pathchk' 'pinky' 'pr' 'printenv' 'printf' 'ptx' - 'pwd' 'readlink' 'realpath' 'rm' 'rmdir' 'runcon' 'seq' 'sha1sum' - 'sha224sum' 'sha256sum' 'sha384sum' 'sha512sum' 'shred' 'shuf' - 'sleep' 'sort' 'split' 'stat' 'stdbuf' 'stty' 'sum' 'sync' 'tac' 'tail' - 'tee' 'test' 'timeout' 'touch' 'tr' 'true' 'truncate' 'tsort' - 'tty' 'uname' 'unexpand' 'uniq' 'unlink' 'uptime' 'users' 'vdir' - 'wc' 'who' 'whoami' 'yes' - - # The following utilities are not part of Coreutils but installed separately. - - # Binutils - 'addr2line' 'ar' 'c++filt' 'elfedit' 'nm' 'objcopy' 'objdump' - 'ranlib' 'readelf' 'size' 'strings' 'strip' - - # Findutils - 'find' 'locate' 'oldfind' 'updatedb' 'xargs' - - # Libtool - 'libtool' 'libtoolize' - - # Miscellaneous - 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'which' -) - -# Wrap GNU utilities in functions. -for _gnu_utility_cmd in "${_gnu_utility_cmds[@]}"; do - _gnu_utility_pcmd="${_gnu_utility_p}${_gnu_utility_cmd}" - if (( ${+commands[${_gnu_utility_pcmd}]} && ! ${+builtins[${_gnu_utility_cmd}]} )); then - eval " - function ${_gnu_utility_cmd} { - '${commands[${_gnu_utility_pcmd}]}' \"\$@\" - } - " - fi -done - -unset _gnu_utility_{p,cmds,cmd,pcmd} diff --git a/.zprezto/modules/gpg/README.md b/.zprezto/modules/gpg/README.md deleted file mode 100644 index be3c1a9..0000000 --- a/.zprezto/modules/gpg/README.md +++ /dev/null @@ -1,28 +0,0 @@ -GPG -=== - -Provides for an easier use of [GPG][1] by setting up [gpg-agent][2]. - -### SSH - -To enable OpenSSH Agent protocol emulation, and make `gpg-agent` a drop-in -replacement for `ssh-agent`, add the following line to -*~/.gnupg/gpg-agent.conf*: - -```conf -enable-ssh-support -``` - -When OpenSSH Agent protocol emulation is enabled, this module will load the SSH -module for additional processing. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.gnupg.org -[2]: http://linux.die.net/man/1/gpg-agent -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/gpg/init.zsh b/.zprezto/modules/gpg/init.zsh deleted file mode 100644 index 7976fd7..0000000 --- a/.zprezto/modules/gpg/init.zsh +++ /dev/null @@ -1,55 +0,0 @@ -# -# Provides for an easier use of GPG by setting up gpg-agent. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[gpg-agent] )); then - return 1 -fi - -# Set the default paths to gpg-agent files. -_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf" -_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID" - -# Load environment variables from previous run -source "$_gpg_agent_env" 2> /dev/null - -# Start gpg-agent if not started. -if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then - # Start gpg-agent if not started. - if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then - eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")" - fi -fi - -# Inform gpg-agent of the current TTY for user prompts. -export GPG_TTY="$(tty)" - -# Integrate with the SSH module. -if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then - # Load required functions. - autoload -Uz add-zsh-hook - - # Override the ssh-agent environment file default path. - _ssh_agent_env="$_gpg_agent_env" - - # Load the SSH module for additional processing. - pmodload 'ssh' - - # Updates the GPG-Agent TTY before every command since SSH does not set it. - function _gpg-agent-update-tty { - gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null - } - add-zsh-hook preexec _gpg-agent-update-tty -fi - -# Clean up. -unset _gpg_agent_{conf,env} - -# Disable GUI prompts inside SSH. -if [[ -n "$SSH_CONNECTION" ]]; then - export PINENTRY_USER_DATA='USE_CURSES=1' -fi diff --git a/.zprezto/modules/haskell/README.md b/.zprezto/modules/haskell/README.md deleted file mode 100644 index dcf144c..0000000 --- a/.zprezto/modules/haskell/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Haskell -======= - -Enables local Haskell package installation. - -Per-user Package Installation ------------------------------ - -[Cabal][1], the Haskell package manager, can install packages into per user -directories. - -This module prepends per user directories to the relevant path variables to -enable the execution of user installed executables and the reading of -documentation. - -### Usage - -Install packages into per user directories with `cabal install --user`. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sebastian Wiesner](https://github.com/lunaryorn) - -[1]: http://www.haskell.org/cabal/ -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/haskell/init.zsh b/.zprezto/modules/haskell/init.zsh deleted file mode 100644 index c1c78ca..0000000 --- a/.zprezto/modules/haskell/init.zsh +++ /dev/null @@ -1,18 +0,0 @@ -# -# Enables local Haskell package installation. -# -# Authors: -# Sebastian Wiesner -# - -# Return if requirements are not found. -if (( ! $+commands[ghc] )); then - return 1 -fi - -# Prepend Cabal per user directories to PATH. -if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then - path=($HOME/Library/Haskell/bin(/N) $path) -else - path=($HOME/.cabal/bin(/N) $path) -fi diff --git a/.zprezto/modules/helper/README.md b/.zprezto/modules/helper/README.md deleted file mode 100644 index 9f10d6e..0000000 --- a/.zprezto/modules/helper/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Helper -====== - -Provides helper functions for developing modules. - -Functions ---------- - - - `add-zsh-trap` adds a function name to a list to be called when a trap is - triggered. - - `is-autoloadable` checks if a file can be autoloaded by trying to load it - in a subshell. - - `is-callable` checks if a name is a command, function, or alias. - - `is-true` checks a boolean variable for "true". - - `coalesce` prints the first non-empty string in the arguments array. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/helper/functions/add-zsh-trap b/.zprezto/modules/helper/functions/add-zsh-trap deleted file mode 100644 index 07663e9..0000000 --- a/.zprezto/modules/helper/functions/add-zsh-trap +++ /dev/null @@ -1,41 +0,0 @@ -# -# Provides for trapping UNIX signals and calling callback functions when a trap -# is triggered. -# -# Authors: -# Sorin Ionescu -# - -# Adds a function name to a list to be called when a trap is triggered. -function add-zsh-trap { - if (( $# < 2 )); then - print "usage: $0 type function" >&2 - return 1 - fi - - if [[ -z "$signals[(r)$1]" ]]; then - print "$0: unknown signal: $1" >&2 - return 1 - fi - - local trap_functions="TRAP${1}_FUNCTIONS" - if (( ! ${(P)+trap_functions} )); then - typeset -gaU "$trap_functions" - fi - eval "$trap_functions+="$2"" - - if (( ! $+functions[TRAP${1}] )); then - eval " - function TRAP${1} { - for trap_function in \"\$TRAP${1}_FUNCTIONS[@]\"; do - if (( \$+functions[\$trap_function] )); then - \"\$trap_function\" \"\$1\" - fi - done - return \$(( 128 + \$1 )) - } - " - fi -} - -add-zsh-trap "$@" diff --git a/.zprezto/modules/helper/init.zsh b/.zprezto/modules/helper/init.zsh deleted file mode 100644 index 328bed4..0000000 --- a/.zprezto/modules/helper/init.zsh +++ /dev/null @@ -1,31 +0,0 @@ -# -# Defines helper functions. -# -# Authors: -# Sorin Ionescu -# - -# Checks if a file can be autoloaded by trying to load it in a subshell. -function is-autoloadable { - ( unfunction $1 ; autoload -U +X $1 ) &> /dev/null -} - -# Checks if a name is a command, function, or alias. -function is-callable { - (( $+commands[$1] || $+functions[$1] || $+aliases[$1] || $+builtins[$1] )) -} - -# Checks a boolean variable for "true". -# Case insensitive: "1", "y", "yes", "t", "true", "o", and "on". -function is-true { - [[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)|[Oo]([Nn]|)) ]] -} - -# Prints the first non-empty string in the arguments array. -function coalesce { - for arg in $argv; do - print "$arg" - return 0 - done - return 1 -} diff --git a/.zprezto/modules/history-substring-search/README.md b/.zprezto/modules/history-substring-search/README.md deleted file mode 100644 index 050a5c2..0000000 --- a/.zprezto/modules/history-substring-search/README.md +++ /dev/null @@ -1,71 +0,0 @@ -History Substring Search -======================== - -Integrates [zsh-history-substring-search][1] into Prezto, which implements -the [Fish shell][2]'s history search feature, where the user can type in any -part of a previously entered command and press up and down to cycle through -matching commands. - -If this module is used in conjunction with the *syntax-highlighting* module, -this module must be loaded **after** the *syntax-highlighting* module. - -Contributors ------------- - -New features and bug fixes should be submitted to the -[zsh-history-substring-search][1] project according to its rules and -regulations. This module will be synchronized against it. - -Settings --------- - -### Case Sensitivity - -To enable case-sensitivity for this module only, add the following line to -*zpreztorc*: - -```sh -zstyle ':prezto:module:history-substring-search' case-sensitive 'yes' -``` - -### Highlighting - -If colors are enabled, *history-substring-search* will automatically highlight -positive results. - -To enable highlighting for this module only, add the following line to -*zpreztorc*: - -```sh -zstyle ':prezto:module:history-substring-search' color 'yes' -``` - -To set the query found color, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:history-substring-search:color' found '' -``` - -To set the query not found color, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:history-substring-search:color' not-found '' -``` - -To set the search globbing flags, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:history-substring-search' globbing-flags '' -``` - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Suraj N. Kurapati](https://github.com/sunaku) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/zsh-users/zsh-history-substring-search -[2]: http://fishshell.com -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/history-substring-search/external/README.md b/.zprezto/modules/history-substring-search/external/README.md deleted file mode 100644 index c9dbad6..0000000 --- a/.zprezto/modules/history-substring-search/external/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# zsh-history-substring-search - -This is a clean-room implementation of the [Fish shell][1]'s history search -feature, where you can type in any part of any command from history and then -press chosen keys, such as the UP and DOWN arrows, to cycle through matches. - -[1]: http://fishshell.com -[2]: http://www.zsh.org/mla/users/2009/msg00818.html -[3]: http://sourceforge.net/projects/fizsh/ -[4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 -[5]: https://github.com/zsh-users/zsh-history-substring-search -[6]: https://github.com/zsh-users/zsh-syntax-highlighting - - -Requirements ------------------------------------------------------------------------------- - -* [ZSH](http://zsh.sourceforge.net) 4.3 or newer - -Install ------------------------------------------------------------------------------- - -Using the [Homebrew]( https://brew.sh ) package manager: - - brew install zsh-history-substring-search - echo 'source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc - -Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): - -1. Clone this repository in oh-my-zsh's plugins directory: - - git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search - -2. Activate the plugin in `~/.zshrc`: - - plugins=( [plugins...] history-substring-search) - -3. Source `~/.zshrc` to take changes into account: - - source ~/.zshrc - -Usage ------------------------------------------------------------------------------- - -1. Load this script into your interactive ZSH session: - - % source zsh-history-substring-search.zsh - - If you want to use [zsh-syntax-highlighting][6] along with this script, - then make sure that you load it *before* you load this script: - - % source zsh-syntax-highlighting.zsh - % source zsh-history-substring-search.zsh - -2. Bind keyboard shortcuts to this script's functions. - - Users typically bind their UP and DOWN arrow keys to this script, thus: - * Run `cat -v` in your favorite terminal emulator to observe key codes. -      (**NOTE:** In some cases, `cat -v` shows the wrong key codes. If the - key codes shown by `cat -v` don't work for you, press `` and - `` at your ZSH command line prompt for correct key codes.) - * Press the UP arrow key and observe what is printed in your terminal. - * Press the DOWN arrow key and observe what is printed in your terminal. - * Press the Control and C keys simultaneously to terminate the `cat -v`. - * Use your observations from the previous steps to create key bindings. - For example, if you observed `^[[A` for UP and `^[[B` for DOWN, then: - - bindkey '^[[A' history-substring-search-up - bindkey '^[[B' history-substring-search-down - - You might also want to bind the Control-P/N keys for use in EMACS mode: - - bindkey -M emacs '^P' history-substring-search-up - bindkey -M emacs '^N' history-substring-search-down - - You might also want to bind the `k` and `j` keys for use in VI mode: - - bindkey -M vicmd 'k' history-substring-search-up - bindkey -M vicmd 'j' history-substring-search-down - -3. Type any part of any previous command and then: - - * Press the `history-substring-search-up` key, which was configured in - step 2 above, to select the nearest command that (1) contains your query - and (2) is also older than the current command in your command history. - - * Press the `history-substring-search-down` key, which was configured in - step 2 above, to select the nearest command that (1) contains your query - and (2) is also newer than the current command in your command history. - - * Press `^U` the Control and U keys simultaneously to abort the search. - -4. If a matching command spans more than one line of text, press the LEFT - arrow key to move the cursor away from the end of the command, and then: - - * Press the `history-substring-search-up` key, which was configured in - step 2 above, to move the cursor to the line above the cursored line. - When the cursor reaches the first line of the command, pressing the - `history-substring-search-up` key again will cause this script to - perform another search. - - * Press the `history-substring-search-down` key, which was configured in - step 2 above, to move the cursor to the line below the cursored line. - When the cursor reaches the last line of the command, pressing the - `history-substring-search-down` key, which was configured in step 2 - above, again will cause this script to perform another search. - - -Configuration ------------------------------------------------------------------------------- - -This script defines the following global variables. You may override their -default values only after having loaded this script into your ZSH session. - -* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND` is a global variable that defines - how the query should be highlighted inside a matching command. Its default - value causes this script to highlight using bold, white text on a magenta - background. See the "Character Highlighting" section in the zshzle(1) man - page to learn about the kinds of values you may assign to this variable. - -* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND` is a global variable that - defines how the query should be highlighted when no commands in the - history match it. Its default value causes this script to highlight using - bold, white text on a red background. See the "Character Highlighting" - section in the zshzle(1) man page to learn about the kinds of values you - may assign to this variable. - -* `HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS` is a global variable that defines - how the command history will be searched for your query. Its default value - causes this script to perform a case-insensitive search. See the "Globbing - Flags" section in the zshexpn(1) man page to learn about the kinds of - values you may assign to this variable. - -* `HISTORY_SUBSTRING_SEARCH_FUZZY` is a global variable that defines - how the command history will be searched for your query. If set to a non-empty - value, causes this script to perform a fuzzy search by words, matching in - given order e.g. `ab c` will match `*ab*c*` - -* `HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE` is a global variable that defines - whether all search results returned are _unique_. If set to a non-empty - value, then only unique search results are presented. This behaviour is off - by default. An alternative way to ensure that search results are unique is - to use `setopt HIST_IGNORE_ALL_DUPS`. If this configuration variable is off - and `setopt HIST_IGNORE_ALL_DUPS` is unset, then `setopt HIST_FIND_NO_DUPS` - is still respected and it makes this script skip duplicate _adjacent_ search - results as you cycle through them, but this does not guarantee that search - results are unique: if your search results were "Dog", "Dog", "HotDog", - "Dog", then cycling them gives "Dog", "HotDog", "Dog". Notice that the "Dog" - search result appeared twice as you cycled through them. If you wish to - receive globally unique search results only once, then use this - configuration variable, or use `setopt HIST_IGNORE_ALL_DUPS`. - - -History ------------------------------------------------------------------------------- - -* September 2009: [Peter Stephenson][2] originally wrote this script and it - published to the zsh-users mailing list. - -* January 2011: Guido van Steen (@guidovansteen) revised this script and - released it under the 3-clause BSD license as part of [fizsh][3], the - Friendly Interactive ZSHell. - -* January 2011: Suraj N. Kurapati (@sunaku) extracted this script from - [fizsh][3] 1.0.1, refactored it heavily, and finally repackaged it as an - [oh-my-zsh plugin][4] and as an independently loadable [ZSH script][5]. - -* July 2011: Guido van Steen, Suraj N. Kurapati, and Sorin Ionescu - (@sorin-ionescu) [further developed it][4] with Vincent Guerci (@vguerci). - -* March 2016: Geza Lore (@gezalore) greatly refactored it in pull request #55. diff --git a/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.plugin.zsh b/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.plugin.zsh deleted file mode 100644 index 93f894d..0000000 --- a/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -0=${(%):-%N} -source ${0:A:h}/zsh-history-substring-search.zsh diff --git a/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.zsh b/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.zsh deleted file mode 100644 index 0edf85e..0000000 --- a/.zprezto/modules/history-substring-search/external/zsh-history-substring-search.zsh +++ /dev/null @@ -1,758 +0,0 @@ -#!/usr/bin/env zsh -############################################################################## -# -# Copyright (c) 2009 Peter Stephenson -# Copyright (c) 2011 Guido van Steen -# Copyright (c) 2011 Suraj N. Kurapati -# Copyright (c) 2011 Sorin Ionescu -# Copyright (c) 2011 Vincent Guerci -# Copyright (c) 2016 Geza Lore -# Copyright (c) 2017 Bengt Brodersen -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# * Neither the name of the FIZSH 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. -# -############################################################################## - -#----------------------------------------------------------------------------- -# declare global configuration variables -#----------------------------------------------------------------------------- - -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' -typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE='' -typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY='' - -#----------------------------------------------------------------------------- -# declare internal global variables -#----------------------------------------------------------------------------- - -typeset -g BUFFER MATCH MBEGIN MEND CURSOR -typeset -g _history_substring_search_refresh_display -typeset -g _history_substring_search_query_highlight -typeset -g _history_substring_search_result -typeset -g _history_substring_search_query -typeset -g -a _history_substring_search_query_parts -typeset -g -a _history_substring_search_raw_matches -typeset -g -i _history_substring_search_raw_match_index -typeset -g -a _history_substring_search_matches -typeset -g -i _history_substring_search_match_index -typeset -g -A _history_substring_search_unique_filter - -#----------------------------------------------------------------------------- -# the main ZLE widgets -#----------------------------------------------------------------------------- - -history-substring-search-up() { - _history-substring-search-begin - - _history-substring-search-up-history || - _history-substring-search-up-buffer || - _history-substring-search-up-search - - _history-substring-search-end -} - -history-substring-search-down() { - _history-substring-search-begin - - _history-substring-search-down-history || - _history-substring-search-down-buffer || - _history-substring-search-down-search - - _history-substring-search-end -} - -zle -N history-substring-search-up -zle -N history-substring-search-down - -#----------------------------------------------------------------------------- -# implementation details -#----------------------------------------------------------------------------- - -zmodload -F zsh/parameter - -# -# We have to "override" some keys and widgets if the -# zsh-syntax-highlighting plugin has not been loaded: -# -# https://github.com/nicoulaj/zsh-syntax-highlighting -# -if [[ $+functions[_zsh_highlight] -eq 0 ]]; then - # - # Dummy implementation of _zsh_highlight() that - # simply removes any existing highlights when the - # user inserts printable characters into $BUFFER. - # - _zsh_highlight() { - if [[ $KEYS == [[:print:]] ]]; then - region_highlight=() - fi - } - - # - # The following snippet was taken from the zsh-syntax-highlighting project: - # - # https://github.com/zsh-users/zsh-syntax-highlighting/blob/56b134f5d62ae3d4e66c7f52bd0cc2595f9b305b/zsh-syntax-highlighting.zsh#L126-161 - # - # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are - # met: - # - # * Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # - # * Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # - # * Neither the name of the zsh-syntax-highlighting contributors nor the - # names of its contributors may be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - #--------------8<-------------------8<-------------------8<----------------- - # Rebind all ZLE widgets to make them invoke _zsh_highlights. - _zsh_highlight_bind_widgets() - { - # Load ZSH module zsh/zleparameter, needed to override user defined widgets. - zmodload zsh/zleparameter 2>/dev/null || { - echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter.' >&2 - return 1 - } - - # Override ZLE widgets to make them invoke _zsh_highlight. - local cur_widget - for cur_widget in ${${(f)"$(builtin zle -la)"}:#(.*|_*|orig-*|run-help|which-command|beep|yank*)}; do - case $widgets[$cur_widget] in - - # Already rebound event: do nothing. - user:$cur_widget|user:_zsh_highlight_widget_*);; - - # User defined widget: override and rebind old one with prefix "orig-". - user:*) eval "zle -N orig-$cur_widget ${widgets[$cur_widget]#*:}; \ - _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; - - # Completion widget: override and rebind old one with prefix "orig-". - completion:*) eval "zle -C orig-$cur_widget ${${widgets[$cur_widget]#*:}/:/ }; \ - _zsh_highlight_widget_$cur_widget() { builtin zle orig-$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; - - # Builtin widget: override and make it call the builtin ".widget". - builtin) eval "_zsh_highlight_widget_$cur_widget() { builtin zle .$cur_widget -- \"\$@\" && _zsh_highlight }; \ - zle -N $cur_widget _zsh_highlight_widget_$cur_widget";; - - # Default: unhandled case. - *) echo "zsh-syntax-highlighting: unhandled ZLE widget '$cur_widget'" >&2 ;; - esac - done - } - #-------------->8------------------->8------------------->8----------------- - - _zsh_highlight_bind_widgets -fi - -_history-substring-search-begin() { - setopt localoptions extendedglob - - _history_substring_search_refresh_display= - _history_substring_search_query_highlight= - - # - # If the buffer is the same as the previously displayed history substring - # search result, then just keep stepping through the match list. Otherwise - # start a new search. - # - if [[ -n $BUFFER && $BUFFER == ${_history_substring_search_result:-} ]]; then - return; - fi - - # - # Clear the previous result. - # - _history_substring_search_result='' - - if [[ -z $BUFFER ]]; then - # - # If the buffer is empty, we will just act like up-history/down-history - # in ZSH, so we do not need to actually search the history. This should - # speed things up a little. - # - _history_substring_search_query= - _history_substring_search_query_parts=() - _history_substring_search_raw_matches=() - - else - # - # For the purpose of highlighting we keep a copy of the original - # query string. - # - _history_substring_search_query=$BUFFER - - # - # compose search pattern - # - if [[ -n $HISTORY_SUBSTRING_SEARCH_FUZZY ]]; then - # - # `=` split string in arguments - # - _history_substring_search_query_parts=(${=_history_substring_search_query}) - else - _history_substring_search_query_parts=(${_history_substring_search_query}) - fi - - # - # Escape and join query parts with wildcard character '*' as seperator - # `(j:CHAR:)` join array to string with CHAR as seperator - # - local search_pattern="*${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*" - - # - # Find all occurrences of the search pattern in the history file. - # - # (k) returns the "keys" (history index numbers) instead of the values - # (R) returns values in reverse older, so the index of the youngest - # matching history entry is at the head of the list. - # - _history_substring_search_raw_matches=(${(k)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${search_pattern}]}) - fi - - # - # In order to stay as responsive as possible, we will process the raw - # matches lazily (when the user requests the next match) to choose items - # that need to be displayed to the user. - # _history_substring_search_raw_match_index holds the index of the last - # unprocessed entry in _history_substring_search_raw_matches. Any items - # that need to be displayed will be added to - # _history_substring_search_matches. - # - # We use an associative array (_history_substring_search_unique_filter) as - # a 'set' data structure to ensure uniqueness of the results if desired. - # If an entry (key) is in the set (non-empty value), then we have already - # added that entry to _history_substring_search_matches. - # - _history_substring_search_raw_match_index=0 - _history_substring_search_matches=() - _history_substring_search_unique_filter=() - - # - # If $_history_substring_search_match_index is equal to - # $#_history_substring_search_matches + 1, this indicates that we - # are beyond the end of $_history_substring_search_matches and that we - # have also processed all entries in - # _history_substring_search_raw_matches. - # - # If $#_history_substring_search_match_index is equal to 0, this indicates - # that we are beyond the beginning of $_history_substring_search_matches. - # - # If we have initially pressed "up" we have to initialize - # $_history_substring_search_match_index to 0 so that it will be - # incremented to 1. - # - # If we have initially pressed "down" we have to initialize - # $_history_substring_search_match_index to 1 so that it will be - # decremented to 0. - # - if [[ $WIDGET == history-substring-search-down ]]; then - _history_substring_search_match_index=1 - else - _history_substring_search_match_index=0 - fi -} - -_history-substring-search-end() { - setopt localoptions extendedglob - - _history_substring_search_result=$BUFFER - - # the search was successful so display the result properly by clearing away - # existing highlights and moving the cursor to the end of the result buffer - if [[ $_history_substring_search_refresh_display -eq 1 ]]; then - region_highlight=() - CURSOR=${#BUFFER} - fi - - # highlight command line using zsh-syntax-highlighting - _zsh_highlight - - # highlight the search query inside the command line - if [[ -n $_history_substring_search_query_highlight ]]; then - # highlight first matching query parts - local highlight_start_index=0 - local highlight_end_index=0 - for query_part in $_history_substring_search_query_parts; do - local escaped_query_part=${query_part//(#m)[\][()|\\*?#<>~^]/\\$MATCH} - # (i) get index of pattern - local query_part_match_index=${${BUFFER:$highlight_start_index}[(i)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${escaped_query_part}]} - if [[ $query_part_match_index -le ${#BUFFER:$highlight_start_index} ]]; then - highlight_start_index=$(( $highlight_start_index + $query_part_match_index )) - highlight_end_index=$(( $highlight_start_index + ${#query_part} )) - region_highlight+=("$(($highlight_start_index - 1)) $(($highlight_end_index - 1)) $_history_substring_search_query_highlight") - fi - done - fi - - # For debugging purposes: - # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY - - # Exit successfully from the history-substring-search-* widgets. - return 0 -} - -_history-substring-search-up-buffer() { - # - # Check if the UP arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the first line of the current multi-line buffer. - # If so, pressing UP would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $LBUFFER, which makes - # sure that xlbuflines is always equal to the number of lines - # until $CURSOR (including the line with the cursor on it). - # - local buflines XLBUFFER xlbuflines - buflines=(${(f)BUFFER}) - XLBUFFER=$LBUFFER"x" - xlbuflines=(${(f)XLBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then - zle up-line-or-history - return 0 - fi - - return 1 -} - -_history-substring-search-down-buffer() { - # - # Check if the DOWN arrow was pressed to move the cursor within a multi-line - # buffer. This amounts to three tests: - # - # 1. $#buflines -gt 1. - # - # 2. $CURSOR -ne $#BUFFER. - # - # 3. Check if we are on the last line of the current multi-line buffer. - # If so, pressing DOWN would amount to leaving the multi-line buffer. - # - # We check this by adding an extra "x" to $RBUFFER, which makes - # sure that xrbuflines is always equal to the number of lines - # from $CURSOR (including the line with the cursor on it). - # - local buflines XRBUFFER xrbuflines - buflines=(${(f)BUFFER}) - XRBUFFER="x"$RBUFFER - xrbuflines=(${(f)XRBUFFER}) - - if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then - zle down-line-or-history - return 0 - fi - - return 1 -} - -_history-substring-search-up-history() { - # - # Behave like up in ZSH, except clear the $BUFFER - # when beginning of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # we have reached the absolute top of history - if [[ $HISTNO -eq 1 ]]; then - BUFFER= - - # going up from somewhere below the top of history - else - zle up-line-or-history - fi - - return 0 - fi - - return 1 -} - -_history-substring-search-down-history() { - # - # Behave like down-history in ZSH, except clear the - # $BUFFER when end of history is reached like in Fish. - # - if [[ -z $_history_substring_search_query ]]; then - - # going down from the absolute top of history - if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then - BUFFER=${history[1]} - _history_substring_search_refresh_display=1 - - # going down from somewhere above the bottom of history - else - zle down-line-or-history - fi - - return 0 - fi - - return 1 -} - -_history_substring_search_process_raw_matches() { - # - # Process more outstanding raw matches and append any matches that need to - # be displayed to the user to _history_substring_search_matches. - # Return whether there were any more results appended. - # - - # - # While we have more raw matches. Process them to see if there are any more - # matches that need to be displayed to the user. - # - while [[ $_history_substring_search_raw_match_index -lt $#_history_substring_search_raw_matches ]]; do - # - # Move on to the next raw entry and get its history index. - # - _history_substring_search_raw_match_index+=1 - local index=${_history_substring_search_raw_matches[$_history_substring_search_raw_match_index]} - - # - # If HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set to a non-empty value, - # then ensure that only unique matches are presented to the user. - # When HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history, - # so in this case we do not need to do anything. - # - if [[ ! -o HIST_IGNORE_ALL_DUPS && -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - # - # Get the actual history entry at the new index, and check if we have - # already added it to _history_substring_search_matches. - # - local entry=${history[$index]} - - if [[ -z ${_history_substring_search_unique_filter[$entry]} ]]; then - # - # This is a new unique entry. Add it to the filter and append the - # index to _history_substring_search_matches. - # - _history_substring_search_unique_filter[$entry]=1 - _history_substring_search_matches+=($index) - - # - # Indicate that we did find a match. - # - return 0 - fi - - else - # - # Just append the new history index to the processed matches. - # - _history_substring_search_matches+=($index) - - # - # Indicate that we did find a match. - # - return 0 - fi - - done - - # - # We are beyond the end of the list of raw matches. Indicate that no - # more matches are available. - # - return 1 -} - -_history-substring-search-has-next() { - # - # Predicate function that returns whether any more older matches are - # available. - # - - if [[ $_history_substring_search_match_index -lt $#_history_substring_search_matches ]]; then - # - # We did not reach the end of the processed list, so we do have further - # matches. - # - return 0 - - else - # - # We are at the end of the processed list. Try to process further - # unprocessed matches. _history_substring_search_process_raw_matches - # returns whether any more matches were available, so just return - # that result. - # - _history_substring_search_process_raw_matches - return $? - fi -} - -_history-substring-search-has-prev() { - # - # Predicate function that returns whether any more younger matches are - # available. - # - - if [[ $_history_substring_search_match_index -gt 1 ]]; then - # - # We did not reach the beginning of the processed list, so we do have - # further matches. - # - return 0 - - else - # - # We are at the beginning of the processed list. We do not have any more - # matches. - # - return 1 - fi -} - -_history-substring-search-found() { - # - # A match is available. The index of the match is held in - # $_history_substring_search_match_index - # - # 1. Make $BUFFER equal to the matching history entry. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND -} - -_history-substring-search-not-found() { - # - # No more matches are available. - # - # 1. Make $BUFFER equal to $_history_substring_search_query so the user can - # revise it and search again. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. - # - BUFFER=$_history_substring_search_query - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND -} - -_history-substring-search-up-search() { - _history_substring_search_refresh_display=1 - - # - # Select history entry during history-substring-down-search: - # - # The following variables have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches that - # need to be displayed to the user. - # $_history_substring_search_match_index is the index of the current match - # that is being displayed to the user. - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $#_history_substring_search_matches + 1]. A value of 0 - # indicates that we are beyond the beginning of - # $_history_substring_search_matches. A value of - # $#_history_substring_search_matches + 1 indicates that we are beyond - # the end of $_history_substring_search_matches and that we have also - # processed all entries in _history_substring_search_raw_matches. - # - # If $_history_substring_search_match_index equals - # $#_history_substring_search_matches and - # $_history_substring_search_raw_match_index is not greater than - # $#_history_substring_search_raw_matches, then we need to further process - # $_history_substring_search_raw_matches to see if there are any more - # entries that need to be displayed to the user. - # - # In _history-substring-search-up-search() the initial value of - # $_history_substring_search_match_index is 0. This value is set in - # _history-substring-search-begin(). _history-substring-search-up-search() - # will initially increment it to 1. - # - - if [[ $_history_substring_search_match_index -gt $#_history_substring_search_matches ]]; then - # - # We are beyond the end of $_history_substring_search_matches. This - # can only happen if we have also exhausted the unprocessed matches in - # _history_substring_search_raw_matches. - # - # 1. Update display to indicate search not found. - # - _history-substring-search-not-found - return - fi - - if _history-substring-search-has-next; then - # - # We do have older matches. - # - # 1. Move index to point to the next match. - # 2. Update display to indicate search found. - # - _history_substring_search_match_index+=1 - _history-substring-search-found - - else - # - # We do not have older matches. - # - # 1. Move the index beyond the end of - # _history_substring_search_matches. - # 2. Update display to indicate search not found. - # - _history_substring_search_match_index+=1 - _history-substring-search-not-found - fi - - # - # When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from - # history should be matched, make sure the new and old results are different. - # - # However, if the HIST_IGNORE_ALL_DUPS shell option, or - # HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a - # unique history, so in this case we do not need to do anything. - # - if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - return - fi - - if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then - # - # Repeat the current search so that a different (unique) match is found. - # - _history-substring-search-up-search - fi -} - -_history-substring-search-down-search() { - _history_substring_search_refresh_display=1 - - # - # Select history entry during history-substring-down-search: - # - # The following variables have been initialized in - # _history-substring-search-up/down-search(): - # - # $_history_substring_search_matches is the current list of matches that - # need to be displayed to the user. - # $_history_substring_search_match_index is the index of the current match - # that is being displayed to the user. - # - # The range of values that $_history_substring_search_match_index can take - # is: [0, $#_history_substring_search_matches + 1]. A value of 0 - # indicates that we are beyond the beginning of - # $_history_substring_search_matches. A value of - # $#_history_substring_search_matches + 1 indicates that we are beyond - # the end of $_history_substring_search_matches and that we have also - # processed all entries in _history_substring_search_raw_matches. - # - # In _history-substring-search-down-search() the initial value of - # $_history_substring_search_match_index is 1. This value is set in - # _history-substring-search-begin(). _history-substring-search-down-search() - # will initially decrement it to 0. - # - - if [[ $_history_substring_search_match_index -lt 1 ]]; then - # - # We are beyond the beginning of $_history_substring_search_matches. - # - # 1. Update display to indicate search not found. - # - _history-substring-search-not-found - return - fi - - if _history-substring-search-has-prev; then - # - # We do have younger matches. - # - # 1. Move index to point to the previous match. - # 2. Update display to indicate search found. - # - _history_substring_search_match_index+=-1 - _history-substring-search-found - - else - # - # We do not have younger matches. - # - # 1. Move the index beyond the beginning of - # _history_substring_search_matches. - # 2. Update display to indicate search not found. - # - _history_substring_search_match_index+=-1 - _history-substring-search-not-found - fi - - # - # When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from - # history should be matched, make sure the new and old results are different. - # - # However, if the HIST_IGNORE_ALL_DUPS shell option, or - # HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a - # unique history, so in this case we do not need to do anything. - # - if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - return - fi - - if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then - # - # Repeat the current search so that a different (unique) match is found. - # - _history-substring-search-down-search - fi -} - -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et diff --git a/.zprezto/modules/history-substring-search/init.zsh b/.zprezto/modules/history-substring-search/init.zsh deleted file mode 100644 index d3ee3a1..0000000 --- a/.zprezto/modules/history-substring-search/init.zsh +++ /dev/null @@ -1,59 +0,0 @@ -# -# Integrates history-substring-search into Prezto. -# -# Authors: -# Suraj N. Kurapati -# Sorin Ionescu -# - -# Load dependencies. -pmodload 'editor' - -# Source module files. -source "${0:h}/external/zsh-history-substring-search.zsh" || return 1 - -# -# Search -# - -zstyle -s ':prezto:module:history-substring-search:color' found \ - 'HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND' \ - || HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' - -zstyle -s ':prezto:module:history-substring-search:color' not-found \ - 'HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND' \ - || HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' - -zstyle -s ':prezto:module:history-substring-search' globbing-flags \ - 'HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS' \ - || HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' - -if zstyle -t ':prezto:module:history-substring-search' case-sensitive; then - HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS//i}" -fi - -if ! zstyle -t ':prezto:module:history-substring-search' color; then - unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND} -fi - -# -# Key Bindings -# - -if [[ -n "$key_info" ]]; then - # Emacs - bindkey -M emacs "$key_info[Control]P" history-substring-search-up - bindkey -M emacs "$key_info[Control]N" history-substring-search-down - - # Vi - bindkey -M vicmd "k" history-substring-search-up - bindkey -M vicmd "j" history-substring-search-down - - # Emacs and Vi - for keymap in 'emacs' 'viins'; do - bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up - bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down - done - - unset keymap -fi diff --git a/.zprezto/modules/history/README.md b/.zprezto/modules/history/README.md deleted file mode 100644 index d020688..0000000 --- a/.zprezto/modules/history/README.md +++ /dev/null @@ -1,43 +0,0 @@ -History -======= - -Sets [history][1] options and defines history aliases. - -Options -------- - - - `BANG_HIST` treats the **!** character specially during expansion. - - `EXTENDED_HISTORY` writes the history file in the *:start:elapsed;command* format. - - `INC_APPEND_HISTORY` writes to the history file immediately, not when the shell exits. - - `SHARE_HISTORY` shares history between all sessions. - - `HIST_EXPIRE_DUPS_FIRST` expires a duplicate event first when trimming history. - - `HIST_IGNORE_DUPS` does not record an event that was just recorded again. - - `HIST_IGNORE_ALL_DUPS` deletes an old recorded event if a new event is a duplicate. - - `HIST_FIND_NO_DUPS` does not display a previously found event. - - `HIST_IGNORE_SPACE` does not record an event starting with a space. - - `HIST_SAVE_NO_DUPS` does not write a duplicate event to the history file. - - `HIST_VERIFY` does not execute immediately upon history expansion. - - `HIST_BEEP` beeps when accessing non-existent history. - -Variables ---------- - - - `HISTFILE` stores the path to the history file. - - `HISTSIZE` stores the maximum number of events to save in the internal history. - - `SAVEHIST` stores the maximum number of events to save in the history file. - -Aliases -------- - - - `history-stat` lists the ten most used commands - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Robby Russell](https://github.com/robbyrussell) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://zsh.sourceforge.net/Guide/zshguide02.html#l16 -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/history/init.zsh b/.zprezto/modules/history/init.zsh deleted file mode 100644 index db357b0..0000000 --- a/.zprezto/modules/history/init.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# -# Sets history options and defines history aliases. -# -# Authors: -# Robby Russell -# Sorin Ionescu -# - -# -# Options -# - -setopt BANG_HIST # Treat the '!' character specially during expansion. -setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. -setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. -setopt SHARE_HISTORY # Share history between all sessions. -setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. -setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. -setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. -setopt HIST_FIND_NO_DUPS # Do not display a previously found event. -setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. -setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. -setopt HIST_VERIFY # Do not execute immediately upon history expansion. -setopt HIST_BEEP # Beep when accessing non-existent history. - -# -# Variables -# - -HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" # The path to the history file. -HISTSIZE=10000 # The maximum number of events to save in the internal history. -SAVEHIST=10000 # The maximum number of events to save in the history file. - -# -# Aliases -# - -# Lists the ten most used commands. -alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" diff --git a/.zprezto/modules/homebrew/README.md b/.zprezto/modules/homebrew/README.md deleted file mode 100644 index 2a37553..0000000 --- a/.zprezto/modules/homebrew/README.md +++ /dev/null @@ -1,45 +0,0 @@ -Homebrew -======== - -Defines Homebrew specific environment variables and aliases. - -Variables ---------- - -Execute the following to list the environment variables loaded in the shell: - -```sh -brew shellenv -``` - -Aliases -------- - -### Homebrew - - - `brewc` cleans outdated brews and their cached archives. - - `brewC` cleans outdated brews, including keg-only, and their cached archives. - - `brewi` installs a formula. - - `brewl` lists installed formulae. - - `brewo` lists brews which have an update available. - - `brews` searches for a formula. - - `brewu` updates and upgrades Homebrew packages and formulae. - - `brewx` uninstalls a formula. - -### Homebrew Cask - - - `cask` is aliased to `brew cask`. - - `caski` installs a cask. - - `caskl` lists installed casks. - - `casko` lists casks which have an update available. - - `caskx` uninstalls a cask. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Griffin Yourick](https://github.com/tough-griff) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/homebrew/init.zsh b/.zprezto/modules/homebrew/init.zsh deleted file mode 100644 index d078b7a..0000000 --- a/.zprezto/modules/homebrew/init.zsh +++ /dev/null @@ -1,56 +0,0 @@ -# -# Defines Homebrew aliases. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if [[ "$OSTYPE" != (darwin|linux)* ]]; then - return 1 -fi - -# -# Variables -# - -# Load standard Homebrew shellenv into the shell session. -# `brew shellenv` is relatively new, guard for legacy Homebrew. -if (( $+commands[brew] )); then - eval "$(brew shellenv 2> /dev/null)" -fi - -# -# Aliases -# - -# Homebrew -alias brewc='brew cleanup' -alias brewC='brew cleanup --force' -alias brewi='brew install' -alias brewl='brew list' -alias brewo='brew outdated' -alias brews='brew search' -alias brewu='brew upgrade' -alias brewx='brew uninstall' - -# Homebrew Cask -alias cask='brew cask' -alias caskc='hb_deprecated brew cask cleanup' -alias caskC='hb_deprecated brew cask cleanup' -alias caski='brew cask install' -alias caskl='brew cask list' -alias casko='brew cask outdated' -alias casks='hb_deprecated brew cask search' -alias caskx='brew cask uninstall' - -function hb_deprecated { - local cmd="${argv[3]}" - local cmd_args=( ${(@)argv:4} ) - - printf "'brew cask %s' has been deprecated, " "${cmd}" - printf "using 'brew %s' instead\n" "${cmd}" - - cmd_args=( ${(@)argv:4} ) - command brew "${cmd}" ${(@)cmd_args} -} diff --git a/.zprezto/modules/macports/README.md b/.zprezto/modules/macports/README.md deleted file mode 100644 index 70e4b8b..0000000 --- a/.zprezto/modules/macports/README.md +++ /dev/null @@ -1,25 +0,0 @@ -MacPorts -======== - -Defines MacPorts aliases and adds MacPorts directories to path variables. - -Aliases -------- - - - `portc` cleans the files used to build ports. - - `porti` installs a port. - - `ports` searches for a port. - - `portu` upgrades a port. - - `portU` upgrades MacPorts, the ports collection, and outdated ports. - - `portx` uninstalls a port. - - `portX` uninstalls inactive ports. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Matt Cable](https://github.com/curiousstranger) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/macports/init.zsh b/.zprezto/modules/macports/init.zsh deleted file mode 100644 index d55744a..0000000 --- a/.zprezto/modules/macports/init.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# -# Defines MacPorts aliases and adds MacPorts directories to path variables. -# -# Authors: -# Matt Cable -# Sorin Ionescu -# - -# Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then - return 1 -fi - -# -# Paths -# - -# Set the list of directories that Zsh searches for programs. -path=( - /opt/local/{bin,sbin} - $path -) - -# -# Aliases -# - -alias portc='sudo port clean --all installed' -alias porti='sudo port install' -alias ports='port search' -alias portU='sudo port selfupdate && sudo port upgrade outdated' -alias portu='sudo port upgrade' -alias portX='sudo port -u uninstall' -alias portx='sudo port uninstall' diff --git a/.zprezto/modules/node/README.md b/.zprezto/modules/node/README.md deleted file mode 100644 index 951f2a7..0000000 --- a/.zprezto/modules/node/README.md +++ /dev/null @@ -1,56 +0,0 @@ -Node.js -======= - -Provides utility functions for [Node.js][1], loads the Node Version Manager, and -enables [npm][2] completion. - -nvm ---- - -[nvm][5] allows for managing multiple, isolated Node.js installations in the -home directory. - -nodenv ------- - -[nodenv][6] does one thing well. nodenv is concerned solely with switching -Node versions. It's simple and predictable, Just Works, and is rock solid in -production. nodenv is forked from the popular [rbenv][7]. - -Functions ---------- - - - `node-doc` opens the Node.js online [API documentation][3] in the default - browser. - - `node-info` exposes information about the Node.js environment via the - `$node_info` associative array. - -Theming -------- - -To display the version number of the current Node.js version, define the -following style inside the `prompt_name_setup` function. - -```sh -# %v - Node.js version. -zstyle ':prezto:module:node:info:version' format 'version:%v' -``` - -Then add `$node_info[version]` to either `$PROMPT` or `$RPROMPT` and call -`node-info` in `prompt_name_preexec` hook function. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][4].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Zeh Rizzatti](https://github.com/zehrizzatti) - -[1]: http://nodejs.org -[2]: http://npmjs.org -[3]: http://nodejs.org/api -[4]: https://github.com/sorin-ionescu/prezto/issues -[5]: https://github.com/creationix/nvm -[6]: https://github.com/nodenv/nodenv -[7]: https://github.com/sstephenson/rbenv diff --git a/.zprezto/modules/node/functions/node-doc b/.zprezto/modules/node/functions/node-doc deleted file mode 100644 index b1a048b..0000000 --- a/.zprezto/modules/node/functions/node-doc +++ /dev/null @@ -1,18 +0,0 @@ -# -# Opens the Node.js online API documentation in the default browser. -# -# Authors: -# Sorin Ionescu -# - -# function node-doc { - -if [[ -z "$BROWSER" ]]; then - print "$0: no web browser defined" >&2 - return 1 -fi - -# TODO: Make the sections easier to use. -"$BROWSER" "http://nodejs.org/docs/$(node --version | sed 's/-.*//')/api/all.html#${1}" - -# } diff --git a/.zprezto/modules/node/functions/node-info b/.zprezto/modules/node/functions/node-info deleted file mode 100644 index 9feca3e..0000000 --- a/.zprezto/modules/node/functions/node-info +++ /dev/null @@ -1,32 +0,0 @@ -# -# Exposes information about the Node.js environment via the $node_info -# associative array. -# -# Authors: -# Zeh Rizzatti -# - -# function node-info { - -local version -local version_format -local version_formatted - -unset node_info -typeset -gA node_info - -if (( $+functions[nvm_version] )); then - version="${$(nvm_version)#v}" -elif (( $+commands[nodenv] )); then - version="${${$(nodenv version)#v}[(w)0]}" -elif (( $+commands[node] )) ; then - version="${$(node -v)#v}" -fi - -if [[ "$version" != (none|) ]]; then - zstyle -s ':prezto:module:node:info:version' format 'version_format' - zformat -f version_formatted "$version_format" "v:$version" - node_info[version]="$version_formatted" -fi - -# } diff --git a/.zprezto/modules/node/init.zsh b/.zprezto/modules/node/init.zsh deleted file mode 100644 index 0a516f0..0000000 --- a/.zprezto/modules/node/init.zsh +++ /dev/null @@ -1,45 +0,0 @@ -# -# Loads the Node Version Manager and enables npm completion. -# -# Authors: -# Sorin Ionescu -# Zeh Rizzatti -# - -# Load manually installed NVM into the shell session. -if [[ -s "$HOME/.nvm/nvm.sh" ]]; then - source "$HOME/.nvm/nvm.sh" - -# Load package manager installed NVM into the shell session. -elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2> /dev/null)" ]]; then - source "$(brew --prefix nvm)/nvm.sh" - -# Load manually installed nodenv into the shell session. -elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then - path=("$HOME/.nodenv/bin" $path) - eval "$(nodenv init - --no-rehash zsh)" - -# Load package manager installed nodenv into the shell session. -elif (( $+commands[nodenv] )); then - eval "$(nodenv init - --no-rehash zsh)" - -# Return if requirements are not found. -elif (( ! $+commands[node] )); then - return 1 -fi - -# Load NPM completion. -if (( $+commands[npm] )); then - cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh" - - if [[ "$commands[npm]" -nt "$cache_file" \ - || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ! -s "$cache_file" ]]; then - # npm is slow; cache its output. - npm completion >! "$cache_file" 2> /dev/null - fi - - source "$cache_file" - - unset cache_file -fi diff --git a/.zprezto/modules/ocaml/README.md b/.zprezto/modules/ocaml/README.md deleted file mode 100644 index e170158..0000000 --- a/.zprezto/modules/ocaml/README.md +++ /dev/null @@ -1,27 +0,0 @@ -OCaml -===== - -Initializes [OCaml][1] package management. - -OPAM ----- - -[OPAM][2] is a package manager for OCaml. - -This module enables local package installation with OPAM by extending the -relevant path and OCaml variables. - -### Usage - -Install packages to your local package directory with `opam install`. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sebastian Wiesner](https://github.com/lunaryorn) - -[1]: http://ocaml.org/ -[2]: http://opam.ocamlpro.com/ -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/ocaml/init.zsh b/.zprezto/modules/ocaml/init.zsh deleted file mode 100644 index b09c7eb..0000000 --- a/.zprezto/modules/ocaml/init.zsh +++ /dev/null @@ -1,14 +0,0 @@ -# -# Initializes OCaml package management. -# -# Authors: -# Sebastian Wiesner -# - -# Return if requirements are not found. -if [[ ! -f "$HOME/.opam/opam-init/init.zsh" ]]; then - return 1 -fi - -# Initialize OPAM. -source "$HOME/.opam/opam-init/init.zsh" diff --git a/.zprezto/modules/osx/README.md b/.zprezto/modules/osx/README.md deleted file mode 100644 index 1f93a2c..0000000 --- a/.zprezto/modules/osx/README.md +++ /dev/null @@ -1,50 +0,0 @@ -OSX -=== - -Defines [macOS][1] aliases and functions. - -Settings --------- - -### Dash Keyword - -To change the keyword used by `mand` to open man pages in [_Dash.app_][2] from -its default value of 'manpages', add the following line in *zpreztorc* and -replace the **keyword** with the one configured in [_Dash.app_][2]. - -```sh -zstyle ':prezto:module:osx:man' dash-keyword 'keyword' -``` - -Aliases -------- - - - `cdf` changes the current working director to the current _Finder_ - directory. - - `pushdf` pushes the current working directory onto the directory queue and - changes the current working director to the current _Finder_ directory. - -Functions ---------- - - - `mand` opens _man_ pages in [_Dash.app_][2]. - - `manp` opens _man_ pages in _Preview.app_. - - `pfd` prints the current _Finder_ directory. - - `pfs` prints the current _Finder_ selection. - - `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]). - - `ql` previews files in Quick Look. - - `osx-rm-dir-metadata` deletes .DS\_Store, \_\_MACOSX cruft. - - `osx-ls-download-history` displays the macOS download history. - - `osx-rm-download-history` deletes the macOS download history. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][4].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.apple.com/macosx/ -[2]: http://kapeli.com/dash -[3]: http://www.iterm2.com/ -[4]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/osx/functions/_mand_manp b/.zprezto/modules/osx/functions/_mand_manp deleted file mode 100644 index 8ea1e56..0000000 --- a/.zprezto/modules/osx/functions/_mand_manp +++ /dev/null @@ -1,11 +0,0 @@ -#compdef mand manp -#autoload - -# -# Completes mand and manp. -# -# Authors: -# Sorin Ionescu -# - -_man diff --git a/.zprezto/modules/osx/functions/mand b/.zprezto/modules/osx/functions/mand deleted file mode 100644 index 2902c76..0000000 --- a/.zprezto/modules/osx/functions/mand +++ /dev/null @@ -1,23 +0,0 @@ -# -# Opens man pages in Dash.app. -# -# Authors: -# Sorin Ionescu -# - -function mand { - if (( $# > 0 )); then - zstyle -s ':prezto:module:osx:man' dash-keyword 'dashkw' || dashkw='manpages' - open "dash://$dashkw:$1" 2> /dev/null - if (( $? != 0 )); then - print "$0: Dash is not installed" >&2 - break - fi - else - print 'What manual page do you want?' >&2 - fi - - unset dashkw -} - -mand "$@" diff --git a/.zprezto/modules/osx/functions/manp b/.zprezto/modules/osx/functions/manp deleted file mode 100644 index fcb2a02..0000000 --- a/.zprezto/modules/osx/functions/manp +++ /dev/null @@ -1,19 +0,0 @@ -# -# Opens man pages in Preview.app. -# -# Authors: -# Sorin Ionescu -# - -function manp { - local page - if (( $# > 0 )); then - for page in "$@"; do - man -t "$page" | open -f -a Preview - done - else - print 'What manual page do you want?' >&2 - fi -} - -manp "$@" diff --git a/.zprezto/modules/osx/functions/osx-ls-download-history b/.zprezto/modules/osx/functions/osx-ls-download-history deleted file mode 100644 index 8b6eaab..0000000 --- a/.zprezto/modules/osx/functions/osx-ls-download-history +++ /dev/null @@ -1,17 +0,0 @@ -# -# Displays the macOS download history. -# -# Authors: -# Sorin Ionescu -# - -# function osx-ls-download-history { - -local db -for db in ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV*; do - if grep -q 'LSQuarantineEvent' < <(sqlite3 "$db" .tables); then - sqlite3 "$db" 'SELECT LSQuarantineDataURLString FROM LSQuarantineEvent' - fi -done - -# } diff --git a/.zprezto/modules/osx/functions/osx-rm-dir-metadata b/.zprezto/modules/osx/functions/osx-rm-dir-metadata deleted file mode 100644 index f15f4ed..0000000 --- a/.zprezto/modules/osx/functions/osx-rm-dir-metadata +++ /dev/null @@ -1,15 +0,0 @@ -# -# Deletes .DS_Store and __MACOSX directories. -# -# Authors: -# Sorin Ionescu -# - -# function osx-rm-dir-metadata { - -find "${@:-$PWD}" \( \ - -type f -name '.DS_Store' -o \ - -type d -name '__MACOSX' \ -\) -print0 | xargs -0 rm -rf - -# } diff --git a/.zprezto/modules/osx/functions/osx-rm-download-history b/.zprezto/modules/osx/functions/osx-rm-download-history deleted file mode 100644 index 068ba3d..0000000 --- a/.zprezto/modules/osx/functions/osx-rm-download-history +++ /dev/null @@ -1,17 +0,0 @@ -# -# Deletes the macOS download history. -# -# Authors: -# Sorin Ionescu -# - -# function osx-rm-download-history { - -local db -for db in ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV*; do - if grep -q 'LSQuarantineEvent' < <(sqlite3 "$db" .tables); then - sqlite3 "$db" 'DELETE FROM LSQuarantineEvent; VACUUM' - fi -done - -# } diff --git a/.zprezto/modules/osx/functions/pfd b/.zprezto/modules/osx/functions/pfd deleted file mode 100644 index 264b40b..0000000 --- a/.zprezto/modules/osx/functions/pfd +++ /dev/null @@ -1,16 +0,0 @@ -# -# Displays the current Finder.app directory. -# -# Authors: -# Sorin Ionescu -# - -# function pfd { - -osascript 2> /dev/null < -# - -# function pfs { - -osascript 2>&1 < -# - -# function ql { - -if (( $# > 0 )); then - qlmanage -p "$@" &> /dev/null -fi - -# } diff --git a/.zprezto/modules/osx/functions/tab b/.zprezto/modules/osx/functions/tab deleted file mode 100644 index c39a6a8..0000000 --- a/.zprezto/modules/osx/functions/tab +++ /dev/null @@ -1,56 +0,0 @@ -# -# Opens a new Terminal.app/iTerm.app tab in the current directory. -# -# Authors: -# Sorin Ionescu -# - -# function tab { - -local command="cd \\\"$PWD\\\"" -(( $# > 0 )) && command="${command}; $*" - -the_app=$( - osascript 2> /dev/null < /dev/null < /dev/null < /dev/null < -# - -# Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then - return 1 -fi - -# -# Aliases -# - -# Changes directory to the current Finder directory. -alias cdf='cd "$(pfd)"' - -# Pushes directory to the current Finder directory. -alias pushdf='pushd "$(pfd)"' diff --git a/.zprezto/modules/pacman/README.md b/.zprezto/modules/pacman/README.md deleted file mode 100644 index a619a74..0000000 --- a/.zprezto/modules/pacman/README.md +++ /dev/null @@ -1,69 +0,0 @@ -Pacman -====== - -Provides aliases and functions for the [Pacman][1] package manager and -frontends. - -Settings --------- - -It is possible to use a Pacman frontend with the pacman aliases provided by this -package as long as that frontend supports the same command line options (The -[AUR Helpers][2] page has a good comparison which lists if the command line -options are pacman compatible). - -Please note that installing packages with an AUR Helper is not officially -supported by Archlinux. It is currently recommended to manually build AUR -packages using the [provided instructions][3]. The [aurutils][4] project has a -set of small utilities to make this easier. - -To enable a Pacman frontend, add the following line to *zpreztorc*, substituting -`pacman_frontend` with the name of the frontent: - -```sh -zstyle ':prezto:module:pacman' frontend 'pacman_frontend' -``` - -Aliases -------- - -### Pacman - - - `pac` is short for `pacman`. - - `paci` installs packages from repositories. - - `pacI` installs packages from files. - - `pacx` removes packages and unneeded dependencies. - - `pacX` removes packages, their configuration, and unneeded dependencies. - - `pacq` displays information about a package from the repositories. - - `pacQ` displays information about a package from the local database. - - `pacs` searches for packages in the repositories. - - `pacS` searches for packages in the local database. - - `pacu` synchronizes the local package and Arch Build System (requires `abs`) - databases against the repositories. - - `pacU` synchronizes the local package database against the repositories then - upgrades outdated packages. - - `pacman-list-orphans` lists orphan packages. - - `pacman-remove-orphans` removes orphan packages. - -### Frontends - -Functions ---------- - - - `aurget` clone an aur package - - `pacman-list-explicit` lists explicitly installed pacman packages. - - `pacman-list-disowned` lists pacman disowned files. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][5].* - - - [Benjamin Boudreau](https://github.com/dreur) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.archlinux.org/pacman/ -[2]: https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table -[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages -[4]: https://github.com/AladW/aurutils -[5]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/pacman/functions/pacman-list-disowned b/.zprezto/modules/pacman/functions/pacman-list-disowned deleted file mode 100644 index 9c8f56a..0000000 --- a/.zprezto/modules/pacman/functions/pacman-list-disowned +++ /dev/null @@ -1,26 +0,0 @@ -# -# Lists Pacman disowned files. -# -# Authors: -# Benjamin Boudreau -# Sorin Ionescu -# - -# function pacman-list-disowned { - -local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$" -local db="$tmp/db" -local fs="$tmp/fs" - -mkdir "$tmp" -trap 'rm -rf "$tmp"' EXIT - -pacman --quiet --query --list | sort --unique > "$db" - -find /bin /etc /lib /sbin /usr \ - ! -name lost+found \ - \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" - -comm -23 "$fs" "$db" - -# } diff --git a/.zprezto/modules/pacman/functions/pacman-list-explicit b/.zprezto/modules/pacman/functions/pacman-list-explicit deleted file mode 100644 index 7c9b08f..0000000 --- a/.zprezto/modules/pacman/functions/pacman-list-explicit +++ /dev/null @@ -1,24 +0,0 @@ -# -# Lists explicitly installed Pacman packages. -# -# Authors: -# Benjamin Boudreau -# Sorin Ionescu -# - -# function pacman-list-explicit { - -pacman --query --explicit --info \ - | awk ' - BEGIN { - FS=":" - } - /^Name/ { - print $2 - } - /^Description/ { - print $2 - } - ' - -# } diff --git a/.zprezto/modules/pacman/init.zsh b/.zprezto/modules/pacman/init.zsh deleted file mode 100644 index 88c977f..0000000 --- a/.zprezto/modules/pacman/init.zsh +++ /dev/null @@ -1,88 +0,0 @@ -# -# Defines Pacman aliases. -# -# Authors: -# Benjamin Boudreau -# Sorin Ionescu -# -# Tips: -# https://wiki.archlinux.org/index.php/Pacman_Tips -# - -# Return if requirements are not found. -if (( ! $+commands[pacman] )); then - return 1 -fi - -# -# Frontend -# - -# Get the Pacman frontend. -zstyle -s ':prezto:module:pacman' frontend '_pacman_frontend' - -if (( $+commands[$_pacman_frontend] )); then - alias pacman="$_pacman_frontend" -else - _pacman_frontend='pacman' - _pacman_sudo='sudo ' -fi - -# -# Aliases -# - -# Pacman. -alias pac="${_pacman_frontend}" - -# Installs packages from repositories. -alias paci="${_pacman_sudo}${_pacman_frontend} --sync" - -# Installs packages from files. -alias pacI="${_pacman_sudo}${_pacman_frontend} --upgrade" - -# Removes packages and unneeded dependencies. -alias pacx="${_pacman_sudo}${_pacman_frontend} --remove" - -# Removes packages, their configuration, and unneeded dependencies. -alias pacX="${_pacman_sudo}${_pacman_frontend} --remove --nosave --recursive" - -# Displays information about a package from the repositories. -alias pacq="${_pacman_frontend} --sync --info" - -# Displays information about a package from the local database. -alias pacQ="${_pacman_frontend} --query --info" - -# Searches for packages in the repositories. -alias pacs="${_pacman_frontend} --sync --search" - -# Searches for packages in the local database. -alias pacS="${_pacman_frontend} --query --search" - -# Lists orphan packages. -alias pacman-list-orphans="${_pacman_sudo}${_pacman_frontend} --query --deps --unrequired" - -# Removes orphan packages. -alias pacman-remove-orphans="${_pacman_sudo}${_pacman_frontend} --remove --recursive \$(${_pacman_frontend} --quiet --query --deps --unrequired)" - -# Synchronizes the local package and Arch Build System databases against the -# repositories using the asp tool. -if (( $+commands[asp] )); then - alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh && sudo asp update" -else - alias pacu="${_pacman_sudo}${_pacman_frontend} --sync --refresh" -fi - -# Synchronizes the local package database against the repositories then -# upgrades outdated packages. -alias pacU="${_pacman_sudo}${_pacman_frontend} --sync --refresh --sysupgrade" - -function aurget { - local target_dir="$1" - if [[ -n "$2" ]]; then - target_dir="$2" - fi - git clone "https://aur.archlinux.org/$1" "$target_dir" -} - -unset _pacman_{frontend,sudo} diff --git a/.zprezto/modules/perl/README.md b/.zprezto/modules/perl/README.md deleted file mode 100644 index 67f2a17..0000000 --- a/.zprezto/modules/perl/README.md +++ /dev/null @@ -1,114 +0,0 @@ -Perl -==== - -Enables local [Perl][1] module installation on macOS and defines aliases. - -Local Module Installation -------------------------- - -Perl versions older than 5.14 do not support the local installation of Perl -modules natively. This module allows for local installation of Perl modules on -macOS in *~/Library/Perl/5.12* by altering the environment. - -### Usage - -For Perl versions older than 5.14, install *local::lib*. - -```console -curl -L -C - -O http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz -tar xvf local-lib-1.008004.tar.gz -cd local-lib-1.008004 -perl Makefile.PL --bootstrap=$HOME/Library/Perl/5.12 -make && make test && make install -``` - -Install *cpanminus*: - -```console -curl -L http://cpanmin.us | perl - --self-upgrade -``` - -Perlbrew --------- - -An alternative to the above is to use [Perlbrew][2], which allows for the -management of multiple, isolated Perl installations in the home directory. - -plenv ------ - -Yet another alternative is [plenv][3]. This is inspired from rbenv and enables -switching between multiple binary installations. - -The subcommands of plenv is similar with rbenv. - -Aliases -------- - -### General - - - `pl` is short for `perl`. - - `pld` looks up Perl documentation (`perldoc`). - - `ple` executes a one line program in a loop (`perl -wlne`). - -### Perlbrew - - - `plb` manages Perl environments. - - `plba` lists available Perl versions. - - `plbi` installs a Perl version. - - `plbl` lists installed Perl versions. - - `plbo` temporarily turns off Perlbrew. - - `plbO` turns off Perlbrew. - - `plbs` switches to a Perl version. - - `plbu` uninstalls a Perl version. - - `plbx` temporarily sets the Perl version to use. - -### plenv - - - `plv` manages Perl environments. - - `plvc` List all available plenv commands. - - `plvl` Set or show the local application-specific Perl version. - - `plvg` Set or show the global Perl version. - - `plvs` Set or show the shell-specific Perl version. - - `plvi` Install a Perl version using the perl-build plugin. - - `plvu` Uninstall a specific Perl version. - - `plvr` Rehash plenv shims (run this after installing executables). - - `plvv` Show the current Perl version and its origin. - - `plvV` List all Perl versions available to plenv. - - `plvw` Display the full path to an executable. - - `plvW` List all Perl versions that contain the given executable. - - `plvm` List cpan modules in current perl. - - `plvM` Migrate cpan modules from other version. - - `plvI` Install cpanm. - -Functions ---------- - - - `perl-info` exposes information about the Perl environment via the - `$perl_info` associative array. - -Theming -------- - -To display the name of the current Perl version in a prompt, define the -following style in the `prompt_name_setup` function. - -```sh -# %v - perl version. -zstyle ':prezto:module:perl:info:version' format 'version:%v' -``` - -Then add `$perl_info[version]` to `$PROMPT` or `$RPROMPT` and call -`perl-info` in the `prompt_name_precmd` hook function. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][4].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.perl.org -[2]: http://perlbrew.pl -[3]: https://github.com/tokuhirom/plenv -[4]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/perl/functions/perl-info b/.zprezto/modules/perl/functions/perl-info deleted file mode 100644 index b42e23d..0000000 --- a/.zprezto/modules/perl/functions/perl-info +++ /dev/null @@ -1,34 +0,0 @@ -# -# Exposes information about the Perl environment via the $perl_info associative -# array. -# -# Authors: -# JINNOUCHI Yasushi -# - -# function perl-info { - -local version -local version_format -local version_formatted - -# Clean up previous $perl_info. -unset perl_info -typeset -gA perl_info - -if (( $+commands[perlbrew] )); then - version="${PERLBREW_PERL##*perl-}" -elif (( $+commands[plenv] )); then - version=$(plenv version-name) -elif (( $+commands[perl] )); then - version=$(perl -e 'printf "%vd", $^V') -fi - -# Format version. -if [[ -n "$version" ]]; then - zstyle -s ':prezto:module:perl:info:version' format 'version_format' - zformat -f version_formatted "$version_format" "v:$version" - perl_info[version]="$version_formatted" -fi - -# } diff --git a/.zprezto/modules/perl/init.zsh b/.zprezto/modules/perl/init.zsh deleted file mode 100644 index b7a7947..0000000 --- a/.zprezto/modules/perl/init.zsh +++ /dev/null @@ -1,93 +0,0 @@ -# -# Enables local Perl module installation on macOS and defines aliases. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[perl] )); then - return 1 -fi - -# -# Load Perlbrew or plenv -# - -# Load Perlbrew into the shell session. -if [[ -s "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}/etc/bashrc" ]]; then - source "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}/etc/bashrc" - - # Load Perlbrew completion. - if [[ -s "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}/etc/perlbrew-completion.bash" ]]; then - source "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}/etc/perlbrew-completion.bash" - fi - -# Load manually installed plenv into the shell session. -elif [[ -s "$HOME/.plenv/bin/plenv" ]]; then - path=("$HOME/.plenv/bin" $path) - eval "$(plenv init - --no-rehash zsh)" - -# Load package manager installed plenv into the shell session. -elif (( $+commands[plenv] )); then - eval "$(plenv init - --no-rehash zsh)" -fi - -# -# Local Module Installation -# - -if [[ "$OSTYPE" == darwin* ]]; then - # Perl is slow; cache its output. - cache_file="${TMPDIR:-/tmp}/prezto-perl-cache.$UID.zsh" - perl_path="$HOME/Library/Perl/5.12" - - if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then - if [[ "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" || ! -s "$cache_file" ]]; then - perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file" - fi - - source "$cache_file" - fi - - unset cache_file perl_path -fi - -# -# Aliases -# - -# General -alias pl='perl' -alias pld='perldoc' -alias ple='perl -wlne' - -# Perlbrew -if (( $+commands[perlbrew] )); then - alias plb='perlbrew' - alias plba='perlbrew available' - alias plbi='perlbrew install' - alias plbl='perlbrew list' - alias plbo='perlbrew off' - alias plbO='perlbrew switch-off' - alias plbs='perlbrew switch' - alias plbu='perlbrew use' - alias plbx='perlbrew uninstall' - -elif (( $+commands[plenv] )); then - alias plv='plenv' - alias plvc='plenv commands' - alias plvl='plenv local' - alias plvg='plenv global' - alias plvs='plenv shell' - alias plvi='plenv install' - alias plvu='plenv uninstall' - alias plvr='plenv rehash' - alias plvv='plenv version' - alias plvV='plenv versions' - alias plvw='plenv which' - alias plvW='plenv whence' - alias plvm='plenv list-modules' - alias plvM='plenv migrate-modules' - alias plvI='plenv install-cpanm' -fi diff --git a/.zprezto/modules/prompt/README.md b/.zprezto/modules/prompt/README.md deleted file mode 100644 index 523c83e..0000000 --- a/.zprezto/modules/prompt/README.md +++ /dev/null @@ -1,156 +0,0 @@ -Prompt -====== - -Loads prompt [themes][1]. - -Settings --------- - -### Prompt Theme - -To select a prompt theme, add the following to *zpreztorc*, and replace **name** -with the name of the theme you wish to load. Setting it to **random** will load -a random theme. - -```sh -zstyle ':prezto:module:prompt' theme 'name' -``` - -### Prompt Display Length - -To change working directory prompt display length from 'short', set the -following to 'long' (without `~` expansion) or 'full' (with `~` expansion) -in *zpreztorc*. - -```sh -zstyle ':prezto:module:prompt' pwd-length 'short' -``` - -### Display Return Value - -Some prompts display the return value in the prompt. If a prompt has support, -this can be disabled with the following snippet. - -```sh -zstyle ':prezto:module:prompt' show-return-val 'no' -``` - -Theming -------- - -A prompt theme is an autoloadable function file with a special name, -`prompt_name_setup`, placed anywhere in `$fpath`, but for the purpose of this -project, themes **should** be placed in the *modules/prompt/functions* -directory. - -### Theme Functions - -There are three theme functions, a setup function, a help function, and -a preview function. The setup function **must** always be defined. The help -function and the preview functions are optional. - -#### `prompt_name_setup` - -This function is called by the `prompt` function to install the theme. This -function may define other functions as necessary to maintain the prompt, -including a function that displays help or a function used to preview it. - -**Do not call this function directly.** - -The most basic example of this function can be seen below. - -```sh -function prompt_name_setup { - PROMPT='%m%# ' - RPROMPT='' -} -``` - -#### `prompt_name_help` - -If the `prompt_name_setup` function is customizable via parameters, a help -function **should** be defined. The user will access it via `prompt -h name`. - -The most basic example of this function can be seen below. - -```sh -function prompt_name_help { - cat <] [] - -where the color is for the left-hand prompt. -EOH -} -``` - -#### `prompt_name_preview` - -If the `prompt_name_setup` function is customizable via parameters, a preview -function **should** be defined. The user will access it via `prompt -p name`. - -The most basic example of this function can be seen below. - -```sh -function prompt_name_preview { - if (( $# > 0 )); then - prompt_preview_theme theme "$@" - else - prompt_preview_theme theme red green blue - print - prompt_preview_theme theme yellow magenta black - fi -} -``` - -### Hook Functions - -There are many Zsh [hook][2] functions, but mostly the *precmd* hook will be -used. - -#### `prompt_name_precmd` - -This hook is called before the prompt is displayed and is useful for getting -information to display in a prompt. - -When calling functions to get information to display in a prompt, do not assume -that all the dependencies have been loaded. Always check for the availability of -a function before you calling it. - -**Do not register hook functions. They will be registered by the `prompt` function.** - -The most basic example of this function can be seen below. - -```sh -function prompt_name_precmd { - if (( $+functions[git-info] )); then - git-info - fi -} -``` - -Troubleshooting ---------------- - -### Fonts aren't displaying properly. - -On most systems, themes which use special characters need to have a patched font -installed and configured properly. - -Powerline provides some information on [terminal support][4] and [how to install -patched fonts][5] which should fix most font issues. - - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Prompt-Themes -[2]: http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functions -[3]: https://github.com/sorin-ionescu/prezto/issues -[4]: http://powerline.readthedocs.io/en/master/usage.html#terminal-emulator-requirements -[5]: http://powerline.readthedocs.io/en/latest/installation.html#fonts-installation diff --git a/.zprezto/modules/prompt/external/agnoster/README.md b/.zprezto/modules/prompt/external/agnoster/README.md deleted file mode 100644 index dd3cbb5..0000000 --- a/.zprezto/modules/prompt/external/agnoster/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# agnoster.zsh-theme - -A ZSH theme optimized for people who use: - -- Solarized -- Git -- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo) - -For Mac users, I highly recommend iTerm 2 + Solarized Dark - -# Compatibility - -**NOTE:** In all likelihood, you will need to install a [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts) for this theme to render correctly. - -To test if your terminal and font support it, check that all the necessary characters are supported by copying the following command to your terminal: `echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699"`. The result should look like this: - -![Character Example](https://gist.githubusercontent.com/agnoster/3712874/raw/characters.png) - -## What does it show? - -- If the previous command failed (✘) -- User @ Hostname (if user is not DEFAULT_USER, which can then be set in your profile) -- Git status - - Branch () or detached head (➦) - - Current branch / SHA1 in detached head state - - Dirty working directory (±, color change) -- Working directory -- Elevated (root) privileges (⚡) - -![Screenshot](https://gist.githubusercontent.com/agnoster/3712874/raw/screenshot.png) - -## Customize your prompt view - -By default prompt has these segments: `prompt_status`, `prompt_context`, `prompt_virtualenv`, `prompt_dir`, `prompt_git`, `prompt_end` in that particular order. - -If you want to add, change the order or remove some segments of the prompt, you can use array environment variable named `AGNOSTER_PROMPT_SEGMENTS`. - -Examples: -- Show all segments of the prompt with indices: -``` -echo "${(F)AGNOSTER_PROMPT_SEGMENTS[@]}" | cat -n -``` -- Add the new segment of the prompt to the beginning: -``` -AGNOSTER_PROMPT_SEGMENTS=("prompt_git" "${AGNOSTER_PROMPT_SEGMENTS[@]}") -``` -- Add the new segment of the prompt to the end: -``` -AGNOSTER_PROMPT_SEGMENTS+="prompt_end" -``` -- Insert the new segment of the prompt = `PROMPT_SEGMENT_NAME` on the particular position = `PROMPT_SEGMENT_POSITION`: -``` -PROMPT_SEGMENT_POSITION=5 PROMPT_SEGMENT_NAME="prompt_end";\ -AGNOSTER_PROMPT_SEGMENTS=("${AGNOSTER_PROMPT_SEGMENTS[@]:0:$PROMPT_SEGMENT_POSITION-1}" "$PROMPT_SEGMENT_NAME" "${AGNOSTER_PROMPT_SEGMENTS[@]:$PROMPT_SEGMENT_POSITION-1}");\ -unset PROMPT_SEGMENT_POSITION PROMPT_SEGMENT_NAME -``` -- Swap segments 4th and 5th: -``` -SWAP_SEGMENTS=(4 5);\ -TMP_VAR="$AGNOSTER_PROMPT_SEGMENTS[$SWAP_SEGMENTS[1]]"; AGNOSTER_PROMPT_SEGMENTS[$SWAP_SEGMENTS[1]]="$AGNOSTER_PROMPT_SEGMENTS[$SWAP_SEGMENTS[2]]"; AGNOSTER_PROMPT_SEGMENTS[$SWAP_SEGMENTS[2]]="$TMP_VAR" -unset SWAP_SEGMENTS TMP_VAR -``` -- Remove the 5th segment: -``` -AGNOSTER_PROMPT_SEGMENTS[5]= -``` - -A small demo of the dummy custom prompt segment, which has been created with help of the built-in `prompt_segment()` function from Agnoster theme: -``` -# prompt_segment() - Takes two arguments, background and foreground. -# Both can be omitted, rendering default background/foreground. - -customize_agnoster() { - prompt_segment 'red' '' ' ⚙ ⚡⚡⚡ ⚙ ' -} -``` -![Customization demo](https://github.com/apodkutin/agnoster-zsh-theme/raw/customize-prompt/agnoster_customization.gif) - -## Future Work - -I don't want to clutter it up too much, but I am toying with the idea of adding RVM (ruby version) and n (node.js version) display. - -It's currently hideously slow, especially inside a git repo. I guess it's not overly so for comparable themes, but it bugs me, and I'd love to hear ideas about how to improve the performance. - -Would be nice for the code to be a bit more sane and re-usable. Something to easily append a section with a given FG/BG, and add the correct opening and closing. - -Also the dependency on a powerline-patched font is regrettable, but there's really no way to get that effect without it. Ideally there would be a way to check for compatibility, or maybe even fall back to one of the similar unicode glyphs. diff --git a/.zprezto/modules/prompt/external/agnoster/agnoster.zsh-theme b/.zprezto/modules/prompt/external/agnoster/agnoster.zsh-theme deleted file mode 100644 index d156340..0000000 --- a/.zprezto/modules/prompt/external/agnoster/agnoster.zsh-theme +++ /dev/null @@ -1,173 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 -# -# agnoster's Theme - https://gist.github.com/3712874 -# A Powerline-inspired theme for ZSH -# -# # README -# -# In order for this theme to render correctly, you will need a -# [Powerline-patched font](https://gist.github.com/1595572). -# -# In addition, I recommend the -# [Solarized theme](https://github.com/altercation/solarized/) and, if you're -# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - -# it has significantly better color fidelity. -# -# # Goals -# -# The aim of this theme is to only show you *relevant* information. Like most -# prompts, it will only show git information when in a git working directory. -# However, it goes a step further: everything from the current user and -# hostname to whether the last call exited with an error to whether background -# jobs are running in this shell will all be displayed automatically when -# appropriate. - -### Segments of the prompt, default order declaration - -typeset -aHg AGNOSTER_PROMPT_SEGMENTS=( - prompt_status - prompt_context - prompt_virtualenv - prompt_dir - prompt_git - prompt_end -) - -### Segment drawing -# A few utility functions to make it easy and re-usable to draw segmented prompts - -CURRENT_BG='NONE' -if [[ -z "$PRIMARY_FG" ]]; then - PRIMARY_FG=black -fi - -# Characters -SEGMENT_SEPARATOR="\ue0b0" -PLUSMINUS="\u00b1" -BRANCH="\ue0a0" -DETACHED="\u27a6" -CROSS="\u2718" -LIGHTNING="\u26a1" -GEAR="\u2699" - -# Begin a segment -# Takes two arguments, background and foreground. Both can be omitted, -# rendering default background/foreground. -prompt_segment() { - local bg fg - [[ -n $1 ]] && bg="%K{$1}" || bg="%k" - [[ -n $2 ]] && fg="%F{$2}" || fg="%f" - if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then - print -n "%{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%}" - else - print -n "%{$bg%}%{$fg%}" - fi - CURRENT_BG=$1 - [[ -n $3 ]] && print -n $3 -} - -# End the prompt, closing any open segments -prompt_end() { - if [[ -n $CURRENT_BG ]]; then - print -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR" - else - print -n "%{%k%}" - fi - print -n "%{%f%}" - CURRENT_BG='' -} - -### Prompt components -# Each component will draw itself, and hide itself if no information needs to be shown - -# Context: user@hostname (who am I and where am I) -prompt_context() { - local user=`whoami` - - if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then - prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m " - fi -} - -# Git: branch/detached head, dirty status -prompt_git() { - local color ref - is_dirty() { - test -n "$(git status --porcelain --ignore-submodules)" - } - ref="$vcs_info_msg_0_" - if [[ -n "$ref" ]]; then - if is_dirty; then - color=yellow - ref="${ref} $PLUSMINUS" - else - color=green - ref="${ref} " - fi - if [[ "${ref/.../}" == "$ref" ]]; then - ref="$BRANCH $ref" - else - ref="$DETACHED ${ref/.../}" - fi - prompt_segment $color $PRIMARY_FG - print -n " $ref" - fi -} - -# Dir: current working directory -prompt_dir() { - prompt_segment blue $PRIMARY_FG ' %~ ' -} - -# Status: -# - was there an error -# - am I root -# - are there background jobs? -prompt_status() { - local symbols - symbols=() - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$CROSS" - [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}$LIGHTNING" - [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$GEAR" - - [[ -n "$symbols" ]] && prompt_segment $PRIMARY_FG default " $symbols " -} - -# Display current virtual environment -prompt_virtualenv() { - if [[ -n $VIRTUAL_ENV ]]; then - color=cyan - prompt_segment $color $PRIMARY_FG - print -Pn " $(basename $VIRTUAL_ENV) " - fi -} - -## Main prompt -prompt_agnoster_main() { - RETVAL=$? - CURRENT_BG='NONE' - for prompt_segment in "${AGNOSTER_PROMPT_SEGMENTS[@]}"; do - [[ -n $prompt_segment ]] && $prompt_segment - done -} - -prompt_agnoster_precmd() { - vcs_info - PROMPT='%{%f%b%k%}$(prompt_agnoster_main) ' -} - -prompt_agnoster_setup() { - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - prompt_opts=(cr subst percent) - - add-zsh-hook precmd prompt_agnoster_precmd - - zstyle ':vcs_info:*' enable git - zstyle ':vcs_info:*' check-for-changes false - zstyle ':vcs_info:git*' formats '%b' - zstyle ':vcs_info:git*' actionformats '%b (%a)' -} - -prompt_agnoster_setup "$@" diff --git a/.zprezto/modules/prompt/external/agnoster/agnoster_customization.gif b/.zprezto/modules/prompt/external/agnoster/agnoster_customization.gif deleted file mode 100644 index 2e472d3..0000000 Binary files a/.zprezto/modules/prompt/external/agnoster/agnoster_customization.gif and /dev/null differ diff --git a/.zprezto/modules/prompt/external/agnoster/characters.png b/.zprezto/modules/prompt/external/agnoster/characters.png deleted file mode 100644 index 22bb0cb..0000000 Binary files a/.zprezto/modules/prompt/external/agnoster/characters.png and /dev/null differ diff --git a/.zprezto/modules/prompt/external/agnoster/screenshot.png b/.zprezto/modules/prompt/external/agnoster/screenshot.png deleted file mode 100644 index 5d28e2d..0000000 Binary files a/.zprezto/modules/prompt/external/agnoster/screenshot.png and /dev/null differ diff --git a/.zprezto/modules/prompt/external/async/LICENSE b/.zprezto/modules/prompt/external/async/LICENSE deleted file mode 100644 index e63b31d..0000000 --- a/.zprezto/modules/prompt/external/async/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Fredriksson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/.zprezto/modules/prompt/external/async/README.md b/.zprezto/modules/prompt/external/async/README.md deleted file mode 100644 index 1541368..0000000 --- a/.zprezto/modules/prompt/external/async/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# zsh-async - -``` -Because your terminal should be able to perform tasks asynchronously without external tools! -``` - -## Intro (TL;DR) - -With `zsh-async` you can run multiple asynchronous jobs, enforce unique jobs (multiple instances of the same job will not run), flush all currently running jobs and create multiple workers (each with their own jobs). For each worker you can register a callback-function through which you will be notified about the job results (job name, return code, output and execution time). - -## Overview - -`zsh-async` is a small library for running asynchronous tasks in zsh without requiring any external tools. It utilizes `zsh/zpty` to launch a pseudo-terminal in which all commands get executed without blocking any other processes. Checking for completed tasks can be done manually, by polling, or better yet, automatically whenever a process has finished executing by notifying through a `SIGWINCH` kill-signal. - -This library bridges the gap between spawning child processes and disowning them. Child processes launched by normal means clutter the terminal with output about their state, and disowned processes become separate entities, no longer under control of the parent. Now you can have both! - -## Usage - -The async worker is a separate environment (think web worker). You send it a job (command + parameters) to execute and it returns the result of that execution through a callback function. If you find that you need to stop/start a worker to update global state (variables) you should consider refactoring so that state is passed during the `async_job` call (e.g. `async_job my_worker my_function $state1 $state2`). - -### Installation - -#### Manual - -You can either source the `async.zsh` script directly or insert under your `$fpath` as async and autoload it through `autoload -Uz async && async`. - -#### Integration - -##### zplug - -``` -zplug "mafredri/zsh-async", from:"github", use:"async.zsh" -``` - -### Functions - -The `zsh-async` library has a bunch of functions that need to be used to perform async actions: - -#### `async_init` - -Initializes the async library (not required if using async from `$fpath` with autoload.) - -#### `async_start_worker [-u] [-n] [-p ]` - -Start a new async worker with optional parameters, a worker can be told to only run unique tasks and to notify a process when tasks are complete. - -* `-u` unique. Only unique job names can run, e.g. the command `git status` will have `git` as the unique job name identifier - -* `-n` notify through `SIGWINCH` signal. Needs to be caught with a `trap '' WINCH` in the process defined by `-p` - - **NOTE:** When `zsh-async` is used in an interactive shell with ZLE enabled this option is not needed. Signaling through `SIGWINCH` has been replaced by a ZLE watcher that is triggered on output from the `zpty` instance (still requires a callback function through `async_register_callback` though). Technically zsh versions prior to `5.2` do not return the file descriptor for zpty instances, however, `zsh-async` attempts to deduce it anyway. - -* `-p` pid to notify (defaults to current pid) - -#### `async_stop_worker []` - -Simply stops a worker and all active jobs will be terminated immediately. - -#### `async_job []` - -Start a new asynchronous job on specified worker, assumes the worker is running. - -#### `async_worker_eval []` - -Evaluate a command (like async_job) inside the async worker, then worker environment can be manipulated. For example, issuing a cd command will change the PWD of the worker which will then be inherited by all future async jobs. - -Output will be returned via callback, job name will be [async/eval]. - -#### `async_process_results ` - -Get results from finished jobs and pass it to the to callback function. This is the only way to reliably return the job name, return code, output and execution time and with minimal effort. - -If the async process buffer becomes corrupt, the callback will be invoked with the first argument being `[async]` (job name), non-zero return code and fifth argument describing the error (stderr). - -The `callback_function` is called with the following parameters: - -* `$1` job name, e.g. the function passed to async_job -* `$2` return code - * Returns `-1` if return code is missing, this should never happen, if it does, you have likely run into a bug. Please open a new [issue](https://github.com/mafredri/zsh-async/issues/new) with a detailed description of what you were doing. -* `$3` resulting (stdout) output from job execution -* `$4` execution time, floating point e.g. 0.0076138973 seconds -* `$5` resulting (stderr) error output from job execution -* `$6` has next result in buffer (0 = buffer empty, 1 = yes) - * This means another async job has completed and is pending in the buffer, it's very likely that your callback function will be called a second time (or more) in this execution. It's generally a good idea to e.g. delay prompt updates (`zle reset-prompt`) until the buffer is empty to prevent strange states in ZLE. - -#### `async_register_callback ` - -Register a callback for completed jobs. As soon as a job is finished, `async_process_results` will be called with the specified callback function. This requires that a worker is initialized with the -n (notify) option. - -#### `async_unregister_callback ` - -Unregister the callback for a specific worker. - -#### `async_flush_jobs ` - -Flush all current jobs running on a worker. This will terminate any and all running processes under the worker by sending a `SIGTERM` to the entire process group, use with caution. - -## Example code - -```zsh -#!/usr/bin/env zsh -source ./async.zsh -async_init - -# Initialize a new worker (with notify option) -async_start_worker my_worker -n - -# Create a callback function to process results -COMPLETED=0 -completed_callback() { - COMPLETED=$(( COMPLETED + 1 )) - print $@ -} - -# Register callback function for the workers completed jobs -async_register_callback my_worker completed_callback - -# Give the worker some tasks to perform -async_job my_worker print hello -async_job my_worker sleep 0.3 - -# Wait for the two tasks to be completed -while (( COMPLETED < 2 )); do - print "Waiting..." - sleep 0.1 -done - -print "Completed $COMPLETED tasks!" - -# Output: -# Waiting... -# print 0 hello 0.001583099365234375 -# Waiting... -# Waiting... -# sleep 0 0.30631208419799805 -# Completed 2 tasks! -``` - -## Testing - -Tests are located in `*_test.zsh` and can be run by executing the test runner: `./test.zsh`. - -Example: - -```console -$ ./test.zsh -ok ./async_test.zsh 2.334s -``` - -The test suite can also run specific tasks that match a pattern, for example: - -```console -$ ./test.zsh -v -run zle -=== RUN test_zle_watcher ---- PASS: test_zle_watcher (0.07s) -PASS -ok ./async_test.zsh 0.070s -``` - -## Limitations - -* A NULL-character (`$'\0'`) is used by `async_job` to signify the end of the command, it is recommended not to pass them as arguments, although they should work when passing multiple arguments to `async_job` (because of quoting). -* Tell me? :) - -## Tips - -If you do not wish to use the `notify` feature, you can couple `zsh-async` with `zsh/sched` or the zsh `periodic` function for scheduling the worker results to be processed. - -## Why did I make this? - -I found a great theme for zsh, [Pure](https://github.com/sindresorhus/pure) by Sindre Sorhus. After using it for a while I noticed some graphical glitches due to the terminal being updated by a disowned process. Thus, I became inspired to get my hands dirty and find a solution. I tried many things, coprocesses (seemed too limited by themselves), different combinations of trapping kill-signals, etc. I also had problems with the zsh process ending up in a deadlock due to some zsh bug. After working out the kinks, I ended up with this and thought, hey, why not make it a library. diff --git a/.zprezto/modules/prompt/external/async/async.plugin.zsh b/.zprezto/modules/prompt/external/async/async.plugin.zsh deleted file mode 100644 index e50b25e..0000000 --- a/.zprezto/modules/prompt/external/async/async.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -0=${(%):-%N} -source ${0:A:h}/async.zsh diff --git a/.zprezto/modules/prompt/external/async/async.zsh b/.zprezto/modules/prompt/external/async/async.zsh deleted file mode 100644 index 415da26..0000000 --- a/.zprezto/modules/prompt/external/async/async.zsh +++ /dev/null @@ -1,558 +0,0 @@ -#!/usr/bin/env zsh - -# -# zsh-async -# -# version: 1.7.1 -# author: Mathias Fredriksson -# url: https://github.com/mafredri/zsh-async -# - -typeset -g ASYNC_VERSION=1.7.1 -# Produce debug output from zsh-async when set to 1. -typeset -g ASYNC_DEBUG=${ASYNC_DEBUG:-0} - -# Execute commands that can manipulate the environment inside the async worker. Return output via callback. -_async_eval() { - local ASYNC_JOB_NAME - # Rename job to _async_eval and redirect all eval output to cat running - # in _async_job. Here, stdout and stderr are not separated for - # simplicity, this could be improved in the future. - { - eval "$@" - } &> >(ASYNC_JOB_NAME=[async/eval] _async_job 'cat') -} - -# Wrapper for jobs executed by the async worker, gives output in parseable format with execution time -_async_job() { - # Disable xtrace as it would mangle the output. - setopt localoptions noxtrace - - # Store start time for job. - float -F duration=$EPOCHREALTIME - - # Run the command and capture both stdout (`eval`) and stderr (`cat`) in - # separate subshells. When the command is complete, we grab write lock - # (mutex token) and output everything except stderr inside the command - # block, after the command block has completed, the stdin for `cat` is - # closed, causing stderr to be appended with a $'\0' at the end to mark the - # end of output from this job. - local jobname=${ASYNC_JOB_NAME:-$1} - local stdout stderr ret tok - { - stdout=$(eval "$@") - ret=$? - duration=$(( EPOCHREALTIME - duration )) # Calculate duration. - - # Grab mutex lock, stalls until token is available. - read -r -k 1 -p tok || exit 1 - - # Return output ( ). - print -r -n - $'\0'${(q)jobname} $ret ${(q)stdout} $duration - } 2> >(stderr=$(cat) && print -r -n - " "${(q)stderr}$'\0') - - # Unlock mutex by inserting a token. - print -n -p $tok -} - -# The background worker manages all tasks and runs them without interfering with other processes -_async_worker() { - # Reset all options to defaults inside async worker. - emulate -R zsh - - # Make sure monitor is unset to avoid printing the - # pids of child processes. - unsetopt monitor - - # Redirect stderr to `/dev/null` in case unforseen errors produced by the - # worker. For example: `fork failed: resource temporarily unavailable`. - # Some older versions of zsh might also print malloc errors (know to happen - # on at least zsh 5.0.2 and 5.0.8) likely due to kill signals. - exec 2>/dev/null - - # When a zpty is deleted (using -d) all the zpty instances created before - # the one being deleted receive a SIGHUP, unless we catch it, the async - # worker would simply exit (stop working) even though visible in the list - # of zpty's (zpty -L). - TRAPHUP() { - return 0 # Return 0, indicating signal was handled. - } - - local -A storage - local unique=0 - local notify_parent=0 - local parent_pid=0 - local coproc_pid=0 - local processing=0 - - local -a zsh_hooks zsh_hook_functions - zsh_hooks=(chpwd periodic precmd preexec zshexit zshaddhistory) - zsh_hook_functions=(${^zsh_hooks}_functions) - unfunction $zsh_hooks &>/dev/null # Deactivate all zsh hooks inside the worker. - unset $zsh_hook_functions # And hooks with registered functions. - unset zsh_hooks zsh_hook_functions # Cleanup. - - close_idle_coproc() { - local -a pids - pids=(${${(v)jobstates##*:*:}%\=*}) - - # If coproc (cat) is the only child running, we close it to avoid - # leaving it running indefinitely and cluttering the process tree. - if (( ! processing )) && [[ $#pids = 1 ]] && [[ $coproc_pid = $pids[1] ]]; then - coproc : - coproc_pid=0 - fi - } - - child_exit() { - close_idle_coproc - - # On older version of zsh (pre 5.2) we notify the parent through a - # SIGWINCH signal because `zpty` did not return a file descriptor (fd) - # prior to that. - if (( notify_parent )); then - # We use SIGWINCH for compatibility with older versions of zsh - # (pre 5.1.1) where other signals (INFO, ALRM, USR1, etc.) could - # cause a deadlock in the shell under certain circumstances. - kill -WINCH $parent_pid - fi - } - - # Register a SIGCHLD trap to handle the completion of child processes. - trap child_exit CHLD - - # Process option parameters passed to worker - while getopts "np:u" opt; do - case $opt in - n) notify_parent=1;; - p) parent_pid=$OPTARG;; - u) unique=1;; - esac - done - - killjobs() { - local tok - local -a pids - pids=(${${(v)jobstates##*:*:}%\=*}) - - # No need to send SIGHUP if no jobs are running. - (( $#pids == 0 )) && continue - (( $#pids == 1 )) && [[ $coproc_pid = $pids[1] ]] && continue - - # Grab lock to prevent half-written output in case a child - # process is in the middle of writing to stdin during kill. - (( coproc_pid )) && read -r -k 1 -p tok - - kill -HUP -$$ # Send to entire process group. - coproc : # Quit coproc. - coproc_pid=0 # Reset pid. - } - - local request do_eval=0 - local -a cmd - while :; do - # Wait for jobs sent by async_job. - read -r -d $'\0' request || { - # Since we handle SIGHUP above (and thus do not know when `zpty -d`) - # occurs, a failure to read probably indicates that stdin has - # closed. This is why we propagate the signal to all children and - # exit manually. - kill -HUP -$$ # Send SIGHUP to all jobs. - exit 0 - } - - # Check for non-job commands sent to worker - case $request in - _unset_trap) notify_parent=0; continue;; - _killjobs) killjobs; continue;; - _async_eval*) do_eval=1;; - esac - - # Parse the request using shell parsing (z) to allow commands - # to be parsed from single strings and multi-args alike. - cmd=("${(z)request}") - - # Name of the job (first argument). - local job=$cmd[1] - - # If worker should perform unique jobs - if (( unique )); then - # Check if a previous job is still running, if yes, let it finnish - for pid in ${${(v)jobstates##*:*:}%\=*}; do - if [[ ${storage[$job]} == $pid ]]; then - continue 2 - fi - done - fi - - # Guard against closing coproc from trap before command has started. - processing=1 - - # Because we close the coproc after the last job has completed, we must - # recreate it when there are no other jobs running. - if (( ! coproc_pid )); then - # Use coproc as a mutex for synchronized output between children. - coproc cat - coproc_pid="$!" - # Insert token into coproc - print -n -p "t" - fi - - if (( do_eval )); then - shift cmd # Strip _async_eval from cmd. - _async_eval $cmd - else - # Run job in background, completed jobs are printed to stdout. - _async_job $cmd & - # Store pid because zsh job manager is extremely unflexible (show jobname as non-unique '$job')... - storage[$job]="$!" - fi - - processing=0 # Disable guard. - - if (( do_eval )); then - do_eval=0 - - # When there are no active jobs we can't rely on the CHLD trap to - # manage the coproc lifetime. - close_idle_coproc - fi - done -} - -# -# Get results from finished jobs and pass it to the to callback function. This is the only way to reliably return the -# job name, return code, output and execution time and with minimal effort. -# -# If the async process buffer becomes corrupt, the callback will be invoked with the first argument being `[async]` (job -# name), non-zero return code and fifth argument describing the error (stderr). -# -# usage: -# async_process_results -# -# callback_function is called with the following parameters: -# $1 = job name, e.g. the function passed to async_job -# $2 = return code -# $3 = resulting stdout from execution -# $4 = execution time, floating point e.g. 2.05 seconds -# $5 = resulting stderr from execution -# $6 = has next result in buffer (0 = buffer empty, 1 = yes) -# -async_process_results() { - setopt localoptions unset noshwordsplit noksharrays noposixidentifiers noposixstrings - - local worker=$1 - local callback=$2 - local caller=$3 - local -a items - local null=$'\0' data - integer -l len pos num_processed has_next - - typeset -gA ASYNC_PROCESS_BUFFER - - # Read output from zpty and parse it if available. - while zpty -r -t $worker data 2>/dev/null; do - ASYNC_PROCESS_BUFFER[$worker]+=$data - len=${#ASYNC_PROCESS_BUFFER[$worker]} - pos=${ASYNC_PROCESS_BUFFER[$worker][(i)$null]} # Get index of NULL-character (delimiter). - - # Keep going until we find a NULL-character. - if (( ! len )) || (( pos > len )); then - continue - fi - - while (( pos <= len )); do - # Take the content from the beginning, until the NULL-character and - # perform shell parsing (z) and unquoting (Q) as an array (@). - items=("${(@Q)${(z)ASYNC_PROCESS_BUFFER[$worker][1,$pos-1]}}") - - # Remove the extracted items from the buffer. - ASYNC_PROCESS_BUFFER[$worker]=${ASYNC_PROCESS_BUFFER[$worker][$pos+1,$len]} - - len=${#ASYNC_PROCESS_BUFFER[$worker]} - if (( len > 1 )); then - pos=${ASYNC_PROCESS_BUFFER[$worker][(i)$null]} # Get index of NULL-character (delimiter). - fi - - has_next=$(( len != 0 )) - if (( $#items == 5 )); then - items+=($has_next) - $callback "${(@)items}" # Send all parsed items to the callback. - (( num_processed++ )) - elif [[ -z $items ]]; then - # Empty items occur between results due to double-null ($'\0\0') - # caused by commands being both pre and suffixed with null. - else - # In case of corrupt data, invoke callback with *async* as job - # name, non-zero exit status and an error message on stderr. - $callback "[async]" 1 "" 0 "$0:$LINENO: error: bad format, got ${#items} items (${(q)items})" $has_next - fi - done - done - - (( num_processed )) && return 0 - - # Avoid printing exit value when `setopt printexitvalue` is active.` - [[ $caller = trap || $caller = watcher ]] && return 0 - - # No results were processed - return 1 -} - -# Watch worker for output -_async_zle_watcher() { - setopt localoptions noshwordsplit - typeset -gA ASYNC_PTYS ASYNC_CALLBACKS - local worker=$ASYNC_PTYS[$1] - local callback=$ASYNC_CALLBACKS[$worker] - - if [[ -n $callback ]]; then - async_process_results $worker $callback watcher - fi -} - -# -# Start a new asynchronous job on specified worker, assumes the worker is running. -# -# usage: -# async_job [] -# -async_job() { - setopt localoptions noshwordsplit noksharrays noposixidentifiers noposixstrings - - local worker=$1; shift - - local -a cmd - cmd=("$@") - if (( $#cmd > 1 )); then - cmd=(${(q)cmd}) # Quote special characters in multi argument commands. - fi - - # Quote the cmd in case RC_EXPAND_PARAM is set. - zpty -w $worker "$cmd"$'\0' -} - -# -# Evaluate a command (like async_job) inside the async worker, then worker environment can be manipulated. For example, -# issuing a cd command will change the PWD of the worker which will then be inherited by all future async jobs. -# -# Output will be returned via callback, job name will be [async/eval]. -# -# usage: -# async_worker_eval [] -# -async_worker_eval() { - setopt localoptions noshwordsplit noksharrays noposixidentifiers noposixstrings - - local worker=$1; shift - - local -a cmd - cmd=("$@") - if (( $#cmd > 1 )); then - cmd=(${(q)cmd}) # Quote special characters in multi argument commands. - fi - - # Quote the cmd in case RC_EXPAND_PARAM is set. - zpty -w $worker "_async_eval $cmd"$'\0' -} - -# This function traps notification signals and calls all registered callbacks -_async_notify_trap() { - setopt localoptions noshwordsplit - - local k - for k in ${(k)ASYNC_CALLBACKS}; do - async_process_results $k ${ASYNC_CALLBACKS[$k]} trap - done -} - -# -# Register a callback for completed jobs. As soon as a job is finnished, async_process_results will be called with the -# specified callback function. This requires that a worker is initialized with the -n (notify) option. -# -# usage: -# async_register_callback -# -async_register_callback() { - setopt localoptions noshwordsplit nolocaltraps - - typeset -gA ASYNC_CALLBACKS - local worker=$1; shift - - ASYNC_CALLBACKS[$worker]="$*" - - # Enable trap when the ZLE watcher is unavailable, allows - # workers to notify (via -n) when a job is done. - if [[ ! -o interactive ]] || [[ ! -o zle ]]; then - trap '_async_notify_trap' WINCH - fi -} - -# -# Unregister the callback for a specific worker. -# -# usage: -# async_unregister_callback -# -async_unregister_callback() { - typeset -gA ASYNC_CALLBACKS - - unset "ASYNC_CALLBACKS[$1]" -} - -# -# Flush all current jobs running on a worker. This will terminate any and all running processes under the worker, use -# with caution. -# -# usage: -# async_flush_jobs -# -async_flush_jobs() { - setopt localoptions noshwordsplit - - local worker=$1; shift - - # Check if the worker exists - zpty -t $worker &>/dev/null || return 1 - - # Send kill command to worker - async_job $worker "_killjobs" - - # Clear the zpty buffer. - local junk - if zpty -r -t $worker junk '*'; then - (( ASYNC_DEBUG )) && print -n "async_flush_jobs $worker: ${(V)junk}" - while zpty -r -t $worker junk '*'; do - (( ASYNC_DEBUG )) && print -n "${(V)junk}" - done - (( ASYNC_DEBUG )) && print - fi - - # Finally, clear the process buffer in case of partially parsed responses. - typeset -gA ASYNC_PROCESS_BUFFER - unset "ASYNC_PROCESS_BUFFER[$worker]" -} - -# -# Start a new async worker with optional parameters, a worker can be told to only run unique tasks and to notify a -# process when tasks are complete. -# -# usage: -# async_start_worker [-u] [-n] [-p ] -# -# opts: -# -u unique (only unique job names can run) -# -n notify through SIGWINCH signal -# -p pid to notify (defaults to current pid) -# -async_start_worker() { - setopt localoptions noshwordsplit - - local worker=$1; shift - zpty -t $worker &>/dev/null && return - - typeset -gA ASYNC_PTYS - typeset -h REPLY - typeset has_xtrace=0 - - # Make sure async worker is started without xtrace - # (the trace output interferes with the worker). - [[ -o xtrace ]] && { - has_xtrace=1 - unsetopt xtrace - } - - if (( ! ASYNC_ZPTY_RETURNS_FD )) && [[ -o interactive ]] && [[ -o zle ]]; then - # When zpty doesn't return a file descriptor (on older versions of zsh) - # we try to guess it anyway. - integer -l zptyfd - exec {zptyfd}>&1 # Open a new file descriptor (above 10). - exec {zptyfd}>&- # Close it so it's free to be used by zpty. - fi - - zpty -b $worker _async_worker -p $$ $@ || { - async_stop_worker $worker - return 1 - } - - # Re-enable it if it was enabled, for debugging. - (( has_xtrace )) && setopt xtrace - - if [[ $ZSH_VERSION < 5.0.8 ]]; then - # For ZSH versions older than 5.0.8 we delay a bit to give - # time for the worker to start before issuing commands, - # otherwise it will not be ready to receive them. - sleep 0.001 - fi - - if [[ -o interactive ]] && [[ -o zle ]]; then - if (( ! ASYNC_ZPTY_RETURNS_FD )); then - REPLY=$zptyfd # Use the guessed value for the file desciptor. - fi - - ASYNC_PTYS[$REPLY]=$worker # Map the file desciptor to the worker. - zle -F $REPLY _async_zle_watcher # Register the ZLE handler. - - # Disable trap in favor of ZLE handler when notify is enabled (-n). - async_job $worker _unset_trap - fi -} - -# -# Stop one or multiple workers that are running, all unfetched and incomplete work will be lost. -# -# usage: -# async_stop_worker [] -# -async_stop_worker() { - setopt localoptions noshwordsplit - - local ret=0 worker k v - for worker in $@; do - # Find and unregister the zle handler for the worker - for k v in ${(@kv)ASYNC_PTYS}; do - if [[ $v == $worker ]]; then - zle -F $k - unset "ASYNC_PTYS[$k]" - fi - done - async_unregister_callback $worker - zpty -d $worker 2>/dev/null || ret=$? - - # Clear any partial buffers. - typeset -gA ASYNC_PROCESS_BUFFER - unset "ASYNC_PROCESS_BUFFER[$worker]" - done - - return $ret -} - -# -# Initialize the required modules for zsh-async. To be called before using the zsh-async library. -# -# usage: -# async_init -# -async_init() { - (( ASYNC_INIT_DONE )) && return - typeset -g ASYNC_INIT_DONE=1 - - zmodload zsh/zpty - zmodload zsh/datetime - - # Check if zsh/zpty returns a file descriptor or not, - # shell must also be interactive with zle enabled. - typeset -g ASYNC_ZPTY_RETURNS_FD=0 - [[ -o interactive ]] && [[ -o zle ]] && { - typeset -h REPLY - zpty _async_test : - (( REPLY )) && ASYNC_ZPTY_RETURNS_FD=1 - zpty -d _async_test - } -} - -async() { - async_init -} - -async "$@" diff --git a/.zprezto/modules/prompt/external/async/async_test.zsh b/.zprezto/modules/prompt/external/async/async_test.zsh deleted file mode 100644 index 17376b5..0000000 --- a/.zprezto/modules/prompt/external/async/async_test.zsh +++ /dev/null @@ -1,605 +0,0 @@ -#!/usr/bin/env zsh - -test__async_job_print_hi() { - coproc cat - print -n -p t # Insert token into coproc. - - local line - local -a out - line=$(_async_job print hi) - # Remove leading/trailing null, parse, unquote and interpret as array. - line=$line[2,$#line-1] - out=("${(@Q)${(z)line}}") - - coproc exit - - [[ $out[1] = print ]] || t_error "command name should be print, got" $out[1] - [[ $out[2] = 0 ]] || t_error "want exit code 0, got" $out[2] - [[ $out[3] = hi ]] || t_error "want output: hi, got" $out[3] -} - -test__async_job_stderr() { - coproc cat - print -n -p t # Insert token into coproc. - - local line - local -a out - line=$(_async_job print 'hi 1>&2') - # Remove trailing null, parse, unquote and interpret as array. - line=$line[1,$#line-1] - out=("${(@Q)${(z)line}}") - - coproc exit - - [[ $out[2] = 0 ]] || t_error "want status 0, got" $out[2] - [[ -z $out[3] ]] || t_error "want empty output, got" $out[3] - [[ $out[5] = hi ]] || t_error "want stderr: hi, got" $out[5] -} - -test__async_job_wait_for_token() { - float start duration - coproc cat - - _async_job print hi >/dev/null & - job=$! - start=$EPOCHREALTIME - { - sleep 0.1 - print -n -p t - } & - - wait $job - - coproc exit - - duration=$(( EPOCHREALTIME - start )) - # Fail if the execution time was faster than 0.1 seconds. - (( duration >= 0.1 )) || t_error "execution was too fast, want >= 0.1, got" $duration -} - -test__async_job_multiple_commands() { - coproc cat - print -n -p t - - local line - local -a out - line="$(_async_job print '-n hi; for i in "1 2" 3 4; do print -n $i; done')" - # Remove trailing null, parse, unquote and interpret as array. - line=$line[1,$#line-1] - out=("${(@Q)${(z)line}}") - - coproc exit - - # $out[1] here will be the entire string passed to _async_job() - # ('print -n hi...') since proper command parsing is done by - # the async worker. - [[ $out[3] = "hi1 234" ]] || t_error "want output hi1 234, got " $out[3] -} - -test_async_start_stop_worker() { - local out - - async_start_worker test - out=$(zpty -L) - [[ $out =~ "test _async_worker" ]] || t_error "want zpty worker running, got ${(Vq-)out}" - - async_stop_worker test || t_error "stop worker: want exit code 0, got $?" - out=$(zpty -L) - [[ -z $out ]] || t_error "want no zpty worker running, got ${(Vq-)out}" - - async_stop_worker nonexistent && t_error "stop non-existent worker: want exit code 1, got $?" -} - -test_async_job_print_matches_input_exactly() { - local -a result - cb() { result=("$@") } - - async_start_worker test - t_defer async_stop_worker test - - want=' - Hello world! - Much *formatting*, - many space\t...\n\n - Such "quote", v '$'\'quote\''' - ' - - async_job test print -r - "$want" - while ! async_process_results test cb; do :; done - - [[ $result[3] = $want ]] || t_error "output, want ${(Vqqqq)want}, got ${(Vqqqq)result[3]}" -} - -test_async_process_results() { - local -a r - cb() { r+=("$@") } - - async_start_worker test - t_defer async_stop_worker test - - async_process_results test cb # No results. - ret=$? - (( ret == 1 )) || t_error "want exit code 1, got $ret" - - async_job test print -n hi - while ! async_process_results test cb; do :; done - (( $#r == 6 )) || t_error "want one result, got $(( $#r % 6 ))" -} - -test_async_process_results_stress() { - # NOTE: This stress test does not always pass properly on older versions of - # zsh, sometimes writing to zpty can hang and other times reading can hang, - # etc. - local -a r - cb() { r+=("$@") } - - async_start_worker test - t_defer async_stop_worker test - - integer iter=40 timeout=5 - for i in {1..$iter}; do - async_job test "print -n $i" - - # TODO: Figure out how we can remove sleep & process here. - - # If we do not sleep here, we end up losing some of the commands sent to - # async_job (~90 get sent). This could possibly be due to the zpty - # buffer being full (see below). - sleep 0.00001 - # Without processing resuls we occasionally run into 'print -n 39' - # failing due to the command name and exit status missing. Sample output - # from processing for 39 (stdout, time, stderr): - # $'39 0.0056798458 ' - # This is again, probably due to the zpty buffer being full, we only - # need to ensure that not too many commands are run before we process. - (( iter % 6 == 0 )) && async_process_results test cb - done - - float start=$EPOCHSECONDS - - while (( $#r / 6 < iter )); do - async_process_results test cb - (( EPOCHSECONDS - start > timeout )) && { - t_log "timed out after ${timeout}s" - t_fatal "wanted $iter results, got $(( $#r / 6 ))" - } - done - - local -a stdouts - while (( $#r > 0 )); do - [[ $r[1] = print ]] || t_error "want 'print', got ${(Vq-)r[1]}" - [[ $r[2] = 0 ]] || t_error "want exit 0, got $r[2]" - stdouts+=($r[3]) - [[ -z $r[5] ]] || t_error "want no stderr, got ${(Vq-)r[5]}" - shift 6 r - done - - local got want - # Check that we received all numbers. - got=(${(on)stdouts}) - want=({1..$iter}) - [[ $want = $got ]] || t_error "want stdout: ${(Vq-)want}, got ${(Vq-)got}" - - # Test with longer running commands (sleep, then print). - iter=40 - for i in {1..$iter}; do - async_job test "sleep 1 && print -n $i" - sleep 0.00001 - (( iter % 6 == 0 )) && async_process_results test cb - done - - start=$EPOCHSECONDS - - while (( $#r / 6 < iter )); do - async_process_results test cb - (( EPOCHSECONDS - start > timeout )) && { - t_log "timed out after ${timeout}s" - t_fatal "wanted $iter results, got $(( $#r / 6 ))" - } - done - - stdouts=() - while (( $#r > 0 )); do - [[ $r[1] = sleep ]] || t_error "want 'sleep', got ${(Vq-)r[1]}" - [[ $r[2] = 0 ]] || t_error "want exit 0, got $r[2]" - stdouts+=($r[3]) - [[ -z $r[5] ]] || t_error "want no stderr, got ${(Vq-)r[5]}" - shift 6 r - done - - # Check that we received all numbers. - got=(${(on)stdouts}) - want=({1..$iter}) - [[ $want = $got ]] || t_error "want stdout: ${(Vq-)want}, got ${(Vq-)got}" -} - -test_async_job_multiple_commands_in_multiline_string() { - local -a result - cb() { result=("$@") } - - async_start_worker test - # Test multi-line (single string) command. - async_job test 'print "hi\n 123 "'$'\nprint -n bye' - while ! async_process_results test cb; do :; done - async_stop_worker test - - [[ $result[1] = print ]] || t_error "want command name: print, got" $result[1] - local want=$'hi\n 123 \nbye' - [[ $result[3] = $want ]] || t_error "want output: ${(Vq-)want}, got ${(Vq-)result[3]}" -} - -test_async_job_git_status() { - local -a result - cb() { result=("$@") } - - async_start_worker test - async_job test git status --porcelain - while ! async_process_results test cb; do :; done - async_stop_worker test - - [[ $result[1] = git ]] || t_error "want command name: git, got" $result[1] - [[ $result[2] = 0 ]] || t_error "want exit code: 0, got" $result[2] - - want=$(git status --porcelain) - got=$result[3] - [[ $got = $want ]] || t_error "want ${(Vq-)want}, got ${(Vq-)got}" -} - -test_async_job_multiple_arguments_and_spaces() { - local -a result - cb() { result=("$@") } - - async_start_worker test - async_job test print "hello world" - while ! async_process_results test cb; do :; done - async_stop_worker test - - [[ $result[1] = print ]] || t_error "want command name: print, got" $result[1] - [[ $result[2] = 0 ]] || t_error "want exit code: 0, got" $result[2] - - [[ $result[3] = "hello world" ]] || { - t_error "want output: \"hello world\", got" ${(Vq-)result[3]} - } -} - -test_async_job_unique_worker() { - local -a result - cb() { - # Add to result so we can detect if it was called multiple times. - result+=("$@") - } - helper() { - sleep 0.1; print $1 - } - - # Start a unique (job) worker. - async_start_worker test -u - - # Launch two jobs with the same name, the first one should be - # allowed to complete whereas the second one is never run. - async_job test helper one - async_job test helper two - - while ! async_process_results test cb; do :; done - - # If both jobs were running but only one was complete, - # async_process_results() could've returned true for - # the first job, wait a little extra to make sure the - # other didn't run. - sleep 0.1 - async_process_results test cb - - async_stop_worker test - - # Ensure that cb was only called once with correc output. - [[ ${#result} = 6 ]] || t_error "result: want 6 elements, got" ${#result} - [[ $result[3] = one ]] || t_error "output: want 'one', got" ${(Vq-)result[3]} -} - -test_async_job_error_and_nonzero_exit() { - local -a r - cb() { r+=("$@") } - error() { - print "Errors!" - 12345 - 54321 - print "Done!" - exit 99 - } - - async_start_worker test - async_job test error - - while ! async_process_results test cb; do :; done - - [[ $r[1] = error ]] || t_error "want 'error', got ${(Vq-)r[1]}" - [[ $r[2] = 99 ]] || t_error "want exit code 99, got $r[2]" - - want=$'Errors!\nDone!' - [[ $r[3] = $want ]] || t_error "want ${(Vq-)want}, got ${(Vq-)r[3]}" - - want=$'.*command not found: 12345\n.*command not found: 54321' - [[ $r[5] =~ $want ]] || t_error "want ${(Vq-)want}, got ${(Vq-)r[5]}" -} - -test_async_worker_notify_sigwinch() { - local -a result - cb() { result=("$@") } - - ASYNC_USE_ZLE_HANDLER=0 - - async_start_worker test -n - async_register_callback test cb - - async_job test 'sleep 0.1; print hi' - - while (( ! $#result )); do sleep 0.01; done - - async_stop_worker test - - [[ $result[3] = hi ]] || t_error "expected output: hi, got" $result[3] -} - -test_async_job_keeps_nulls() { - local -a r - cb() { r=("$@") } - null_echo() { - print Hello$'\0' with$'\0' nulls! - print "Did we catch them all?"$'\0' - print $'\0'"What about the errors?"$'\0' 1>&2 - } - - async_start_worker test - async_job test null_echo - - while ! async_process_results test cb; do :; done - - async_stop_worker test - - local want - want=$'Hello\0 with\0 nulls!\nDid we catch them all?\0' - [[ $r[3] = $want ]] || t_error stdout: want ${(Vq-)want}, got ${(Vq-)r[3]} - want=$'\0What about the errors?\0' - [[ $r[5] = $want ]] || t_error stderr: want ${(Vq-)want}, got ${(Vq-)r[5]} -} - -test_async_flush_jobs() { - local -a r - cb() { r=+("$@") } - - print_four() { print -n 4 } - print_123_delayed_exit() { - print -n 1 - { sleep 0.25 && print -n 2 } &! - { sleep 0.3 && print -n 3 } &! - } - - async_start_worker test - - # Start a job that prints 1 and starts two disowned child processes that - # print 2 and 3, respectively, after a timeout. The job will not exit - # immediately (and thus print 1) because the child processes are still - # running. - async_job test print_123_delayed_exit - - # Check that the job is waiting for the child processes. - sleep 0.05 - async_process_results test cb - (( $#r == 0 )) || t_error "want no output, got ${(Vq-)r}" - - # Start a job that prints four, it will produce - # output but we will not process it. - async_job test print_four - sleep 0.2 - - # Flush jobs, this kills running jobs and discards unprocessed results. - # TODO: Confirm that they no longer exist in the process tree. - local output - output="${(Q)$(ASYNC_DEBUG=1 async_flush_jobs test)}" - # NOTE(mafredri): First 'p' in print_four is lost when null-prefixing - # _async_job output. - [[ $output = *'rint_four 0 4'* ]] || { - t_error "want discarded output 'rint_four 0 4' when ASYNC_DEBUG=1, got ${(Vq-)output}" - } - - # Check that the killed job did not produce output. - sleep 0.1 - async_process_results test cb - (( $#r == 0 )) || t_error "want no output, got ${(Vq-)r}" - - async_stop_worker test -} - -test_async_worker_survives_termination_of_other_worker() { - local -a result - cb() { result+=("$@") } - - async_start_worker test1 - t_defer async_stop_worker test1 - - # Start and stop a worker, will send SIGHUP to previous worker - # (probably has to do with some shell inheritance). - async_start_worker test2 - async_stop_worker test2 - - async_job test1 print hi - - integer start=$EPOCHREALTIME - while (( EPOCHREALTIME - start < 2.0 )); do - async_process_results test1 cb && break - done - - (( $#result == 6 )) || t_error "wanted a result, got (${(@Vq)result})" -} - -test_async_worker_update_pwd() { - local -a result - local eval_out - cb() { - if [[ $1 == '[async/eval]' ]]; then - eval_out="$3" - else - result+=("$3") - fi - } - - async_start_worker test1 - t_defer async_stop_worker test1 - - async_job test1 'print $PWD' - async_worker_eval test1 'print -n foo; cd ..; print -n bar; print -n -u2 baz' - async_job test1 'print $PWD' - - start=$EPOCHREALTIME - while (( EPOCHREALTIME - start < 2.0 && $#result < 3 )); do - async_process_results test1 cb - done - - (( $#result == 2 )) || t_error "wanted 2 results, got ${#result}" - [[ $eval_out = foobarbaz ]] || t_error "wanted async_worker_eval to output foobarbaz, got ${(q)eval_out}" - [[ -n $result[2] ]] || t_error "wanted second pwd to be non-empty" - [[ $result[1] != $result[2] ]] || t_error "wanted worker to change pwd, was ${(q)result[1]}, got ${(q)result[2]}" -} - -setopt_helper() { - setopt localoptions $1 - - # Make sure to test with multiple options - local -a result - cb() { result=("$@") } - - async_start_worker test - async_job test print "hello world" - while ! async_process_results test cb; do :; done - async_stop_worker test - - # At this point, ksh arrays will only mess with the test. - setopt noksharrays - - [[ $result[1] = print ]] || t_fatal "$1 want command name: print, got" $result[1] - [[ $result[2] = 0 ]] || t_fatal "$1 want exit code: 0, got" $result[2] - - [[ $result[3] = "hello world" ]] || { - t_fatal "$1 want output: \"hello world\", got" ${(Vq-)result[3]} - } -} - -test_all_options() { - local -a opts exclude - - if [[ $ZSH_VERSION == 5.0.? ]]; then - t_skip "Test is not reliable on zsh 5.0.X" - fi - - # Make sure worker is stopped, even if tests fail. - t_defer async_stop_worker test - - { sleep 15 && t_fatal "timed out" } & - local tpid=$! - - opts=(${(k)options}) - - # These options can't be tested. - exclude=( - zle interactive restricted shinstdin stdin onecmd singlecommand - warnnestedvar errreturn - ) - - for opt in ${opts:|exclude}; do - if [[ $options[$opt] = on ]]; then - setopt_helper no$opt - else - setopt_helper $opt - fi - done 2>/dev/null # Remove redirect to see output. - - kill $tpid # Stop timeout. -} - -test_async_job_with_rc_expand_param() { - setopt localoptions rcexpandparam - - # Make sure to test with multiple options - local -a result - cb() { result=("$@") } - - async_start_worker test - async_job test print "hello world" - while ! async_process_results test cb; do :; done - async_stop_worker test - - [[ $result[1] = print ]] || t_error "want command name: print, got" $result[1] - [[ $result[2] = 0 ]] || t_error "want exit code: 0, got" $result[2] - - [[ $result[3] = "hello world" ]] || { - t_error "want output: \"hello world\", got" ${(Vq-)result[3]} - } -} - -zpty_init() { - zmodload zsh/zpty - - export PS1="" - zpty zsh 'zsh -f +Z' - zpty -r zsh zpty_init1 "**" || { - t_log "initial prompt missing" - return 1 - } - - zpty -w zsh "{ $@ }" - zpty -r -m zsh zpty_init2 "**" || { - t_log "prompt missing" - return 1 - } -} - -zpty_run() { - zpty -w zsh "$*" - zpty -r -m zsh zpty_run "**" || { - t_log "prompt missing after ${(Vq-)*}" - return 1 - } -} - -zpty_deinit() { - zpty -d zsh -} - -test_zle_watcher() { - zpty_init ' - emulate -R zsh - setopt zle - stty 38400 columns 80 rows 24 tabs -icanon -iexten - TERM=vt100 - - . "'$PWD'/async.zsh" - async_init - - print_result_cb() { print ${(Vq-)@} } - async_start_worker test - async_register_callback test print_result_cb - ' || { - zpty_deinit - t_fatal "failed to init zpty" - } - - t_defer zpty_deinit # Deinit after test completion. - - zpty -w zsh "zle -F" - zpty -r -m zsh result "*_async_zle_watcher*" || { - t_fatal "want _async_zle_watcher to be registered as zle watcher, got output ${(Vq-)result}" - } - - zpty_run async_job test 'print hello world' || t_fatal "could not send async_job command" - - zpty -r -m zsh result "*print 0 'hello world'*" || { - t_fatal "want \"print 0 'hello world'\", got output ${(Vq-)result}" - } -} - -test_main() { - # Load zsh-async before running each test. - zmodload zsh/datetime - . ./async.zsh - async_init -} diff --git a/.zprezto/modules/prompt/external/async/test.zsh b/.zprezto/modules/prompt/external/async/test.zsh deleted file mode 100755 index 98d44e1..0000000 --- a/.zprezto/modules/prompt/external/async/test.zsh +++ /dev/null @@ -1,263 +0,0 @@ -#!/usr/bin/env zsh -# -# zsh-async test runner. -# Checks for test files named *_test.zsh or *_test.sh and runs all functions -# named test_*. -# -emulate -R zsh - -zmodload zsh/datetime -zmodload zsh/parameter -zmodload zsh/zutil -zmodload zsh/system -zmodload zsh/zselect - -TEST_GLOB=. -TEST_RUN= -TEST_VERBOSE=0 -TEST_TRACE=1 -TEST_CODE_SKIP=100 -TEST_CODE_ERROR=101 -TEST_CODE_TIMEOUT=102 - -show_help() { - print "usage: ./test.zsh [-v] [-x] [-run pattern] [search pattern]" -} - -parse_opts() { - local -a verbose debug trace help run - - local out - zparseopts -E -D \ - v=verbose verbose=verbose -verbose=verbose \ - d=debug debug=debug -debug=debug \ - x=trace trace=trace -trace=trace \ - h=help -help=help \ - \?=help \ - run:=run -run:=run - - (( $? )) || (( $+help[1] )) && show_help && exit 0 - - if (( $#@ > 1 )); then - print -- "unknown arguments: $@" - show_help - exit 1 - fi - - [[ -n $1 ]] && TEST_GLOB=$1 - TEST_VERBOSE=$+verbose[1] - TEST_TRACE=$+trace[1] - ZTEST_DEBUG=$+debug[1] - (( $+run[2] )) && TEST_RUN=$run[2] -} - -t_runner_init() { - emulate -L zsh - - zmodload zsh/parameter - - # _t_runner is the main loop that waits for tests, - # used to abort test execution by exec. - _t_runner() { - local -a _test_defer_funcs - integer _test_errors=0 - while read -r; do - eval "$REPLY" - done - } - - _t_log() { - local trace=$1; shift - local -a lines indent - lines=("${(@f)@}") - indent=($'\t\t'${^lines[2,$#lines]}) - print -u7 -lr - $'\t'"$trace: $lines[1]" ${(F)indent} - } - - # t_log is for printing log output, visible in verbose (-v) mode. - t_log() { - local line=$funcfiletrace[1] - [[ ${line%:[0-9]*} = "" ]] && line=ztest:$functrace[1] # Not from a file. - _t_log $line "$*" - } - - # t_skip is for skipping a test. - t_skip() { - _t_log $funcfiletrace[1] "$*" - () { return 100 } - t_done - } - - # t_error logs the error and fails the test without aborting. - t_error() { - (( _test_errors++ )) - _t_log $funcfiletrace[1] "$*" - } - - # t_fatal fails the test and halts execution immediately. - t_fatal() { - _t_log $funcfiletrace[1] "$*" - () { return 101 } - t_done - } - - # t_defer takes a function (and optionally, arguments) - # to be executed after the test has completed. - t_defer() { - _test_defer_funcs+=("$*") - } - - # t_done completes the test execution, called automatically after a test. - # Can also be called manually when the test is done. - t_done() { - local ret=$? w=${1:-1} - (( _test_errors )) && ret=101 - - (( w )) && wait # Wait for test children to exit. - for d in $_test_defer_funcs; do - eval "$d" - done - print -n -u8 $ret # Send exit code to ztest. - exec _t_runner # Replace shell, wait for new test. - } - - source $1 # Load the test module. - - # Send available test functions to main process. - print -u7 ${(R)${(okM)functions:#test_*}:#test_main} - - # Run test_main. - if [[ -n $functions[test_main] ]]; then - test_main - fi - - exec _t_runner # Wait for commands. -} - -# run_test_module runs all the tests from a test module (asynchronously). -run_test_module() { - local module=$1 - local -a tests - float start module_time - - # Create fd's for communication with test runner. - integer run_pid cmdoutfd cmdinfd outfd infd doneoutfd doneinfd - - coproc cat; exec {cmdoutfd}>&p; exec {cmdinfd}<&p - coproc cat; exec {outfd}>&p; exec {infd}<&p - coproc cat; exec {doneoutfd}>&p; exec {doneinfd}<&p - - # No need to keep coproc (&p) open since we - # have redirected the outputs and inputs. - coproc exit - - # Launch a new interactive zsh test runner. We don't capture stdout - typeset -a run_args - (( TEST_TRACE )) && run_args+=('-x') - zsh -s $run_args <&$cmdinfd 7>&$outfd 8>&$doneoutfd & - run_pid=$! - - # Initialize by sending function body from t_runner_init - # and immediately execute it as an anonymous function. - syswrite -o $cmdoutfd "() { ${functions[t_runner_init]} } $module"$'\n' - sysread -i $infd - tests=(${(@)=REPLY}) - [[ -n $TEST_RUN ]] && tests=(${(M)tests:#*$TEST_RUN*}) - - integer mod_exit=0 - float mod_start mod_time - - mod_start=$EPOCHREALTIME # Store the module start time. - - # Run all tests. - local test_out - float test_start test_time - integer text_exit - - for test in $tests; do - (( TEST_VERBOSE )) && print "=== RUN $test" - - test_start=$EPOCHREALTIME # Store the test start time. - - # Start the test. - syswrite -o $cmdoutfd "$test; t_done"$'\n' - - test_out= - test_exit=-1 - while (( test_exit == -1 )); do - # Block until there is data to be read. - zselect -r $doneinfd -r $infd - - if [[ $reply[2] = $doneinfd ]]; then - sysread -i $doneinfd - test_exit=$REPLY # Store reply from sysread - # Store the test execution time. - test_time=$(( EPOCHREALTIME - test_start )) - fi - - # Read all output from the test output channel. - while sysread -i $infd -t 0; do - test_out+=$REPLY - unset REPLY - done - done - - case $test_exit in - (0|1) state=PASS;; - (100) state=SKIP;; - (101|102) state=FAIL; mod_exit=1;; - *) state="????";; - esac - - if [[ $state = FAIL ]] || (( TEST_VERBOSE )); then - printf -- "--- $state: $test (%.2fs)\n" $test_time - print -n $test_out - fi - done - - # Store module execution time. - mod_time=$(( EPOCHREALTIME - mod_start )) - - # Perform cleanup. - kill -HUP $run_pid - exec {outfd}>&- - exec {infd}<&- - exec {cmdinfd}>&- - exec {cmdoutfd}<&- - exec {doneinfd}<&- - exec {doneoutfd}>&- - - if (( mod_exit )); then - print "FAIL" - (( TEST_VERBOSE )) && print "exit code $mod_exit" - printf "FAIL\t$module\t%.3fs\n" $mod_time - else - (( TEST_VERBOSE )) && print "PASS" - printf "ok\t$module\t%.3fs\n" $mod_time - fi - - return $mod_exit -} - -cleanup() { - trap - HUP - kill -HUP $$ 2>/dev/null - kill -HUP -$$ 2>/dev/null -} - -trap cleanup EXIT INT HUP QUIT TERM USR1 - -# Parse command arguments. -parse_opts $@ - -(( ZTEST_DEBUG )) && setopt xtrace - -# Execute tests modules. -failed=0 -for tf in ${~TEST_GLOB}/*_test.(zsh|sh); do - run_test_module $tf & - wait $! - (( $? )) && failed=1 -done - -exit $failed diff --git a/.zprezto/modules/prompt/external/powerlevel9k/CHANGELOG.md b/.zprezto/modules/prompt/external/powerlevel9k/CHANGELOG.md deleted file mode 100644 index b40ce50..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/CHANGELOG.md +++ /dev/null @@ -1,450 +0,0 @@ -## v0.6.6 - -- The `rbenv` segment is no longer a default segment in the LPROMPT. -- PR #959 - Fixing issue in v0.6.5 where we changed some color codes. -- PR #934 - Add Tests -- PR #884 - test-in-docker: fix with newer ZSH versions -- PR #928 - [Docs] Add etc state description in dir docs -- PR #937 - Use SUDO_COMMAND to check for sudo -- PR #925 - [Bugfix] Resolve #918 Transparent background -- PR #923 - Fix font issue debugging script -- PR #921 - Add missing colors to fix color comparison -- PR #951 - Add fallback icon for missing linux distro icons -- PR #956 - Fix broken link in readme -- Fixed #936 - fallback icons for Linux distros -- Fixed #926 - `etc` state for `dir` segment in docs -- Fixed #852 - `sudo` detection got crazy, there. sorry, everyone. -- Fixed #927 - more default color issues. - -## v0.6.5 - -- Multiple PRs: General fixes to README, improved documentation. -- Multiple PRs: Improvements to icons / glyphs. -- PR #777: now possible to always show the Ruby env segment. -- PR #773: Fixed issue with home abbreviation in directory segment. -- PR #789: Now properly working around some odd ZSH status return codes. -- PR #716: Now possible to configure the colors of the VCS segment in rebase mode. -- PR #722: Removed dependency on `bc` for `load` segment. -- PR #686: Fixed issue where whitespaces in path occasionally broke `dir` segment. -- PR #685: No longer accidentally invoking user `grep` aliases. -- PR #680: Using env variable for `PYENV` properly, now. -- PR #676, #611: Fixes for Kubernetes segment. -- PR #667: Supporting multiple AWS profiles. -- PR #660: Fixing directory parsing issue with PYTHONPATH. -- PR #663: Fixed silly issues causing ZSH warnings. -- PR #647: Fixing `public_ip` segment for macOS. -- PR #643: Fixing `vpn_ip` segment naming. -- PR #636: `context` segment now grabs user with command rather than env. -- PR #618: Fix issue where `su -` didn't change context segment. -- PR #608: Load average selection in `load` segment. - -### New Segment: `laravel_version` - -Displays the current laravel version. - -## v0.6.4 - -- `load` segment now has configurable averages. -- Update to `dir` segment to add `dir_writable` feature. -- `status` segment can now display POSIX signal name of exit code. -- Added `teardown` command to turn off P9k prompt. -- Fixes for P9k in Cygwin and 32-bit systems. -- Better colors in virtualization segments. -- Added 'Gopher' icon to the `go_version` segment. -- Improved detection in `nvm` -- Added option to support command status reading from piped command sequences. -- Fixed issue with visual artifacts with quick consecutive commands. -- Updated 'ananconda' segment for more uniform styling. -- `rvm` segment can now support usernames with dashes. -- Fixed Python icon reference in some font configurations. -- Vi mode indicator fixed. -- Fixes for Docker segment. -- Added new Docker-based testing system. -- Significant enhancements to the `battery` segment. Check out the README to - read more! -- New truncation strategy that truncates until the path becomes unique. - -### New Segments: `host` and `user` - -Provides two separate segments for `host` and `user` in case you don't wont both -in one (per the `context` segment). - -### New Segment: `newline` - -Allows you to split segments across multiple lines. - -### New Segment: `kubecontext` - -Shows the current context of your `kubectl` configuration. - -### New Segment: `vpn` - -Shows current `vpn` interface. - -## v0.6.3 - -- Fixed susceptibility to [pw3nage exploit](https://github.com/njhartwell/pw3nage). -- Added support for Android -- The abbreviation for $HOME is now configurable (doesn't have to be `~`). -- Fixed colorization of VCS segment in Subversion repos. -- Improved handling of symlinks in installation paths. - -## v0.6.2 - -- Fixed some issues with the new `nerdfont-fontconfig` option. -- Fixed typo in README. -- The `get_icon_names` function can now print sorted output, and show which - icons users have overridden. -- Added a FreeBSD VM for testing. - -### Add debug script for iTerm2 issues - -A new script `debug/iterm.zsh` was added for easier spotting problems with your iTerm2 configuration. - -### Add debug script for font issues - -A new script `debug/font-issues.zsh` was added, so that problems with your font could be spotted easier. - -### `ram` changes - -The `ram` segment now shows the available ram instead of free. - -### Add new segments `host` and `user` - -The user and host segments allow you to have different icons and colors for both the user and host segments -depending on their state. - -## v0.6.0 - -- Fixed a bug where the tag display was broken on detached HEADs. -- Fixed a bug where SVN detection sometimes failed. -- Fixed the `load` and `ram` segments for BSD. -- Fixed code-points that changed in Awesome fonts. -- Fixed display of "OK_ICON" in `status` segment in non-verbose mode. -- Fixed an issue where dir name truncation that was very short sometimes failed. -- Speed & accuracy improvements to the battery segment. -- Added Github syntax highlighting to README. -- Various documentation cleanup. - -### New Font Option: nerd-fonts - -There is now an option to use [nerd-fonts](https://github.com/ryanoasis/nerd-fonts) with P9k. Simply configure the `nerdfont-fontconfig`, and you'll be set! - -### `vcs` changes - -The VCS segment can now display icons for remote repo hosting services, including Github, Gitlab, and 'other'. - -### `dir` changes - -Added an option to configure the path separator. If you want something -else than an ordinary slash, you could set -`POWERLEVEL9K_DIR_PATH_SEPARATOR` to whatever you want. - -#### `truncate_with_package_name` now searches for `composer.json` as well - -Now `composer.json` files are searched as well. By default `package.json` still takes -precedence. If you want to change that, set `POWERLEVEL9K_DIR_PACKAGE_FILES=(composer.json package.json)`. - -### New segment `command_execution_time` added - -Shows the duration a command needed to run. By default only durations over 3 seconds -are shown (can be adjusted by setting POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD). - -### New segment `dir_writable` added - -This segment displays a lock icon if your user has no write permissions in the current folder. - -### New segment `disk_usage` added - -This segment will show the usage level of your current partition. - -### New segment `public_ip` added - -Fetches your Public IP (using ident.me) and displays it in your prompt. - -### New segment `swift_version` added - -This segment displays the version of Swift that is installed / in your path. - -### New segment `detect_virt` added - -Detects and reports if you are in a virtualized session using `systemd`. - -## v0.5.0 - -### `load` and `ram` changes - -These two segments now support BSD. - -### `vcs` changes - -- We implemented a huge speed improvement for this segment. -- Now this segment supports Subversion repositories. -- Add ability to hide tags by setting `POWERLEVEL9K_VCS_HIDE_TAGS` to true. - -## `anaconda` changes - -Speed improvements for `anaconda` segment. - -## v0.4.0 - -### Development changes - -From now on, development makes use of a CI system "travis". - -### `vcs` changes - -The default state was renamed to `clean`. If you overrode foreground -or background color in the past, you need to rename your variables to: - -```zsh -POWERLEVEL9K_VCS_CLEAN_FOREGROUND='cyan' -POWERLEVEL9K_VCS_CLEAN_BACKGROUND='white' -``` - -Additionaly the vcs segment now has an `untracked` state which -indicates that you have untracked files in your repository. - -The foreground color of actionformat is now configurable via: -```zsh -POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND='green' -``` - -Also, the vcs segment uses the foreground color it was configured to. -That said, the variables `POWERLEVEL9K_VCS_FOREGROUND` and -`POWERLEVEL9K_VCS_DARK_FOREGROUND` are no longer used. Instead use -the proper variable `POWERLEVEL9K_VCS__FOREGROUND` to change -foreground color. - -### `dir` Shortening Strategies - -There is now a path shortening strategy that will use the `package.json` file to -shorten your directory path. See the documentation for the `dir` segment for more -details. - -Also, the shorten delimiter was changed to an unicode ellipsis. It is configurable -via `POWERLEVEL9K_SHORTEN_DELIMITER`. - -### `rbenv` changes - -The `rbenv` segment now makes use of the full rbenv command, so the correct -ruby version is now shown if it differs from the globally one. - -### `node`, `nvm` Segments - -Improvements to speed / reliability. - -### `ram` changes - -The `ram` segment was split up into `ram` and `swap`. The -`POWERLEVEL9K_RAM_ELEMENTS` variable is obsolete. - -### New segment `swap` added - -Due to the split up of the ram segment, this one was created. It -shows the currently used swap size. - -### New segment `nodeenv` added - -Added new `nodeenv` segment that shows the currently used node environment. - -### New segment `aws_eb_env` added - -This segment displays the current Elastic Beanstalk environment. - -### New segment `chruby` added - -Added new `chruby` segment to support this version manager. - -### New segment `docker_machine` added - -Added new `docker_machine` segment that will show your Docker machine. - -### New segment `anaconda` added - -A new segment `anaconda` was added that shows the current used -anaconda environment. - -## New segment `pyenv` added - -This segment shows your active python version as reported by `pyenv`. - - -## v0.3.2 - -### `vcs` changes - -A new state `UNTRACKED` was added to the `vcs` segment. So we now -have 3 states for repositories: `UNTRACKED`, `MODIFIED`, and the -default state. The `UNTRACKED` state is active when there are files -in the repository directory which have not been added to the repo -(the same as when the `+` icon appears). The default color for the -`UNTRACKED` state is now yellow, and the default color for the -`MODIFIED` state is now read, but those colors can be changed by -setting these variables, for example: - -```zsh -POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='black' -POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='white' -POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='green' -POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='blue' -``` - -## v0.3.1 - -### `dir` changes - -A new state `HOME_SUBFOLDER` was added. So if you want to overwrite -colors for this segment, also set this variables: -```zsh -POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='black' -POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='white' -``` - -### `background_jobs` changes -Now displays the number of background jobs if there's more than 1. -You can disable it by setting : -```zsh -POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false -``` - -## v0.3.0 - -### Introduced "visual identifiers" to the segments - -Now almost every segment can have a visual identifier, which is an -icon whose color could be adjusted by users. - -### Added ability for "joined" segments - -You can now merge segments together by suffixing the segment name with "_joined". -For Developers: Be aware that the order of parameters in left/right_prompt_segment -has changed. Now a boolean parameter must be set as second parameter (true if joined). - -### `dir` changes - -This segment now has "state", which means you now can change the colors seperatly -depending if you are in your homefolder or not. -Your variables for that should now look like: -```zsh -POWERLEVEL9K_DIR_HOME_BACKGROUND='green' -POWERLEVEL9K_DIR_HOME_FOREGROUND='cyan' -POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='red' -POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='yellow' -``` - -### `status` changes - -The `status` segment was split up into three segments. `background_jobs` prints -an icon if there are background jobs. `root_indicator` prints an icon if the user -is root. The `status` segment focuses now on the status only. -The `status` segment also now has "state". If you want to overwrite the colors, -you have to add the state to your variables: -```zsh -POWERLEVEL9K_STATUS_ERROR_BACKGROUND='green' -POWERLEVEL9K_STATUS_ERROR_FOREGROUND='cyan' -POWERLEVEL9K_STATUS_OK_BACKGROUND='red' -POWERLEVEL9K_STATUS_OK_FOREGROUND='yellow' -``` - -### New segment `custom_command` added - -A new segment that allows users to define a custom command was added. - -### `virtualenv` changes - -This segment now respects `VIRTUAL_ENV_DISABLE_PROMPT`. If this variable is set -to `true`, the segments does not get rendered. - -### `load` changes - -The `load` segement was split and a new segment `ram` was extracted. This new -segment is able to show the free ram and used swap. - -### `vcs` changes - -This prompt uses the `VCS_INFO` subsystem by ZSH. From now on this subsystem -is only invoked if a `vcs` segment was configured. - -### `rvm` changes - -This segment now does not invoke RVM directly anymore. Instead, is relys on the -circumstance that RVM was invoked beforehand and just reads the environment -variables '$GEM_HOME' and '$MY_RUBY_HOME'. It also now displays the used gemset. - -### New segment `battery` added - -A new segment that shows the battery status of your laptop was added. - -### New segment `go_version` added - -This segment shows the GO version. - -### New segment `nvm` added - -This segment shows your NodeJS version by using NVM (and if it is not 'default'). - -### New segment `todo` added - -This segment shows your ToDos from [todo.sh](http://todotxt.com/). - -### New segment `rust_version` added - -This segment shows your local rust version. - -## v0.2.0 - -### `longstatus` is now `status` - -The segments got merged together. To show the segment only if an error occurred, -set `POWERLEVEL9K_STATUS_VERBOSE=false` (this is the same behavior as the old -`status` segment. - -### Icon overriding mechanism added - -All icons can now be overridden by setting a variable named by the internal icon -name. You can get a full list of icon name by calling `get_icon_names`. - -### Same color segements get visual separator - -This separator can be controlled by setting `POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR` -or `POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR`. By default this separator is -printed in the foreground color. - -### `dir` segment has different strategies for truncation - -Now you can choose between `truncate_middle` or `truncate_from_right` by setting -`POWERLEVEL9K_SHORTEN_STRATEGY`. Default behavior is unchanged (truncate whole -directories). `POWERLEVEL9K_SHORTEN_DIR_LENGTH` can be used to influence how -much will be truncated (either direcories or chars). - -### New segment `ip` added - -This segment shows your internal IP address. You can define which interfaces IP -will be shown by specifying it via `POWERLEVEL9K_IP_INTERFACE`. - -### New segment `load` added - -This segment shows your computers 5min load average. - -### New segment `os_icon` added - -This segment shows a little indicator which OS you are running. - -### New segment `php_version` added - -This segment shows your PHP version. - -### New segment `vi_mode` added - -This segment gives you a hint in which VI-mode you currently are. This -segment requires a proper configured VI-mode. - -### Added the ability to have empty left or right prompts - -By setting the according variable to an empty array, the left or right -prompt will be empty. - -## v0.1.0 - -This is the first release diff --git a/.zprezto/modules/prompt/external/powerlevel9k/CODE_OF_CONDUCT.md b/.zprezto/modules/prompt/external/powerlevel9k/CODE_OF_CONDUCT.md deleted file mode 100644 index 22c9ebb..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at bhilburn@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/LICENSE b/.zprezto/modules/prompt/external/powerlevel9k/LICENSE deleted file mode 100644 index 812d306..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014-2017 Ben Hilburn - -MIT LICENSE - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.zprezto/modules/prompt/external/powerlevel9k/README.md b/.zprezto/modules/prompt/external/powerlevel9k/README.md deleted file mode 100644 index 2b037bd..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/README.md +++ /dev/null @@ -1,765 +0,0 @@ -![](https://raw.githubusercontent.com/bhilburn/powerlevel9k-logo/master/logo-banner.png) ---- -[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=master)](https://travis-ci.org/bhilburn/powerlevel9k) -[![Join the chat at https://gitter.im/bhilburn/powerlevel9k](https://badges.gitter.im/bhilburn/powerlevel9k.svg)](https://gitter.im/bhilburn/powerlevel9k?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -Powerlevel9k is a theme for ZSH which uses [Powerline -Fonts](https://github.com/powerline/fonts). It can be used with vanilla ZSH or -ZSH frameworks such as [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh), -[Prezto](https://github.com/sorin-ionescu/prezto), -[Antigen](https://github.com/zsh-users/antigen), and [many -others](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions). - -Get more out of your terminal. Be a badass. Impress everyone in 'Screenshot Your -Desktop' threads. Use powerlevel9k. - -![](http://bhilburn.org/content/images/2015/01/pl9k-improved.png) - -You can check out some other users' configurations in our wiki: [Show Off Your -Config](https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config). - -There are a number of Powerline ZSH themes available, now. The developers of -this theme focus on four primary goals: - -1. Give users a great out-of-the-box configuration with no additional - configuration required. -2. Make customization easy for users who do want to tweak their prompt. -3. Provide useful segments that you can enable to make your prompt even more - effective and helpful. We have prompt segments for everything from unit test - coverage to your AWS instance. -4. Optimize the code for execution speed as much as possible. A snappy terminal - is a happy terminal. - -Powerlevel9k can be used to create both very useful and beautiful terminal environments: - -![](https://camo.githubusercontent.com/b5d7eb49a30bfe6bdb5706fa3c9be95fe8e5956e/687474703a2f2f67696679752e636f6d2f696d616765732f70396b6e65772e676966) - -### Table of Contents - -1. [Installation](#installation) -2. [Customization](#prompt-customization) - 1. [Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) - 2. [Customizing Prompt Segments](#customizing-prompt-segments) - 3. [Available Prompt Segments](#available-prompt-segments) -3. [Troubleshooting](https://github.com/bhilburn/powerlevel9k/wiki/Troubleshooting) - -Be sure to also [check out the Wiki](https://github.com/bhilburn/powerlevel9k/wiki)! - -### Installation -There are two installation steps to go from a vanilla terminal to a PL9k -terminal. Once you are done, you can optionally customize your prompt. - -[Installation Instructions](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions) - -1. [Install the Powerlevel9k Theme](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-1-install-powerlevel9k) -2. [Install Powerline Fonts](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-2-install-a-powerline-font) - -No configuration is necessary post-installation if you like the default -settings, but there are plenty of segment customization options available if you -are interested. - -### Prompt Customization - -Be sure to check out the wiki page on the additional prompt customization -options, including color and icon settings: [Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) - -#### Customizing Prompt Segments -Customizing your prompt is easy! Select the segments you want to have displayed, -and then assign them to either the left or right prompt by adding the following -variables to your `~/.zshrc`. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`|`(context dir vcs)`|Segment list for left prompt| -|`POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`|`(status root_indicator background_jobs history time)`|Segment list for right prompt| - - -The table above shows the default values, so if you wanted to set these -variables manually, you would put the following in -your `~/.zshrc`: -```zsh -POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs) -POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time) -``` -#### Available Prompt Segments -The segments that are currently available are: - -**System Status Segments:** -* [`background_jobs`](#background_jobs) - Indicator for background jobs. -* [`battery`](#battery) - Current battery status. -* [`context`](#context) - Your username and host, conditionalized based on $USER and SSH status. -* [`date`](#date) - System date. -* [`dir`](#dir) - Your current working directory. -* `dir_writable` - Displays a lock icon, if you do not have write permissions on the current folder. -* [`disk_usage`](#disk_usage) - Disk usage of your current partition. -* `history` - The command number for the current line. -* [`host`](#host) - Your current host name -* [`ip`](#ip) - Shows the current IP address. -* [`vpn_ip`](#vpn_ip) - Shows the current VPN IP address. -* [`public_ip`](#public_ip) - Shows your public IP address. -* [`load`](#load) - Your machine's load averages. -* `os_icon` - Display a nice little icon, depending on your operating system. -* `ram` - Show free RAM. -* `root_indicator` - An indicator if the user has superuser status. -* [`status`](#status) - The return code of the previous command. -* `swap` - Prints the current swap size. -* [`time`](#time) - System time. -* [`user`](#user) - Your current username -* [`vi_mode`](#vi_mode)- Your prompt's Vi editing mode (NORMAL|INSERT). -* `ssh` - Indicates whether or not you are in an SSH session. - -**Development Environment Segments:** -* [`vcs`](#vcs) - Information about this `git` or `hg` repository (if you are in one). - -**Language Segments:** -* **GoLang Segments:** - * `go_version` - Show the current GO version. -* **Javascript / Node.js Segments:** - * `node_version` - Show the version number of the installed Node.js. - * `nodeenv` - [nodeenv](https://github.com/ekalinin/nodeenv) prompt for displaying node version and environment name. - * `nvm` - Show the version of Node that is currently active, if it differs from the version used by NVM -* **PHP Segments:** - * `php_version` - Show the current PHP version. - * `laravel_version` - Show the current Laravel version. - * [`symfony2_tests`](#symfony2_tests) - Show a ratio of test classes vs code classes for Symfony2. - * `symfony2_version` - Show the current Symfony2 version, if you are in a Symfony2-Project dir. -* **Python Segments:** - * `virtualenv` - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). - * [`anaconda`](#anaconda) - Your active [Anaconda](https://www.continuum.io/why-anaconda) environment. - * `pyenv` - Your active python version as reported by the first word of [`pyenv version`](https://github.com/yyuu/pyenv). Note that the segment is not displayed if that word is _system_ i.e. the segment is inactive if you are using system python. -* **Ruby Segments:** - * [`chruby`](#chruby) - Ruby environment information using `chruby` (if one is active). - * [`rbenv`](#rbenv) - Ruby environment information using `rbenv` (if one is active). - * [`rspec_stats`](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. - * `rvm` - Ruby environment information using `$GEM_HOME` and `$MY_RUBY_HOME` (if one is active). -* **Rust Segments:** - * `rust_version` - Display the current rust version and [logo](https://www.rust-lang.org/logos/rust-logo-blk.svg). -* **Swift Segments:** - * `swift_version` - Show the version number of the installed Swift. -* **Java Segments:** - * `java_version` - Show the current Java version. - -**Cloud Segments:** -* **AWS Segments:** - * [`aws`](#aws) - The current AWS profile, if active. - * `aws_eb_env` - The current Elastic Beanstalk Environment. -* `docker_machine` - The current Docker Machine. -* `kubecontext` - The current context of your `kubectl` configuration. -* `dropbox` - Indicates Dropbox directory and syncing status using `dropbox-cli` - -**Other:** -* [`custom_command`](#custom_command) - Create a custom segment to display the - output of an arbitrary command. -* [`command_execution_time`](#command_execution_time) - Display the time the current command took to execute. -* [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. -* `detect_virt` - Virtualization detection with systemd -* `newline` - Continues the prompt on a new line. -* `openfoam` - Shows the currently sourced [OpenFOAM](https://openfoam.org/) environment. - ---------------------------------------------------------------------------------- - - -##### anaconda - -This segment shows your active anaconda environment. It relies on either the -`CONDA_ENV_PATH` or the `CONDA_PREFIX` (depending on the `conda` version) -environment variable to be set which happens when you properly `source -activate` an environment. - -Special configuration variables: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_ANACONDA_LEFT_DELIMITER`|"("|The left delimiter just before the environment name.| -|`POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER`|")"|The right delimiter just after the environment name.| - -Additionally the following segment specific parameters can be used to customize -it: `POWERLEVEL9K_PYTHON_ICON`, `POWERLEVEL9K_ANACONDA_BACKGROUND`, and -`POWERLEVEL9K_ANACONDA_FOREGROUND`. - -##### aws - -If you would like to display the [current AWS -profile](http://docs.aws.amazon.com/cli/latest/userguide/installing.html), add -the `aws` segment to one of the prompts, and define `AWS_DEFAULT_PROFILE` in -your `~/.zshrc`: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`AWS_DEFAULT_PROFILE`|None|Your AWS profile name| - -##### background_jobs - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE`|`true`|If there is more than one background job, this segment will show the number of jobs. Set this to `false` to turn this feature off.| -`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS`|`false`|Always show the jobs count (even if it's zero).| - -##### battery - -The default settings for this segment will display your current battery status (fails gracefully on -systems without a battery). It is supported on both OSX and Linux (note that it requires `acpi` on Linux). - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_BATTERY_CHARGING`|`"yellow"`|Color to indicate a charging battery.| -|`POWERLEVEL9K_BATTERY_CHARGED`|`"green"`|Color to indicate a charged battery.| -|`POWERLEVEL9K_BATTERY_DISCONNECTED`|`$DEFAULT_COLOR`|Color to indicate absence of battery.| -|`POWERLEVEL9K_BATTERY_LOW_THRESHOLD`|`10`|Threshold to consider battery level critical.| -|`POWERLEVEL9K_BATTERY_LOW_COLOR`|`"red"`|Color to indicate critically low charge level.| -|`POWERLEVEL9K_BATTERY_VERBOSE`|`true`|Display time remaining next to battery level.| - -Note that you can [modify the `_FOREGROUND` -color](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#segment-color-customization) -without affecting the icon color. - -You can also change the battery icon automatically depending on the battery -level. This will override the default battery icon. In order to do this, you -need to define the `POWERLEVEL9k_BATTERY_STAGES` variable. - - -| Variable | Default Value | Description | -|-------------------------------|---------------|---------------------------------------------------------------| -| `POWERLEVEL9K_BATTERY_STAGES` | Unset | A string or array, which each index indicates a charge level. | - -Powerlevel9k will use each index of the string or array as a stage to indicate battery -charge level, progressing from left to right. You can provide any number of -stages. The setting below, for example, provides 8 stages for Powerlevel9k to use. -```zsh -POWERLEVEL9K_BATTERY_STAGES="▁▂▃▄▅▆▇█" -``` - -If you require extra spacing after the icon, you will have to set it as an array, -since spaces in the string will be used as one of the stages and you will get a -missing icon. To do this, declare the variable as follows: -```zsh -POWERLEVEL9K_BATTERY_STAGES=($'\u2581 ' $'\u2582 ' $'\u2583 ' $'\u2584 ' $'\u2585 ' $'\u2586 ' $'\u2587 ' $'\u2588 ') -``` - -Using the array syntax, you can create stages comprised of multiple characters. -The below setting provides 40 battery stages. -```zsh -POWERLEVEL9K_BATTERY_STAGES=( - $'▏ ▏' $'▎ ▏' $'▍ ▏' $'▌ ▏' $'▋ ▏' $'▊ ▏' $'▉ ▏' $'█ ▏' - $'█▏ ▏' $'█▎ ▏' $'█▍ ▏' $'█▌ ▏' $'█▋ ▏' $'█▊ ▏' $'█▉ ▏' $'██ ▏' - $'██ ▏' $'██▎ ▏' $'██▍ ▏' $'██▌ ▏' $'██▋ ▏' $'██▊ ▏' $'██▉ ▏' $'███ ▏' - $'███ ▏' $'███▎ ▏' $'███▍ ▏' $'███▌ ▏' $'███▋ ▏' $'███▊ ▏' $'███▉ ▏' $'████ ▏' - $'████ ▏' $'████▎▏' $'████▍▏' $'████▌▏' $'████▋▏' $'████▊▏' $'████▉▏' $'█████▏' ) -``` - -You can also change the background of the segment automatically depending on the -battery level. This will override the following variables: -`POWERLEVEL9K_BATTERY_CHARGING`, `POWERLEVEL9K_BATTERY_CHARGED`, -`POWERLEVEL9K_BATTERY_DISCONNECTED`, and `POWERLEVEL9K_BATTERY_LOW_COLOR`. In -order to do this, define a color array, from low to high, as shown below: -```zsh -POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND=(red1 orangered1 darkorange orange1 gold1 yellow1 yellow2 greenyellow chartreuse1 chartreuse2 green1) -``` - -As with the battery stages, you can use any number of colors and Powerlevel9k -will automatically use all of them appropriately. - -Some example settings: - -| Brightness | Possible Array | -|----------------|---------------------------------------------------------------------------------------------------------------| -| Bright Colors | `(red1 orangered1 darkorange orange1 gold1 yellow1 yellow2 greenyellow chartreuse1 chartreuse2 green1)` | -| Normal Colors | `(red3 darkorange3 darkgoldenrod gold3 yellow3 chartreuse2 mediumspringgreen green3 green3 green4 darkgreen)` | -| Subdued Colors | `(darkred orange4 yellow4 yellow4 chartreuse3 green3 green4 darkgreen)` | - -##### chruby - -This segment shows the version of Ruby being used when using `chruby` to change your current Ruby stack. - -It uses `$RUBY_ENGINE` and `$RUBY_VERSION` as set by `chruby`. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_CHRUBY_SHOW_ENGINE`|true|Show the currently selected Ruby engine (e.g. `ruby`, `jruby`, `rbx`, etc) -|`POWERLEVEL9K_CHRUBY_SHOW_VERSION`|true|Shows the currently selected engine's version (e.g. `2.5.1`) - -##### command_execution_time - -Display the time the previous command took to execute if the time is above -`POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD`. The time is formatted to be -"human readable", and so scales the units based on the length of execution time. -If you want more precision, just set the -`POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION` field. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD`|3|Threshold above which to print this segment. Can be set to `0` to always print.| -|`POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION`|2|Number of digits to use in the fractional part of the time value.| - -##### custom_command - -The `custom_...` segment allows you to turn the output of a custom command into -a prompt segment. As an example, if you wanted to create a custom segment to -display your WiFi signal strength, you might define a custom segment called -`custom_wifi_signal` like this: -```zsh -POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_wifi_signal) -POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="echo signal: \$(nmcli device wifi | grep yes | awk '{print \$8}')" -POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_BACKGROUND="blue" -POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_FOREGROUND="yellow" -``` -If you prefer, you can also define the function in your `.zshrc` rather than -putting it in-line with the variable export, as shown above. Just don't forget -to invoke your function from your segment! Example code that achieves the same -result as the above: -```zsh -zsh_wifi_signal(){ - local signal=$(nmcli device wifi | grep yes | awk '{print $8}') - local color='%F{yellow}' - [[ $signal -gt 75 ]] && color='%F{green}' - [[ $signal -lt 50 ]] && color='%F{red}' - echo -n "%{$color%}\uf230 $signal%{%f%}" # \uf230 is  -} - -POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="zsh_wifi_signal" -POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_wifi_signal) -``` -The command, above, gives you the wireless signal segment shown below: - -![signal](http://i.imgur.com/hviMATC.png) - -You can define as many custom segments as you wish. If you think you have -a segment that others would find useful, please consider upstreaming it to the -main theme distribution so that everyone can use it! - -##### context - -The `context` segment (user@host string) is conditional. By default, it will -only print if you are not your 'normal' user (including if you are root), or if -you are SSH'd to a remote host. `SUDO` and `REMOTE_SUDO` states are also available to show whether the current user or remote user has superuser privileges. - -To use this feature, make sure the `context` segment is enabled in your prompt -elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`. - -You can customize the `context` segment. For example, you can make it to print the -full hostname by setting - -``` -POWERLEVEL9K_CONTEXT_TEMPLATE="%n@`hostname -f`" -``` - -You can set the `POWERLEVEL9K_CONTEXT_HOST_DEPTH` variable to change how the -hostname is displayed. See [ZSH Manual](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information) -for details. The default is set to %m which will show the hostname up to the first ‘.’ -You can set it to %{N}m where N is an integer to show that many segments of system -hostname. Setting N to a negative integer will show that many segments from the -end of the hostname. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`DEFAULT_USER`|None|Username to consider a "default context" (you can also set `$USER`).| -|`POWERLEVEL9K_ALWAYS_SHOW_CONTEXT`|false|Always show this segment, including $USER and hostname.| -|`POWERLEVEL9K_ALWAYS_SHOW_USER`|false|Always show the username, but conditionalize the hostname.| -|`POWERLEVEL9K_CONTEXT_TEMPLATE`|%n@%m|Default context prompt (username@machine). Refer to the [ZSH Documentation](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) for all possible expansions, including deeper host depths.| - -This segment can have different states. They might help you to visualize your -different privileges. Read more about styling with states [here](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#special-segment-colors). - -| State | Meaning | -|---------------|----------------------------------------------------------| -| `DEFAULT` | You are a normal user | -| `ROOT` | You are the root user | -| `SUDO` | You are using elevated rights | -| `REMOTE_SUDO` | You are SSH'ed into the machine and have elevated rights | -| `REMOTE` | You are SSH'ed into the machine | - -##### date - -The `date` segment shows the current system date. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_DATE_FORMAT`|`%D{%d.%m.%y}`|[ZSH time format](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Date-and-time) to use in this segment.| - -##### dir - -The `dir` segment shows the current working directory. When using the "Awesome -Powerline" fonts, there are additional glyphs, as well: - -| `Compatible` | `Powerline` | `Awesome Powerline` | Situation -|------------|-----------|-------------------|---------------------------- -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | At the root of your home folder | -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within a subfolder of your home directory | -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of your home folder | -| None | None | ⚙ | Within the `/etc` directory | - -To turn off these icons you could set these variables to an empty string. -```zsh -POWERLEVEL9K_HOME_ICON='' -POWERLEVEL9K_HOME_SUB_ICON='' -POWERLEVEL9K_FOLDER_ICON='' -POWERLEVEL9K_ETC_ICON='' -``` -You can limit the output to a certain length by truncating long paths. -Customizations available are: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_DIR_PATH_ABSOLUTE`|None|If set to `true`, will use absolute paths instead of home folder abbreviation `~`| -|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is entire directories, this field determines how many directories to leave at the end. If your shorten strategy is by character count, this field determines how many characters to allow per directory string.| -|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be truncated. See the table below for more informations.| -|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.| - -| Strategy Name | Description | -|---------------|-------------| -|Default|Truncate whole directories from left. How many is defined by `POWERLEVEL9K_SHORTEN_DIR_LENGTH`| -|`truncate_absolute_chars`|Truncates an absolute number of characters from the left such that the number of characters that your path displays (with or without `POWERLEVEL9K_SHORTEN_DELIMITER`) is no more than `POWERLEVEL9K_SHORTEN_DIR_LENGTH` + the length of `POWERLEVEL9K_SHORTEN_DELIMITER` | -|`truncate_middle`|Truncates the middle part of a folder. E.g. you are in a folder named `~/MySuperProjects/AwesomeFiles/BoringOffice`, then it will truncated to `~/MyS..cts/Awe..les/BoringOffice`, if `POWERLEVEL9K_SHORTEN_DIR_LENGTH=3` is also set (controls the amount of characters to be left).| -|`truncate_from_right`|Just leaves the beginning of a folder name untouched. E.g. your folders will be truncated like so: "/ro../Pr../office". How many characters will be untouched is controlled by `POWERLEVEL9K_SHORTEN_DIR_LENGTH`.| -|`truncate_absolute`|Truncates everything exept the last few characters in the path. E.g. if you are in a folder named "~/Projects/powerlevel9k" and you have set `POWERLEVEL9K_SHORTEN_DIR_LENGTH=3`, you will get "..l9k".| -|`truncate_to_last`|Truncates everything before the last folder in the path.| -|`truncate_to_first_and_last|Truncate middle directories from the path. How many directories will be untouched is controlled by POWERLEVEL9K_SHORTER_DIR_LENGTH. E.g. if you are in a folder named "~/Projects/powerlevel9k" and you have set `POWERLEVEL9K_SHORTEN_DIR_LENGTH=1`, you will get "~/../powerlevel9k".|| -|`truncate_to_unique`|Parse all parent path components and truncate them to the shortest unique length. If you copy & paste the result to a shell, after hitting `TAB` it should expand to the original path unambiguously.| -|`truncate_with_package_name`|Search for a `package.json` or `composer.json` and prints the `name` field to abbreviate the directory path. The precedence and/or files could be set by `POWERLEVEL9K_DIR_PACKAGE_FILES=(package.json composer.json)`. If you have [jq](https://stedolan.github.io/jq/) installed, it will dramatically improve the speed of this strategy.| -|`truncate_with_folder_marker`|Search for a file that is specified by `POWERLEVEL9K_SHORTEN_FOLDER_MARKER` and truncate everything before that (if found, otherwise stop on $HOME and ROOT).| - -For example, if you wanted the truncation behavior of the `fish` shell, which -truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following: -```zsh -POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 -POWERLEVEL9K_SHORTEN_DELIMITER="" -POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" -``` -In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in -others whole directories. - -The `truncate_with_package_name` strategy gives your directory path relative to the root of your project. For example, if you have a project inside `$HOME/projects/my-project` with a `package.json` that looks like: - -```json -{ - "name": "my-cool-project" -} -``` - -The path shown would be `my-cool-project`. If you navigate to `$HOME/projects/my-project/src`, then the path shown would be `my-cool-project/src`. Please note that this currently looks for `.git` directory to determine the root of the project. - -If you want to customize the directory separator, you could set: -```zsh -# Double quotes are important here! -POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{red} $(print_icon 'LEFT_SUBSEGMENT_SEPARATOR') %F{black}" -``` -To omit the first character (usually a slash that gets replaced if you set `POWERLEVEL9K_DIR_PATH_SEPARATOR`), -you could set `POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true`. - -You can also customize the leading tilde character when you are in `$HOME` using: -```zsh -# Double quotes are important here! -POWERLEVEL9K_HOME_FOLDER_ABBREVIATION="%F{red} $(print_icon 'HOME_ICON') %F{black}" -``` -You can also configure the `dir` segment to show when you are in a directory without write permissions, using the variable below. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_DIR_SHOW_WRITABLE`|`false`|If set to `true` and you are in a directory that you do not have write permissions for, this segment will display a lock icon and enter the `NOT_WRITABLE` state (which can be customized per [our usual process](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#segment-color-customization)). Note that this functionality is also available in a separate segment, `dir_writable`.| - -If you want to customize the last directory of the path, you can now set `POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND` to a custom color and/or `POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true` to display that part in bold. - -You can also color the separator separately by setting the color using `POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND`. - -##### disk_usage - -The `disk_usage` segment will show the usage level of the partition that your current working directory resides in. It can be configured with the following variables. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|POWERLEVEL9K_DISK_USAGE_ONLY_WARNING|false|Hide the segment except when usage levels have hit warning or critical levels.| -|POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL|90|The usage level that triggers a warning state.| -|POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL|95|The usage level that triggers a critical state.| - -##### host - -The `host` segment will print the hostname. - -You can set the `POWERLEVEL9K_HOST_TEMPLATE` variable to change how the hostname -is displayed. See (ZSH Manual)[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information] -for details. The default is set to `%m` which will show the hostname up to the -first `.`. You can set it to `%{N}m` where N is an integer to show that many -segments of system hostname. Setting `N` to a negative integer will show that many -segments from the end of the hostname. - -``` -POWERLEVEL9K_HOST_TEMPLATE="%2m" -``` - -By default, LOCAL hosts will show the host icon and remote hosts will show the SSH icon. You can override them by setting -``` -POWERLEVEL9K_HOST_ICON="\uF109 " -POWERLEVEL9K_SSH_ICON="\uF489 " -``` - - -##### ip - -This segment tries to examine all currently used network interfaces and prints -the first address it finds. In the case that this is not the right NIC, you can -specify the correct network interface by setting: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_IP_INTERFACE`|None|The NIC for which you wish to display the IP address. Example: `eth0`.| - -##### vpn_ip - -This segment tries to extract the VPN related IP addresses from nmcli, based on the NIC type: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_VPN_IP_INTERFACE`|`tun`|The VPN interface.| - -##### public_ip - -This segment will display your public IP address. There are several methods of obtaining this -information and by default it will try all of them starting with the most efficient. You can -also specify which method you would like it to use. The methods available are dig using opendns, -curl, or wget. The host used for wget and curl is http://ident.me by default but can be set to -another host if you prefer. - -If you activate a VPN, the icon for this segment will change to the defined VPN icon. - -The public_ip segment will attempt to update your public IP address every 5 minutes by default(also -configurable by the user). If you lose connection your cached IP address will be displayed until -your timeout expires at which point every time your prompt is generated a new attempt will be made. -Until an IP is successfully pulled the value of $POWERLEVEL9K_PUBLIC_IP_NONE will be displayed for -this segment. If this value is empty(the default)and $POWERLEVEL9K_PUBLIC_IP_FILE is empty the -segment will not be displayed. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_PUBLIC_IP_FILE`|'/tmp/p9k_public_ip'|This is the file your public IP is cached in.| -|`POWERLEVEL9K_PUBLIC_IP_HOST`|'http://ident.me'|This is the default host to get your public IP.| -|`POWERLEVEL9K_PUBLIC_IP_TIMEOUT`|300|The amount of time in seconds between refreshing your cached IP.| -|`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.| -|`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained| - -##### load - -Displays one of your load averages with appropriate state coloring. The thresholds are: -- `0.7 * NUM_CORES <`: critical -- `0.5 * NUM_CORES <`: warning -- `less`: normal - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_LOAD_WHICH`|5|Which average to show. Possible values: 1, 5 or 15| - -##### newline - -Puts a newline in your prompt so you can continue using segments on the next -line. This allows you to use segments on both lines, unlike -`POWERLEVEL9K_PROMPT_ON_NEWLINE`, which simply separates segments from the -prompt itself. - -This only works on the left side. On the right side it does nothing. - -##### rbenv - -This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack. - -It figures out the version being used by taking the output of the `rbenv version-name` command. - -* If `rbenv` is not in $PATH, nothing will be shown. -* By default, if the current local Ruby version is the same as the global Ruby version, nothing will be shown. See the configuration variable, below, to modify this behavior. - -Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_RBENV_ALWAYS`|'false'|Always show the `rbenv` segment, even if the local version matches the global.| - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW`|`false`|Set to true if you wish to show the rbenv segment even if the current Ruby version is the same as the global Ruby version| - -##### pyenv - -This segment shows the version of Python being used when using `pyenv` to change your current Python stack. - -The `PYENV_VERSION` environment variable will be used if specified. Otherwise it figures out the version being used by taking the output of the `pyenv version-name` command. - -* If `pyenv` is not in $PATH, nothing will be shown. -* If the current Python version is the same as the global Python version, nothing will be shown. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW`|`false`|Set to true if you wish to show the pyenv segment even if the current Python version is the same as the global Python version| - -##### rspec_stats - -See [Unit Test Ratios](#unit-test-ratios), below. - -##### status - -This segment shows the return code of the last command. - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_STATUS_CROSS`|`false`|Set to true if you wish not to show the error code when the last command returned an error and optionally hide this segment when the last command completed successfully by setting `POWERLEVEL9K_STATUS_OK` to false.| -|`POWERLEVEL9K_STATUS_OK`|`true`|Set to true if you wish to show this segment when the last command completed successfully, false to hide it.| -|`POWERLEVEL9K_STATUS_SHOW_PIPESTATUS`|`true`|Set to true if you wish to show the exit status for all piped commands.| -|`POWERLEVEL9K_STATUS_HIDE_SIGNAME`|`false`|Set to true return the raw exit code (`1-255`). When set to false, values over 128 are shown as `SIGNAME(-n)` (e.g. `KILL(-9)`)| - -##### ram - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_RAM_ELEMENTS`|Both|Specify `ram_free` or `swap_used` to only show one or the other rather than both.| - -##### symfony2_tests - -See [Unit Test Ratios](#unit-test-ratios), below. - -##### time - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_TIME_FORMAT`|`'H:M:S'`|ZSH time format to use in this segment.| - -As an example, if you wanted a reversed time format, you would use this: -```zsh -# Reversed time format -POWERLEVEL9K_TIME_FORMAT='%D{%S:%M:%H}' -``` -If you are using an "Awesome Powerline Font", you can add a time symbol to this -segment, as well: -```zsh -# Output time, date, and a symbol from the "Awesome Powerline Font" set -POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S \uE868 %d.%m.%y}" -``` -##### user - -The `user` segment will print the username. - -You can also override the icons by setting: - -``` -POWERLEVEL9K_USER_ICON="\uF415" #  -POWERLEVEL9K_ROOT_ICON="#" -POWERLEVEL9K_SUDO_ICON=$'\uF09C' #  -``` - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`DEFAULT_USER`|None|Username to consider a "default context".| -|`POWERLEVEL9K_ALWAYS_SHOW_USER`|`false`|Always print this segment.| -|`POWERLEVEL9K_USER_TEMPLATE`|`%n`|Default username prompt. Refer to the [ZSH Documentation](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) for all possible expansions| - -##### vcs - -By default, the `vcs` segment will provide quite a bit of information. Further -customization is provided via: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_HIDE_BRANCH_ICON`|`false`|Set to `true` to hide the branch icon from the segment.| -|`POWERLEVEL9K_SHOW_CHANGESET`|`false`|Set to `true` to display the hash / changeset in the segment.| -|`POWERLEVEL9K_CHANGESET_HASH_LENGTH`|`12`|How many characters of the hash / changeset to display in the segment.| -|`POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY`|`true`|Set to `false` to not reflect submodule status in the top-level repository prompt.| -|`POWERLEVEL9K_VCS_HIDE_TAGS`|`false`|Set to `true` to stop tags being displayed in the segment.| -|`POWERLEVEL9K_VCS_GIT_HOOKS`|`(vcs-detect-changes git-untracked git-aheadbehind git-stash git-remotebranch git-tagname)`|Layout of the segment for git repositories.| -|`POWERLEVEL9K_VCS_HG_HOOKS`|`(vcs-detect-changes)`|Layout of the segment for Mercurial repositories.| -|`POWERLEVEL9K_VCS_SVN_HOOKS`|`(vcs-detect-changes svn-detect-changes)`|Layout of the segment for SVN repositories.| -|`POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND`|`red`|The color of the foreground font during actions (e.g., `REBASE`).| - - -##### vcs symbols - -The `vcs` segment uses various symbols to tell you the state of your repository. -These symbols depend on your installed font and selected `POWERLEVEL9K_MODE` -from the [Installation](#Installation) section above. - -| `Compatible` | `Powerline` | `Awesome Powerline` | Explanation -|--------------|---------------------|-------------------|-------------------------- -| `↑4` | `↑4` | ![icon_outgoing](https://cloud.githubusercontent.com/assets/1544760/7976089/b5904d6e-0a76-11e5-8147-5e873ac52d79.gif)4 | Number of commits your repository is ahead of your remote branch -| `↓5` | `↓5` | ![icon_incoming](https://cloud.githubusercontent.com/assets/1544760/7976091/b5909c9c-0a76-11e5-9cad-9bf0a28a897c.gif)5 | Number of commits your repository is behind of your remote branch -| `⍟3` | `⍟3` | ![icon_stash](https://cloud.githubusercontent.com/assets/1544760/7976094/b5ae9346-0a76-11e5-8cc7-e98b81824118.gif)3 | Number of stashes, here 3. -| `●` | `●` | ![icon_unstaged](https://cloud.githubusercontent.com/assets/1544760/7976096/b5aefa98-0a76-11e5-9408-985440471215.gif) | There are unstaged changes in your working copy -| `✚` | `✚` | ![icon_staged](https://cloud.githubusercontent.com/assets/1544760/7976095/b5aecc8a-0a76-11e5-8988-221afc6e8982.gif) | There are staged changes in your working copy -| `?` | `?` | ![icon_untracked](https://cloud.githubusercontent.com/assets/1544760/7976098/b5c7a2e6-0a76-11e5-8c5b-315b595b2bc4.gif) | There are files in your working copy, that are unknown to your repository -| `→` | `→` | ![icon_remote_tracking_branch](https://cloud.githubusercontent.com/assets/1544760/7976093/b5ad2c0e-0a76-11e5-9cd3-62a077b1b0c7.gif) | The name of your branch differs from its tracking branch. -| `☿` | `☿` | ![icon_bookmark](https://cloud.githubusercontent.com/assets/1544760/7976197/546cfac6-0a78-11e5-88a6-ce3a1e0a174e.gif) | A mercurial bookmark is active. -| `@` | ![icon_branch_powerline](https://cloud.githubusercontent.com/assets/1544760/8000852/e7e8d8a0-0b5f-11e5-9834-de9b25c92284.gif) | ![](https://cloud.githubusercontent.com/assets/1544760/7976087/b58bbe3e-0a76-11e5-8d0d-7a5c1bc7f730.gif) | Branch Icon -| None | None | ![icon_commit](https://cloud.githubusercontent.com/assets/1544760/7976088/b58f4e50-0a76-11e5-9e70-86450d937030.gif)2c3705 | The current commit hash. Here "2c3705" -| None | None | ![icon_git](https://cloud.githubusercontent.com/assets/1544760/7976092/b5909f80-0a76-11e5-9950-1438b9d72465.gif) | Repository is a git repository -| None | None | ![icon_mercurial](https://cloud.githubusercontent.com/assets/1544760/7976090/b5908da6-0a76-11e5-8c91-452b6e73f631.gif) | Repository is a Mercurial repository - -##### vcs truncation - -You can limit the branch name to a certain length by truncating long names. -Customizations available are: - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_VCS_SHORTEN_LENGTH`|None|This field determines how many characters to show.| -|`POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH`|None|This field determines minimum branch length. Branch name will be truncated if its length greater than this field.| -|`POWERLEVEL9K_VCS_SHORTEN_STRATEGY`|None|This field determines how branch name should be truncated. See the table below for more information.| -|`POWERLEVEL9K_SHORTEN_DELIMITER`|`...`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.| - -| Strategy Name | Description | -|---------------|-------------| -|`truncate_middle`|Truncates the middle part of a branch. E.g. branch name is `1234-super_super_long_branch_name`, then it will truncated to `1234-..._name`, if `POWERLEVEL9K_VCS_SHORTEN_LENGTH=5` is also set (controls the amount of characters to be left).| -|`truncate_from_right`|Just leaves the beginning of a branch name untouched. E.g. branch name will be truncated like so: `1234-...`. How many characters will be untouched is controlled by `POWERLEVEL9K_VCS_SHORTEN_LENGTH`.| - -For example, if you want to truncate `1234-super_super_long_branch_name` to `1234-..` and don't do it with `development`: -```zsh -POWERLEVEL9K_VCS_SHORTEN_LENGTH=4 -POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH=11 -POWERLEVEL9K_VCS_SHORTEN_STRATEGY="truncate_from_right" -POWERLEVEL9K_VCS_SHORTEN_DELIMITER=".." -``` - -##### vi_mode - -This segment shows ZSH's current input mode. Note that this is only useful if -you are using the [ZSH Line Editor](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html) -(VI mode). You can enable this either by `.zshrc` configuration or using a plugin, like -[Oh-My-Zsh's vi-mode plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh). - -| Variable | Default Value | Description | -|----------|---------------|-------------| -|`POWERLEVEL9K_VI_INSERT_MODE_STRING`|`"INSERT"`|String to display while in 'Insert' mode.| -|`POWERLEVEL9K_VI_COMMAND_MODE_STRING`|`"NORMAL"`|String to display while in 'Command' mode.| - -To hide the segment entirely when in `INSERT` mode, set `POWERLEVEL9K_VI_INSERT_MODE_STRING=''` - -#### Unit Test Ratios - -The `symfony2_tests` and `rspec_stats` segments both show a ratio of "real" -classes vs test classes in your source code. This is just a very simple ratio, -and does not show your code coverage or any sophisticated stats. All this does -is count your source files and test files, and calculate the ratio between them. -Just enough to give you a quick overview about the test situation of the project -you are dealing with. - -### Disabling / Enabling Powerlevel9k - -You can disable P9k and return to a very basic prompt at any time simply by -calling: - -```zsh -$ prompt_powerlevel9k_teardown -``` - -You can then re-enable it by calling: - -```zsh -$ prompt_powerlevel9k_setup -``` - -### tl; dr - -Want to just get a quick start? Check out the [Show Off Your -Config](https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config) -portion of the wiki to get going. - -[The Wiki also has a ton of other useful -information!](https://github.com/bhilburn/powerlevel9k/wiki) - -### License - -Project: MIT - -Logo: CC-BY-SA. Source repository: https://github.com/bhilburn/powerlevel9k-logo diff --git a/.zprezto/modules/prompt/external/powerlevel9k/TESTS.md b/.zprezto/modules/prompt/external/powerlevel9k/TESTS.md deleted file mode 100644 index b57c4d6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/TESTS.md +++ /dev/null @@ -1,69 +0,0 @@ -# Tests - -## Automated Tests - -The Unit-Tests do not follow exactly the file structure of Powerlevel9k itself, -but we try to reflect the structure as much as possible. All tests are located -under `test/`. Segment specific tests under `test/segments/` (one file per -segment). - -### Installation - -In order to execute the tests you need to install `shunit2`, which is a -submodule. To install the submodule, you can execute -`git submodule init && git submodule update`. - -### Executing tests - -The tests are shell scripts on their own. So you can execute them right away. -To execute all tests you could just execute `./test/suite.spec`. - -### General Test Structure - -The tests usually have a `setUp()` function which is executed before every -test function. Speaking of, test functions must be prefixed with `test`. In -the tests, you can do [different Assertions](https://github.com/kward/shunit2#-asserts). -It is always a good idea to mock the program you want to test (just have a -look at other tests), so that the testrunner does not have to have all -programs installed. - -### Travis - -We use [Travis](https://travis-ci.org/) for Continuous Integration. This -service executes our tests after every push. For now, we need to tell travis -where to find the tests, which is what happens in the `.travis.yml` file. - -## Manual Testing - -If unit tests are not sufficient (e.g. you have an issue with your prompt that -occurs only in a specific ZSH framework) then you can use either Docker or -or our Vagrant. - -### Docker - -This is the easiest to use _if_ you have Docker already installed and running. - -The command `./test-in-docker` should make it fairly easy to get into a running -container with the framework of your choice. - -Examples: - -``` zsh -# Test Antigen with the oldest version of ZSH -$ ./test-in-docker antigen -``` - -``` zsh -# Test Prezto with ZSH version 5.2 -$ ./test-in-docker --zsh 5.2 prezto -``` - -You can get Docker at . - -**Note:** Not all frameworks work with all versions of ZSH (or the underlying OS). - -### Vagrant - -Currently there are two test VMs. `test-vm` is an Ubuntu machine with several -pre-installed ZSH frameworks. And there is `test-bsd-vm` which is a FreeBSD! -For how to run the machines see [here](test-vm/README.md). diff --git a/.zprezto/modules/prompt/external/powerlevel9k/debug/font-issues.zsh b/.zprezto/modules/prompt/external/powerlevel9k/debug/font-issues.zsh deleted file mode 100755 index 82f8e60..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/debug/font-issues.zsh +++ /dev/null @@ -1,423 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -source functions/colors.zsh -source functions/icons.zsh -source functions/utilities.zsh -# Map our $OS to neofetch $os -os="$OS" - - -trim() { - set -f - # shellcheck disable=2048,2086 - set -- $* - printf '%s\n' "${*//[[:space:]]/}" - set +f -} - -get_ppid() { - # Get parent process ID of PID. - case "$os" in - "Windows") - ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')" - ppid="${ppid/PPID}" - ;; - - "Linux") - ppid="$(grep -i -F "PPid:" "/proc/${1:-$PPID}/status")" - ppid="$(trim "${ppid/PPid:}")" - ;; - - *) - ppid="$(ps -p "${1:-$PPID}" -o ppid=)" - ;; - esac - - printf "%s" "$ppid" -} - -get_process_name() { - # Get PID name. - case "$os" in - "Windows") - name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')" - name="${name/COMMAND}" - name="${name/*\/}" - ;; - - "Linux") - name="$(< "/proc/${1:-$PPID}/comm")" - ;; - - *) - name="$(ps -p "${1:-$PPID}" -o comm=)" - ;; - esac - - printf "%s" "$name" -} - -# Taken from NeoFetch (slightly modified) -get_term() { - local term - - # If function was run, stop here. - # ((term_run == 1)) && return - - # Workaround for macOS systems that - # don't support the block below. - case "$TERM_PROGRAM" in - "iTerm.app") term="iTerm2" ;; - "Terminal.app") term="Apple Terminal" ;; - "Hyper") term="HyperTerm" ;; - *) term="${TERM_PROGRAM/\.app}" ;; - esac - - # Most likely TosWin2 on FreeMiNT - quick check - [[ "$TERM" == "tw52" || "$TERM" == "tw100" ]] && \ - term="TosWin2" - - [[ "$SSH_CONNECTION" ]] && \ - term="$SSH_TTY" - - # Check $PPID for terminal emulator. - while [[ -z "$term" ]]; do - parent="$(get_ppid "$parent")" - [[ -z "$parent" ]] && break - name="$(get_process_name "$parent")" - - case "${name// }" in - "${SHELL/*\/}"|*"sh"|"screen"|"su"*) ;; - - "login"*|*"Login"*|"init"|"(init)") - term="$(tty)" - ;; - - "ruby"|"1"|"tmux"*|"systemd"|"sshd"*|"python"*|"USER"*"PID"*|"kdeinit"*|"launchd"*) - break - ;; - - "gnome-terminal-") term="gnome-terminal" ;; - "urxvtd") term="urxvt" ;; - *"nvim") term="Neovim Terminal" ;; - *"NeoVimServer"*) term="VimR Terminal" ;; - *) term="${name##*/}" ;; - esac - done - - # Log that the function was run. - # term_run=1 - - echo "${term}" -} - -get_term_font() { - local term="${1}" - # ((term_run != 1)) && get_term - - case "$term" in - "alacritty"*) - shopt -s nullglob - confs=({$XDG_CONFIG_HOME,$HOME}/{alacritty,}/{.,}alacritty.ym?) - shopt -u nullglob - - [[ -f "${confs[0]}" ]] || return - - term_font="$(awk -F ':|#' '/normal:/ {getline; print}' "${confs[0]}")" - term_font="${term_font/*family:}" - term_font="${term_font/$'\n'*}" - term_font="${term_font/\#*}" - ;; - - "Apple_Terminal") - term_font="$(osascript </dev/null | grep -c "Guid") -for idx in $(seq 0 "${profilesCount}"); do - local profileName=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Name:" ~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null) - if [[ "${profileName}" == "${currentProfileName}" ]]; then - # "Normal Font" - normalFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Normal\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - type=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Terminal\ Type:" ~/Library/Preferences/com.googlecode.iterm2.plist) - command=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Command:" ~/Library/Preferences/com.googlecode.iterm2.plist) - ambiguousDoubleWidth=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Ambiguous\ Double\ Width:" ~/Library/Preferences/com.googlecode.iterm2.plist) - minimumContrast=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Minimum\ Contrast:" ~/Library/Preferences/com.googlecode.iterm2.plist) - - # Font for non-ascii characters - # Only check for a different non-ASCII font, if the user checked - # the "use a different font for non-ascii text" switch. - useDifferentFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Use\ Non-ASCII\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - if [[ "$useDifferentFont" == "true" ]]; then - nonAsciiFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Non\ Ascii\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - if [[ "$normalFont" != "$nonAsciiFont" ]]; then - normalFont="$normalFont (normal) / $nonAsciiFont (non-ascii)" - fi - fi - break - fi -done - -print -P "You use %F{blue}iTerm2%f with the following settings:" -print -P " Font: ${normalFont}" -print -P " Terminal-Type: ${type}" -print -P " Command: ${command}" - -############################# -# Analyse possible problems # -############################# -local problemsFound -if [[ "${ambiguousDoubleWidth}" == "true" ]]; then - problemsFound="${problemsFound}\n * Please uncheck 'Treat ambiguous characters as double-width'." -fi -if (( minimumContrast > 0 )); then - problemsFound="${problemsFound}\n * Please set minimum contrast to zero." -fi -if [[ $(echo "${normalFont}" | grep -c -E "Powerline|Awesome|Nerd|Source Code Pro") -eq 0 ]]; then - problemsFound="${problemsFound}\n * It does not seem like you use an Powerline-enabled or Awesome Terminal Font!" -fi - -############################# -# Output problems # -############################# -if [[ -n "${problemsFound}" ]]; then - print -P "\n" - print -P "%F{yellow}Possible Problems found:%f" - print -P "${problemsFound}" -else - print -P "%F{green}No Problems found%f. Yay!" -fi diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/Dockerfile deleted file mode 100644 index 84a60a8..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/antibody/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/antibody/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/install.zsh deleted file mode 100644 index 4c54fa6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/install.zsh +++ /dev/null @@ -1 +0,0 @@ -curl -sL https://git.io/antibody | bash -s diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/zshrc deleted file mode 100644 index d516b67..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antibody/zshrc +++ /dev/null @@ -1,2 +0,0 @@ -source <(antibody init) -antibody bundle ~/p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/Dockerfile deleted file mode 100644 index d8d0a4b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/antigen/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/antigen/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/install.zsh deleted file mode 100644 index 6bab8ab..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/install.zsh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/zsh - -mkdir ~/antigen - -curl \ - -qLsSf \ - -o ~/antigen/antigen.zsh \ - https://git.io/antigen - -source ~/antigen/antigen.zsh - -# EOF diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/zshrc deleted file mode 100644 index 0f8d4da..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/antigen/zshrc +++ /dev/null @@ -1,4 +0,0 @@ -source ~/antigen/antigen.zsh - -antigen theme "${HOME}/p9k" powerlevel9k --no-local-clone -antigen apply diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-4.3.11/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-4.3.11/Dockerfile deleted file mode 100644 index 805a7ae..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-4.3.11/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM centos:6 - -RUN \ - yum install -y \ - curl \ - git \ - zsh \ - mercurial \ - subversion \ - golang \ - jq \ - node \ - ruby \ - python \ - python-virtualenv \ - sudo - -RUN adduser --shell /bin/zsh --comment 'fred' --user-group fred - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.0.3/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.0.3/Dockerfile deleted file mode 100644 index b1b85fc..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.0.3/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM ubuntu:14.04 - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.0.2-3ubuntu6.2 \ - mercurial \ - subversion \ - golang \ - jq \ - node \ - ruby \ - python \ - python-virtualenv - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.1.1/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.1.1/Dockerfile deleted file mode 100644 index c4fb642..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.1.1/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:16.04 - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.1.1-1ubuntu2.2 \ - mercurial \ - subversion \ - golang \ - jq \ - nodejs \ - ruby \ - python \ - python-virtualenv \ - sudo \ - locales - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.2/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.2/Dockerfile deleted file mode 100644 index 2ec096f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.2/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:17.10 - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.2-5ubuntu1.2 \ - mercurial \ - subversion \ - golang \ - jq \ - nodejs \ - ruby \ - python \ - python-virtualenv \ - sudo \ - locales - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.3.1/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.3.1/Dockerfile deleted file mode 100644 index 0294cf2..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.3.1/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM debian:stretch - -# We switched here to debian, as there seems no ZSH 5.3 in ubuntu. - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.3.1-4+b2 \ - mercurial \ - subversion \ - golang \ - jq \ - nodejs \ - ruby \ - python \ - python-virtualenv \ - sudo \ - locales - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -# Locale generation is different in debian. We need to enable en_US -# locale and then regenerate locales. -RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.4.2/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.4.2/Dockerfile deleted file mode 100644 index 8984c10..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.4.2/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:18.04 - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.4.2-3ubuntu3 \ - mercurial \ - subversion \ - golang \ - jq \ - nodejs \ - ruby \ - python \ - python-virtualenv \ - sudo \ - locales - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.5.1/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.5.1/Dockerfile deleted file mode 100644 index 85fc570..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/base-5.5.1/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:18.10 - -RUN \ - apt-get update && \ - echo 'golang-go golang-go/dashboard boolean false' | debconf-set-selections && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - curl \ - git \ - zsh=5.5.1-1ubuntu1 \ - mercurial \ - subversion \ - golang \ - jq \ - nodejs \ - ruby \ - python \ - python-virtualenv \ - sudo \ - locales - -RUN adduser --shell /bin/zsh --gecos 'fred' --disabled-password fred -RUN locale-gen "en_US.UTF-8" - -COPY docker/fred-sudoers /etc/sudoers.d/fred - -USER fred -WORKDIR /home/fred -ENV LANG=en_US.UTF-8 -ENV TERM=xterm-256color -ENV DEFAULT_USER=fred -ENV POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - -RUN touch .zshrc - -CMD ["/bin/zsh", "-l"] diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/Dockerfile deleted file mode 100644 index f29c4d5..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY ./ p9k/ -COPY docker/dotfile/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/zshrc deleted file mode 100644 index 382b84a..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/dotfile/zshrc +++ /dev/null @@ -1 +0,0 @@ -source "${HOME}/p9k/prompt_powerlevel9k_setup" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/fred-sudoers b/.zprezto/modules/prompt/external/powerlevel9k/docker/fred-sudoers deleted file mode 100644 index 5fcd646..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/fred-sudoers +++ /dev/null @@ -1,2 +0,0 @@ -Defaults:fred !requiretty -fred ALL=(ALL) NOPASSWD: ALL diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/Dockerfile deleted file mode 100644 index 1a417b9..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/omz/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY docker/omz/zshrc .zshrc -COPY ./ p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/install.zsh deleted file mode 100644 index e2cdfa9..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/install.zsh +++ /dev/null @@ -1,4 +0,0 @@ -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - -mkdir -p ~/.oh-my-zsh/custom/themes -ln -nsf ~/p9k/ ~/.oh-my-zsh/custom/themes/powerlevel9k diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/zshrc deleted file mode 100644 index 9e798e2..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/omz/zshrc +++ /dev/null @@ -1,5 +0,0 @@ -export ZSH=$HOME/.oh-my-zsh -ZSH_THEME="powerlevel9k/powerlevel9k" -plugins=(git rake ruby) - -source $ZSH/oh-my-zsh.sh diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/Dockerfile deleted file mode 100644 index 70f3b65..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/prezto/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/install.zsh deleted file mode 100644 index 2b2e878..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/prezto/install.zsh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/zsh - -set -eu - -git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" - -setopt EXTENDED_GLOB -for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - ln -nsf "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" -done - -ln -snf "${HOME}/p9k/powerlevel9k.zsh-theme" \ - "${HOME}/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup" - -echo "zstyle ':prezto:module:prompt' theme 'powerlevel9k'" \ - >> "${HOME}/.zpreztorc" - -# EOF diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/Dockerfile deleted file mode 100644 index 48e44c7..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zgen/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/zgen/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/install.zsh deleted file mode 100644 index 5cdc618..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/install.zsh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/zsh - -git clone https://github.com/tarjoilija/zgen.git "${HOME}/.zgen" - -# EOF diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/zshrc deleted file mode 100644 index 1fcb75b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zgen/zshrc +++ /dev/null @@ -1,10 +0,0 @@ -# load zgen -source ~/.zgen/zgen.zsh - -# if the init scipt doesn't exist -if ! zgen saved; then - zgen load ~/p9k/powerlevel9k.zsh-theme - - # generate the init script from plugins above - zgen save -fi diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/Dockerfile deleted file mode 100644 index cfe0fc9..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zim/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/install.zsh deleted file mode 100644 index d6c6006..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zim/install.zsh +++ /dev/null @@ -1,21 +0,0 @@ -#!zsh - -git clone --recursive https://github.com/Eriner/zim.git "${ZDOTDIR:-${HOME}}/.zim" - -setopt EXTENDED_GLOB -for template_file ( ${ZDOTDIR:-${HOME}}/.zim/templates/* ); do - user_file="${ZDOTDIR:-${HOME}}/.${template_file:t}" - touch ${user_file} - ( print -rn "$(<${template_file})$(<${user_file})" >! ${user_file} ) 2>/dev/null -done - -source "${ZDOTDIR:-${HOME}}/.zlogin" - -ln -nsf \ - ~/p9k/ \ - ~/.zim/modules/prompt/external-themes/powerlevel9k -ln -nsf \ - ~/.zim/modules/prompt/external-themes/powerlevel9k/powerlevel9k.zsh-theme \ - ~/.zim/modules/prompt/functions/prompt_powerlevel9k_setup - -sed -i "s/zprompt_theme='steeef'/zprompt_theme='powerlevel9k'/g" ~/.zimrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/Dockerfile deleted file mode 100644 index 89c23d5..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zplug/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/zplug/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/install.zsh deleted file mode 100644 index b01ff6e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/install.zsh +++ /dev/null @@ -1,5 +0,0 @@ -#!zsh - -curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh| zsh - -# git clone https://github.com/zplug/zplug "${HOME}/.zplug" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/zshrc deleted file mode 100644 index 0a4ceb8..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplug/zshrc +++ /dev/null @@ -1,5 +0,0 @@ -#!zsh - -source ~/.zplug/init.zsh -zplug "${HOME}/p9k", use:"powerlevel9k.zsh-theme", from:local, as:theme -zplug load --verbose diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/Dockerfile deleted file mode 100644 index 90c35c0..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zplugin/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/zplugin/zshrc.plugins .zshrc.plugins diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/install.zsh deleted file mode 100644 index fec4249..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/install.zsh +++ /dev/null @@ -1,12 +0,0 @@ -sh -c "$(curl -fsSL https://raw.githubusercontent.com/psprint/zplugin/master/doc/install.sh)" - -# The 'zplugin snippet' only copies the .zsh-theme file, not everything else. -mkdir -p ~/.zplugin/snippets -ln -nsf \ - ~/p9k/ \ -~/.zplugin/snippets/--SLASH--home--SLASH--fred--SLASH--p9k--SLASH--powerlevel9k--DOT--zsh-theme - -{ - echo - echo "source ~/.zshrc.plugins" -} >> ~/.zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/zshrc.plugins b/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/zshrc.plugins deleted file mode 100644 index 2e9ba7a..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zplugin/zshrc.plugins +++ /dev/null @@ -1,5 +0,0 @@ -#!zsh - -zplugin load psprint zsh-navigation-tools -zplugin load psprint---zprompts -zplugin snippet ~/p9k/powerlevel9k.zsh-theme diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/Dockerfile deleted file mode 100644 index c1c44e3..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zpm/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ -COPY docker/zpm/zshrc .zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/install.zsh deleted file mode 100644 index 6f74e8e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/install.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# install zpm -git clone --recursive https://github.com/zpm-zsh/zpm.git ~/.zpm - -# Install powerlevel9k -mkdir ~/.zpm/plugins/powerlevel9k -ln -s ~/p9k/powerlevel9k.zsh-theme ~/.zpm/plugins/powerlevel9k/powerlevel9k.plugin.zsh diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/zshrc b/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/zshrc deleted file mode 100644 index b107976..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zpm/zshrc +++ /dev/null @@ -1,3 +0,0 @@ -source ~/.zpm/zpm.zsh - -zpm load powerlevel9k diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/Dockerfile deleted file mode 100644 index a51a306..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zshing/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/install.zsh deleted file mode 100644 index 8f92699..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zshing/install.zsh +++ /dev/null @@ -1,16 +0,0 @@ -#!zsh - -# install zshing https://github.com/zakariaGatter/zshing -git clone https://github.com/zakariaGatter/zshing.git ~/.zshing/zshing - -# Link P9K in zshing directory -ln -nsf ~/p9k ~/.zshing/powerlevel9k - -{ - echo - echo 'ZSHING_PLUGINS=( - "bhilburn/powerlevel9k" - )' - echo - echo "source ~/.zshing/zshing/zshing.zsh" -} >> ~/.zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/Dockerfile b/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/Dockerfile deleted file mode 100644 index 880a07d..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG base -FROM p9k:${base} - -COPY docker/zulu/install.zsh /tmp/ -RUN zsh /tmp/install.zsh - -COPY ./ p9k/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/install.zsh b/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/install.zsh deleted file mode 100644 index 0ad6aae..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/docker/zulu/install.zsh +++ /dev/null @@ -1,10 +0,0 @@ -#!zsh - -# install zulu https://github.com/zulu-zsh/zulu -curl -L https://git.io/zulu-install | zsh && zsh - -{ -echo 'zulu fpath add ~/p9k' -echo 'zulu fpath add ~/p9k/functions' -echo 'zulu theme powerlevel9k' -} >> ~/.zshrc diff --git a/.zprezto/modules/prompt/external/powerlevel9k/functions/colors.zsh b/.zprezto/modules/prompt/external/powerlevel9k/functions/colors.zsh deleted file mode 100755 index 80abb6b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/functions/colors.zsh +++ /dev/null @@ -1,358 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 -################################################################ -# Color functions -# This file holds some color-functions for -# the powerlevel9k-ZSH-theme -# https://github.com/bhilburn/powerlevel9k -################################################################ - -typeset -gAh __P9K_COLORS -# https://jonasjacek.github.io/colors/ -# use color names by default to allow dark/light themes to adjust colors based on names -__P9K_COLORS=( - black 000 - red 001 - green 002 - yellow 003 - blue 004 - magenta 005 - cyan 006 - white 007 - grey 008 - maroon 009 - lime 010 - olive 011 - navy 012 - fuchsia 013 - purple 013 - aqua 014 - teal 014 - silver 015 - grey0 016 - navyblue 017 - darkblue 018 - blue3 019 - blue3 020 - blue1 021 - darkgreen 022 - deepskyblue4 023 - deepskyblue4 024 - deepskyblue4 025 - dodgerblue3 026 - dodgerblue2 027 - green4 028 - springgreen4 029 - turquoise4 030 - deepskyblue3 031 - deepskyblue3 032 - dodgerblue1 033 - green3 034 - springgreen3 035 - darkcyan 036 - lightseagreen 037 - deepskyblue2 038 - deepskyblue1 039 - green3 040 - springgreen3 041 - springgreen2 042 - cyan3 043 - darkturquoise 044 - turquoise2 045 - green1 046 - springgreen2 047 - springgreen1 048 - mediumspringgreen 049 - cyan2 050 - cyan1 051 - darkred 052 - deeppink4 053 - purple4 054 - purple4 055 - purple3 056 - blueviolet 057 - orange4 058 - grey37 059 - mediumpurple4 060 - slateblue3 061 - slateblue3 062 - royalblue1 063 - chartreuse4 064 - darkseagreen4 065 - paleturquoise4 066 - steelblue 067 - steelblue3 068 - cornflowerblue 069 - chartreuse3 070 - darkseagreen4 071 - cadetblue 072 - cadetblue 073 - skyblue3 074 - steelblue1 075 - chartreuse3 076 - palegreen3 077 - seagreen3 078 - aquamarine3 079 - mediumturquoise 080 - steelblue1 081 - chartreuse2 082 - seagreen2 083 - seagreen1 084 - seagreen1 085 - aquamarine1 086 - darkslategray2 087 - darkred 088 - deeppink4 089 - darkmagenta 090 - darkmagenta 091 - darkviolet 092 - purple 093 - orange4 094 - lightpink4 095 - plum4 096 - mediumpurple3 097 - mediumpurple3 098 - slateblue1 099 - yellow4 100 - wheat4 101 - grey53 102 - lightslategrey 103 - mediumpurple 104 - lightslateblue 105 - yellow4 106 - darkolivegreen3 107 - darkseagreen 108 - lightskyblue3 109 - lightskyblue3 110 - skyblue2 111 - chartreuse2 112 - darkolivegreen3 113 - palegreen3 114 - darkseagreen3 115 - darkslategray3 116 - skyblue1 117 - chartreuse1 118 - lightgreen 119 - lightgreen 120 - palegreen1 121 - aquamarine1 122 - darkslategray1 123 - red3 124 - deeppink4 125 - mediumvioletred 126 - magenta3 127 - darkviolet 128 - purple 129 - darkorange3 130 - indianred 131 - hotpink3 132 - mediumorchid3 133 - mediumorchid 134 - mediumpurple2 135 - darkgoldenrod 136 - lightsalmon3 137 - rosybrown 138 - grey63 139 - mediumpurple2 140 - mediumpurple1 141 - gold3 142 - darkkhaki 143 - navajowhite3 144 - grey69 145 - lightsteelblue3 146 - lightsteelblue 147 - yellow3 148 - darkolivegreen3 149 - darkseagreen3 150 - darkseagreen2 151 - lightcyan3 152 - lightskyblue1 153 - greenyellow 154 - darkolivegreen2 155 - palegreen1 156 - darkseagreen2 157 - darkseagreen1 158 - paleturquoise1 159 - red3 160 - deeppink3 161 - deeppink3 162 - magenta3 163 - magenta3 164 - magenta2 165 - darkorange3 166 - indianred 167 - hotpink3 168 - hotpink2 169 - orchid 170 - mediumorchid1 171 - orange3 172 - lightsalmon3 173 - lightpink3 174 - pink3 175 - plum3 176 - violet 177 - gold3 178 - lightgoldenrod3 179 - tan 180 - mistyrose3 181 - thistle3 182 - plum2 183 - yellow3 184 - khaki3 185 - lightgoldenrod2 186 - lightyellow3 187 - grey84 188 - lightsteelblue1 189 - yellow2 190 - darkolivegreen1 191 - darkolivegreen1 192 - darkseagreen1 193 - honeydew2 194 - lightcyan1 195 - red1 196 - deeppink2 197 - deeppink1 198 - deeppink1 199 - magenta2 200 - magenta1 201 - orangered1 202 - indianred1 203 - indianred1 204 - hotpink 205 - hotpink 206 - mediumorchid1 207 - darkorange 208 - salmon1 209 - lightcoral 210 - palevioletred1 211 - orchid2 212 - orchid1 213 - orange1 214 - sandybrown 215 - lightsalmon1 216 - lightpink1 217 - pink1 218 - plum1 219 - gold1 220 - lightgoldenrod2 221 - lightgoldenrod2 222 - navajowhite1 223 - mistyrose1 224 - thistle1 225 - yellow1 226 - lightgoldenrod1 227 - khaki1 228 - wheat1 229 - cornsilk1 230 - grey100 231 - grey3 232 - grey7 233 - grey11 234 - grey15 235 - grey19 236 - grey23 237 - grey27 238 - grey30 239 - grey35 240 - grey39 241 - grey42 242 - grey46 243 - grey50 244 - grey54 245 - grey58 246 - grey62 247 - grey66 248 - grey70 249 - grey74 250 - grey78 251 - grey82 252 - grey85 253 - grey89 254 - grey93 255 -) - -function termColors() { - if [[ $POWERLEVEL9K_IGNORE_TERM_COLORS == true ]]; then - return - fi - - local term_colors - - if which tput &>/dev/null; then - term_colors=$(tput colors) - else - term_colors=$(echotc Co) - fi - if (( ! $? && ${term_colors:-0} < 256 )); then - print -P "%F{red}WARNING!%f Your terminal appears to support fewer than 256 colors!" - print -P "If your terminal supports 256 colors, please export the appropriate environment variable" - print -P "_before_ loading this theme in your \~\/.zshrc. In most terminal emulators, putting" - print -P "%F{blue}export TERM=\"xterm-256color\"%f at the top of your \~\/.zshrc is sufficient." - fi -} - -# get the proper color code if it does not exist as a name. -function getColor() { - # If Color is not numerical, try to get the color code. - if [[ "$1" != <-> ]]; then - 1=$(getColorCode $1) - fi - echo -n "$1" -} - -# empty paramenter resets (stops) background color -function backgroundColor() { - echo -n "%K{$(getColor $1)}" -} - -# empty paramenter resets (stops) foreground color -function foregroundColor() { - echo -n "%F{$(getColor $1)}" -} - -# Get numerical color codes. That way we translate ANSI codes -# into ZSH-Style color codes. -function getColorCode() { - # Early exit: Check if given value is already numerical - if [[ "$1" == <-> ]]; then - # Pad color with zeroes - echo -n "${(l:3::0:)1}" - return - fi - - local colorName="${1}" - # Check if value is none with any case. - if [[ "${(L)colorName}" == "none" ]]; then - echo -n 'none' - elif [[ "${colorName}" == "foreground" ]]; then - # for testing purposes in terminal - # call via `getColorCode foreground` - for i in "${(k@)__P9K_COLORS}"; do - print -P "$(foregroundColor $i)$(getColor $i) - $i%f" - done - elif [[ "${colorName}" == "background" ]]; then - # call via `getColorCode background` - for i in "${(k@)__P9K_COLORS}"; do - print -P "$(backgroundColor $i)$(getColor $i) - $i%k" - done - else - # Strip eventual "bg-" prefixes - colorName=${colorName#bg-} - # Strip eventual "fg-" prefixes - colorName=${colorName#fg-} - # Strip eventual "br" prefixes ("bright" colors) - colorName=${colorName#br} - echo -n $__P9K_COLORS[$colorName] - fi -} - -# Check if two colors are equal, even if one is specified as ANSI code. -function isSameColor() { - if [[ "$1" == "NONE" || "$2" == "NONE" ]]; then - return 1 - fi - - local color1=$(getColorCode "$1") - local color2=$(getColorCode "$2") - - return $(( color1 != color2 )) -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/functions/icons.zsh b/.zprezto/modules/prompt/external/powerlevel9k/functions/icons.zsh deleted file mode 100755 index d8661e6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/functions/icons.zsh +++ /dev/null @@ -1,560 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 -################################################################ -# icons -# This file holds the icon definitions and -# icon-functions for the powerlevel9k-ZSH-theme -# https://github.com/bhilburn/powerlevel9k -################################################################ - -# These characters require the Powerline fonts to work properly. If you see -# boxes or bizarre characters below, your fonts are not correctly installed. If -# you do not want to install a special font, you can set `POWERLEVEL9K_MODE` to -# `compatible`. This shows all icons in regular symbols. - -# Initialize the icon list according to the user's `POWERLEVEL9K_MODE`. -typeset -gAH icons -case $POWERLEVEL9K_MODE in - 'flat'|'awesome-patched') - # Awesome-Patched Font required! See: - # https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons=( - LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  - RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  - LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace - LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' #  - RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  - CARRIAGE_RETURN_ICON $'\u21B5' # ↵ - ROOT_ICON $'\uE801' #  - SUDO_ICON $'\uF09C' #  - RUBY_ICON $'\uE847 ' #  - AWS_ICON $'\uE895' #  - AWS_EB_ICON $'\U1F331 ' # 🌱 - BACKGROUND_JOBS_ICON $'\uE82F ' #  - TEST_ICON $'\uE891' #  - TODO_ICON $'\u2611' # ☑ - BATTERY_ICON $'\uE894' #  - DISK_ICON $'\uE1AE ' #  - OK_ICON $'\u2714' # ✔ - FAIL_ICON $'\u2718' # ✘ - SYMFONY_ICON 'SF' - NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ - MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ - MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ - APPLE_ICON $'\uE26E' #  - WINDOWS_ICON $'\uE26F' #  - FREEBSD_ICON $'\U1F608 ' # 😈 - ANDROID_ICON $'\uE270' #  - LINUX_ICON $'\uE271' #  - LINUX_ARCH_ICON $'\uE271' #  - LINUX_DEBIAN_ICON $'\uE271' #  - LINUX_UBUNTU_ICON $'\uE271' #  - LINUX_CENTOS_ICON $'\uE271' #  - LINUX_COREOS_ICON $'\uE271' #  - LINUX_ELEMENTARY_ICON $'\uE271' #  - LINUX_MINT_ICON $'\uE271' #  - LINUX_FEDORA_ICON $'\uE271' #  - LINUX_GENTOO_ICON $'\uE271' #  - LINUX_MAGEIA_ICON $'\uE271' #  - LINUX_NIXOS_ICON $'\uE271' #  - LINUX_MANJARO_ICON $'\uE271' #  - LINUX_DEVUAN_ICON $'\uE271' #  - LINUX_ALPINE_ICON $'\uE271' #  - LINUX_AOSC_ICON $'\uE271' #  - LINUX_OPENSUSE_ICON $'\uE271' #  - LINUX_SABAYON_ICON $'\uE271' #  - LINUX_SLACKWARE_ICON $'\uE271' #  - SUNOS_ICON $'\U1F31E ' # 🌞 - HOME_ICON $'\uE12C' #  - HOME_SUB_ICON $'\uE18D' #  - FOLDER_ICON $'\uE818' #  - NETWORK_ICON $'\uE1AD' #  - ETC_ICON $'\uE82F' #  - LOAD_ICON $'\uE190 ' #  - SWAP_ICON $'\uE87D' #  - RAM_ICON $'\uE1E2 ' #  - SERVER_ICON $'\uE895' #  - VCS_UNTRACKED_ICON $'\uE16C' #  - VCS_UNSTAGED_ICON $'\uE17C' #  - VCS_STAGED_ICON $'\uE168' #  - VCS_STASH_ICON $'\uE133 ' #  - #VCS_INCOMING_CHANGES_ICON $'\uE1EB ' #  - #VCS_INCOMING_CHANGES_ICON $'\uE80D ' #  - VCS_INCOMING_CHANGES_ICON $'\uE131 ' #  - #VCS_OUTGOING_CHANGES_ICON $'\uE1EC ' #  - #VCS_OUTGOING_CHANGES_ICON $'\uE80E ' #  - VCS_OUTGOING_CHANGES_ICON $'\uE132 ' #  - VCS_TAG_ICON $'\uE817 ' #  - VCS_BOOKMARK_ICON $'\uE87B' #  - VCS_COMMIT_ICON $'\uE821 ' #  - VCS_BRANCH_ICON $'\uE220 ' #  - VCS_REMOTE_BRANCH_ICON $'\u2192' # → - VCS_GIT_ICON $'\uE20E ' #  - VCS_GIT_GITHUB_ICON $'\uE20E ' # - VCS_GIT_BITBUCKET_ICON $'\uE20E ' # - VCS_GIT_GITLAB_ICON $'\uE20E ' # - VCS_HG_ICON $'\uE1C3 ' #  - VCS_SVN_ICON '(svn) ' - RUST_ICON '(rust)' - PYTHON_ICON $'\ue63c' #  - SWIFT_ICON '' - GO_ICON '' - PUBLIC_IP_ICON '' - LOCK_ICON $'\UE138' #  - EXECUTION_TIME_ICON $'\UE89C' #  - SSH_ICON '(ssh)' - VPN_ICON '(vpn)' - KUBERNETES_ICON $'\U2388' # ⎈ - DROPBOX_ICON $'\UF16B' #  - DATE_ICON $'\uE184' #  - TIME_ICON $'\uE12E' #  - JAVA_ICON $'\U2615' # ☕︎ - LARAVEL_ICON '' - ) - ;; - 'awesome-fontconfig') - # fontconfig with awesome-font required! See - # https://github.com/gabrielelana/awesome-terminal-fonts - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons=( - LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  - RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  - LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace - LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' #  - RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  - CARRIAGE_RETURN_ICON $'\u21B5' # ↵ - ROOT_ICON $'\uF201' #  - SUDO_ICON $'\uF09C' #  - RUBY_ICON $'\uF219 ' #  - AWS_ICON $'\uF270' #  - AWS_EB_ICON $'\U1F331 ' # 🌱 - BACKGROUND_JOBS_ICON $'\uF013 ' #  - TEST_ICON $'\uF291' #  - TODO_ICON $'\u2611' # ☑ - BATTERY_ICON $'\U1F50B' # 🔋 - DISK_ICON $'\uF0A0 ' #  - OK_ICON $'\u2714' # ✔ - FAIL_ICON $'\u2718' # ✘ - SYMFONY_ICON 'SF' - NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ - MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ - MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ - APPLE_ICON $'\uF179' #  - WINDOWS_ICON $'\uF17A' #  - FREEBSD_ICON $'\U1F608 ' # 😈 - ANDROID_ICON $'\uE17B' #  - LINUX_ICON $'\uF17C' #  - LINUX_ARCH_ICON $'\uF17C' #  - LINUX_DEBIAN_ICON $'\uF17C' #  - LINUX_UBUNTU_ICON $'\uF17C' #  - LINUX_CENTOS_ICON $'\uF17C' #  - LINUX_COREOS_ICON $'\uF17C' #  - LINUX_ELEMENTARY_ICON $'\uF17C' #  - LINUX_MINT_ICON $'\uF17C' #  - LINUX_FEDORA_ICON $'\uF17C' #  - LINUX_GENTOO_ICON $'\uF17C' #  - LINUX_MAGEIA_ICON $'\uF17C' #  - LINUX_NIXOS_ICON $'\uF17C' #  - LINUX_MANJARO_ICON $'\uF17C' #  - LINUX_DEVUAN_ICON $'\uF17C' #  - LINUX_ALPINE_ICON $'\uF17C' #  - LINUX_AOSC_ICON $'\uF17C' #  - LINUX_OPENSUSE_ICON $'\uF17C' #  - LINUX_SABAYON_ICON $'\uF17C' #  - LINUX_SLACKWARE_ICON $'\uF17C' #  - SUNOS_ICON $'\uF185 ' #  - HOME_ICON $'\uF015' #  - HOME_SUB_ICON $'\uF07C' #  - FOLDER_ICON $'\uF115' #  - ETC_ICON $'\uF013 ' #  - NETWORK_ICON $'\uF09E' #  - LOAD_ICON $'\uF080 ' #  - SWAP_ICON $'\uF0E4' #  - RAM_ICON $'\uF0E4' #  - SERVER_ICON $'\uF233' #  - VCS_UNTRACKED_ICON $'\uF059' #  - VCS_UNSTAGED_ICON $'\uF06A' #  - VCS_STAGED_ICON $'\uF055' #  - VCS_STASH_ICON $'\uF01C ' #  - VCS_INCOMING_CHANGES_ICON $'\uF01A ' #  - VCS_OUTGOING_CHANGES_ICON $'\uF01B ' #  - VCS_TAG_ICON $'\uF217 ' #  - VCS_BOOKMARK_ICON $'\uF27B' #  - VCS_COMMIT_ICON $'\uF221 ' #  - VCS_BRANCH_ICON $'\uF126 ' #  - VCS_REMOTE_BRANCH_ICON $'\u2192' # → - VCS_GIT_ICON $'\uF1D3 ' #  - VCS_GIT_GITHUB_ICON $'\uF113 ' #  - VCS_GIT_BITBUCKET_ICON $'\uF171 ' #  - VCS_GIT_GITLAB_ICON $'\uF296 ' #  - VCS_HG_ICON $'\uF0C3 ' #  - VCS_SVN_ICON '(svn) ' - RUST_ICON $'\uE6A8' #  - PYTHON_ICON $'\ue63c' #  - SWIFT_ICON '' - GO_ICON '' - PUBLIC_IP_ICON '' - LOCK_ICON $'\UF023' #  - EXECUTION_TIME_ICON $'\uF253' - SSH_ICON '(ssh)' - VPN_ICON $'\uF023' - KUBERNETES_ICON $'\U2388' # ⎈ - DROPBOX_ICON $'\UF16B' #  - DATE_ICON $'\uF073 ' #  - TIME_ICON $'\uF017 ' #  - JAVA_ICON $'\U2615' # ☕︎ - LARAVEL_ICON '' - ) - ;; - 'awesome-mapped-fontconfig') - # mapped fontconfig with awesome-font required! See - # https://github.com/gabrielelana/awesome-terminal-fonts - # don't forget to source the font maps in your startup script - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - - if [ -z "$AWESOME_GLYPHS_LOADED" ]; then - echo "Powerlevel9k warning: Awesome-Font mappings have not been loaded. - Source a font mapping in your shell config, per the Awesome-Font docs - (https://github.com/gabrielelana/awesome-terminal-fonts), - Or use a different Powerlevel9k font configuration."; - fi - - icons=( - LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  - RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  - LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace - LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' #  - RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  - CARRIAGE_RETURN_ICON $'\u21B5' # ↵ - ROOT_ICON '\u'$CODEPOINT_OF_OCTICONS_ZAP #  - SUDO_ICON '\u'$CODEPOINT_OF_AWESOME_UNLOCK #  - RUBY_ICON '\u'$CODEPOINT_OF_OCTICONS_RUBY' ' #  - AWS_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER #  - AWS_EB_ICON $'\U1F331 ' # 🌱 - BACKGROUND_JOBS_ICON '\u'$CODEPOINT_OF_AWESOME_COG' ' #  - TEST_ICON '\u'$CODEPOINT_OF_AWESOME_BUG #  - TODO_ICON '\u'$CODEPOINT_OF_AWESOME_CHECK_SQUARE_O #  - BATTERY_ICON '\U'$CODEPOINT_OF_AWESOME_BATTERY_FULL #  - DISK_ICON '\u'$CODEPOINT_OF_AWESOME_HDD_O' ' #  - OK_ICON '\u'$CODEPOINT_OF_AWESOME_CHECK #  - FAIL_ICON '\u'$CODEPOINT_OF_AWESOME_TIMES #  - SYMFONY_ICON 'SF' - NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ - APPLE_ICON '\u'$CODEPOINT_OF_AWESOME_APPLE #  - FREEBSD_ICON $'\U1F608 ' # 😈 - LINUX_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_ARCH_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_DEBIAN_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_UBUNTU_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_CENTOS_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_COREOS_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_ELEMENTARY_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_MINT_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_FEDORA_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_GENTOO_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_MAGEIA_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_NIXOS_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_MANJARO_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_DEVUAN_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_ALPINE_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_AOSC_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_OPENSUSE_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_SABAYON_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - LINUX_SLACKWARE_ICON '\u'$CODEPOINT_OF_AWESOME_LINUX #  - SUNOS_ICON '\u'$CODEPOINT_OF_AWESOME_SUN_O' ' #  - HOME_ICON '\u'$CODEPOINT_OF_AWESOME_HOME #  - HOME_SUB_ICON '\u'$CODEPOINT_OF_AWESOME_FOLDER_OPEN #  - FOLDER_ICON '\u'$CODEPOINT_OF_AWESOME_FOLDER_O #  - ETC_ICON '\u'$CODEPOINT_OF_AWESOME_COG' ' #  - NETWORK_ICON '\u'$CODEPOINT_OF_AWESOME_RSS #  - LOAD_ICON '\u'$CODEPOINT_OF_AWESOME_BAR_CHART' ' #  - SWAP_ICON '\u'$CODEPOINT_OF_AWESOME_DASHBOARD #  - RAM_ICON '\u'$CODEPOINT_OF_AWESOME_DASHBOARD #  - SERVER_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER #  - VCS_UNTRACKED_ICON '\u'$CODEPOINT_OF_AWESOME_QUESTION_CIRCLE #  - VCS_UNSTAGED_ICON '\u'$CODEPOINT_OF_AWESOME_EXCLAMATION_CIRCLE #  - VCS_STAGED_ICON '\u'$CODEPOINT_OF_AWESOME_PLUS_CIRCLE #  - VCS_STASH_ICON '\u'$CODEPOINT_OF_AWESOME_INBOX' ' #  - VCS_INCOMING_CHANGES_ICON '\u'$CODEPOINT_OF_AWESOME_ARROW_CIRCLE_DOWN' ' #  - VCS_OUTGOING_CHANGES_ICON '\u'$CODEPOINT_OF_AWESOME_ARROW_CIRCLE_UP' ' #  - VCS_TAG_ICON '\u'$CODEPOINT_OF_AWESOME_TAG' ' #  - VCS_BOOKMARK_ICON '\u'$CODEPOINT_OF_OCTICONS_BOOKMARK #  - VCS_COMMIT_ICON '\u'$CODEPOINT_OF_OCTICONS_GIT_COMMIT' ' #  - VCS_BRANCH_ICON '\u'$CODEPOINT_OF_OCTICONS_GIT_BRANCH' ' #  - VCS_REMOTE_BRANCH_ICON '\u'$CODEPOINT_OF_OCTICONS_REPO_PUSH #  - VCS_GIT_ICON '\u'$CODEPOINT_OF_AWESOME_GIT' ' #  - VCS_GIT_GITHUB_ICON '\u'$CODEPOINT_OF_AWESOME_GITHUB_ALT' ' #  - VCS_GIT_BITBUCKET_ICON '\u'$CODEPOINT_OF_AWESOME_BITBUCKET' ' #  - VCS_GIT_GITLAB_ICON '\u'$CODEPOINT_OF_AWESOME_GITLAB' ' #  - VCS_HG_ICON '\u'$CODEPOINT_OF_AWESOME_FLASK' ' #  - VCS_SVN_ICON '(svn) ' - RUST_ICON $'\uE6A8' #  - PYTHON_ICON $'\U1F40D' # 🐍 - SWIFT_ICON $'\uE655' #  - PUBLIC_IP_ICON '\u'$CODEPOINT_OF_AWESOME_GLOBE #  - LOCK_ICON '\u'$CODEPOINT_OF_AWESOME_LOCK #  - EXECUTION_TIME_ICON '\u'$CODEPOINT_OF_AWESOME_HOURGLASS_END #  - SSH_ICON '(ssh)' - VPN_ICON '\u'$CODEPOINT_OF_AWESOME_LOCK - KUBERNETES_ICON $'\U2388' # ⎈ - DROPBOX_ICON '\u'$CODEPOINT_OF_AWESOME_DROPBOX #  - DATE_ICON $'\uF073 ' #  - TIME_ICON $'\uF017 ' #  - JAVA_ICON $'\U2615' # ☕︎ - LARAVEL_ICON '' - ) - ;; - 'nerdfont-complete'|'nerdfont-fontconfig') - # nerd-font patched (complete) font required! See - # https://github.com/ryanoasis/nerd-fonts - # http://nerdfonts.com/#cheat-sheet - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons=( - LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  - RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  - LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace - LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' #  - RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  - CARRIAGE_RETURN_ICON $'\u21B5' # ↵ - ROOT_ICON $'\uE614 ' #  - SUDO_ICON $'\uF09C' #  - RUBY_ICON $'\uF219 ' #  - AWS_ICON $'\uF270' #  - AWS_EB_ICON $'\UF1BD ' #  - BACKGROUND_JOBS_ICON $'\uF013 ' #  - TEST_ICON $'\uF188' #  - TODO_ICON $'\uF133' #  - BATTERY_ICON $'\UF240 ' #  - DISK_ICON $'\uF0A0' #  - OK_ICON $'\uF00C' #  - FAIL_ICON $'\uF00D' #  - SYMFONY_ICON $'\uE757' #  - NODE_ICON $'\uE617 ' #  - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ - MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ - MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ - APPLE_ICON $'\uF179' #  - WINDOWS_ICON $'\uF17A' #  - FREEBSD_ICON $'\UF30C ' #  - ANDROID_ICON $'\uF17B' #  - LINUX_ARCH_ICON $'\uF303' #  - LINUX_CENTOS_ICON $'\uF304' #  - LINUX_COREOS_ICON $'\uF305' #  - LINUX_DEBIAN_ICON $'\uF306' #  - LINUX_ELEMENTARY_ICON $'\uF309' #  - LINUX_FEDORA_ICON $'\uF30a' #  - LINUX_GENTOO_ICON $'\uF30d' #  - LINUX_MAGEIA_ICON $'\uF310' #  - LINUX_MINT_ICON $'\uF30e' #  - LINUX_NIXOS_ICON $'\uF313' #  - LINUX_MANJARO_ICON $'\uF312' #  - LINUX_DEVUAN_ICON $'\uF307' #  - LINUX_ALPINE_ICON $'\uF300' #  - LINUX_AOSC_ICON $'\uF301' #  - LINUX_OPENSUSE_ICON $'\uF314' #  - LINUX_SABAYON_ICON $'\uF317' #  - LINUX_SLACKWARE_ICON $'\uF319' #  - LINUX_UBUNTU_ICON $'\uF31b' #  - LINUX_ICON $'\uF17C' #  - SUNOS_ICON $'\uF185 ' #  - HOME_ICON $'\uF015' #  - HOME_SUB_ICON $'\uF07C' #  - FOLDER_ICON $'\uF115' #  - ETC_ICON $'\uF013' #  - NETWORK_ICON $'\uF1EB' #  - LOAD_ICON $'\uF080 ' #  - SWAP_ICON $'\uF464' #  - RAM_ICON $'\uF0E4' #  - SERVER_ICON $'\uF0AE' #  - VCS_UNTRACKED_ICON $'\uF059' #  - VCS_UNSTAGED_ICON $'\uF06A' #  - VCS_STAGED_ICON $'\uF055' #  - VCS_STASH_ICON $'\uF01C ' #  - VCS_INCOMING_CHANGES_ICON $'\uF01A ' #  - VCS_OUTGOING_CHANGES_ICON $'\uF01B ' #  - VCS_TAG_ICON $'\uF02B ' #  - VCS_BOOKMARK_ICON $'\uF461 ' #  - VCS_COMMIT_ICON $'\uE729 ' #  - VCS_BRANCH_ICON $'\uF126 ' #  - VCS_REMOTE_BRANCH_ICON $'\uE728 ' #  - VCS_GIT_ICON $'\uF1D3 ' #  - VCS_GIT_GITHUB_ICON $'\uF113 ' #  - VCS_GIT_BITBUCKET_ICON $'\uE703 ' #  - VCS_GIT_GITLAB_ICON $'\uF296 ' #  - VCS_HG_ICON $'\uF0C3 ' #  - VCS_SVN_ICON $'\uE72D ' #  - RUST_ICON $'\uE7A8 ' #  - PYTHON_ICON $'\UE73C ' #  - SWIFT_ICON $'\uE755' #  - GO_ICON $'\uE626' #  - PUBLIC_IP_ICON $'\UF0AC' #  - LOCK_ICON $'\UF023' #  - EXECUTION_TIME_ICON $'\uF252' #  - SSH_ICON $'\uF489' #  - VPN_ICON '(vpn)' - KUBERNETES_ICON $'\U2388' # ⎈ - DROPBOX_ICON $'\UF16B' #  - DATE_ICON $'\uF073 ' #  - TIME_ICON $'\uF017 ' #  - JAVA_ICON $'\U2615' # ☕︎ - LARAVEL_ICON $'\ue73f ' #  - ) - ;; - *) - # Powerline-Patched Font required! - # See https://github.com/Lokaltog/powerline-fonts - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons=( - LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  - RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  - LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace - LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' #  - RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  - CARRIAGE_RETURN_ICON $'\u21B5' # ↵ - ROOT_ICON $'\u26A1' # ⚡ - SUDO_ICON $'\uE0A2' #  - RUBY_ICON '' - AWS_ICON 'AWS:' - AWS_EB_ICON $'\U1F331 ' # 🌱 - BACKGROUND_JOBS_ICON $'\u2699' # ⚙ - TEST_ICON '' - TODO_ICON $'\u2611' # ☑ - BATTERY_ICON $'\U1F50B' # 🔋 - DISK_ICON $'hdd ' - OK_ICON $'\u2714' # ✔ - FAIL_ICON $'\u2718' # ✘ - SYMFONY_ICON 'SF' - NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ - MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ - MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ - APPLE_ICON 'OSX' - WINDOWS_ICON 'WIN' - FREEBSD_ICON 'BSD' - ANDROID_ICON 'And' - LINUX_ICON 'Lx' - LINUX_ARCH_ICON 'Arc' - LINUX_DEBIAN_ICON 'Deb' - LINUX_UBUNTU_ICON 'Ubu' - LINUX_CENTOS_ICON 'Cen' - LINUX_COREOS_ICON 'Cor' - LINUX_ELEMENTARY_ICON 'Elm' - LINUX_MINT_ICON 'LMi' - LINUX_FEDORA_ICON 'Fed' - LINUX_GENTOO_ICON 'Gen' - LINUX_MAGEIA_ICON 'Mag' - LINUX_NIXOS_ICON 'Nix' - LINUX_MANJARO_ICON 'Man' - LINUX_DEVUAN_ICON 'Dev' - LINUX_ALPINE_ICON 'Alp' - LINUX_AOSC_ICON 'Aos' - LINUX_OPENSUSE_ICON 'OSu' - LINUX_SABAYON_ICON 'Sab' - LINUX_SLACKWARE_ICON 'Sla' - SUNOS_ICON 'Sun' - HOME_ICON '' - HOME_SUB_ICON '' - FOLDER_ICON '' - ETC_ICON $'\u2699' # ⚙ - NETWORK_ICON 'IP' - LOAD_ICON 'L' - SWAP_ICON 'SWP' - RAM_ICON 'RAM' - SERVER_ICON '' - VCS_UNTRACKED_ICON '?' - VCS_UNSTAGED_ICON $'\u25CF' # ● - VCS_STAGED_ICON $'\u271A' # ✚ - VCS_STASH_ICON $'\u235F' # ⍟ - VCS_INCOMING_CHANGES_ICON $'\u2193' # ↓ - VCS_OUTGOING_CHANGES_ICON $'\u2191' # ↑ - VCS_TAG_ICON '' - VCS_BOOKMARK_ICON $'\u263F' # ☿ - VCS_COMMIT_ICON '' - VCS_BRANCH_ICON $'\uE0A0 ' #  - VCS_REMOTE_BRANCH_ICON $'\u2192' # → - VCS_GIT_ICON '' - VCS_GIT_GITHUB_ICON '' - VCS_GIT_BITBUCKET_ICON '' - VCS_GIT_GITLAB_ICON '' - VCS_HG_ICON '' - VCS_SVN_ICON '' - RUST_ICON 'Rust' - PYTHON_ICON '' - SWIFT_ICON 'Swift' - GO_ICON 'Go' - PUBLIC_IP_ICON '' - LOCK_ICON $'\UE0A2' - EXECUTION_TIME_ICON 'Dur' - SSH_ICON '(ssh)' - VPN_ICON '(vpn)' - KUBERNETES_ICON $'\U2388' # ⎈ - DROPBOX_ICON 'Dropbox' - DATE_ICON '' - TIME_ICON '' - JAVA_ICON $'\U2615' # ☕︎ - LARAVEL_ICON '' - ) - ;; -esac - -# Override the above icon settings with any user-defined variables. -case $POWERLEVEL9K_MODE in - 'flat') - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons[LEFT_SEGMENT_SEPARATOR]='' - icons[RIGHT_SEGMENT_SEPARATOR]='' - icons[LEFT_SUBSEGMENT_SEPARATOR]='|' - icons[RIGHT_SUBSEGMENT_SEPARATOR]='|' - ;; - 'compatible') - # Set the right locale to protect special characters - local LC_ALL="" LC_CTYPE="en_US.UTF-8" - icons[LEFT_SEGMENT_SEPARATOR]=$'\u2B80' # ⮀ - icons[RIGHT_SEGMENT_SEPARATOR]=$'\u2B82' # ⮂ - icons[VCS_BRANCH_ICON]='@' - ;; -esac - -if [[ "$POWERLEVEL9K_HIDE_BRANCH_ICON" == true ]]; then - icons[VCS_BRANCH_ICON]='' -fi - -# Safety function for printing icons -# Prints the named icon, or if that icon is undefined, the string name. -function print_icon() { - local icon_name=$1 - local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name} - if defined "$ICON_USER_VARIABLE"; then - echo -n "${(P)ICON_USER_VARIABLE}" - else - echo -n "${icons[$icon_name]}" - fi -} - -# Get a list of configured icons -# * $1 string - If "original", then the original icons are printed, -# otherwise "print_icon" is used, which takes the users -# overrides into account. -get_icon_names() { - # Iterate over a ordered list of keys of the icons array - for key in ${(@kon)icons}; do - echo -n "POWERLEVEL9K_$key: " - if [[ "${1}" == "original" ]]; then - # print the original icons as they are defined in the array above - echo "${icons[$key]}" - else - # print the icons as they are configured by the user - echo "$(print_icon "$key")" - fi - done -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/functions/utilities.zsh b/.zprezto/modules/prompt/external/powerlevel9k/functions/utilities.zsh deleted file mode 100755 index 127007f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/functions/utilities.zsh +++ /dev/null @@ -1,373 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 -################################################################ -# Utility functions -# This file holds some utility-functions for -# the powerlevel9k-ZSH-theme -# https://github.com/bhilburn/powerlevel9k -################################################################ - -# Exits with 0 if a variable has been previously defined (even if empty) -# Takes the name of a variable that should be checked. -function defined() { - [[ ! -z "${(tP)1}" ]] -} - -# Given the name of a variable and a default value, sets the variable -# value to the default only if it has not been defined. -# -# Typeset cannot set the value for an array, so this will only work -# for scalar values. -function set_default() { - local varname="$1" - local default_value="$2" - - defined "$varname" || typeset -g "$varname"="$default_value" -} - -# Converts large memory values into a human-readable unit (e.g., bytes --> GB) -# Takes two arguments: -# * $size - The number which should be prettified -# * $base - The base of the number (default Bytes) -printSizeHumanReadable() { - typeset -F 2 size - size="$1"+0.00001 - local extension - extension=('B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y') - local index=1 - - # if the base is not Bytes - if [[ -n $2 ]]; then - local idx - for idx in "${extension[@]}"; do - if [[ "$2" == "$idx" ]]; then - break - fi - index=$(( index + 1 )) - done - fi - - while (( (size / 1024) > 0.1 )); do - size=$(( size / 1024 )) - index=$(( index + 1 )) - done - - echo "$size${extension[$index]}" -} - -# Gets the first value out of a list of items that is not empty. -# The items are examined by a callback-function. -# Takes two arguments: -# * $list - A list of items -# * $callback - A callback function to examine if the item is -# worthy. The callback function has access to -# the inner variable $item. -function getRelevantItem() { - local -a list - local callback - # Explicitly split the elements by whitespace. - list=(${=1}) - callback=$2 - - for item in $list; do - # The first non-empty item wins - try=$(eval "$callback") - if [[ -n "$try" ]]; then - echo "$try" - break; - fi - done -} - -# OS detection -case $(uname) in - Darwin) - OS='OSX' - OS_ICON=$(print_icon 'APPLE_ICON') - ;; - CYGWIN_NT-* | MSYS_NT-*) - OS='Windows' - OS_ICON=$(print_icon 'WINDOWS_ICON') - ;; - FreeBSD) - OS='BSD' - OS_ICON=$(print_icon 'FREEBSD_ICON') - ;; - OpenBSD) - OS='BSD' - OS_ICON=$(print_icon 'FREEBSD_ICON') - ;; - DragonFly) - OS='BSD' - OS_ICON=$(print_icon 'FREEBSD_ICON') - ;; - Linux) - OS='Linux' - os_release_id="$(grep -E '^ID=([a-zA-Z]*)' /etc/os-release | cut -d '=' -f 2)" - case "$os_release_id" in - *arch*) - OS_ICON=$(print_icon 'LINUX_ARCH_ICON') - ;; - *debian*) - OS_ICON=$(print_icon 'LINUX_DEBIAN_ICON') - ;; - *ubuntu*) - OS_ICON=$(print_icon 'LINUX_UBUNTU_ICON') - ;; - *elementary*) - OS_ICON=$(print_icon 'LINUX_ELEMENTARY_ICON') - ;; - *fedora*) - OS_ICON=$(print_icon 'LINUX_FEDORA_ICON') - ;; - *coreos*) - OS_ICON=$(print_icon 'LINUX_COREOS_ICON') - ;; - *gentoo*) - OS_ICON=$(print_icon 'LINUX_GENTOO_ICON') - ;; - *mageia*) - OS_ICON=$(print_icon 'LINUX_MAGEIA_ICON') - ;; - *centos*) - OS_ICON=$(print_icon 'LINUX_CENTOS_ICON') - ;; - *opensuse*|*tumbleweed*) - OS_ICON=$(print_icon 'LINUX_OPENSUSE_ICON') - ;; - *sabayon*) - OS_ICON=$(print_icon 'LINUX_SABAYON_ICON') - ;; - *slackware*) - OS_ICON=$(print_icon 'LINUX_SLACKWARE_ICON') - ;; - *linuxmint*) - OS_ICON=$(print_icon 'LINUX_MINT_ICON') - ;; - *alpine*) - OS_ICON=$(print_icon 'LINUX_ALPINE_ICON') - ;; - *aosc*) - OS_ICON=$(print_icon 'LINUX_AOSC_ICON') - ;; - *nixos*) - OS_ICON=$(print_icon 'LINUX_NIXOS_ICON') - ;; - *devuan*) - OS_ICON=$(print_icon 'LINUX_DEVUAN_ICON') - ;; - *manjaro*) - OS_ICON=$(print_icon 'LINUX_MANJARO_ICON') - ;; - *) - OS='Linux' - OS_ICON=$(print_icon 'LINUX_ICON') - ;; - esac - - # Check if we're running on Android - case $(uname -o 2>/dev/null) in - Android) - OS='Android' - OS_ICON=$(print_icon 'ANDROID_ICON') - ;; - esac - ;; - SunOS) - OS='Solaris' - OS_ICON=$(print_icon 'SUNOS_ICON') - ;; - *) - OS='' - OS_ICON='' - ;; -esac - -# Determine the correct sed parameter. -# -# `sed` is unfortunately not consistent across OSes when it comes to flags. -SED_EXTENDED_REGEX_PARAMETER="-r" -if [[ "$OS" == 'OSX' ]]; then - local IS_BSD_SED="$(sed --version &>> /dev/null || echo "BSD sed")" - if [[ -n "$IS_BSD_SED" ]]; then - SED_EXTENDED_REGEX_PARAMETER="-E" - fi -fi - -# Determine if the passed segment is used in the prompt -# -# Pass the name of the segment to this function to test for its presence in -# either the LEFT or RIGHT prompt arrays. -# * $1: The segment to be tested. -segment_in_use() { - local key=$1 - if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then - return 0 - else - return 1 - fi -} - -# Print a deprecation warning if an old segment is in use. -# Takes the name of an associative array that contains the -# deprecated segments as keys, the values contain the new -# segment names. -print_deprecation_warning() { - typeset -AH raw_deprecated_segments - raw_deprecated_segments=(${(kvP@)1}) - - for key in ${(@k)raw_deprecated_segments}; do - if segment_in_use $key; then - # segment is deprecated - print -P "%F{yellow}Warning!%f The '$key' segment is deprecated. Use '%F{blue}${raw_deprecated_segments[$key]}%f' instead. For more informations, have a look at the CHANGELOG.md." - fi - done -} - -# A helper function to determine if a segment should be -# joined or promoted to a full one. -# Takes three arguments: -# * $1: The array index of the current segment -# * $2: The array index of the last printed segment -# * $3: The array of segments of the left or right prompt -function segmentShouldBeJoined() { - local current_index=$1 - local last_segment_index=$2 - # Explicitly split the elements by whitespace. - local -a elements - elements=(${=3}) - - local current_segment=${elements[$current_index]} - local joined=false - if [[ ${current_segment[-7,-1]} == '_joined' ]]; then - joined=true - # promote segment to a full one, if the predecessing full segment - # was conditional. So this can only be the case for segments that - # are not our direct predecessor. - if (( $(($current_index - $last_segment_index)) > 1)); then - # Now we have to examine every previous segment, until we reach - # the last printed one (found by its index). This is relevant if - # all previous segments are joined. Then we want to join our - # segment as well. - local examined_index=$((current_index - 1)) - while (( $examined_index > $last_segment_index )); do - local previous_segment=${elements[$examined_index]} - # If one of the examined segments is not joined, then we know - # that the current segment should not be joined, as the target - # segment is the wrong one. - if [[ ${previous_segment[-7,-1]} != '_joined' ]]; then - joined=false - break - fi - examined_index=$((examined_index - 1)) - done - fi - fi - - # Return 1 means error; return 0 means no error. So we have - # to invert $joined - if [[ "$joined" == "true" ]]; then - return 0 - else - return 1 - fi -} - -################################################################ -# Given a directory path, truncate it according to the settings. -# Parameters: -# * $1 Path: string - the directory path to be truncated -# * $2 Length: integer - length to truncate to -# * $3 Delimiter: string - the delimiter to use -# * $4 From: string - "right" | "middle". If omited, assumes right. -function truncatePath() { - # if the current path is not 1 character long (e.g. "/" or "~") - if (( ${#1} > 1 )); then - # convert $2 from string to integer - 2=$(( $2 )) - # set $3 to "" if not defined - [[ -z $3 ]] && 3="" || 3=$(echo -n $3) - # set $4 to "right" if not defined - [[ -z $4 ]] && 4="right" - # create a variable for the truncated path. - local trunc_path - # if the path is in the home folder, add "~/" to the start otherwise "/" - [[ $1 == "~"* ]] && trunc_path='~/' || trunc_path='/' - # split the path into an array using "/" as the delimiter - local paths=$1 - paths=(${(s:/:)${paths//"~\/"/}}) - # declare locals for the directory being tested and its length - local test_dir test_dir_length - # do the needed truncation - case $4 in - right) - # include the delimiter length in the threshhold - local threshhold=$(( $2 + ${#3} )) - # loop through the paths - for (( i=1; i<${#paths}; i++ )); do - # get the current directory value - test_dir=$paths[$i] - test_dir_length=${#test_dir} - # only truncate if the resulting truncation will be shorter than - # the truncation + delimiter length and at least 3 characters - if (( $test_dir_length > $threshhold )) && (( $test_dir_length > 3 )); then - # use the first $2 characters and the delimiter - trunc_path+="${test_dir:0:$2}$3/" - else - # use the full path - trunc_path+="${test_dir}/" - fi - done - ;; - middle) - # we need double the length for start and end truncation + delimiter length - local threshhold=$(( $2 * 2 )) - # create a variable for the start of the end truncation - local last_pos - # loop through the paths - for (( i=1; i<${#paths}; i++ )); do - # get the current directory value - test_dir=$paths[$i] - test_dir_length=${#test_dir} - # only truncate if the resulting truncation will be shorter than - # the truncation + delimiter length - if (( $test_dir_length > $threshhold )); then - # use the first $2 characters, the delimiter and the last $2 characters - last_pos=$(( $test_dir_length - $2 )) - trunc_path+="${test_dir:0:$2}$3${test_dir:$last_pos:$test_dir_length}/" - else - # use the full path - trunc_path+="${test_dir}/" - fi - done - ;; - esac - # return the truncated path + the current directory - echo $trunc_path${1:t} - else # current path is 1 character long (e.g. "/" or "~") - echo $1 - fi -} - -# Given a directory path, truncate it according to the settings for -# `truncate_from_right` -function truncatePathFromRight() { - local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER:-1} - echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \ - "s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g" -} - -# Search recursively in parent folders for given file. -function upsearch () { - if [[ "$PWD" == "$HOME" || "$PWD" == "/" ]]; then - echo "$PWD" - elif test -e "$1"; then - pushd .. > /dev/null - upsearch "$1" - popd > /dev/null - echo "$PWD" - else - pushd .. > /dev/null - upsearch "$1" - popd > /dev/null - fi -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/functions/vcs.zsh b/.zprezto/modules/prompt/external/powerlevel9k/functions/vcs.zsh deleted file mode 100755 index b99e7c8..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/functions/vcs.zsh +++ /dev/null @@ -1,169 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 -################################################################ -# vcs -# This file holds supplemental VCS functions -# for the powerlevel9k-ZSH-theme -# https://github.com/bhilburn/powerlevel9k -################################################################ - -set_default POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY true -function +vi-git-untracked() { - # TODO: check git >= 1.7.2 - see function git_compare_version() - local FLAGS - FLAGS=('--porcelain') - - if [[ "$POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY" == "false" ]]; then - FLAGS+='--ignore-submodules=dirty' - fi - - if [[ $(command git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ - -n $(command git status ${FLAGS} | \grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then - hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" - VCS_WORKDIR_HALF_DIRTY=true - else - VCS_WORKDIR_HALF_DIRTY=false - fi -} - -function +vi-git-aheadbehind() { - local ahead behind branch_name - local -a gitstatus - - branch_name=$(command git symbolic-ref --short HEAD 2>/dev/null) - - # for git prior to 1.7 - # ahead=$(command git rev-list origin/${branch_name}..HEAD | wc -l) - ahead=$(command git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l) - (( ahead )) && gitstatus+=( " $(print_icon 'VCS_OUTGOING_CHANGES_ICON')${ahead// /}" ) - - # for git prior to 1.7 - # behind=$(command git rev-list HEAD..origin/${branch_name} | wc -l) - behind=$(command git rev-list HEAD.."${branch_name}"@{upstream} 2>/dev/null | wc -l) - (( behind )) && gitstatus+=( " $(print_icon 'VCS_INCOMING_CHANGES_ICON')${behind// /}" ) - - hook_com[misc]+=${(j::)gitstatus} -} - -function +vi-git-remotebranch() { - local remote branch_name - - # Are we on a remote-tracking branch? - remote=${$(command git rev-parse --verify HEAD@{upstream} --symbolic-full-name 2>/dev/null)/refs\/(remotes|heads)\/} - branch_name=$(command git symbolic-ref --short HEAD 2>/dev/null) - - if [[ -n "$POWERLEVEL9K_VCS_SHORTEN_LENGTH" ]] && [[ -n "$POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH" ]]; then - set_default POWERLEVEL9K_VCS_SHORTEN_DELIMITER $'\U2026' - - if [ ${#hook_com[branch]} -gt $POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH ] && [ ${#hook_com[branch]} -gt $POWERLEVEL9K_VCS_SHORTEN_LENGTH ]; then - case "$POWERLEVEL9K_VCS_SHORTEN_STRATEGY" in - truncate_middle) - hook_com[branch]="$(echo "${branch_name:0:$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")$POWERLEVEL9K_VCS_SHORTEN_DELIMITER$(echo "${branch_name: -$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")" - ;; - truncate_from_right) - hook_com[branch]="$(echo "${branch_name:0:$POWERLEVEL9K_VCS_SHORTEN_LENGTH}")$POWERLEVEL9K_VCS_SHORTEN_DELIMITER" - ;; - esac - fi - fi - - hook_com[branch]="$(print_icon 'VCS_BRANCH_ICON')${hook_com[branch]}" - # Always show the remote - #if [[ -n ${remote} ]] ; then - # Only show the remote if it differs from the local - if [[ -n ${remote} ]] && [[ "${remote#*/}" != "${branch_name}" ]] ; then - hook_com[branch]+="$(print_icon 'VCS_REMOTE_BRANCH_ICON')${remote// /}" - fi -} - -set_default POWERLEVEL9K_VCS_HIDE_TAGS false -function +vi-git-tagname() { - if [[ "$POWERLEVEL9K_VCS_HIDE_TAGS" == "false" ]]; then - # If we are on a tag, append the tagname to the current branch string. - local tag - tag=$(command git describe --tags --exact-match HEAD 2>/dev/null) - - if [[ -n "${tag}" ]] ; then - # There is a tag that points to our current commit. Need to determine if we - # are also on a branch, or are in a DETACHED_HEAD state. - if [[ -z $(command git symbolic-ref HEAD 2>/dev/null) ]]; then - # DETACHED_HEAD state. We want to append the tag name to the commit hash - # and print it. Unfortunately, `vcs_info` blows away the hash when a tag - # exists, so we have to manually retrieve it and clobber the branch - # string. - local revision - revision=$(command git rev-list -n 1 --abbrev-commit --abbrev=${POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH} HEAD) - hook_com[branch]="$(print_icon 'VCS_BRANCH_ICON')${revision} $(print_icon 'VCS_TAG_ICON')${tag}" - else - # We are on both a tag and a branch; print both by appending the tag name. - hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}" - fi - fi - fi -} - -# Show count of stashed changes -# Port from https://github.com/whiteinge/dotfiles/blob/5dfd08d30f7f2749cfc60bc55564c6ea239624d9/.zsh_shouse_prompt#L268 -function +vi-git-stash() { - local -a stashes - - if [[ -s $(command git rev-parse --git-dir)/refs/stash ]] ; then - stashes=$(command git stash list 2>/dev/null | wc -l) - hook_com[misc]+=" $(print_icon 'VCS_STASH_ICON')${stashes// /}" - fi -} - -function +vi-hg-bookmarks() { - if [[ -n "${hgbmarks[@]}" ]]; then - hook_com[hg-bookmark-string]=" $(print_icon 'VCS_BOOKMARK_ICON')${hgbmarks[@]}" - - # To signal that we want to use the sting we just generated, set the special - # variable `ret' to something other than the default zero: - ret=1 - return 0 - fi -} - -function +vi-vcs-detect-changes() { - if [[ "${hook_com[vcs]}" == "git" ]]; then - - local remote=$(command git ls-remote --get-url 2> /dev/null) - if [[ "$remote" =~ "github" ]] then - vcs_visual_identifier='VCS_GIT_GITHUB_ICON' - elif [[ "$remote" =~ "bitbucket" ]] then - vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' - elif [[ "$remote" =~ "stash" ]] then - vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' - elif [[ "$remote" =~ "gitlab" ]] then - vcs_visual_identifier='VCS_GIT_GITLAB_ICON' - else - vcs_visual_identifier='VCS_GIT_ICON' - fi - - elif [[ "${hook_com[vcs]}" == "hg" ]]; then - vcs_visual_identifier='VCS_HG_ICON' - elif [[ "${hook_com[vcs]}" == "svn" ]]; then - vcs_visual_identifier='VCS_SVN_ICON' - fi - - if [[ -n "${hook_com[staged]}" ]] || [[ -n "${hook_com[unstaged]}" ]]; then - VCS_WORKDIR_DIRTY=true - else - VCS_WORKDIR_DIRTY=false - fi -} - -function +vi-svn-detect-changes() { - local svn_status="$(svn status)" - if [[ -n "$(echo "$svn_status" | \grep \^\?)" ]]; then - hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" - VCS_WORKDIR_HALF_DIRTY=true - fi - if [[ -n "$(echo "$svn_status" | \grep \^\M)" ]]; then - hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')" - VCS_WORKDIR_DIRTY=true - fi - if [[ -n "$(echo "$svn_status" | \grep \^\A)" ]]; then - hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')" - VCS_WORKDIR_DIRTY=true - fi -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/powerlevel9k.zsh-theme b/.zprezto/modules/prompt/external/powerlevel9k/powerlevel9k.zsh-theme deleted file mode 100755 index 3c3303f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/powerlevel9k.zsh-theme +++ /dev/null @@ -1,1955 +0,0 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 -################################################################ -# powerlevel9k Theme -# https://github.com/bhilburn/powerlevel9k -# -# This theme was inspired by agnoster's Theme: -# https://gist.github.com/3712874 -################################################################ - -################################################################ -# For basic documentation, please refer to the README.md in the top-level -# directory. For more detailed documentation, refer to the project wiki, hosted -# on Github: https://github.com/bhilburn/powerlevel9k/wiki -# -# There are a lot of easy ways you can customize your prompt segments and -# theming with simple variables defined in your `~/.zshrc`. -################################################################ - -## Turn on for Debugging -#PS4='%s%f%b%k%F{blue}%{λ%}%L %F{240}%N:%i%(?.. %F{red}%?) %1(_.%F{yellow}%-1_ .)%s%f%b%k ' -#zstyle ':vcs_info:*+*:*' debug true -#set -o xtrace - -# Try to set the installation path -if [[ -n "$POWERLEVEL9K_INSTALLATION_DIR" ]]; then - p9k_directory=${POWERLEVEL9K_INSTALLATION_DIR:A} -else - if [[ "${(%):-%N}" == '(eval)' ]]; then - if [[ "$0" == '-antigen-load' ]] && [[ -r "${PWD}/powerlevel9k.zsh-theme" ]]; then - # Antigen uses eval to load things so it can change the plugin (!!) - # https://github.com/zsh-users/antigen/issues/581 - p9k_directory=$PWD - else - print -P "%F{red}You must set POWERLEVEL9K_INSTALLATION_DIR work from within an (eval).%f" - return 1 - fi - else - # Get the path to file this code is executing in; then - # get the absolute path and strip the filename. - # See https://stackoverflow.com/a/28336473/108857 - p9k_directory=${${(%):-%x}:A:h} - fi -fi - -################################################################ -# Source icon functions -################################################################ - -source "${p9k_directory}/functions/icons.zsh" - -################################################################ -# Source utility functions -################################################################ - -source "${p9k_directory}/functions/utilities.zsh" - -################################################################ -# Source color functions -################################################################ - -source "${p9k_directory}/functions/colors.zsh" - -################################################################ -# Source VCS_INFO hooks / helper functions -################################################################ - -source "${p9k_directory}/functions/vcs.zsh" - -# cleanup temporary variables. -unset p9k_directory - -################################################################ -# Color Scheme -################################################################ - -if [[ "$POWERLEVEL9K_COLOR_SCHEME" == "light" ]]; then - DEFAULT_COLOR=white - DEFAULT_COLOR_INVERTED=black -else - DEFAULT_COLOR=black - DEFAULT_COLOR_INVERTED=white -fi - -################################################################ -# Prompt Segment Constructors -# -# Methodology behind user-defined variables overwriting colors: -# The first parameter to the segment constructors is the calling function's -# name. From this function name, we strip the "prompt_"-prefix and -# uppercase it. This is then prefixed with "POWERLEVEL9K_" and suffixed -# with either "_BACKGROUND" or "_FOREGROUND", thus giving us the variable -# name. So each new segment is user-overwritten by a variable following -# this naming convention. -################################################################ - -# The `CURRENT_BG` variable is used to remember what the last BG color used was -# when building the left-hand prompt. Because the RPROMPT is created from -# right-left but reads the opposite, this isn't necessary for the other side. -CURRENT_BG='NONE' - -# Begin a left prompt segment -# Takes four arguments: -# * $1: Name of the function that was originally invoked (mandatory). -# Necessary, to make the dynamic color-overwrite mechanism work. -# * $2: The array index of the current segment -# * $3: Background color -# * $4: Foreground color -# * $5: The segment content -# * $6: An identifying icon (must be a key of the icons array) -# The latter three can be omitted, -set_default last_left_element_index 1 -set_default POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS " " -left_prompt_segment() { - local segment_name="${1}" - local current_index=$2 - # Check if the segment should be joined with the previous one - local joined - segmentShouldBeJoined $current_index $last_left_element_index "$POWERLEVEL9K_LEFT_PROMPT_ELEMENTS" && joined=true || joined=false - - # Colors - local backgroundColor="${3}" - local foregroundColor="${4}" - - # Overwrite given background-color by user defined variable for this segment. - local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)${segment_name}#prompt_}_BACKGROUND - local BG_COLOR_MODIFIER=${(P)BACKGROUND_USER_VARIABLE} - [[ -n $BG_COLOR_MODIFIER ]] && backgroundColor="$BG_COLOR_MODIFIER" - - # Overwrite given foreground-color by user defined variable for this segment. - local FOREGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)${segment_name}#prompt_}_FOREGROUND - local FG_COLOR_MODIFIER=${(P)FOREGROUND_USER_VARIABLE} - [[ -n $FG_COLOR_MODIFIER ]] && foregroundColor="$FG_COLOR_MODIFIER" - - # Get color codes here to save some calls later on - backgroundColor="$(getColorCode ${backgroundColor})" - foregroundColor="$(getColorCode ${foregroundColor})" - - local background foreground - [[ -n "${backgroundColor}" ]] && background="$(backgroundColor ${backgroundColor})" || background="%k" - [[ -n "${foregroundColor}" ]] && foreground="$(foregroundColor ${foregroundColor})" || foreground="%f" - - if [[ $CURRENT_BG != 'NONE' ]] && ! isSameColor "${backgroundColor}" "$CURRENT_BG"; then - echo -n "${background}%F{$CURRENT_BG}" - if [[ $joined == false ]]; then - # Middle segment - echo -n "$(print_icon 'LEFT_SEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS" - fi - elif isSameColor "$CURRENT_BG" "${backgroundColor}"; then - # Middle segment with same color as previous segment - # We take the current foreground color as color for our - # subsegment (or the default color). This should have - # enough contrast. - local complement - [[ -n "${foregroundColor}" ]] && complement="${foreground}" || complement="$(foregroundColor $DEFAULT_COLOR)" - echo -n "${background}${complement}" - if [[ $joined == false ]]; then - echo -n "$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS" - fi - else - # First segment - echo -n "${background}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS" - fi - - local visual_identifier - if [[ -n $6 ]]; then - visual_identifier="$(print_icon $6)" - if [[ -n "$visual_identifier" ]]; then - # Add an whitespace if we print more than just the visual identifier. - # To avoid cutting off the visual identifier in some terminal emulators (e.g., Konsole, st), - # we need to color both the visual identifier and the whitespace. - [[ -n "$5" ]] && visual_identifier="$visual_identifier " - # Allow users to overwrite the color for the visual identifier only. - local visual_identifier_color_variable=POWERLEVEL9K_${(U)${segment_name}#prompt_}_VISUAL_IDENTIFIER_COLOR - set_default $visual_identifier_color_variable "${foregroundColor}" - visual_identifier="$(foregroundColor ${(P)visual_identifier_color_variable})${visual_identifier}%f" - fi - fi - - # Print the visual identifier - echo -n "${visual_identifier}" - # Print the content of the segment, if there is any - [[ -n "$5" ]] && echo -n "${foreground}${5}" - echo -n "${POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS}" - - CURRENT_BG="${backgroundColor}" - last_left_element_index=$current_index -} - -# End the left prompt, closes the final segment. -left_prompt_end() { - if [[ -n $CURRENT_BG ]]; then - echo -n "%k$(foregroundColor ${CURRENT_BG})$(print_icon 'LEFT_SEGMENT_SEPARATOR')" - else - echo -n "%k" - fi - echo -n "%f$(print_icon 'LEFT_SEGMENT_END_SEPARATOR')" - CURRENT_BG='' -} - -CURRENT_RIGHT_BG='NONE' - -# Begin a right prompt segment -# Takes four arguments: -# * $1: Name of the function that was originally invoked (mandatory). -# Necessary, to make the dynamic color-overwrite mechanism work. -# * $2: The array index of the current segment -# * $3: Background color -# * $4: Foreground color -# * $5: The segment content -# * $6: An identifying icon (must be a key of the icons array) -# No ending for the right prompt segment is needed (unlike the left prompt, above). -set_default last_right_element_index 1 -set_default POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS " " -right_prompt_segment() { - local segment_name="${1}" - local current_index=$2 - - # Check if the segment should be joined with the previous one - local joined - segmentShouldBeJoined $current_index $last_right_element_index "$POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS" && joined=true || joined=false - - # Colors - local backgroundColor="${3}" - local foregroundColor="${4}" - - # Overwrite given background-color by user defined variable for this segment. - local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)${segment_name}#prompt_}_BACKGROUND - local BG_COLOR_MODIFIER=${(P)BACKGROUND_USER_VARIABLE} - [[ -n $BG_COLOR_MODIFIER ]] && backgroundColor="$BG_COLOR_MODIFIER" - - # Overwrite given foreground-color by user defined variable for this segment. - local FOREGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)${segment_name}#prompt_}_FOREGROUND - local FG_COLOR_MODIFIER=${(P)FOREGROUND_USER_VARIABLE} - [[ -n $FG_COLOR_MODIFIER ]] && foregroundColor="$FG_COLOR_MODIFIER" - - # Get color codes here to save some calls later on - backgroundColor="$(getColorCode ${backgroundColor})" - foregroundColor="$(getColorCode ${foregroundColor})" - - local background foreground - [[ -n "${backgroundColor}" ]] && background="$(backgroundColor ${backgroundColor})" || background="%k" - [[ -n "${foregroundColor}" ]] && foreground="$(foregroundColor ${foregroundColor})" || foreground="%f" - - # If CURRENT_RIGHT_BG is "NONE", we are the first right segment. - - if [[ "$CURRENT_RIGHT_BG" != "NONE" ]]; then - # This is the closing whitespace for the previous segment - echo -n "${POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS}%f" - fi - - if [[ $joined == false ]] || [[ "$CURRENT_RIGHT_BG" == "NONE" ]]; then - if isSameColor "$CURRENT_RIGHT_BG" "${backgroundColor}"; then - # Middle segment with same color as previous segment - # We take the current foreground color as color for our - # subsegment (or the default color). This should have - # enough contrast. - local complement - [[ -n "${foregroundColor}" ]] && complement="${foreground}" || complement="$(foregroundColor $DEFAULT_COLOR)" - echo -n "$complement$(print_icon 'RIGHT_SUBSEGMENT_SEPARATOR')%f" - else - # Use the new Background Color as the foreground of the segment separator - echo -n "$(foregroundColor ${backgroundColor})$(print_icon 'RIGHT_SEGMENT_SEPARATOR')%f" - fi - fi - - local visual_identifier - if [[ -n "$6" ]]; then - visual_identifier="$(print_icon $6)" - if [[ -n "$visual_identifier" ]]; then - # Add an whitespace if we print more than just the visual identifier. - # To avoid cutting off the visual identifier in some terminal emulators (e.g., Konsole, st), - # we need to color both the visual identifier and the whitespace. - [[ -n "$5" ]] && visual_identifier=" $visual_identifier" - # Allow users to overwrite the color for the visual identifier only. - local visual_identifier_color_variable=POWERLEVEL9K_${(U)${segment_name}#prompt_}_VISUAL_IDENTIFIER_COLOR - set_default $visual_identifier_color_variable "${foregroundColor}" - visual_identifier="$(foregroundColor ${(P)visual_identifier_color_variable})${visual_identifier}%f" - fi - fi - - echo -n "${background}${foreground}" - - # Print whitespace only if segment is not joined or first right segment - [[ $joined == false ]] || [[ "$CURRENT_RIGHT_BG" == "NONE" ]] && echo -n "${POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS}" - - # Print segment content if there is any - [[ -n "$5" ]] && echo -n "${5}" - # Print the visual identifier - echo -n "${visual_identifier}" - - CURRENT_RIGHT_BG="${backgroundColor}" - last_right_element_index=$current_index -} - -################################################################ -# Prompt Segment Definitions -################################################################ - -################################################################ -# Anaconda Environment -prompt_anaconda() { - # Depending on the conda version, either might be set. This - # variant works even if both are set. - local _path=$CONDA_ENV_PATH$CONDA_PREFIX - if ! [ -z "$_path" ]; then - # config - can be overwritten in users' zshrc file. - set_default POWERLEVEL9K_ANACONDA_LEFT_DELIMITER "(" - set_default POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER ")" - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$POWERLEVEL9K_ANACONDA_LEFT_DELIMITER$(basename $_path)$POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" 'PYTHON_ICON' - fi -} - -################################################################ -# AWS Profile -prompt_aws() { - local aws_profile="${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}" - - if [[ -n "$aws_profile" ]]; then - "$1_prompt_segment" "$0" "$2" red white "$aws_profile" 'AWS_ICON' - fi -} - -################################################################ -# Current Elastic Beanstalk environment -prompt_aws_eb_env() { - local eb_env=$(grep environment .elasticbeanstalk/config.yml 2> /dev/null | awk '{print $2}') - - if [[ -n "$eb_env" ]]; then - "$1_prompt_segment" "$0" "$2" black green "$eb_env" 'AWS_EB_ICON' - fi -} - -################################################################ -# Segment to indicate background jobs with an icon. -set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true -set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS false -prompt_background_jobs() { - local background_jobs_number=${$(jobs -l | wc -l)// /} - local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'` - if [[ wrong_lines -gt 0 ]]; then - background_jobs_number=$(( $background_jobs_number - $wrong_lines )) - fi - if [[ background_jobs_number -gt 0 ]]; then - local background_jobs_number_print="" - if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && ([[ "$background_jobs_number" -gt 1 ]] || [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS" == "true" ]]); then - background_jobs_number_print="$background_jobs_number" - fi - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON' - fi -} - -################################################################ -# A newline in your prompt, so you can segments on multiple lines. -prompt_newline() { - local lws newline - [[ "$1" == "right" ]] && return - newline=$'\n' - lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS - if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then - newline="${newline}$(print_icon 'MULTILINE_NEWLINE_PROMPT_PREFIX')" - fi - POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS= - "$1_prompt_segment" \ - "$0" \ - "$2" \ - "NONE" "NONE" "${newline}" - POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws -} - -################################################################ -# Segment that indicates usage level of current partition. -set_default POWERLEVEL9K_DISK_USAGE_ONLY_WARNING false -set_default POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL 90 -set_default POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL 95 -prompt_disk_usage() { - local current_state="unknown" - typeset -AH hdd_usage_forecolors - hdd_usage_forecolors=( - 'normal' 'yellow' - 'warning' "$DEFAULT_COLOR" - 'critical' 'white' - ) - typeset -AH hdd_usage_backcolors - hdd_usage_backcolors=( - 'normal' $DEFAULT_COLOR - 'warning' 'yellow' - 'critical' 'red' - ) - - local disk_usage="${$(\df -P . | sed -n '2p' | awk '{ print $5 }')%%\%}" - - if [ "$disk_usage" -ge "$POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL" ]; then - current_state='warning' - if [ "$disk_usage" -ge "$POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL" ]; then - current_state='critical' - fi - else - if [[ "$POWERLEVEL9K_DISK_USAGE_ONLY_WARNING" == true ]]; then - current_state='' - return - fi - current_state='normal' - fi - - local message="${disk_usage}%%" - - # Draw the prompt_segment - if [[ -n $disk_usage ]]; then - "$1_prompt_segment" "${0}_${current_state}" "$2" "${hdd_usage_backcolors[$current_state]}" "${hdd_usage_forecolors[$current_state]}" "$message" 'DISK_ICON' - fi -} - -################################################################ -# Segment that displays the battery status in levels and colors -prompt_battery() { - # The battery can have four different states - default to 'unknown'. - local current_state='unknown' - typeset -AH battery_states - battery_states=( - 'low' 'red' - 'charging' 'yellow' - 'charged' 'green' - 'disconnected' "$DEFAULT_COLOR_INVERTED" - ) - local ROOT_PREFIX="${4}" - # Set default values if the user did not configure them - set_default POWERLEVEL9K_BATTERY_LOW_THRESHOLD 10 - - if [[ $OS =~ OSX && -f "${ROOT_PREFIX}"/usr/bin/pmset && -x "${ROOT_PREFIX}"/usr/bin/pmset ]]; then - # obtain battery information from system - local raw_data="$(${ROOT_PREFIX}/usr/bin/pmset -g batt | awk 'FNR==2{print}')" - # return if there is no battery on system - [[ -z $(echo $raw_data | grep "InternalBattery") ]] && return - - # Time remaining on battery operation (charging/discharging) - local tstring=$(echo $raw_data | awk -F ';' '{print $3}' | awk '{print $1}') - # If time has not been calculated by system yet - [[ $tstring =~ '(\(no|not)' ]] && tstring="..." - - # percent of battery charged - typeset -i 10 bat_percent - bat_percent=$(echo $raw_data | grep -o '[0-9]*%' | sed 's/%//') - - local remain="" - # Logic for string output - case $(echo $raw_data | awk -F ';' '{print $2}' | awk '{$1=$1};1') in - # for a short time after attaching power, status will be 'AC attached;' - 'charging'|'finishing charge'|'AC attached') - current_state="charging" - remain=" ($tstring)" - ;; - 'discharging') - [[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && current_state="low" || current_state="disconnected" - remain=" ($tstring)" - ;; - *) - current_state="charged" - ;; - esac - fi - - if [[ "$OS" == 'Linux' ]] || [[ "$OS" == 'Android' ]]; then - local sysp="${ROOT_PREFIX}/sys/class/power_supply" - - # Reported BAT0 or BAT1 depending on kernel version - [[ -a $sysp/BAT0 ]] && local bat=$sysp/BAT0 - [[ -a $sysp/BAT1 ]] && local bat=$sysp/BAT1 - - # Android-related - # Tested on: Moto G falcon (CM 13.0) - [[ -a $sysp/battery ]] && local bat=$sysp/battery - - # Return if no battery found - [[ -z $bat ]] && return - local capacity=$(cat $bat/capacity) - local battery_status=$(cat $bat/status) - [[ $capacity -gt 100 ]] && local bat_percent=100 || local bat_percent=$capacity - [[ $battery_status =~ Charging || $battery_status =~ Full ]] && local connected=true - if [[ -z $connected ]]; then - [[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && current_state="low" || current_state="disconnected" - else - [[ $bat_percent =~ 100 ]] && current_state="charged" - [[ $bat_percent -lt 100 ]] && current_state="charging" - fi - if [[ -f ${ROOT_PREFIX}/usr/bin/acpi ]]; then - local time_remaining=$(${ROOT_PREFIX}/usr/bin/acpi | awk '{ print $5 }') - if [[ $time_remaining =~ rate ]]; then - local tstring="..." - elif [[ $time_remaining =~ "[[:digit:]]+" ]]; then - local tstring=${(f)$(date -u -d "$(echo $time_remaining)" +%k:%M 2> /dev/null)} - fi - fi - [[ -n $tstring ]] && local remain=" ($tstring)" - fi - - local message - # Default behavior: Be verbose! - set_default POWERLEVEL9K_BATTERY_VERBOSE true - if [[ "$POWERLEVEL9K_BATTERY_VERBOSE" == true ]]; then - message="$bat_percent%%$remain" - else - message="$bat_percent%%" - fi - - # override default icon if we are using battery stages - if [[ -n "$POWERLEVEL9K_BATTERY_STAGES" ]]; then - local segment=$(( 100.0 / (${#POWERLEVEL9K_BATTERY_STAGES} - 1 ) )) - if [[ $segment > 1 ]]; then - local offset=$(( ($bat_percent / $segment) + 1 )) - # check if the stages are in an array or a string - [[ "${(t)POWERLEVEL9K_BATTERY_STAGES}" =~ "array" ]] && POWERLEVEL9K_BATTERY_ICON="$POWERLEVEL9K_BATTERY_STAGES[$offset]" || POWERLEVEL9K_BATTERY_ICON=${POWERLEVEL9K_BATTERY_STAGES:$offset:1} - fi - fi - # return if POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD is set and the battery percentage is greater or equal - if defined POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD && [[ "${bat_percent}" -ge $POWERLEVEL9K_BATTERY_HIDE_ABOVE_THRESHOLD ]]; then - return - fi - - # override the default color if we are using a color level array - if [[ -n "$POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND" ]] && [[ "${(t)POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND}" =~ "array" ]]; then - local segment=$(( 100.0 / (${#POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND} - 1 ) )) - local offset=$(( ($bat_percent / $segment) + 1 )) - "$1_prompt_segment" "$0_${current_state}" "$2" "${POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND[$offset]}" "${battery_states[$current_state]}" "${message}" "BATTERY_ICON" - else - # Draw the prompt_segment - "$1_prompt_segment" "$0_${current_state}" "$2" "${DEFAULT_COLOR}" "${battery_states[$current_state]}" "${message}" "BATTERY_ICON" - fi -} - -################################################################ -# Public IP segment -# Parameters: -# * $1 Alignment: string - left|right -# * $2 Index: integer -# * $3 Joined: bool - If the segment should be joined -prompt_public_ip() { - # set default values for segment - set_default POWERLEVEL9K_PUBLIC_IP_TIMEOUT "300" - set_default POWERLEVEL9K_PUBLIC_IP_NONE "" - set_default POWERLEVEL9K_PUBLIC_IP_FILE "/tmp/p9k_public_ip" - set_default POWERLEVEL9K_PUBLIC_IP_HOST "http://ident.me" - defined POWERLEVEL9K_PUBLIC_IP_METHODS || POWERLEVEL9K_PUBLIC_IP_METHODS=(dig curl wget) - - # Do we need a fresh IP? - local refresh_ip=false - if [[ -f $POWERLEVEL9K_PUBLIC_IP_FILE ]]; then - typeset -i timediff - # if saved IP is more than - if [[ "$OS" == "OSX" ]]; then - timediff=$(($(date +%s) - $(stat -f "%m" $POWERLEVEL9K_PUBLIC_IP_FILE))) - else - timediff=$(($(date +%s) - $(date -r $POWERLEVEL9K_PUBLIC_IP_FILE +%s))) - fi - [[ $timediff -gt $POWERLEVEL9K_PUBLIC_IP_TIMEOUT ]] && refresh_ip=true - # If tmp file is empty get a fresh IP - [[ -z $(cat $POWERLEVEL9K_PUBLIC_IP_FILE) ]] && refresh_ip=true - [[ -n $POWERLEVEL9K_PUBLIC_IP_NONE ]] && [[ $(cat $POWERLEVEL9K_PUBLIC_IP_FILE) =~ "$POWERLEVEL9K_PUBLIC_IP_NONE" ]] && refresh_ip=true - else - touch $POWERLEVEL9K_PUBLIC_IP_FILE && refresh_ip=true - fi - - # grab a fresh IP if needed - local fresh_ip - if [[ $refresh_ip =~ true && -w $POWERLEVEL9K_PUBLIC_IP_FILE ]]; then - for method in "${POWERLEVEL9K_PUBLIC_IP_METHODS[@]}"; do - case $method in - 'dig') - fresh_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com 2> /dev/null)" - [[ "$fresh_ip" =~ ^\; ]] && unset fresh_ip - ;; - 'curl') - fresh_ip="$(curl --max-time 10 -w '\n' "$POWERLEVEL9K_PUBLIC_IP_HOST" 2> /dev/null)" - ;; - 'wget') - fresh_ip="$(wget -T 10 -qO- "$POWERLEVEL9K_PUBLIC_IP_HOST" 2> /dev/null)" - ;; - esac - # If we found a fresh IP, break loop. - if [[ -n "${fresh_ip}" ]]; then - break; - fi - done - - # write IP to tmp file or clear tmp file if an IP was not retrieved - # Redirection with `>!`. From the manpage: Same as >, except that the file - # is truncated to zero length if it exists, even if CLOBBER is unset. - # If the file already exists, and a simple `>` redirection and CLOBBER - # unset, ZSH will produce an error. - [[ -n "${fresh_ip}" ]] && echo $fresh_ip >! $POWERLEVEL9K_PUBLIC_IP_FILE || echo $POWERLEVEL9K_PUBLIC_IP_NONE >! $POWERLEVEL9K_PUBLIC_IP_FILE - fi - - # read public IP saved to tmp file - local public_ip="$(cat $POWERLEVEL9K_PUBLIC_IP_FILE)" - - # Draw the prompt segment - if [[ -n $public_ip ]]; then - icon='PUBLIC_IP_ICON' - # Check VPN is on if VPN interface is set - if [[ -n $POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE ]]; then - for vpn_iface in $(/sbin/ifconfig | grep -e ^"$POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE" | cut -d":" -f1) - do - icon='VPN_ICON' - break - done - fi - $1_prompt_segment "$0" "$2" "$DEFAULT_COLOR" "$DEFAULT_COLOR_INVERTED" "${public_ip}" "$icon" - fi -} - -################################################################ -# Context: user@hostname (who am I and where am I) -# Note that if $DEFAULT_USER is not set, this prompt segment will always print -set_default POWERLEVEL9K_ALWAYS_SHOW_CONTEXT false -set_default POWERLEVEL9K_ALWAYS_SHOW_USER false -set_default POWERLEVEL9K_CONTEXT_TEMPLATE "%n@%m" -prompt_context() { - local current_state="DEFAULT" - typeset -AH context_states - context_states=( - "ROOT" "yellow" - "SUDO" "yellow" - "DEFAULT" "yellow" - "REMOTE" "yellow" - "REMOTE_SUDO" "yellow" - ) - - local content="" - - if [[ "$POWERLEVEL9K_ALWAYS_SHOW_CONTEXT" == true ]] || [[ "$(whoami)" != "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then - content="${POWERLEVEL9K_CONTEXT_TEMPLATE}" - elif [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]]; then - content="$(whoami)" - else - return - fi - - if [[ $(print -P "%#") == '#' ]]; then - current_state="ROOT" - elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then - if [[ -n "$SUDO_COMMAND" ]]; then - current_state="REMOTE_SUDO" - else - current_state="REMOTE" - fi - elif [[ -n "$SUDO_COMMAND" ]]; then - current_state="SUDO" - fi - - "$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${context_states[$current_state]}" "${content}" -} - -################################################################ -# User: user (who am I) -# Note that if $DEFAULT_USER is not set, this prompt segment will always print -set_default POWERLEVEL9K_USER_TEMPLATE "%n" -prompt_user() { - local current_state="DEFAULT" - typeset -AH user_state - if [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]] || [[ "$(whoami)" != "$DEFAULT_USER" ]]; then - if [[ $(print -P "%#") == '#' ]]; then - user_state=( - "STATE" "ROOT" - "CONTENT" "${POWERLEVEL9K_USER_TEMPLATE}" - "BACKGROUND_COLOR" "${DEFAULT_COLOR}" - "FOREGROUND_COLOR" "yellow" - "VISUAL_IDENTIFIER" "ROOT_ICON" - ) - elif [[ -n "$SUDO_COMMAND" ]]; then - user_state=( - "STATE" "SUDO" - "CONTENT" "${POWERLEVEL9K_USER_TEMPLATE}" - "BACKGROUND_COLOR" "${DEFAULT_COLOR}" - "FOREGROUND_COLOR" "yellow" - "VISUAL_IDENTIFIER" "SUDO_ICON" - ) - else - user_state=( - "STATE" "DEFAULT" - "CONTENT" "$(whoami)" - "BACKGROUND_COLOR" "${DEFAULT_COLOR}" - "FOREGROUND_COLOR" "yellow" - "VISUAL_IDENTIFIER" "USER_ICON" - ) - fi - "$1_prompt_segment" "${0}_${user_state[STATE]}" "$2" "${user_state[BACKGROUND_COLOR]}" "${user_state[FOREGROUND_COLOR]}" "${user_state[CONTENT]}" "${user_state[VISUAL_IDENTIFIER]}" - fi -} - -################################################################ -# Host: machine (where am I) -set_default POWERLEVEL9K_HOST_TEMPLATE "%m" -prompt_host() { - local current_state="LOCAL" - typeset -AH host_state - if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then - host_state=( - "STATE" "REMOTE" - "CONTENT" "${POWERLEVEL9K_HOST_TEMPLATE}" - "BACKGROUND_COLOR" "${DEFAULT_COLOR}" - "FOREGROUND_COLOR" "yellow" - "VISUAL_IDENTIFIER" "SSH_ICON" - ) - else - host_state=( - "STATE" "LOCAL" - "CONTENT" "${POWERLEVEL9K_HOST_TEMPLATE}" - "BACKGROUND_COLOR" "${DEFAULT_COLOR}" - "FOREGROUND_COLOR" "yellow" - "VISUAL_IDENTIFIER" "HOST_ICON" - ) - fi - "$1_prompt_segment" "$0_${host_state[STATE]}" "$2" "${host_state[BACKGROUND_COLOR]}" "${host_state[FOREGROUND_COLOR]}" "${host_state[CONTENT]}" "${host_state[VISUAL_IDENTIFIER]}" -} - -################################################################ -# The 'custom` prompt provides a way for users to invoke commands and display -# the output in a segment. -prompt_custom() { - local segment_name="${3:u}" - # Get content of custom segment - local command="POWERLEVEL9K_CUSTOM_${segment_name}" - local segment_content="$(eval ${(P)command})" - - if [[ -n $segment_content ]]; then - "$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$segment_content" "CUSTOM_${segment_name}_ICON" - fi -} - -################################################################ -# Display the duration the command needed to run. -prompt_command_execution_time() { - set_default POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD 3 - set_default POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION 2 - - # Print time in human readable format - # For that use `strftime` and convert - # the duration (float) to an seconds - # (integer). - # See http://unix.stackexchange.com/a/89748 - local humanReadableDuration - if (( _P9K_COMMAND_DURATION > 3600 )); then - humanReadableDuration=$(TZ=GMT; strftime '%H:%M:%S' $(( int(rint(_P9K_COMMAND_DURATION)) ))) - elif (( _P9K_COMMAND_DURATION > 60 )); then - humanReadableDuration=$(TZ=GMT; strftime '%M:%S' $(( int(rint(_P9K_COMMAND_DURATION)) ))) - else - # If the command executed in seconds, print as float. - # Convert to float - if [[ "${POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION}" == "0" ]]; then - # If user does not want microseconds, then we need to convert - # the duration to an integer. - typeset -i humanReadableDuration - else - typeset -F ${POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION} humanReadableDuration - fi - humanReadableDuration=$_P9K_COMMAND_DURATION - fi - - if (( _P9K_COMMAND_DURATION >= POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD )); then - "$1_prompt_segment" "$0" "$2" "red" "yellow1" "${humanReadableDuration}" 'EXECUTION_TIME_ICON' - fi -} - -################################################################ -# Determine the unique path - this is needed for the -# truncate_to_unique strategy. -# -function getUniqueFolder() { - local trunc_path directory test_dir test_dir_length - local -a matching - local -a paths - local cur_path='/' - paths=(${(s:/:)1}) - for directory in ${paths[@]}; do - test_dir='' - for (( i=0; i < ${#directory}; i++ )); do - test_dir+="${directory:$i:1}" - matching=("$cur_path"/"$test_dir"*/) - if [[ ${#matching[@]} -eq 1 ]]; then - break - fi - done - trunc_path+="$test_dir/" - cur_path+="$directory/" - done - echo "${trunc_path: : -1}" -} - -################################################################ -# Dir: current working directory -# Parameters: -# * $1 Alignment: string - left|right -# * $2 Index: integer -set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/" -set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~" -set_default POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD false -prompt_dir() { - # using $PWD instead of "$(print -P '%~')" to allow use of POWERLEVEL9K_DIR_PATH_ABSOLUTE - local current_path=$PWD # WAS: local current_path="$(print -P '%~')" - # check if the user wants to use absolute paths or "~" paths - [[ ${(L)POWERLEVEL9K_DIR_PATH_ABSOLUTE} != "true" ]] && current_path=${current_path//$HOME/"~"} - # declare all local variables - local paths directory test_dir test_dir_length trunc_path threshhold - # if we are not in "~" or "/", split the paths into an array and exclude "~" - (( ${#current_path} > 1 )) && paths=(${(s:/:)${current_path//"~\/"/}}) || paths=() - # only run the code if SHORTEN_DIR_LENGTH is set, or we are using the two strategies that don't rely on it. - if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_to_last" ]]; then - set_default POWERLEVEL9K_SHORTEN_DELIMITER "\u2026" - # convert delimiter from unicode to literal character, so that we can get the correct length later - local delim=$(echo -n $POWERLEVEL9K_SHORTEN_DELIMITER) - - case "$POWERLEVEL9K_SHORTEN_STRATEGY" in - truncate_absolute_chars) - if [ ${#current_path} -gt $(( $POWERLEVEL9K_SHORTEN_DIR_LENGTH + ${#POWERLEVEL9K_SHORTEN_DELIMITER} )) ]; then - current_path=$POWERLEVEL9K_SHORTEN_DELIMITER${current_path:(-POWERLEVEL9K_SHORTEN_DIR_LENGTH)} - fi - ;; - truncate_middle) - # truncate characters from the middle of the path - current_path=$(truncatePath $current_path $POWERLEVEL9K_SHORTEN_DIR_LENGTH $POWERLEVEL9K_SHORTEN_DELIMITER "middle") - ;; - truncate_from_right) - # truncate characters from the right of the path - current_path=$(truncatePath "$current_path" $POWERLEVEL9K_SHORTEN_DIR_LENGTH $POWERLEVEL9K_SHORTEN_DELIMITER) - ;; - truncate_absolute) - # truncate all characters except the last POWERLEVEL9K_SHORTEN_DIR_LENGTH characters - if [ ${#current_path} -gt $(( $POWERLEVEL9K_SHORTEN_DIR_LENGTH + ${#POWERLEVEL9K_SHORTEN_DELIMITER} )) ]; then - current_path=$POWERLEVEL9K_SHORTEN_DELIMITER${current_path:(-POWERLEVEL9K_SHORTEN_DIR_LENGTH)} - fi - ;; - truncate_to_last) - # truncate all characters before the current directory - current_path=${current_path##*/} - ;; - truncate_to_first_and_last) - if (( ${#current_path} > 1 )) && (( ${POWERLEVEL9K_SHORTEN_DIR_LENGTH} > 0 )); then - threshhold=$(( ${POWERLEVEL9K_SHORTEN_DIR_LENGTH} * 2)) - # if we are in "~", add it back into the paths array - [[ $current_path == '~'* ]] && paths=("~" "${paths[@]}") - if (( ${#paths} > $threshhold )); then - local num=$(( ${#paths} - ${POWERLEVEL9K_SHORTEN_DIR_LENGTH} )) - # repace the middle elements - for (( i=$POWERLEVEL9K_SHORTEN_DIR_LENGTH; i<$num; i++ )); do - paths[$i+1]=$POWERLEVEL9K_SHORTEN_DELIMITER - done - [[ $current_path != '~'* ]] && current_path="/" || current_path="" - current_path+="${(j:/:)paths}" - fi - fi - ;; - truncate_to_unique) - # for each parent path component find the shortest unique beginning - # characters sequence. Source: https://stackoverflow.com/a/45336078 - if (( ${#current_path} > 1 )); then # root and home are exceptions and won't have paths - # cheating here to retain ~ as home folder - local home_path="$(getUniqueFolder $HOME)" - trunc_path="$(getUniqueFolder $PWD)" - [[ $current_path == "~"* ]] && current_path="~${trunc_path//${home_path}/}" || current_path="/${trunc_path}" - fi - ;; - truncate_with_folder_marker) - if (( ${#paths} > 0 )); then # root and home are exceptions and won't have paths, so skip this - local last_marked_folder marked_folder - set_default POWERLEVEL9K_SHORTEN_FOLDER_MARKER ".shorten_folder_marker" - - # Search for the folder marker in the parent directories and - # buildup a pattern that is removed from the current path - # later on. - for marked_folder in $(upsearch $POWERLEVEL9K_SHORTEN_FOLDER_MARKER); do - if [[ "$marked_folder" == "/" ]]; then - # If we reached root folder, stop upsearch. - trunc_path="/" - elif [[ "$marked_folder" == "$HOME" ]]; then - # If we reached home folder, stop upsearch. - trunc_path="~" - elif [[ "${marked_folder%/*}" == $last_marked_folder ]]; then - trunc_path="${trunc_path%/}/${marked_folder##*/}" - else - trunc_path="${trunc_path%/}/$POWERLEVEL9K_SHORTEN_DELIMITER/${marked_folder##*/}" - fi - last_marked_folder=$marked_folder - done - - # Replace the shortest possible match of the marked folder from - # the current path. - current_path=$trunc_path${current_path#${last_marked_folder}*} - fi - ;; - truncate_with_package_name) - local name repo_path package_path current_dir zero - - # Get the path of the Git repo, which should have the package.json file - if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == "true" ]]; then - # Get path from the root of the git repository to the current dir - local gitPath=$(git rev-parse --show-prefix) - # Remove trailing slash from git path, so that we can - # remove that git path from the pwd. - gitPath=${gitPath%/} - package_path=${$(pwd)%%$gitPath} - # Remove trailing slash - package_path=${package_path%/} - elif [[ $(git rev-parse --is-inside-git-dir 2> /dev/null) == "true" ]]; then - package_path=${$(pwd)%%/.git*} - fi - - # Replace the shortest possible match of the marked folder from - # the current path. Remove the amount of characters up to the - # folder marker from the left. Count only the visible characters - # in the path (this is done by the "zero" pattern; see - # http://stackoverflow.com/a/40855342/5586433). - local zero='%([BSUbfksu]|([FB]|){*})' - trunc_path=$(pwd) - # Then, find the length of the package_path string, and save the - # subdirectory path as a substring of the current directory's path from 0 - # to the length of the package path's string - subdirectory_path=$(truncatePath "${trunc_path:${#${(S%%)package_path//$~zero/}}}" $POWERLEVEL9K_SHORTEN_DIR_LENGTH $POWERLEVEL9K_SHORTEN_DELIMITER) - # Parse the 'name' from the package.json; if there are any problems, just - # print the file path - defined POWERLEVEL9K_DIR_PACKAGE_FILES || POWERLEVEL9K_DIR_PACKAGE_FILES=(package.json composer.json) - - local pkgFile="unknown" - for file in "${POWERLEVEL9K_DIR_PACKAGE_FILES[@]}"; do - if [[ -f "${package_path}/${file}" ]]; then - pkgFile="${package_path}/${file}" - break; - fi - done - - local packageName=$(jq '.name' ${pkgFile} 2> /dev/null \ - || node -e 'console.log(require(process.argv[1]).name);' ${pkgFile} 2>/dev/null \ - || cat "${pkgFile}" 2> /dev/null | grep -m 1 "\"name\"" | awk -F ':' '{print $2}' | awk -F '"' '{print $2}' 2>/dev/null \ - ) - if [[ -n "${packageName}" ]]; then - # Instead of printing out the full path, print out the name of the package - # from the package.json and append the current subdirectory - current_path="`echo $packageName | tr -d '"'`$subdirectory_path" - fi - ;; - *) - if [[ $current_path != "~" ]]; then - current_path="$(print -P "%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c")" - fi - ;; - esac - fi - - # save state of path for highlighting and bold options - local path_opt=$current_path - - typeset -AH dir_states - dir_states=( - "DEFAULT" "FOLDER_ICON" - "HOME" "HOME_ICON" - "HOME_SUBFOLDER" "HOME_SUB_ICON" - "NOT_WRITABLE" "LOCK_ICON" - "ETC" "ETC_ICON" - ) - local state_path="$(print -P '%~')" - local current_state="DEFAULT" - if [[ $state_path == '/etc'* ]]; then - current_state='ETC' - elif [[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == true && ! -w "$PWD" ]]; then - current_state="NOT_WRITABLE" - elif [[ $state_path == '~' ]]; then - current_state="HOME" - elif [[ $state_path == '~'* ]]; then - current_state="HOME_SUBFOLDER" - fi - - # declare variables used for bold and state colors - local bld_on bld_off dir_state_foreground dir_state_user_foreground - # test if user wants the last directory printed in bold - if [[ "${(L)POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD}" == "true" ]]; then - bld_on="%B" - bld_off="%b" - else - bld_on="" - bld_off="" - fi - # determine is the user has set a last directory color - local dir_state_user_foreground=POWERLEVEL9K_DIR_${current_state}_FOREGROUND - local dir_state_foreground=${(P)dir_state_user_foreground} - [[ -z ${dir_state_foreground} ]] && dir_state_foreground="${DEFAULT_COLOR}" - - local dir_name base_name - # use ZSH substitution to get the dirname and basename instead of calling external functions - dir_name=${path_opt%/*} - base_name=${path_opt##*/} - - # if the user wants the last directory colored... - if [[ -n ${POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND} ]]; then - # it the path is "/" or "~" - if [[ $path_opt == "/" || $path_opt == "~" ]]; then - current_path="${bld_on}%F{$POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND}${current_path}${bld_off}" - else # has a subfolder - # test if dirname != basename - they are equal if we use truncate_to_last or truncate_absolute - if [[ $dir_name != $base_name ]]; then - current_path="${dir_name}/${bld_on}%F{$POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND}${base_name}${bld_off}" - else - current_path="${bld_on}%F{$POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND}${base_name}${bld_off}" - fi - fi - else # no coloring - # it the path is "/" or "~" - if [[ $path_opt == "/" || $path_opt == "~" ]]; then - current_path="${bld_on}${current_path}${bld_off}" - else # has a subfolder - # test if dirname != basename - they are equal if we use truncate_to_last or truncate_absolute - if [[ $dir_name != $base_name ]]; then - current_path="${dir_name}/${bld_on}${base_name}${bld_off}" - else - current_path="${bld_on}${base_name}${bld_off}" - fi - fi - fi - - # check if we need to omit the first character and only do it if we are not in "~" or "/" - if [[ "${POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER}" == "true" && $path_opt != "/" && $path_opt != "~" ]]; then - current_path="${current_path[2,-1]}" - fi - - # check if the user wants the separator colored. - if [[ -n ${POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND} && $path_opt != "/" ]]; then - # because this contains color changing codes, it is easier to set a variable for what should be replaced - local repl="%F{$POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND}/%F{$dir_state_foreground}" - # escape the / with a \ - current_path=${current_path//\//$repl} - fi - - if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" && $path_opt != "/" ]]; then - current_path=${current_path//\//$POWERLEVEL9K_DIR_PATH_SEPARATOR} - fi - - if [[ "${POWERLEVEL9K_HOME_FOLDER_ABBREVIATION}" != "~" && ! "${(L)POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER}" == "true" ]]; then - # use :s to only replace the first occurance - current_path=${current_path:s/~/$POWERLEVEL9K_HOME_FOLDER_ABBREVIATION} - fi - - "$1_prompt_segment" "$0_${current_state}" "$2" "blue" "$DEFAULT_COLOR" "${current_path}" "${dir_states[$current_state]}" -} - -################################################################ -# Docker machine -prompt_docker_machine() { - local docker_machine="$DOCKER_MACHINE_NAME" - - if [[ -n "$docker_machine" ]]; then - "$1_prompt_segment" "$0" "$2" "magenta" "$DEFAULT_COLOR" "$docker_machine" 'SERVER_ICON' - fi -} - -################################################################ -# GO prompt -prompt_go_version() { - local go_version - local go_path - go_version=$(go version 2>/dev/null | sed -E "s/.*(go[0-9.]*).*/\1/") - go_path=$(go env GOPATH 2>/dev/null) - - if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then - "$1_prompt_segment" "$0" "$2" "green" "grey93" "$go_version" "GO_ICON" - fi -} - -################################################################ -# Command number (in local history) -prompt_history() { - "$1_prompt_segment" "$0" "$2" "grey50" "$DEFAULT_COLOR" '%h' -} - -################################################################ -# Detection for virtualization (systemd based systems only) -prompt_detect_virt() { - local virt=$(systemd-detect-virt 2> /dev/null) - if [[ "$virt" == "none" ]]; then - if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then - virt="chroot" - fi - fi - - if [[ -n "${virt}" ]]; then - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt" - fi -} - -################################################################ -# Test icons -prompt_icons_test() { - for key in ${(@k)icons}; do - # The lower color spectrum in ZSH makes big steps. Choosing - # the next color has enough contrast to read. - local random_color=$((RANDOM % 8)) - local next_color=$((random_color+1)) - "$1_prompt_segment" "$0" "$2" "$random_color" "$next_color" "$key" "$key" - done -} - -################################################################ -# Segment to display the current IP address -prompt_ip() { - if [[ "$OS" == "OSX" ]]; then - if defined POWERLEVEL9K_IP_INTERFACE; then - # Get the IP address of the specified interface. - ip=$(ipconfig getifaddr "$POWERLEVEL9K_IP_INTERFACE") - else - local interfaces callback - # Get network interface names ordered by service precedence. - interfaces=$(networksetup -listnetworkserviceorder | grep -o "Device:\s*[a-z0-9]*" | grep -o -E '[a-z0-9]*$') - callback='ipconfig getifaddr $item' - - ip=$(getRelevantItem "$interfaces" "$callback") - fi - else - if defined POWERLEVEL9K_IP_INTERFACE; then - # Get the IP address of the specified interface. - ip=$(ip -4 a show "$POWERLEVEL9K_IP_INTERFACE" | grep -o "inet\s*[0-9.]*" | grep -o -E "[0-9.]+") - else - local interfaces callback - # Get all network interface names that are up - interfaces=$(ip link ls up | grep -o -E ":\s+[a-z0-9]+:" | grep -v "lo" | grep -o -E "[a-z0-9]+") - callback='ip -4 a show $item | grep -o "inet\s*[0-9.]*" | grep -o -E "[0-9.]+"' - - ip=$(getRelevantItem "$interfaces" "$callback") - fi - fi - - if [[ -n "$ip" ]]; then - "$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'NETWORK_ICON' - fi -} - -################################################################ -# Segment to display if VPN is active -set_default POWERLEVEL9K_VPN_IP_INTERFACE "tun" -# prompt if vpn active -prompt_vpn_ip() { - for vpn_iface in $(/sbin/ifconfig | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1) - do - ip=$(/sbin/ifconfig "$vpn_iface" | grep -o "inet\s.*" | cut -d' ' -f2) - "$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'VPN_ICON' - done -} - -################################################################ -# Segment to display laravel version -prompt_laravel_version() { - local laravel_version="$(php artisan --version 2> /dev/null)" - if [[ -n "${laravel_version}" && "${laravel_version}" =~ "Laravel Framework" ]]; then - # Strip out everything but the version - laravel_version="${laravel_version//Laravel Framework /}" - "$1_prompt_segment" "$0" "$2" "maroon" "white" "${laravel_version}" 'LARAVEL_ICON' - fi -} - -################################################################ -# Segment to display load -set_default POWERLEVEL9K_LOAD_WHICH 5 -prompt_load() { - local ROOT_PREFIX="${4}" - # The load segment can have three different states - local current_state="unknown" - local load_select=2 - local load_avg - local cores - - typeset -AH load_states - load_states=( - 'critical' 'red' - 'warning' 'yellow' - 'normal' 'green' - ) - - case "$POWERLEVEL9K_LOAD_WHICH" in - 1) - load_select=1 - ;; - 5) - load_select=2 - ;; - 15) - load_select=3 - ;; - esac - - case "$OS" in - OSX|BSD) - load_avg=$(sysctl vm.loadavg | grep -o -E '[0-9]+(\.|,)[0-9]+' | sed -n ${load_select}p) - if [[ "$OS" == "OSX" ]]; then - cores=$(sysctl -n hw.logicalcpu) - else - cores=$(sysctl -n hw.ncpu) - fi - ;; - *) - load_avg=$(cut -d" " -f${load_select} ${ROOT_PREFIX}/proc/loadavg) - cores=$(nproc) - esac - - # Replace comma - load_avg=${load_avg//,/.} - - if [[ "$load_avg" -gt $((${cores} * 0.7)) ]]; then - current_state="critical" - elif [[ "$load_avg" -gt $((${cores} * 0.5)) ]]; then - current_state="warning" - else - current_state="normal" - fi - - "$1_prompt_segment" "${0}_${current_state}" "$2" "${load_states[$current_state]}" "$DEFAULT_COLOR" "$load_avg" 'LOAD_ICON' -} - -################################################################ -# Segment to diplay Node version -prompt_node_version() { - local node_version=$(node -v 2>/dev/null) - [[ -z "${node_version}" ]] && return - - "$1_prompt_segment" "$0" "$2" "green" "white" "${node_version:1}" 'NODE_ICON' -} - -################################################################ -# Segment to display Node version from NVM -# Only prints the segment if different than the default value -prompt_nvm() { - local node_version nvm_default - (( $+functions[nvm_version] )) || return - - node_version=$(nvm_version current) - [[ -z "${node_version}" || ${node_version} == "none" ]] && return - - nvm_default=$(nvm_version default) - [[ "$node_version" =~ "$nvm_default" ]] && return - - $1_prompt_segment "$0" "$2" "magenta" "black" "${node_version:1}" 'NODE_ICON' -} - -################################################################ -# Segment to display NodeEnv -prompt_nodeenv() { - local nodeenv_path="$NODE_VIRTUAL_ENV" - if [[ -n "$nodeenv_path" && "$NODE_VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then - local info="$(node -v)[$(basename "$nodeenv_path")]" - "$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON' - fi -} - -################################################################ -# Segment to print a little OS icon -prompt_os_icon() { - "$1_prompt_segment" "$0" "$2" "black" "white" "$OS_ICON" -} - -################################################################ -# Segment to display PHP version number -prompt_php_version() { - local php_version - php_version=$(php -v 2>&1 | grep -oe "^PHP\s*[0-9.]*") - - if [[ -n "$php_version" ]]; then - "$1_prompt_segment" "$0" "$2" "fuchsia" "grey93" "$php_version" - fi -} - -################################################################ -# Segment to display free RAM and used Swap -prompt_ram() { - local ROOT_PREFIX="${4}" - local base='' - local ramfree=0 - if [[ "$OS" == "OSX" ]]; then - # Available = Free + Inactive - # See https://support.apple.com/en-us/HT201538 - ramfree=$(vm_stat | grep "Pages free" | grep -o -E '[0-9]+') - ramfree=$((ramfree + $(vm_stat | grep "Pages inactive" | grep -o -E '[0-9]+'))) - # Convert pages into Bytes - ramfree=$(( ramfree * 4096 )) - else - if [[ "$OS" == "BSD" ]]; then - ramfree=$(grep 'avail memory' ${ROOT_PREFIX}/var/run/dmesg.boot | awk '{print $4}') - else - ramfree=$(grep -o -E "MemAvailable:\s+[0-9]+" ${ROOT_PREFIX}/proc/meminfo | grep -o -E "[0-9]+") - base='K' - fi - fi - - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$ramfree" $base)" 'RAM_ICON' -} - -################################################################ -# Segment to display rbenv information -# https://github.com/rbenv/rbenv#choosing-the-ruby-version -set_default POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW false -prompt_rbenv() { - if [[ -n "$RBENV_VERSION" ]]; then - "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$RBENV_VERSION" 'RUBY_ICON' - elif [ $commands[rbenv] ]; then - local rbenv_version_name="$(rbenv version-name)" - local rbenv_global="$(rbenv global)" - if [[ "${rbenv_version_name}" != "${rbenv_global}" || "${POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then - "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' - fi - fi -} - -################################################################ -# Segment to display chruby information -# see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH -prompt_chruby() { - # Uses $RUBY_VERSION and $RUBY_ENGINE set by chruby - set_default POWERLEVEL9K_CHRUBY_SHOW_VERSION true - set_default POWERLEVEL9K_CHRUBY_SHOW_ENGINE true - local chruby_label="" - - if [[ "$POWERLEVEL9K_CHRUBY_SHOW_ENGINE" == true ]]; then - chruby_label+="$RUBY_ENGINE " - fi - if [[ "$POWERLEVEL9K_CHRUBY_SHOW_VERSION" == true ]]; then - chruby_label+="$RUBY_VERSION" - fi - - # Truncate trailing spaces - chruby_label="${chruby_label%"${chruby_label##*[![:space:]]}"}" - - # Don't show anything if the chruby did not change the default ruby - if [[ "$RUBY_ENGINE" != "" ]]; then - "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "${chruby_label}" 'RUBY_ICON' - fi -} - -################################################################ -# Segment to print an icon if user is root. -prompt_root_indicator() { - if [[ "$UID" -eq 0 ]]; then - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "" 'ROOT_ICON' - fi -} - -################################################################ -# Segment to display Rust version number -prompt_rust_version() { - local rust_version - rust_version=$(command rustc --version 2>/dev/null) - # Remove "rustc " (including the whitespace) from the beginning - # of the version string and remove everything after the next - # whitespace. This way we'll end up with only the version. - rust_version=${${rust_version/rustc /}%% *} - - if [[ -n "$rust_version" ]]; then - "$1_prompt_segment" "$0" "$2" "darkorange" "$DEFAULT_COLOR" "$rust_version" 'RUST_ICON' - fi -} - -# RSpec test ratio -prompt_rspec_stats() { - if [[ (-d app && -d spec) ]]; then - local code_amount tests_amount - code_amount=$(ls -1 app/**/*.rb | wc -l) - tests_amount=$(ls -1 spec/**/*.rb | wc -l) - - build_test_stats "$1" "$0" "$2" "$code_amount" "$tests_amount" "RSpec" 'TEST_ICON' - fi -} - -################################################################ -# Segment to display Ruby Version Manager information -prompt_rvm() { - local version_and_gemset=${rvm_env_string/ruby-} - - if [[ -n "$version_and_gemset" ]]; then - "$1_prompt_segment" "$0" "$2" "grey35" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON' - fi -} - -################################################################ -# Segment to display SSH icon when connected -prompt_ssh() { - if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "" 'SSH_ICON' - fi -} - -################################################################ -# Status: When an error occur, return the error code, or a cross icon if option is set -# Display an ok icon when no error occur, or hide the segment if option is set to false -# -set_default POWERLEVEL9K_STATUS_CROSS false -set_default POWERLEVEL9K_STATUS_OK true -set_default POWERLEVEL9K_STATUS_SHOW_PIPESTATUS true -set_default POWERLEVEL9K_STATUS_HIDE_SIGNAME false -# old options, retro compatibility -set_default POWERLEVEL9K_STATUS_VERBOSE true -set_default POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE false - -exit_code_or_status() { - local ec=$1 - if [[ "$POWERLEVEL9K_STATUS_HIDE_SIGNAME" = true ]]; then - echo "$ec" - elif (( ec <= 128 )); then - echo "$ec" - else - local sig=$(( ec - 128 )) - local idx=$(( sig + 1 )) - echo "SIG${signals[$idx]}(${sig})" - fi -} - -prompt_status() { - local ec_text - local ec_sum - local ec - - if [[ $POWERLEVEL9K_STATUS_SHOW_PIPESTATUS == true ]]; then - if (( $#RETVALS > 1 )); then - ec_text=$(exit_code_or_status "${RETVALS[1]}") - ec_sum=${RETVALS[1]} - else - ec_text=$(exit_code_or_status "${RETVAL}") - ec_sum=${RETVAL} - fi - - for ec in "${(@)RETVALS[2,-1]}"; do - ec_text="${ec_text}|$(exit_code_or_status "$ec")" - ec_sum=$(( $ec_sum + $ec )) - done - else - # We use RETVAL instead of the right-most RETVALS item because - # PIPE_FAIL may be set. - ec_text=$(exit_code_or_status "${RETVAL}") - ec_sum=${RETVAL} - fi - - if (( ec_sum > 0 )); then - if [[ "$POWERLEVEL9K_STATUS_CROSS" == false && "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then - "$1_prompt_segment" "$0_ERROR" "$2" "red" "yellow1" "$ec_text" 'CARRIAGE_RETURN_ICON' - else - "$1_prompt_segment" "$0_ERROR" "$2" "$DEFAULT_COLOR" "red" "" 'FAIL_ICON' - fi - elif [[ "$POWERLEVEL9K_STATUS_OK" == true ]] && [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true || "$POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE" == true ]]; then - "$1_prompt_segment" "$0_OK" "$2" "$DEFAULT_COLOR" "green" "" 'OK_ICON' - fi -} - -################################################################ -# Segment to display Swap information -prompt_swap() { - local ROOT_PREFIX="${4}" - local swap_used=0 - local base='' - - if [[ "$OS" == "OSX" ]]; then - local raw_swap_used - raw_swap_used=$(sysctl vm.swapusage | grep -o "used\s*=\s*[0-9,.A-Z]*" | grep -o "[0-9,.A-Z]*$") - - typeset -F 2 swap_used - swap_used=${$(echo $raw_swap_used | grep -o "[0-9,.]*")//,/.} - # Replace comma - swap_used=${swap_used//,/.} - - base=$(echo "$raw_swap_used" | grep -o "[A-Z]*$") - else - swap_total=$(grep -o -E "SwapTotal:\s+[0-9]+" ${ROOT_PREFIX}/proc/meminfo | grep -o -E "[0-9]+") - swap_free=$(grep -o -E "SwapFree:\s+[0-9]+" ${ROOT_PREFIX}/proc/meminfo | grep -o -E "[0-9]+") - swap_used=$(( swap_total - swap_free )) - base='K' - fi - - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$swap_used" $base)" 'SWAP_ICON' -} - -################################################################ -# Symfony2-PHPUnit test ratio -prompt_symfony2_tests() { - if [[ (-d src && -d app && -f app/AppKernel.php) ]]; then - local code_amount tests_amount - code_amount=$(ls -1 src/**/*.php | grep -vc Tests) - tests_amount=$(ls -1 src/**/*.php | grep -c Tests) - - build_test_stats "$1" "$0" "$2" "$code_amount" "$tests_amount" "SF2" 'TEST_ICON' - fi -} - -################################################################ -# Segment to display Symfony2-Version -prompt_symfony2_version() { - if [[ -f app/bootstrap.php.cache ]]; then - local symfony2_version - symfony2_version=$(grep " VERSION " app/bootstrap.php.cache | sed -e 's/[^.0-9]*//g') - "$1_prompt_segment" "$0" "$2" "grey35" "$DEFAULT_COLOR" "$symfony2_version" 'SYMFONY_ICON' - fi -} - -################################################################ -# Show a ratio of tests vs code -build_test_stats() { - local code_amount="$4" - local tests_amount="$5"+0.00001 - local headline="$6" - - # Set float precision to 2 digits: - typeset -F 2 ratio - local ratio=$(( (tests_amount/code_amount) * 100 )) - - (( ratio >= 75 )) && "$1_prompt_segment" "${2}_GOOD" "$3" "cyan" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6" - (( ratio >= 50 && ratio < 75 )) && "$1_prompt_segment" "$2_AVG" "$3" "yellow" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6" - (( ratio < 50 )) && "$1_prompt_segment" "$2_BAD" "$3" "red" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6" -} - -################################################################ -# System time -prompt_time() { - set_default POWERLEVEL9K_TIME_FORMAT "%D{%H:%M:%S}" - - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$POWERLEVEL9K_TIME_FORMAT" "TIME_ICON" -} - -################################################################ -# System date -prompt_date() { - set_default POWERLEVEL9K_DATE_FORMAT "%D{%d.%m.%y}" - - "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$POWERLEVEL9K_DATE_FORMAT" "DATE_ICON" -} - -################################################################ -# todo.sh: shows the number of tasks in your todo.sh file -prompt_todo() { - if $(hash todo.sh 2>&-); then - count=$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }') - if [[ "$count" = <-> ]]; then - "$1_prompt_segment" "$0" "$2" "grey50" "$DEFAULT_COLOR" "$count" 'TODO_ICON' - fi - fi -} - -################################################################ -# VCS segment: shows the state of your repository, if you are in a folder under -# version control -set_default POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND "red" -# Default: Just display the first 8 characters of our changeset-ID. -set_default POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH "8" -powerlevel9k_vcs_init() { - if [[ -n "$POWERLEVEL9K_CHANGESET_HASH_LENGTH" ]]; then - POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH="$POWERLEVEL9K_CHANGESET_HASH_LENGTH" - fi - - # Load VCS_INFO - autoload -Uz vcs_info - - VCS_WORKDIR_DIRTY=false - VCS_WORKDIR_HALF_DIRTY=false - - # The vcs segment can have three different states - defaults to 'clean'. - typeset -gAH vcs_states - vcs_states=( - 'clean' 'green' - 'modified' 'yellow' - 'untracked' 'green' - ) - - VCS_CHANGESET_PREFIX='' - if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then - VCS_CHANGESET_PREFIX="$(print_icon 'VCS_COMMIT_ICON')%0.$POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH""i " - fi - - zstyle ':vcs_info:*' enable git hg svn - zstyle ':vcs_info:*' check-for-changes true - - VCS_DEFAULT_FORMAT="$VCS_CHANGESET_PREFIX%b%c%u%m" - zstyle ':vcs_info:*' formats "$VCS_DEFAULT_FORMAT" - - zstyle ':vcs_info:*' actionformats "%b %F{${POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND}}| %a%f" - - zstyle ':vcs_info:*' stagedstr " $(print_icon 'VCS_STAGED_ICON')" - zstyle ':vcs_info:*' unstagedstr " $(print_icon 'VCS_UNSTAGED_ICON')" - - defined POWERLEVEL9K_VCS_GIT_HOOKS || POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind git-stash git-remotebranch git-tagname) - zstyle ':vcs_info:git*+set-message:*' hooks $POWERLEVEL9K_VCS_GIT_HOOKS - defined POWERLEVEL9K_VCS_HG_HOOKS || POWERLEVEL9K_VCS_HG_HOOKS=(vcs-detect-changes) - zstyle ':vcs_info:hg*+set-message:*' hooks $POWERLEVEL9K_VCS_HG_HOOKS - defined POWERLEVEL9K_VCS_SVN_HOOKS || POWERLEVEL9K_VCS_SVN_HOOKS=(vcs-detect-changes svn-detect-changes) - zstyle ':vcs_info:svn*+set-message:*' hooks $POWERLEVEL9K_VCS_SVN_HOOKS - - # For Hg, only show the branch name - zstyle ':vcs_info:hg*:*' branchformat "$(print_icon 'VCS_BRANCH_ICON')%b" - # The `get-revision` function must be turned on for dirty-check to work for Hg - zstyle ':vcs_info:hg*:*' get-revision true - zstyle ':vcs_info:hg*:*' get-bookmarks true - zstyle ':vcs_info:hg*+gen-hg-bookmark-string:*' hooks hg-bookmarks - - # For svn, only - # TODO fix the %b (branch) format for svn. Using %b breaks - # color-encoding of the foreground for the rest of the powerline. - zstyle ':vcs_info:svn*:*' formats "$VCS_CHANGESET_PREFIX%c%u" - zstyle ':vcs_info:svn*:*' actionformats "$VCS_CHANGESET_PREFIX%c%u %F{${POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND}}| %a%f" - - if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then - zstyle ':vcs_info:*' get-revision true - fi -} - -################################################################ -# Segment to show VCS information -prompt_vcs() { - VCS_WORKDIR_DIRTY=false - VCS_WORKDIR_HALF_DIRTY=false - local current_state="" - - # Actually invoke vcs_info manually to gather all information. - vcs_info - local vcs_prompt="${vcs_info_msg_0_}" - - if [[ -n "$vcs_prompt" ]]; then - if [[ "$VCS_WORKDIR_DIRTY" == true ]]; then - # $vcs_visual_identifier gets set in +vi-vcs-detect-changes in functions/vcs.zsh, - # as we have there access to vcs_info internal hooks. - current_state='modified' - else - if [[ "$VCS_WORKDIR_HALF_DIRTY" == true ]]; then - current_state='untracked' - else - current_state='clean' - fi - fi - "$1_prompt_segment" "${0}_${(U)current_state}" "$2" "${vcs_states[$current_state]}" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" - fi -} - -################################################################ -# Vi Mode: show editing mode (NORMAL|INSERT) -set_default POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT" -set_default POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL" -prompt_vi_mode() { - case ${KEYMAP} in - vicmd) - "$1_prompt_segment" "$0_NORMAL" "$2" "$DEFAULT_COLOR" "white" "$POWERLEVEL9K_VI_COMMAND_MODE_STRING" - ;; - main|viins|*) - if [[ -z $POWERLEVEL9K_VI_INSERT_MODE_STRING ]]; then return; fi - "$1_prompt_segment" "$0_INSERT" "$2" "$DEFAULT_COLOR" "blue" "$POWERLEVEL9K_VI_INSERT_MODE_STRING" - ;; - esac -} - -################################################################ -# Virtualenv: current working virtualenv -# More information on virtualenv (Python): -# https://virtualenv.pypa.io/en/latest/ -prompt_virtualenv() { - local virtualenv_path="$VIRTUAL_ENV" - if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON' - fi -} - -################################################################ -# Segment to display pyenv information -# https://github.com/pyenv/pyenv#choosing-the-python-version -set_default POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW false -prompt_pyenv() { - if [[ -n "$PYENV_VERSION" ]]; then - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON' - elif [ $commands[pyenv] ]; then - local pyenv_version_name="$(pyenv version-name)" - local pyenv_global="system" - local pyenv_root="$(pyenv root)" - if [[ -f "${pyenv_root}/version" ]]; then - pyenv_global="$(pyenv version-file-read ${pyenv_root}/version)" - fi - if [[ "${pyenv_version_name}" != "${pyenv_global}" || "${POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version_name" 'PYTHON_ICON' - fi - fi -} - -################################################################ -# Display openfoam information -prompt_openfoam() { - local wm_project_version="$WM_PROJECT_VERSION" - local wm_fork="$WM_FORK" - if [[ -n "$wm_project_version" ]] && [[ -z "$wm_fork" ]] ; then - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "OF: $(basename "$wm_project_version")" - elif [[ -n "$wm_project_version" ]] && [[ -n "$wm_fork" ]] ; then - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "F-X: $(basename "$wm_project_version")" - fi -} - -################################################################ -# Segment to display Swift version -prompt_swift_version() { - # Get the first number as this is probably the "main" version number.. - local swift_version=$(swift --version 2>/dev/null | grep -o -E "[0-9.]+" | head -n 1) - [[ -z "${swift_version}" ]] && return - - "$1_prompt_segment" "$0" "$2" "magenta" "white" "${swift_version}" 'SWIFT_ICON' -} - -################################################################ -# dir_writable: Display information about the user's permission to write in the current directory -prompt_dir_writable() { - if [[ ! -w "$PWD" ]]; then - "$1_prompt_segment" "$0_FORBIDDEN" "$2" "red" "yellow1" "" 'LOCK_ICON' - fi -} - -################################################################ -# Kubernetes Current Context/Namespace -prompt_kubecontext() { - local kubectl_version="$(kubectl version --client 2>/dev/null)" - - if [[ -n "$kubectl_version" ]]; then - # Get the current Kuberenetes context - local cur_ctx=$(kubectl config view -o=jsonpath='{.current-context}') - cur_namespace="$(kubectl config view -o=jsonpath="{.contexts[?(@.name==\"${cur_ctx}\")].context.namespace}")" - # If the namespace comes back empty set it default. - if [[ -z "${cur_namespace}" ]]; then - cur_namespace="default" - fi - - local k8s_final_text="" - - if [[ "$cur_ctx" == "$cur_namespace" ]]; then - # No reason to print out the same identificator twice - k8s_final_text="$cur_ctx" - else - k8s_final_text="$cur_ctx/$cur_namespace" - fi - - "$1_prompt_segment" "$0" "$2" "magenta" "white" "$k8s_final_text" "KUBERNETES_ICON" - fi -} - -################################################################ -# Dropbox status -prompt_dropbox() { - # The first column is just the directory, so cut it - local dropbox_status="$(dropbox-cli filestatus . | cut -d\ -f2-)" - - # Only show if the folder is tracked and dropbox is running - if [[ "$dropbox_status" != 'unwatched' && "$dropbox_status" != "isn't running!" ]]; then - # If "up to date", only show the icon - if [[ "$dropbox_status" =~ 'up to date' ]]; then - dropbox_status="" - fi - - "$1_prompt_segment" "$0" "$2" "white" "blue" "$dropbox_status" "DROPBOX_ICON" - fi -} - -# print Java version number -prompt_java_version() { - local java_version - # Stupid: Java prints its version on STDERR. - # The first version ouput will print nothing, we just - # use it to transport whether the command was successful. - # If yes, we parse the version string (and need to - # redirect the stderr to stdout to make the pipe work). - java_version=$(java -version 2>/dev/null && java -fullversion 2>&1 | cut -d '"' -f 2) - - if [[ -n "$java_version" ]]; then - "$1_prompt_segment" "$0" "$2" "red" "white" "$java_version" "JAVA_ICON" - fi -} - -################################################################ -# Prompt processing and drawing -################################################################ -# Main prompt -build_left_prompt() { - local index=1 - local element - for element in "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[@]}"; do - # Remove joined information in direct calls - element=${element%_joined} - - # Check if it is a custom command, otherwise interpet it as - # a prompt. - if [[ $element[0,7] =~ "custom_" ]]; then - "prompt_custom" "left" "$index" $element[8,-1] - else - "prompt_$element" "left" "$index" - fi - - index=$((index + 1)) - done - - left_prompt_end -} - -# Right prompt -build_right_prompt() { - local index=1 - local element - for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do - # Remove joined information in direct calls - element=${element%_joined} - - # Check if it is a custom command, otherwise interpet it as - # a prompt. - if [[ $element[0,7] =~ "custom_" ]]; then - "prompt_custom" "right" "$index" $element[8,-1] - else - "prompt_$element" "right" "$index" - fi - - index=$((index + 1)) - done - - # Clear to the end of the line - echo -n "%E" -} - -powerlevel9k_preexec() { - _P9K_TIMER_START=$EPOCHREALTIME -} - -set_default POWERLEVEL9K_PROMPT_ADD_NEWLINE false -powerlevel9k_prepare_prompts() { - # Return values. These need to be global, because - # they are used in prompt_status. Also, we need - # to get the return value of the last command at - # very first in this function. Do not move the - # lines down, otherwise the last command is not - # what you expected it to be. - RETVAL=$? - RETVALS=( "$pipestatus[@]" ) - - local RPROMPT_SUFFIX RPROMPT_PREFIX - _P9K_COMMAND_DURATION=$((EPOCHREALTIME - _P9K_TIMER_START)) - - # Reset start time - _P9K_TIMER_START=0x7FFFFFFF - - if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then - PROMPT='$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%f%b%k$(build_left_prompt) -$(print_icon 'MULTILINE_LAST_PROMPT_PREFIX')' - if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then - # The right prompt should be on the same line as the first line of the left - # prompt. To do so, there is just a quite ugly workaround: Before zsh draws - # the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we - # advise it to go one line down. See: - # http://superuser.com/questions/357107/zsh-right-justify-in-ps1 - local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters - RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up - RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down - else - RPROMPT_PREFIX='' - RPROMPT_SUFFIX='' - fi - else - PROMPT='%f%b%k$(build_left_prompt)' - RPROMPT_PREFIX='' - RPROMPT_SUFFIX='' - fi - - if [[ "$POWERLEVEL9K_DISABLE_RPROMPT" != true ]]; then - RPROMPT="${RPROMPT_PREFIX}"'%f%b%k$(build_right_prompt)%{$reset_color%}'"${RPROMPT_SUFFIX}" - fi - -local NEWLINE=' -' - - if [[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]]; then - NEWLINES="" - repeat ${POWERLEVEL9K_PROMPT_ADD_NEWLINE_COUNT:-1} { NEWLINES+=$NEWLINE } - PROMPT="$NEWLINES$PROMPT" - fi - - # Allow iTerm integration to work - [[ $ITERM_SHELL_INTEGRATION_INSTALLED == "Yes" ]] && PROMPT="%{$(iterm2_prompt_mark)%}$PROMPT" -} - -zle-keymap-select () { - zle reset-prompt - zle -R -} - -set_default POWERLEVEL9K_IGNORE_TERM_COLORS false -set_default POWERLEVEL9K_IGNORE_TERM_LANG false - -prompt_powerlevel9k_setup() { - # The value below was set to better support 32-bit CPUs. - # It's the maximum _signed_ integer value on 32-bit CPUs. - # Please don't change it until 19 January of 2038. ;) - - # Disable false display of command execution time - _P9K_TIMER_START=0x7FFFFFFF - - # The prompt function will set these prompt_* options after the setup function - # returns. We need prompt_subst so we can safely run commands in the prompt - # without them being double expanded and we need prompt_percent to expand the - # common percent escape sequences. - prompt_opts=(cr percent sp subst) - - # Borrowed from promptinit, sets the prompt options in case the theme was - # not initialized via promptinit. - setopt noprompt{bang,cr,percent,sp,subst} "prompt${^prompt_opts[@]}" - - # Display a warning if the terminal does not support 256 colors - termColors - - # If the terminal `LANG` is set to `C`, this theme will not work at all. - if [[ $POWERLEVEL9K_IGNORE_TERM_LANG == false ]]; then - local term_lang - term_lang=$(echo $LANG) - if [[ $term_lang == 'C' ]]; then - print -P "\t%F{red}WARNING!%f Your terminal's 'LANG' is set to 'C', which breaks this theme!" - print -P "\t%F{red}WARNING!%f Please set your 'LANG' to a UTF-8 language, like 'en_US.UTF-8'" - print -P "\t%F{red}WARNING!%f _before_ loading this theme in your \~\.zshrc. Putting" - print -P "\t%F{red}WARNING!%f %F{blue}export LANG=\"en_US.UTF-8\"%f at the top of your \~\/.zshrc is sufficient." - fi - fi - - defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs) - defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time) - - # Display a warning if deprecated segments are in use. - typeset -AH deprecated_segments - # old => new - deprecated_segments=( - 'longstatus' 'status' - ) - print_deprecation_warning deprecated_segments - - # initialize colors - autoload -U colors && colors - - if segment_in_use "vcs"; then - powerlevel9k_vcs_init - fi - - # initialize timing functions - zmodload zsh/datetime - - # Initialize math functions - zmodload zsh/mathfunc - - # initialize hooks - autoload -Uz add-zsh-hook - - # prepare prompts - add-zsh-hook precmd powerlevel9k_prepare_prompts - add-zsh-hook preexec powerlevel9k_preexec - - zle -N zle-keymap-select -} - -prompt_powerlevel9k_teardown() { - add-zsh-hook -D precmd powerlevel9k_\* - add-zsh-hook -D preexec powerlevel9k_\* - PROMPT='%m%# ' - RPROMPT= -} - -prompt_powerlevel9k_setup "$@" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/prompt_powerlevel9k_setup b/.zprezto/modules/prompt/external/powerlevel9k/prompt_powerlevel9k_setup deleted file mode 120000 index 311575f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/prompt_powerlevel9k_setup +++ /dev/null @@ -1 +0,0 @@ -powerlevel9k.zsh-theme \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/CODE_OF_CONDUCT.md b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/CODE_OF_CONDUCT.md deleted file mode 100644 index dc906ab..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at kate.ward@forestent.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/LICENSE b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/README.md b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/README.md deleted file mode 100644 index e0f92f2..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/README.md +++ /dev/null @@ -1,434 +0,0 @@ -# shUnit2 - -shUnit2 is a [xUnit](http://en.wikipedia.org/wiki/XUnit) unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to [JUnit](http://www.junit.org), [PyUnit](http://pyunit.sourceforge.net), etc.. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job. - -[![Travis CI](https://img.shields.io/travis/kward/shunit2.svg)](https://travis-ci.org/kward/shunit2) - -## Table of Contents -* [Introduction](#introduction) - * [Credits / Contributors](#credits-contributors) - * [Feedback](#feedback) -* [Quickstart](#quickstart) -* [Function Reference](#function-reference) - * [General Info](#general-info) - * [Asserts](#asserts) - * [Failures](#failures) - * [Setup/Teardown](#setup-teardown) - * [Skipping](#skipping) - * [Suites](#suites) -* [Advanced Usage](#advanced-usage) - * [Some constants you can use](#some-constants-you-can-use) - * [Error Handling](#error-handling) - * [Including Line Numbers in Asserts (Macros)](#including-line-numbers-in-asserts-macros) - * [Test Skipping](#test-skipping) -* [Appendix](#appendix) - * [Getting help](#getting-help) - * [Zsh](#zsh) - ---- -## Introduction -shUnit2 was originally developed to provide a consistent testing solution for [log4sh][log4sh], a shell based logging framework similar to [log4j](http://logging.apache.org). During the development of that product, a repeated problem of having things work just fine under one shell (`/bin/bash` on Linux to be specific), and then not working under another shell (`/bin/sh` on Solaris) kept coming up. Although several simple tests were run, they were not adequate and did not catch some corner cases. The decision was finally made to write a proper unit test framework after multiple brown-bag releases were made. _Research was done to look for an existing product that met the testing requirements, but no adequate product was found._ - -Tested Operating Systems (varies over time) - -* Cygwin -* FreeBSD (user supported) -* Linux (Gentoo, Ubuntu) -* Mac OS X -* Solaris 8, 9, 10 (inc. OpenSolaris) - -Tested Shells - -* Bourne Shell (__sh__) -* BASH - GNU Bourne Again SHell (__bash__) -* DASH (__dash__) -* Korn Shell (__ksh__) -* pdksh - Public Domain Korn Shell (__pdksh__) -* zsh - Zsh (__zsh__) (since 2.1.2) _please see the Zsh shell errata for more information_ - -See the appropriate Release Notes for this release (`doc/RELEASE_NOTES-X.X.X.txt`) for the list of actual versions tested. - -### Credits / Contributors -A list of contributors to shUnit2 can be found in `doc/contributors.md`. Many thanks go out to all those who have contributed to make this a better tool. - -shUnit2 is the original product of many hours of work by Kate Ward, the primary author of the code. For related software, check out https://github.com/kward. - -### Feedback -Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the shunit2-users@google.com mailing list. - ---- - -## Quickstart -This section will give a very quick start to running unit tests with shUnit2. More information is located in later sections. - -Here is a quick sample script to show how easy it is to write a unit test in shell. _Note: the script as it stands expects that you are running it from the "examples" directory._ - -```sh -#! /bin/sh -# file: examples/equality_test.sh - -testEquality() { - assertEquals 1 1 -} - -# Load shUnit2. -. ./shunit2 -``` - -Running the unit test should give results similar to the following. - -```console -$ cd examples -$ ./equality_test.sh -testEquality - -Ran 1 test. - -OK -``` - -W00t! You've just run your first successful unit test. So, what just happened? Quite a bit really, and it all happened simply by sourcing the `shunit2` library. The basic functionality for the script above goes like this: - -* When shUnit2 is sourced, it will walk through any functions defined whose name starts with the string `test`, and add those to an internal list of tests to execute. Once a list of test functions to be run has been determined, shunit2 will go to work. -* Before any tests are executed, shUnit2 again looks for a function, this time one named `oneTimeSetUp()`. If it exists, it will be run. This function is normally used to setup the environment for all tests to be run. Things like creating directories for output or setting environment variables are good to place here. Just so you know, you can also declare a corresponding function named `oneTimeTearDown()` function that does the same thing, but once all the tests have been completed. It is good for removing temporary directories, etc. -* shUnit2 is now ready to run tests. Before doing so though, it again looks for another function that might be declared, one named `setUp()`. If the function exists, it will be run before each test. It is good for resetting the environment so that each test starts with a clean slate. **At this stage, the first test is finally run.** The success of the test is recorded for a report that will be generated later. After the test is run, shUnit2 looks for a final function that might be declared, one named `tearDown()`. If it exists, it will be run after each test. It is a good place for cleaning up after each test, maybe doing things like removing files that were created, or removing directories. This set of steps, `setUp() > test() > tearDown()`, is repeated for all of the available tests. -* Once all the work is done, shUnit2 will generate the nice report you saw above. A summary of all the successes and failures will be given so that you know how well your code is doing. - -We should now try adding a test that fails. Change your unit test to look like this. - -```sh -#! /bin/sh -# file: examples/party_test.sh - -testEquality() { - assertEquals 1 1 -} - -testPartyLikeItIs1999() { - year=`date '+%Y'` - assertEquals "It's not 1999 :-(" '1999' "${year}" -} - -# Load shUnit2. -. ./shunit2 -``` - -So, what did you get? I guess it told you that this isn't 1999. Bummer, eh? Hopefully, you noticed a couple of things that were different about the second test. First, we added an optional message that the user will see if the assert fails. Second, we did comparisons of strings instead of integers as in the first test. It doesn't matter whether you are testing for equality of strings or integers. Both work equally well with shUnit2. - -Hopefully, this is enough to get you started with unit testing. If you want a ton more examples, take a look at the tests provided with [log4sh][log4sh] or [shFlags][shflags]. Both provide excellent examples of more advanced usage. shUnit2 was after all written to meet the unit testing need that [log4sh][log4sh] had. - ---- - -## Function Reference - -### General Info - -Any string values passed should be properly quoted -- they should must be surrounded by single-quote (`'`) or double-quote (`"`) characters -- so that the shell will properly parse them. - -### Asserts - -`assertEquals [message] expected actual` - -Asserts that _expected_ and _actual_ are equal to one another. The _expected_ and _actual_ values can be either strings or integer values as both will be treated as strings. The _message_ is optional, and must be quoted. - -`assertNotEquals [message] unexpected actual` - -Asserts that _unexpected_ and _actual_ are not equal to one another. The _unexpected_ and _actual_ values can be either strings or integer values as both will be treaded as strings. The _message_ is optional, and must be quoted. - -`assertSame [message] expected actual` - -This function is functionally equivalent to `assertEquals`. - -`assertNotSame [message] unexpected actual` - -This function is functionally equivalent to `assertNotEquals`. - -`assertNull [message] value` - -Asserts that _value_ is _null_, or in shell terms, a zero-length string. The _value_ must be a string as an integer value does not translate into a zero-length string. The _message_ is optional, and must be quoted. - -`assertNotNull [message] value` - -Asserts that _value_ is _not null_, or in shell terms, a non-empty string. The _value_ may be a string or an integer as the later will be parsed as a non-empty string value. The _message_ is optional, and must be quoted. - -`assertTrue [message] condition` - -Asserts that a given shell test _condition_ is _true_. The condition can be as simple as a shell _true_ value (the value `0` -- equivalent to `${SHUNIT_TRUE}`), or a more sophisticated shell conditional expression. The _message_ is optional, and must be quoted. - -A sophisticated shell conditional expression is equivalent to what the __if__ or __while__ shell built-ins would use (more specifically, what the __test__ command would use). Testing for example whether some value is greater than another value can be done this way. - -`assertTrue "[ 34 -gt 23 ]"` - -Testing for the ability to read a file can also be done. This particular test will fail. - -`assertTrue 'test failed' "[ -r /some/non-existant/file' ]"` - -As the expressions are standard shell __test__ expressions, it is possible to string multiple expressions together with `-a` and `-o` in the standard fashion. This test will succeed as the entire expression evaluates to _true_. - -`assertTrue 'test failed' '[ 1 -eq 1 -a 2 -eq 2 ]'` - -_One word of warning: be very careful with your quoting as shell is not the most forgiving of bad quoting, and things will fail in strange ways._ - -`assertFalse [message] condition` - -Asserts that a given shell test _condition_ is _false_. The condition can be as simple as a shell _false_ value (the value `1` -- equivalent to `${SHUNIT_FALSE}`), or a more sophisticated shell conditional expression. The _message_ is optional, and must be quoted. - -_For examples of more sophisticated expressions, see `assertTrue`._ - -### Failures - -Just to clarify, failures __do not__ test the various arguments against one another. Failures simply fail, optionally with a message, and that is all they do. If you need to test arguments against one another, use asserts. - -If all failures do is fail, why might one use them? There are times when you may have some very complicated logic that you need to test, and the simple asserts provided are simply not adequate. You can do your own validation of the code, use an `assertTrue ${SHUNIT_TRUE}` if your own tests succeeded, and use a failure to record a failure. - -`fail [message]` - -Fails the test immediately. The _message_ is optional, and must be quoted. - -`failNotEquals [message] unexpected actual` - -Fails the test immediately, reporting that the _unexpected_ and _actual_ values are not equal to one another. The _message_ is optional, and must be quoted. - -_Note: no actual comparison of unexpected and actual is done._ - -`failSame [message] expected actual` - -Fails the test immediately, reporting that the _expected_ and _actual_ values are the same. The _message_ is optional, and must be quoted. - -_Note: no actual comparison of expected and actual is done._ - -`failNotSame [message] expected actual` - -Fails the test immediately, reporting that the _expected_ and _actual_ values are not the same. The _message_ is optional, and must be quoted. - -_Note: no actual comparison of expected and actual is done._ - -### Setup/Teardown - -`oneTimeSetUp` - -This function can be be optionally overridden by the user in their test suite. - -If this function exists, it will be called once before any tests are run. It is useful to prepare a common environment for all tests. - -`oneTimeTearDown` - -This function can be be optionally overridden by the user in their test suite. - -If this function exists, it will be called once after all tests are completed. It is useful to clean up the environment after all tests. - -`setUp` - -This function can be be optionally overridden by the user in their test suite. - -If this function exists, it will be called before each test is run. It is useful to reset the environment before each test. - -`tearDown` - -This function can be be optionally overridden by the user in their test suite. - -If this function exists, it will be called after each test completes. It is useful to clean up the environment after each test. - -### Skipping - -`startSkipping` - -This function forces the remaining _assert_ and _fail_ functions to be "skipped", i.e. they will have no effect. Each function skipped will be recorded so that the total of asserts and fails will not be altered. - -`endSkipping` - -This function returns calls to the _assert_ and _fail_ functions to their default behavior, i.e. they will be called. - -`isSkipping` - -This function returns the current state of skipping. It can be compared against `${SHUNIT_TRUE}` or `${SHUNIT_FALSE}` if desired. - -### Suites - -The default behavior of shUnit2 is that all tests will be found dynamically. If you have a specific set of tests you want to run, or you don't want to use the standard naming scheme of prefixing your tests with `test`, these functions are for you. Most users will never use them though. - -`suite` - -This function can be optionally overridden by the user in their test suite. - -If this function exists, it will be called when `shunit2` is sourced. If it does not exist, shUnit2 will search the parent script for all functions beginning with the word `test`, and they will be added dynamically to the test suite. - -`suite_addTest name` - -This function adds a function named _name_ to the list of tests scheduled for execution as part of this test suite. This function should only be called from within the `suite()` function. - ---- - -## Advanced Usage - -### Some constants you can use - -There are several constants provided by shUnit2 as variables that might be of use to you. - -*Predefined* - -| Constant | Value | -| --------------- | ----- | -| SHUNIT\_TRUE | Standard shell `true` value (the integer value 0). | -| SHUNIT\_FALSE | Standard shell `false` value (the integer value 1). | -| SHUNIT\_ERROR | The integer value 2. | -| SHUNIT\_TMPDIR | Path to temporary directory that will be automatically cleaned up upon exit of shUnit2. | -| SHUNIT\_VERSION | The version of shUnit2 you are running. | - -*User defined* - -| Constant | Value | -| ----------------- | ----- | -| SHUNIT\_CMD\_EXPR | Override which `expr` command is used. By default `expr` is used, except on BSD systems where `gexpr` is used. | -| SHUNIT\_COLOR | Enable colorized output. Options are 'auto', 'always', or 'never', with 'auto' being the default. | -| SHUNIT\_PARENT | The filename of the shell script containing the tests. This is needed specifically for Zsh support. | -| SHUNIT\_TEST\_PREFIX | Define this variable to add a prefix in front of each test name that is output in the test report. | - -### Error handling - -The constants values `SHUNIT_TRUE`, `SHUNIT_FALSE`, and `SHUNIT_ERROR` are returned from nearly every function to indicate the success or failure of the function. Additionally the variable `flags_error` is filled with a detailed error message if any function returns with a `SHUNIT_ERROR` value. - -### Including Line Numbers in Asserts (Macros) - -If you include lots of assert statements in an individual test function, it can become difficult to determine exactly which assert was thrown unless your messages are unique. To help somewhat, line numbers can be included in the assert messages. To enable this, a special shell "macro" must be used rather than the standard assert calls. _Shell doesn't actually have macros; the name is used here as the operation is similar to a standard macro._ - -For example, to include line numbers for a `assertEquals()` function call, replace the `assertEquals()` with `${_ASSERT_EQUALS_}`. - -_**Example** -- Asserts with and without line numbers_ -```sh -#! /bin/sh -# file: examples/lineno_test.sh - -testLineNo() { - # This assert will have line numbers included (e.g. "ASSERT:[123] ..."). - echo "ae: ${_ASSERT_EQUALS_}" - ${_ASSERT_EQUALS_} 'not equal' 1 2 - - # This assert will not have line numbers included (e.g. "ASSERT: ..."). - assertEquals 'not equal' 1 2 -} - -# Load shUnit2. -. ./shunit2 -``` - -Notes: - -1. Due to how shell parses command-line arguments, all strings used with macros should be quoted twice. Namely, single-quotes must be converted to single-double-quotes, and vice-versa. If the string being passed is absolutely for sure not empty, the extra quoting is not necessary.

Normal `assertEquals` call.
`assertEquals 'some message' 'x' ''`

Macro `_ASSERT_EQUALS_` call. Note the extra quoting around the _message_ and the _null_ value.
`_ASSERT_EQUALS_ '"some message"' 'x' '""'` - -1. Line numbers are not supported in all shells. If a shell does not support them, no errors will be thrown. Supported shells include: __bash__ (>=3.0), __ksh__, __pdksh__, and __zsh__. - -### Test Skipping - -There are times where the test code you have written is just not applicable to the system you are running on. This section describes how to skip these tests but maintain the total test count. - -Probably the easiest example would be shell code that is meant to run under the __bash__ shell, but the unit test is running under the Bourne shell. There are things that just won't work. The following test code demonstrates two sample functions, one that will be run under any shell, and the another that will run only under the __bash__ shell. - -_**Example** -- math include_ -```sh -# file: examples/math.inc. - -add_generic() { - num_a=$1 - num_b=$2 - - expr $1 + $2 -} - -add_bash() { - num_a=$1 - num_b=$2 - - echo $(($1 + $2)) -} -``` - -And here is a corresponding unit test that correctly skips the `add_bash()` function when the unit test is not running under the __bash__ shell. - -_**Example** -- math unit test_ -```sh -#! /bin/sh -# file: examples/math_test.sh - -testAdding() { - result=`add_generic 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" - - # Disable non-generic tests. - [ -z "${BASH_VERSION:-}" ] && startSkipping - - result=`add_bash 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" -} - -oneTimeSetUp() { - # Load include to test. - . ./math.inc -} - -# Load and run shUnit2. -. ./shunit2 -``` - -Running the above test under the __bash__ shell will result in the following output. - -```console -$ /bin/bash math_test.sh -testAdding - -Ran 1 test. - -OK -``` - -But, running the test under any other Unix shell will result in the following output. - -```console -$ /bin/ksh math_test.sh -testAdding - -Ran 1 test. - -OK (skipped=1) -``` - -As you can see, the total number of tests has not changed, but the report indicates that some tests were skipped. - -Skipping can be controlled with the following functions: `startSkipping()`, `endSkipping()`, and `isSkipping()`. Once skipping is enabled, it will remain enabled until the end of the current test function call, after which skipping is disabled. - ---- - -## Appendix - -### Getting Help - -For help, please send requests to either the shunit2-users@googlegroups.com mailing list (archives available on the web at http://groups.google.com/group/shunit2-users) or directly to Kate Ward . - -### Zsh - -For compatibility with Zsh, there is one requirement that must be met -- the `shwordsplit` option must be set. There are three ways to accomplish this. - -1. In the unit-test script, add the following shell code snippet before sourcing the `shunit2` library. - -```sh -setopt shwordsplit -``` - -1. When invoking __zsh__ from either the command-line or as a script with `#!`, add the `-y` parameter. - -```sh -#! /bin/zsh -y -``` - -1. When invoking __zsh__ from the command-line, add `-o shwordsplit --` as parameters before the script name. - -```console -$ zsh -o shwordsplit -- some_script -``` - -[log4sh]: https://github.com/kward/log4sh -[shflags]: https://github.com/kward/shflags diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/CHANGES-2.1.md b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/CHANGES-2.1.md deleted file mode 100644 index 5c3fdf0..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/CHANGES-2.1.md +++ /dev/null @@ -1,253 +0,0 @@ -# shUnit2 2.1.x Changes - -## Changes with 2.1.8 - -### Enhancements - -Issue #29. Add support for user defined prefix for test names. A prefix can be added by defining the `SHUNIT_TEST_PREFIX` variable. - -Issue #78. Added an example for using suite tests. - -Run continuous integration additionally against Ubuntu Trusty. - -### Bug fixes - -Issue #84. Treat syntax errors in functions as test failures. - -Issue #77. Fail tests when the environment functions (e.g. `setup()` or `tearDown()`) fail. - -## Changes with 2.1.7 - -### Bug fixes - -Issue #69. shUnit2 should not exit with 0 when it has (syntax) errors. - -### Enhancements - -Issue #54. Shell commands prefixed with '\' so that they can be stubbed in -tests. - -Issue #68. Ran all code through [ShellCheck](http://www.shellcheck.net/). - -Issue #60. Continuous integration tests now run with -[Travis CI](https://travis-ci.org/kward/shunit2). - -Issue #56. Added color support. Color is enabled automatically when supported, -but can be disabled by defining the SHUNIT_COLOR environment variable before -sourcing shunit2. Accepted values are `always`, `auto` (the default), and -`none`. - -Issue #35. Add colored output. - -### Other - -Moved code to GitHub (https://github.com/kward/shunit2), and restructured to -be more GitHub like. - -Changed to the Apache 2.0 license. - - -## Changes with 2.1.6 - -Removed all references to the DocBook documentation. - -Simplified the 'src' structure. - -Fixed error message in fail() that stated wrong number of required arguments. - -Updated lib/versions. - -Fixed bug in `_shunit_mktempDir()` where a failure occurred when the 'od' -command was not present in `/usr/bin`. - -Renamed `shunit_tmpDir` variable to `SHUNIT_TMPDIR` to closer match the standard -`TMPDIR` variable. - -Added support for calling shunit2 as an executable, in addition to the existing -method of sourcing it in as a library. This allows users to keep tests working -despite the location of the shunit2 executable being different for each OS -distribution. - -Issue #14: Improved handling of some strange chars (e.g. single and double -quotes) in messages. - -Issue# 27: Fixed error message for `assertSame()`. - -Issue# 25: Added check and error message to user when phantom functions are -written to a partition mounted with `noexec`. - -Issue# 11: Added support for defining functions like `function someFunction()`. - - -## Changes with 2.1.5 - -Issue# 1: Fixed bug pointed out by R Bernstein in the trap code where certain -types of exit conditions did not generate the ending report. - -Issue# 2: Added `assertNotEquals()` assert. - -Issue# 3: Moved check for unset variables out of shUnit2 into the unit tests. -Testing poorly written software blows up if this check is in, but it is only -interesting for shUnit2 itself. Added `shunit_test_output.sh` unit test for -this. Some shells still do not catch such errors properly (e.g. Bourne shell and -BASH 2.x). - -Added new custom assert in test_helpers to check for output to STDOUT, and none -to STDERR. - -Replaced fatal message in the temp directory creation with a `_shunit_fatal()` -function call. - -Fixed test_output unit test so it works now that the 'set -u' stuff was removed -for Issue# 3. - -Flushed out the coding standards in the `README.txt` a bit more, and brought the -shunit2 code up to par with the documented standards. - -Issue# 4: Completely changed the reporting output to be a closer match for -JUnit and PyUnit. As a result, tests are counted separately from assertions. - -Provide public `shunit_tmpDir` variable that can be used by unit test scripts -that need automated and guaranteed cleanup. - -Issue# 7: Fixed duplicated printing of messages passed to asserts. - -Per code review, fixed wording of `failSame()` and `failNotSame()` messages. - -Replaced `version_info.sh` with versions library and made appropriate changes in -other scripts to use it. - -Added `gen_test_results.sh` to make releases easier. - -Fixed bugs in `shlib_relToAbsPath()` in shlib. - -Converted DocBook documentation to reStructuredText for easier maintenance. The -DocBook documentation is now considered obsolete, and will be removed in a -future release. - -Issue# 5: Fixed the documentation around the usage of failures. - -Issue# 9: Added unit tests and updated documentation to demonstrate the -requirement of quoting values twice when macros are used. This is due to how -shell parses arguments. - -When an invalid number of arguments is passed to a function, the invalid number -is returned to the user so they are more aware of what the cause might be. - - -## Changes with 2.1.4 - -Removed the `_shunit_functionExists()` function as it was dead code. - -Fixed zsh version number check in version_info. - -Fixed bug in last resort temporary directory creation. - -Fixed off-by-one in exit value for scripts caught by the trap handler. - -Added argument count error checking to all functions. - -Added mkdir_test.sh example. - -Moved src/test into src/shell to better match structure used with shFlags. - -Fixed problem where null values were not handled properly under ksh. - -Added support for outputting line numbers as part of assert messages. - -Started documenting the coding standards, and changed some variable names as a -result. - -Improved zsh version and option checks. - -Renamed the `__SHUNIT_VERSION` variable to `SHUNIT_VERSION`. - - -## Changes with 2.1.3 - -Added some explicit variable defaults, even though the variables are set, as -they sometimes behave strange when the script is canceled. - -Additional workarounds for zsh compatibility. - -shUnit2 now exits with a non-zero exit code if any of the tests failed. This was -done for automated testing frameworks. Tests that were skipped are not -considered failures, and do not affect the exit code. - -Changed detection of STDERR output in unit tests. - - -## Changes with 2.1.2 - -Unset additional variables that were missed. - -Added checks and workarounds to improve zsh compatibility. - -Added some argument count checks `assertEquals()`, `assertNull()`, and -`assertSame()`. - - -## Changes with 2.1.1 - -Fixed bug where `fail()` was not honoring skipping. - -Fixed problem with `docs-docbook-prep` target that prevented it from working. -(Thanks to Bryan Larsen for pointing this out.) - -Changed the test in `assertFalse()` so that any non-zero value registers as -false. (Credits to Bryan Larsen) - -Major fiddling to bring more in line with [JUnit](http://junit.org/). Asserts -give better output when no message is given, and failures now just fail. - -It was pointed out that the simple 'failed' message for a failed assert was not -only insufficient, it was nonstandard (when compared to JUnit) and didn't -provide the user with an expected vs actual result. The code was revised -somewhat to bring closer into alignment with JUnit (v4.3.1 specifically) so -that it feels more "normal". (Credits to Richard Jensen) - -As part of the JUnit realignment, it was noticed that `fail*()` functions in -JUnit don't actually do any comparisons themselves. They only generate a -failure message. Updated the code to match. - -Added self-testing unit tests. Kinda horkey, but they did find bugs during the -JUnit realignment. - -Fixed the code for returning from asserts as the return was being called before -the unsetting of variables occurred. (Credits to Mathias Goldau) - -The assert(True|False)() functions now accept an integer value for a -conditional test. A value of '0' is considered 'true', while any non-zero value -is considered 'false'. - -All public functions now fill use default values to work properly with the '-x' -shell debugging flag. - -Fixed the method of percent calculation for the report to get achieve better -accuracy. - - -## Changes with 2.1.0 (since 2.0.1) - -This release is a branch of the 2.0.1 release. - -Moving to [reStructured Text](http://docutils.sourceforge.net/rst.html) for -the documentation. - -Fixed problem with `fail()`. The failure message was not properly printed. - -Fixed the `Makefile` so that the DocBook XML and XSLT files would be -downloaded before parsing can continue. - -Renamed the internal `__SHUNIT_TRUE` and `__SHUNIT_FALSE` variables to -`SHUNIT_TRUE` and `SHUNIT_FALSE` so that unit tests can "use" them. - -Added support for test "skipping". If skipping is turned on with the -`startSkip()` function, `assert` and `fail` functions will return immediately, -and the skip will be recorded. - -The report output format was changed to include the percentage for each test -result, rather than just those successful. - - -.. vim:fileencoding=latin1:ft=text:spell:tw=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.0.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.0.txt deleted file mode 100644 index c99f746..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.0.txt +++ /dev/null @@ -1,104 +0,0 @@ -Release Notes for shUnit2 2.1.0 -=============================== - -This release was branched from shUnit2 2.0.1. It mostly adds new functionality, -but there are couple of bugs fixed from the previous release. - -See the ``CHANGES-2.1.rst`` file for a full list of changes. - - -Tested Platforms ----------------- - -This list of platforms comes from the latest version of log4sh as shUnit2 is -used in the testing of log4sh on each of these platforms. - -Cygwin - -- bash 3.2.9(10) -- pdksh 5.2.14 - -Linux - -- bash 3.1.17(1), 3.2.10(1) -- dash 0.5.3 -- ksh 1993-12-28 -- pdksh 5.2.14 -- zsh 4.3.2 (does not work) - -Mac OS X 10.4.8 (Darwin 8.8) - -- bash 2.05b.0(1) -- ksh 1993-12-28 - -Solaris 8 U3 (x86) - -- /bin/sh -- bash 2.03.0(1) -- ksh M-11/16/88i - -Solaris 10 U2 (sparc) - -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i - -Solaris 10 U2 (x86) - -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i - - -New Features ------------- - -Test skipping - - Support added for test "skipping". A skip mode can be enabled so that - subsequent ``assert`` and ``fail`` functions that are called will be recorded - as "skipped" rather than as "passed" or "failed". This functionality can be - used such that when a set of tests makes sense on one platform but not on - another, they can be effectively disabled without altering the total number - of tests. - - One example might be when something is supported under ``bash``, but not - under a standard Bourne shell. - - New functions: ``startSkipping()``, ``endSkipping``, ``isSkipping`` - - -Changes and Enhancements ------------------------- - -Moving to the use of `reStructured Text -`_ for documentation. It is easy to -read and edit in textual form, but converts nicely to HTML. - -The report format has changed. Rather than including a simple "success" -percentage at the end, a percentage is given for each type of test. - - -Bug Fixes ---------- - -The ``fail()`` function did not output the optional failure message. - -Fixed the ``Makefile`` so that the DocBook XML and XSLT files would be -downloaded before documentation parsing will continue. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -None. - - -.. $Revision$ -.. vim:fileencoding=latin1:spell:syntax=rst:textwidth=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.1.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.1.txt deleted file mode 100644 index 4c61005..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.1.txt +++ /dev/null @@ -1,88 +0,0 @@ -Release Notes for shUnit2 2.1.1 -=============================== - -This is mainly a bug fix release, but it also incorporates a realignment with -the JUnit 4 code. Asserts now provide better failure messages, and the failure -functions no longer perform tests. - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - - -Tested Platforms ----------------- - -This list of platforms comes from the latest version of log4sh as shUnit2 is -used in the testing of log4sh on each of these platforms. - -Cygwin - -- bash 3.2.15(13) -- pdksh 5.2.14 - -Linux - -- bash 3.1.17(1), 3.2.10(1) -- dash 0.5.3 -- ksh 1993-12-28 -- pdksh 5.2.14 -- zsh 4.3.2 (does not work) - -Mac OS X 10.4.9 (Darwin 8.9.1) - -- bash 2.05b.0(1) -- ksh 1993-12-28 - -Solaris 8 U3 (x86) - -- /bin/sh -- bash 2.03.0(1) -- ksh M-11/16/88i - -Solaris 10 U2 (sparc, x86) - -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i - - -New Features ------------- - -None. - - -Changes and Enhancements ------------------------- - -The internal test in ``assertFalse()`` now accepts any non-zero value as false. - -The ``assertTrue()`` and ``assertFalse()`` functions now accept an integer value -for a conditional test. A value of '0' is considered 'true', while any non-zero -value is considered 'false'. - -Self-testing unit tests were added. - - -Bug Fixes ---------- - -The ``fail()`` assert now honors skipping. - -The ``docs-docbook-prep`` target now works properly. - -All asserts now properly unset their variables. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -Functions do not properly test for an invalid number of arguments. - - -.. vim:fileencoding=latin1:ft=rst:spell:textwidth=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.2.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.2.txt deleted file mode 100644 index 5492984..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.2.txt +++ /dev/null @@ -1,83 +0,0 @@ -Release Notes for shUnit2 2.1.2 -=============================== - -This release adds initial support for the zsh shell. Due to some differences -with this shell as compared with others, some special checks have been added, -and there are some extra requirements necessary when this shell is to be used. - -To use zsh with shUnit2, the following two requirements must be met: -* The ``shwordsplit`` option must be set. -* The ``function_argzero`` option must be unset. - -Please read the Shell Errata section of the documentation for guidance on how -to meet these requirements. - - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - - -Tested Platforms ----------------- - -This list of platforms comes from the latest version of log4sh as shUnit2 is -used in the testing of log4sh on each of these platforms. - -Linux - -- bash 3.1.17(1), 3.2.25(1) -- dash 0.5.4 -- ksh 1993-12-28 -- pdksh 5.2.14 -- zsh 4.2.5, 4.3.4 - -Mac OS X 10.4.11 (Darwin 8.11.1) - -- bash 2.05b.0(1) -- ksh 1993-12-28 -- zsh 4.2.3 - -Solaris 10 U3 (x86) - -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i -- zsh 4.2.1 - - -New Features ------------- - -Support for the zsh shell. - - -Changes and Enhancements ------------------------- - -Added some argument count checks. - - -Bug Fixes ---------- - -None. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -Functions do not properly test for an invalid number of arguments. - -ksh and pdksh do not pass null arguments (i.e. empty strings as '') properly, -and as such checks do not work properly. - -zsh requires the ``shwordsplit`` option to be set, and the ``function_argzero`` -option to be unset for proper operation. - - -.. vim:fileencoding=latin1:ft=rst:spell:textwidth=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.3.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.3.txt deleted file mode 100644 index 7d1c9f6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.3.txt +++ /dev/null @@ -1,84 +0,0 @@ -Release Notes for shUnit2 2.1.3 -=============================== - -This release is minor feature release. It improves support for zsh (although it -still isn't what it could be) and adds automated testing framework support by -returning a non-zero exit when tests fail. - -To use zsh with shUnit2, the following two requirements must be met: -* The ``shwordsplit`` option must be set. -* The ``function_argzero`` option must be unset. - -Please read the Shell Errata section of the documentation for guidance on how -to meet these requirements. - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - - -Tested Platforms ----------------- - -Cygwin - -- bash 3.2.33(18) -- pdksh 5.2.14 - -Linux - -- bash 3.2.33(1) -- dash 0.5.4 -- ksh 1993-12-28 -- pdksh 5.2.14 -- zsh 4.3.4 - -Mac OS X 10.5.2 (Darwin 9.2.2) - -- bash 3.2.17(1) -- ksh 1993-12-28 -- zsh 4.3.4 - -Solaris 11 x86 (Nevada 77) - -- /bin/sh -- bash 3.2.25(1) -- ksh M-11/16/88i -- zsh 4.3.4 - - -New Features ------------- - -None. - - -Changes and Enhancements ------------------------- - -Support for automated testing frameworks. - - -Bug Fixes ---------- - -Fixed some issues with zsh support. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -Functions do not properly test for an invalid number of arguments. - -ksh and pdksh do not pass null arguments (i.e. empty strings as '') properly, -and as such checks do not work properly. - -zsh requires the ``shwordsplit`` option to be set, and the ``function_argzero`` -option to be unset for proper operation. - - -.. vim:fileencoding=latin1:ft=rst:spell:textwidth=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.4.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.4.txt deleted file mode 100644 index 007b5c3..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.4.txt +++ /dev/null @@ -1,100 +0,0 @@ -Release Notes for shUnit2 2.1.4 -=============================== - -This release contains lots of bug fixes and changes. Mostly, it fixes zsh -support in zsh 3.0, and the handling of null values in ksh. - -To use zsh with shUnit2, the following requirement must be met: - -- The ``shwordsplit`` option must be set. - -Please read the Shell Errata section of the documentation for guidance on how -to meet these requirements. - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - - -Tested Platforms ----------------- - -Cygwin - -- bash 3.2.39(19) -- pdksh 5.2.14 -- zsh 4.3.4 - -Linux (Ubuntu Dapper 6.06) - -- bash 3.1.17(1) -- pdksh 5.2.14 -- zsh 4.2.5 - -Linux (Ubuntu Hardy 8.04) - -- bash 3.2.39(1) -- dash 0.5.4 -- ksh 1993-12-28 -- pdksh 5.2.14 -- zsh 4.3.4 - -Mac OS X 10.5.4 (Darwin 9.4.0) - -- bash 3.2.17(1) -- ksh 1993-12-28 -- zsh 4.3.4 - -Solaris 9 U6 x86 - -- /bin/sh -- bash 2.05.0(1) -- ksh M-11/16/88i -- zsh 3.0.8 - -Solaris 11 x86 (Nevada 77) - -- /bin/sh -- bash 3.2.25(1) -- ksh M-11/16/88i -- zsh 4.3.4 - - -New Features ------------- - -Support added to output assert source line number as part of assert messages. - - -Changes and Enhancements ------------------------- - -Support for automated testing frameworks. - -Added argument count error checking to all functions. - - -Bug Fixes ---------- - -Fixed some issues with ksh and zsh support. - -Fixed off-by-one of exit value in trap handler. - -Fixed handling of null values under ksh. - -Fixed bug in last resort temporary directory creation. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -zsh requires the ``shwordsplit`` option to be set. - -Line numbers in assert messages do not work properly with Bash 2.x. - -.. vim:fileencoding=latin1:ft=rst:spell:tw=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.5.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.5.txt deleted file mode 100644 index d9f26ce..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.5.txt +++ /dev/null @@ -1,128 +0,0 @@ -Release Notes for shUnit2 2.1.5 -=============================== - -This release contains several bug fixes and changes. Additionally, it includes -a rewrite of the test output to better match JUnit and PyUnit. - -This version also includes a slightly expanded set of coding standards by which -shUnit2 is coded. It should help anyone reading the code to better understand -it. - - - -Please read the Shell Errata section of the documentation for guidance on how -to meet these requirements. - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - - -Tested Platforms ----------------- - -Cygwin - -- bash 3.2.39(20) -- ksh (sym-link to pdksh) -- pdksh 5.2.14 -- zsh 4.3.4 - -Linux (Ubuntu Dapper 6.06) - -- bash 3.1.17(1) -- ksh M-1993-12-28 -- pdksh 5.2.14-99/07/13.2 -- zsh 4.2.5 - -Linux (Ubuntu Hardy 8.04) - -- bash 3.2.39(1) -- dash 0.5.4 -- ksh M-1993-12-28 -- pdksh 5.2.14-99/07/13.2 -- zsh 4.3.4 - -Mac OS X 10.5.4 (Darwin 9.4.0) - -- bash 3.2.17(1) -- ksh M-1993-12-28 -- zsh 4.3.4 - -Solaris 9 U6 x86 - -- /bin/sh -- bash 2.05.0(1) -- ksh M-11/16/88i -- zsh 3.0.8 - -Solaris 11 x86 (Nevada 77) - -- /bin/sh -- bash 3.2.25(1) -- ksh M-11/16/88i -- zsh 4.3.4 - - -New Features ------------- - -Support added for output assert source line number as part of assert messages. - -Issue #2: Added assertNotEquals() assert. - -Provided a public ``shunit_tmpDir`` variable that can be used by unit test -scripts that need automated and guaranteed cleanup. - - -Changes and Enhancements ------------------------- - -Issue #3: Removed the check for unset variables as shUnit2 should not expect -scripts being tested to be clean. - -Issue #4: Rewrote the test summary. It is now greatly simplified and much more -script friendly. - -Issue #5: Fixed the documentation around the usage of failures. - -Issue #9: Added unit tests and improved documentation around the use of macros. - -Code updated to meet documented coding standards. - -Improved code reuse of ``_shunit_exit()`` and ``_shunit_fatal()`` functions. - -All output except shUnit2 error messages now goes to STDOUT. - -Converted DocBook documentation to reStructuredText for easier maintenance. - - -Bug Fixes ---------- - -Issue #1: Fixed bug in rap code where certain types of exit conditions did not -generate the ending report. - -Issue #7: Fixed duplicated printing of messages passed to asserts. - -Fixed bugs in ``shlib_relToAbsPath()`` in ``shlib``. - - -Deprecated Features -------------------- - -None. - - -Known Bugs and Issues ---------------------- - -Zsh requires the ``shwordsplit`` option to be set. See the documentation for -examples of how to do this. - -Line numbers in assert messages do not work properly with BASH 2.x. - -The Bourne shell of Solaris, BASH 2.x, and Zsh 3.0.x do not properly catch the -SIGTERM signal. As such, shell interpreter failures due to such things as -unbound variables cannot be caught. (See ``shunit_test_misc.sh``) - - -.. vim:fileencoding=latin1:ft=rst:spell:tw=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.6.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.6.txt deleted file mode 100644 index 50087fe..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.6.txt +++ /dev/null @@ -1,112 +0,0 @@ -Release Notes for shUnit2 2.1.6 -=============================== - -This release contains bug fixes and changes. It is also the first release to -support running shunit2 as a standalone program. - -Please read the Shell Errata section of the documentation for guidance on how -to meet these requirements. - -See the ``CHANGES-2.1.txt`` file for a full list of changes. - -New Features ------------- - -Support for running shUnit2 as a standalone program. This makes it possible for -users to execute their unit tests in a manner that is not dependent on the -location an OS distribution maintainer chose to place shUnit2 in the file -system. - -Added support for functions defined like 'function someFunction()'. - -Changes and Enhancements ------------------------- - -Renamed the public ``shunit_tmpDir`` variable to ``SHUNIT_TMPDIR`` to be more -consistent with the ``TMPDIR`` variable. - -Bug Fixes ---------- - -Fixed issue where shunit2 would fail on some distributions when creating a -temporary directory because the **od** command was not present. - -Deprecated Features -------------------- - -None. - -Known Bugs and Issues ---------------------- - -Zsh requires the ``shwordsplit`` option to be set. See the documentation for -examples of how to do this. - -Line numbers in assert messages do not work properly with BASH 2.x. - -The Bourne shell of Solaris, BASH 2.x, and Zsh 3.0.x do not properly catch the -SIGTERM signal. As such, shell interpreter failures due to such things as -unbound variables cannot be caught. (See ``shunit_test_misc.sh``) - -Tested Platforms ----------------- - -Cygwin 1.7.9 (Windows XP SP2) - -- bash 4.1.10(4) -- dash 0.5.6.1 -- ksh (sym-link to pdksh) -- pdksh 5.2.14 -- zsh 4.3.11 - -Linux (Ubuntu Dapper 6.06.2 LTS) - -- bash 3.1.17(1) -- dash 0.5.3 -- ksh (sym-link to pdksh) -- pdksh 5.2.14-99/07/13.2 -- zsh 4.2.5 - -Linux (Ubuntu Hardy 8.04.4 LTS) - -- bash 3.2.39(1) -- dash 0.5.4 -- ksh M-1993-12-28 -- pdksh 5.2.14-99/07/13.2 -- zsh 4.3.4 - -Linux (Ubuntu Lucid 10.04.2 LTS) - -- bash 4.1.5(1) -- dash 0.5.5.1 -- ksh JM-93t+-2009-05-01 -- pdksh 5.2.14-99/07/13.2 -- zsh 4.3.10 - -Mac OS X 10.6.7 - -- bash 3.2.48(1) -- ksh M-1993-12-28 -- zsh 4.3.9 - -Solaris 8 U7 x86 - -- /bin/sh -- bash 2.03.0(1) -- ksh M-11/16/88i -- zsh 3.0.6 - -Solaris 9 U6 x86 - -- /bin/sh -- bash 2.05.0(1) -- ksh M-11/16/88i -- zsh 3.0.8 - -OpenSolaris 2009.06(snv_111b) x86 - -- /bin/sh -- bash 3.2.25(1) -- ksh 2008-11-04 - -.. vim:fileencoding=latin1:ft=rst:spell:tw=80 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.7.md b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.7.md deleted file mode 100644 index 6497942..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/RELEASE_NOTES-2.1.7.md +++ /dev/null @@ -1,62 +0,0 @@ -# shUnit2 2.1.7 Release Notes - -https://github.com/kward/shunit2 - -This release contains bug fixes and enhancements. It is the first release since moving to GitHub. Users can now clone the latest version at any time. - -See the `CHANGES-2.1.md` file for a full list of changes. - - -## New Features - -Colorized output, based on popular demand. shUnit2 output is now colorized based on the result of the asserts. - - -## Changes and Enhancements - -With the move to GitHub, the shUnit2 unit tests are run on every commit using the [Travis CI][TravisCI] continuous integration framework. Additionally, all code is run through [ShellCheck](http:/www.shellcheck.net/) on every commit. - -[TravisCI]: https://travis-ci.org/kward/shunit2 - -Shell commands in shUnit2 are prefixed with '\' so that they can be stubbed in tests. - - -## Bug Fixes - -shUnit2 no longer exits with an 'OK' result if there were syntax errors due to incorrect usage of the assert commands. - - -## Deprecated Features - -None. - - -## Known Bugs and Issues - -Zsh requires the `shwordsplit` option to be set. See the documentation for examples of how to do this. - -Line numbers in assert messages do not work properly with BASH 2.x. - -The Bourne shell of Solaris, BASH 2.x, and Zsh 3.0.x do not properly catch the -SIGTERM signal. As such, shell interpreter failures due to such things as -unbound variables cannot be caught. (See `shunit_test_misc.sh`) - - -## Tested Platforms - -Continuous integration testing is provided by [Travis CI][TravisCI]. - -Tested OSes: - -- Linux -- macOS - -Tested shells: - -- /bin/sh -- ash -- bash -- dash -- ksh -- pdksh -- zsh diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/TODO.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/TODO.txt deleted file mode 100644 index cecc17d..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/TODO.txt +++ /dev/null @@ -1,13 +0,0 @@ -Make it possible to execute a single test by passing the name of the test on -the command line - -Add support for '--randomize-order' so that the test order is randomized to -check for dependencies (which shouldn't be there) between tests. - ---debug option to display point in source code (line number and such) where the -problem showed up. - -assertTrue() just gives 'ASSERT:', nothing else :-(. others too? -upd: assertNull() will give message passed, but nothing else useful :-( - -$Revision$ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/contributors.md b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/contributors.md deleted file mode 100644 index 7adae22..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/contributors.md +++ /dev/null @@ -1,15 +0,0 @@ -The original author of shunit2 is Kate Ward. The following people have -contributed in some way or another to shunit2. - -- [Alex Harvey](https://github.com/alexharv074) -- Bryan Larsen -- [David Acacio](https://github.com/dacacioa) -- Kevin Van Horn -- [Maciej Bliziński](https://github.com/automatthias) -- Mario Sparada -- Mathias Goldau -- Richard Jensen -- Rob Holland -- Rocky Bernstein -- [rugk](https://github.com/rugk) -- wood4321 (of code.google.com) diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/design_doc.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/design_doc.txt deleted file mode 100644 index 24d41ff..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/design_doc.txt +++ /dev/null @@ -1,34 +0,0 @@ -Design Doc for shUnit - -shUnit is based upon JUnit. The initial ideas for the script came from the book -"Pragmatic Unit Testing - In Java with JUnit" by Andrew Hunt and David Thomas. - -The script was written to perform unit testing for log4sh. log4sh had grown -enough that it was becoming difficult to easily test and and verify that the -tests passed for the many different operating systems on which it was being -used. - -The functions in shUnit are meant to match those in JUnit as much as possible -where shell allows. In the initial version, there will be no concept of -exceptions (as normal POSIX shell has no concept of them) but attempts to trap -problems will be done. - -Programatic Standards: - -* SHUNIT_TRUE - public global constant -* __SHUNIT_SHELL_FLAGS - private global constant -* __shunit_oldShellFlags - private global variable - -* assertEquals - public unit test function -* shunit_publicFunc - public shUnit function; can be called from parent unit - test script -* _shunit_privateFunc - private shUnit function; should not be called from - parent script. meant for internal use by shUnit - -* _su_myVar - variable inside a public function. prefixing with '_su_' to - reduce the chances that a variable outside of shUnit will be overridden. -* _su__myVar - variable inside a private function. prefixing with '_su__' to - reduce the chances that a variable in a shUnit public function, or a variable - outside of shUnit will be overridden. - -$Revision$ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.html b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.html deleted file mode 100644 index 4285223..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.html +++ /dev/null @@ -1,880 +0,0 @@ - - - - - - -shUnit2 2.1.x Documentation - - - -
-

shUnit2 2.1.x Documentation

- -
-

Abstract

-

shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it -is designed to work in a similar manner to JUnit, PyUnit, etc.. If you have -ever had the desire to write a unit test for a shell script, shUnit2 can do the -job.

- -
-
-

Introduction

-

shUnit2 was originally developed to provide a consistent testing solution for -log4sh, a shell based logging framework similar to log4j. During the -development of that product, a repeated problem of having things work just fine -under one shell (/bin/bash on Linux to be specific), and then not working -under another shell (/bin/sh on Solaris) kept coming up. Although several -simple tests were run, they were not adequate and did not catch some corner -cases. The decision was finally made to write a proper unit test framework after -multiple brown-bag releases were made. Research was done to look for an -existing product that met the testing requirements, but no adequate product was -found.

-

Tested Operating Systems (varies over time)

-
    -
  • Cygwin
  • -
  • FreeBSD (user supported)
  • -
  • Linux (Gentoo, Ubuntu)
  • -
  • Mac OS X
  • -
  • Solaris 8, 9, 10 (inc. OpenSolaris)
  • -
-

Tested Shells

-
    -
  • Bourne Shell (sh)
  • -
  • BASH - GNU Bourne Again SHell (bash)
  • -
  • DASH (dash)
  • -
  • Korn Shell (ksh)
  • -
  • pdksh - Public Domain Korn Shell (pdksh)
  • -
  • zsh - Zsh (zsh) (since 2.1.2) please see the Zsh shell errata for more -information
  • -
-

See the appropriate Release Notes for this release -(doc/RELEASE_NOTES-X.X.X.txt) for the list of actual versions tested.

-
-

Credits / Contributors

-

A list of contributors to shUnit2 can be found in the source archive in -doc/contributors.txt. Many thanks go out to all those who have contributed -to make this a better tool.

-

shUnit2 is the original product of many hours of work by Kate Ward, the primary -author of the code. For other products by her, look up log4sh or shFlags, or -visit her website at http://forestent.com/.

-
-
-

Feedback

-

Feedback is most certainly welcome for this document. Send your additions, -comments and criticisms to the shunit2-users@google.com mailing list.

-
-
-
-

Quickstart

-

This section will give a very quick start to running unit tests with shUnit2. -More information is located in later sections.

-

Here is a quick sample script to show how easy it is to write a unit test in -shell. Note: the script as it stands expects that you are running it from the -``examples`` directory.

-
-#! /bin/sh
-# file: examples/equality_test.sh
-
-testEquality()
-{
-  assertEquals 1 1
-}
-
-# load shunit2
-. ../src/shell/shunit2
-
-

Running the unit test should give results similar to the following.

-
-testEquality
-
-Ran 1 test.
-
-OK
-
-

W00t! You've just run your first successful unit test. So, what just happened? -Quite a bit really, and it all happened simply by sourcing the shunit2 -library. The basic functionality for the script above goes like this:

-
    -
  • When shUnit2 is sourced, it will walk through any functions defined whose -namestart with the string test and add those to an internal list of tests -to execute. Once a list of test functions to be run has been determined, -shunit2 will go to work.
  • -
  • Before any tests are executed, shUnit2 again looks for a function, this time -one named oneTimeSetUp(). If it exists, it will be run. This function is -normally used to setup the environment for all tests to be run. Things like -creating directories for output or setting environment variables are good to -place here. Just so you know, you can also declare a corresponding function -named oneTimeTearDown() function that does the same thing, but once all -the tests have been completed. It is good for removing temporary directories, -etc.
  • -
  • shUnit2 is now ready to run tests. Before doing so though, it again looks for -another function that might be declared, one named setUp(). If the -function exists, it will be run before each test. It is good for resetting the -environment so that each test starts with a clean slate. At this stage, the -first test is finally run. The success of the test is recorded for a report -that will be generated later. After the test is run, shUnit2 looks for a final -function that might be declared, one named tearDown(). If it exists, it -will be run after each test. It is a good place for cleaning up after each -test, maybe doing things like removing files that were created, or removing -directories. This set of steps, setUp() > test() > tearDown(), is -repeated for all of the available tests.
  • -
  • Once all the work is done, shUnit2 will generate the nice report you saw -above. A summary of all the successes and failures will be given so that you -know how well your code is doing.
  • -
-

We should now try adding a test that fails. Change your unit test to look like -this.

-
-#! /bin/sh
-# file: examples/party_test.sh
-
-testEquality()
-{
-  assertEquals 1 1
-}
-
-testPartyLikeItIs1999()
-{
-  year=`date '+%Y'`
-  assertEquals "It's not 1999 :-(" \
-      '1999' "${year}"
-}
-
-# load shunit2
-. ../src/shell/shunit2
-
-

So, what did you get? I guess it told you that this isn't 1999. Bummer, eh? -Hopefully, you noticed a couple of things that were different about the second -test. First, we added an optional message that the user will see if the assert -fails. Second, we did comparisons of strings instead of integers as in the first -test. It doesn't matter whether you are testing for equality of strings or -integers. Both work equally well with shUnit2.

-

Hopefully, this is enough to get you started with unit testing. If you want a -ton more examples, take a look at the tests provided with log4sh or shFlags. -Both provide excellent examples of more advanced usage. shUnit2 was after all -written to help with the unit testing problems that log4sh had.

-
-
-

Function Reference

-
-

General Info

-

Any string values passed should be properly quoted -- they should must be -surrounded by single-quote (') or double-quote (") characters -- so that the -shell will properly parse them.

-
-
-

Asserts

-
-
assertEquals [message] expected actual
-
Asserts that expected and actual are equal to one another. The expected -and actual values can be either strings or integer values as both will be -treated as strings. The message is optional, and must be quoted.
-
assertNotEquals [message] expected actual
-
Asserts that unexpected and actual are not equal to one another. The -unexpected and actual values can be either strings or integer values as -both will be treaded as strings. The message is optional, and must be -quoted.
-
assertSame [message] expected actual
-
This function is functionally equivalent to assertEquals.
-
assertNotSame [message] unexpected actual
-
This function is functionally equivalent to assertNotEquals.
-
assertNull [message] value
-
Asserts that value is null, or in shell terms, a zero-length string. The -value must be a string as an integer value does not translate into a -zero-length string. The message is optional, and must be quoted.
-
assertNotNull [message] value
-
Asserts that value is not null, or in shell terms, a non-empty string. The -value may be a string or an integer as the later will be parsed as a -non-empty string value. The message is optional, and must be quoted.
-
assertTrue [message] condition
-

Asserts that a given shell test condition is true. The condition can be as -simple as a shell true value (the value 0 -- equivalent to -${SHUNIT_TRUE}), or a more sophisticated shell conditional expression. The -message is optional, and must be quoted.

-

A sophisticated shell conditional expression is equivalent to what the if -or while shell built-ins would use (more specifically, what the test -command would use). Testing for example whether some value is greater than -another value can be done this way.

-
-assertTrue "[ 34 -gt 23 ]"
-
-

Testing for the ability to read a file can also be done. This particular test -will fail.

-
-assertTrue 'test failed' "[ -r /some/non-existent/file' ]"
-
-

As the expressions are standard shell test expressions, it is possible to -string multiple expressions together with -a and -o in the standard -fashion. This test will succeed as the entire expression evaluates to true.

-
-assertTrue 'test failed' '[ 1 -eq 1 -a 2 -eq 2 ]'
-
-

One word of warning: be very careful with your quoting as shell is not the -most forgiving of bad quoting, and things will fail in strange ways.

-
-
assertFalse [message] condition
-

Asserts that a given shell test condition is false. The condition can be -as simple as a shell false value (the value 1 -- equivalent to -${SHUNIT_FALSE}), or a more sophisticated shell conditional expression. -The message is optional, and must be quoted.

-

For examples of more sophisticated expressions, see ``assertTrue``.

-
-
-
-
-

Failures

-

Just to clarify, failures do not test the various arguments against one -another. Failures simply fail, optionally with a message, and that is all they -do. If you need to test arguments against one another, use asserts.

-

If all failures do is fail, why might one use them? There are times when you may -have some very complicated logic that you need to test, and the simple asserts -provided are simply not adequate. You can do your own validation of the code, -use an assertTrue ${SHUNIT_TRUE} if your own tests succeeded, and use a -failure to record a failure.

-
-
fail [message]
-
Fails the test immediately. The message is optional, and must be quoted.
-
failNotEquals [message] unexpected actual
-

Fails the test immediately, reporting that the unexpected and actual -values are not equal to one another. The message is optional, and must be -quoted.

-

Note: no actual comparison of unexpected and actual is done.

-
-
failSame [message] expected actual
-

Fails the test immediately, reporting that the expected and actual values -are the same. The message is optional, and must be quoted.

-

Note: no actual comparison of expected and actual is done.

-
-
failNotSame [message] expected actual
-

Fails the test immediately, reporting that the expected and actual values -are not the same. The message is optional, and must be quoted.

-

Note: no actual comparison of expected and actual is done.

-
-
-
-
-

Setup/Teardown

-
-
oneTimeSetUp
-

This function can be be optionally overridden by the user in their test suite.

-

If this function exists, it will be called once before any tests are run. It -is useful to prepare a common environment for all tests.

-
-
oneTimeTearDown
-

This function can be be optionally overridden by the user in their test suite.

-

If this function exists, it will be called once after all tests are completed. -It is useful to clean up the environment after all tests.

-
-
setUp
-

This function can be be optionally overridden by the user in their test suite.

-

If this function exists, it will be called before each test is run. It is -useful to reset the environment before each test.

-
-
tearDown
-

This function can be be optionally overridden by the user in their test suite.

-

If this function exists, it will be called after each test completes. It is -useful to clean up the environment after each test.

-
-
-
-
-

Skipping

-
-
startSkipping
-
This function forces the remaining assert and fail functions to be -"skipped", i.e. they will have no effect. Each function skipped will be -recorded so that the total of asserts and fails will not be altered.
-
endSkipping
-
This function returns calls to the assert and fail functions to their -default behavior, i.e. they will be called.
-
isSkipping
-
This function returns the current state of skipping. It can be compared -against ${SHUNIT_TRUE} or ${SHUNIT_FALSE} if desired.
-
-
-
-

Suites

-

The default behavior of shUnit2 is that all tests will be found dynamically. If -you have a specific set of tests you want to run, or you don't want to use the -standard naming scheme of prefixing your tests with test, these functions -are for you. Most users will never use them though.

-
-
suite
-

This function can be optionally overridden by the user in their test suite.

-

If this function exists, it will be called when shunit2 is sourced. If it -does not exist, shUnit2 will search the parent script for all functions -beginning with the word test, and they will be added dynamically to the -test suite.

-
-
suite_addTest name
-
This function adds a function named name to the list of tests scheduled for -execution as part of this test suite. This function should only be called from -within the suite() function.
-
-
-
-
-

Advanced Usage

-

This section covers several advanced usage topics.

-
-

Some constants you can use

-

There are several constants provided by shUnit2 as variables that might be of -use to you.

-

Predefined

- ---- - - - - - - - - - - - - - - - - - -
SHUNIT_VERSIONThe version of shUnit2 you are running.
SHUNIT_TRUEStandard shell true value (the integer value 0).
SHUNIT_FALSEStandard shell false value (the integer value 1).
SHUNIT_ERRORThe integer value 2.
SHUNIT_TMPDIRPath to temporary directory that will be automatically -cleaned up upon exit of shUnit2.
-

User defined

- ---- - - - - - -
SHUNIT_PARENTThe filename of the shell script containing the tests. This -is needed specifically for Zsh support.
-
-
-

Error handling

-

The constants values SHUNIT_TRUE, SHUNIT_FALSE, and SHUNIT_ERROR are -returned from nearly every function to indicate the success or failure of the -function. Additionally the variable flags_error is filled with a detailed -error message if any function returns with a SHUNIT_ERROR value.

-
-
-

Including Line Numbers in Asserts (Macros)

-

If you include lots of assert statements in an individual test function, it can -become difficult to determine exactly which assert was thrown unless your -messages are unique. To help somewhat, line numbers can be included in the -assert messages. To enable this, a special shell "macro" must be used rather -than the standard assert calls. Shell doesn't actually have macros; the name is -used here as the operation is similar to a standard macro.

-

For example, to include line numbers for a assertEquals() function call, -replace the assertEquals() with ${_ASSERT_EQUALS_}.

-

Example -- Asserts with and without line numbers

-
-#! /bin/sh
-# file: examples/lineno_test.sh
-
-testLineNo()
-{
-  # this assert will have line numbers included (e.g. "ASSERT:[123] ...")
-  echo "ae: ${_ASSERT_EQUALS_}"
-  ${_ASSERT_EQUALS_} 'not equal' 1 2
-
-  # this assert will not have line numbers included (e.g. "ASSERT: ...")
-  assertEquals 'not equal' 1 2
-}
-
-# load shunit2
-. ../src/shell/shunit2
-
-

Notes:

-
    -
  1. Due to how shell parses command-line arguments, all strings used with macros -should be quoted twice. Namely, single-quotes must be converted to -single-double-quotes, and vice-versa. If the string being passed is -absolutely for sure not empty, the extra quoting is not necessary.

    -

    Normal assertEquals call.

    -
    -assertEquals 'some message' 'x' ''
    -
    -

    Macro _ASSERT_EQUALS_ call. Note the extra quoting around the message -and the null value.

    -
    -_ASSERT_EQUALS_ '"some message"' 'x' '""'
    -
    -
  2. -
  3. Line numbers are not supported in all shells. If a shell does not support -them, no errors will be thrown. Supported shells include: bash (>=3.0), -ksh, pdksh, and zsh.

    -
  4. -
-
-
-

Test Skipping

-

There are times where the test code you have written is just not applicable to -the system you are running on. This section describes how to skip these tests -but maintain the total test count.

-

Probably the easiest example would be shell code that is meant to run under the -bash shell, but the unit test is running under the Bourne shell. There are -things that just won't work. The following test code demonstrates two sample -functions, one that will be run under any shell, and the another that will run -only under the bash shell.

-

Example -- math include

-
-# available as examples/math.inc
-
-add_generic()
-{
-  num_a=$1
-  num_b=$2
-
-  expr $1 + $2
-}
-
-add_bash()
-{
-  num_a=$1
-  num_b=$2
-
-  echo $(($1 + $2))
-}
-
-

And here is a corresponding unit test that correctly skips the add_bash() -function when the unit test is not running under the bash shell.

-

Example -- math unit test

-
-#! /bin/sh
-# available as examples/math_test.sh
-
-testAdding()
-{
-  result=`add_generic 1 2`
-  assertEquals \
-      "the result of '${result}' was wrong" \
-      3 "${result}"
-
-  # disable non-generic tests
-  [ -z "${BASH_VERSION:-}" ] && startSkipping
-
-  result=`add_bash 1 2`
-  assertEquals \
-      "the result of '${result}' was wrong" \
-      3 "${result}"
-}
-
-oneTimeSetUp()
-{
-  # load include to test
-  . ./math.inc
-}
-
-# load and run shUnit2
-. ../src/shell/shunit2
-
-

Running the above test under the bash shell will result in the following -output.

-
-$ /bin/bash math_test.sh
-testAdding
-
-Ran 1 test.
-
-OK
-
-

But, running the test under any other Unix shell will result in the following -output.

-
-$ /bin/ksh math_test.sh
-testAdding
-
-Ran 1 test.
-
-OK (skipped=1)
-
-

As you can see, the total number of tests has not changed, but the report -indicates that some tests were skipped.

-

Skipping can be controlled with the following functions: startSkipping(), -endSkipping(), and isSkipping(). Once skipping is enabled, it will -remain enabled until the end of the current test function call, after which -skipping is disabled.

-
-
-
-

Appendix

-
-

Getting help

-

For help, please send requests to either the shunit2-users@googlegroups.com -mailing list (archives available on the web at -http://groups.google.com/group/shunit2-users) or directly to -Kate Ward <kate dot ward at forestent dot com>.

-
-
-

Zsh

-

For compatibility with Zsh, there is one requirement that must be met -- the -shwordsplit option must be set. There are three ways to accomplish this.

-
    -
  1. In the unit-test script, add the following shell code snippet before sourcing -the shunit2 library.

    -
    -setopt shwordsplit
    -
    -
  2. -
  3. When invoking zsh from either the command-line or as a script with -#!, add the -y parameter.

    -
    -#! /bin/zsh -y
    -
    -
  4. -
  5. When invoking zsh from the command-line, add -o shwordsplit -- as -parameters before the script name.

    -
    -$ zsh -o shwordsplit -- some_script
    -
    -
  6. -
- - - - - -
-
-
- - diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.txt b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.txt deleted file mode 100644 index 537e2eb..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/doc/shunit2.txt +++ /dev/null @@ -1,564 +0,0 @@ -=========================== -shUnit2 2.1.x Documentation -=========================== - -Abstract -======== - -shUnit2_ is a xUnit_ unit test framework for Bourne based shell scripts, and it -is designed to work in a similar manner to JUnit_, PyUnit_, etc.. If you have -ever had the desire to write a unit test for a shell script, shUnit2 can do the -job. - -.. contents:: Table of Contents - :depth: 2 - -Introduction -============ - -shUnit2 was originally developed to provide a consistent testing solution for -log4sh_, a shell based logging framework similar to log4j_. During the -development of that product, a repeated problem of having things work just fine -under one shell (``/bin/bash`` on Linux to be specific), and then not working -under another shell (``/bin/sh`` on Solaris) kept coming up. Although several -simple tests were run, they were not adequate and did not catch some corner -cases. The decision was finally made to write a proper unit test framework after -multiple brown-bag releases were made. *Research was done to look for an -existing product that met the testing requirements, but no adequate product was -found.* - -Tested Operating Systems (varies over time) - -- Cygwin -- FreeBSD (user supported) -- Linux (Gentoo, Ubuntu) -- Mac OS X -- Solaris 8, 9, 10 (inc. OpenSolaris) - -Tested Shells - -- Bourne Shell (**sh**) -- BASH - GNU Bourne Again SHell (**bash**) -- DASH (**dash**) -- Korn Shell (**ksh**) -- pdksh - Public Domain Korn Shell (**pdksh**) -- zsh - Zsh (**zsh**) (since 2.1.2) *please see the Zsh shell errata for more - information* - -See the appropriate Release Notes for this release -(``doc/RELEASE_NOTES-X.X.X.txt``) for the list of actual versions tested. - -Credits / Contributors ----------------------- - -A list of contributors to shUnit2 can be found in ``doc/contributors.md``. -Many thanks go out to all those who have contributed to make this a better -tool. - -shUnit2 is the original product of many hours of work by Kate Ward, the primary -author of the code. For other products by her, look up log4sh_ or shFlags_, or -visit her website at http://forestent.com/. - -Feedback --------- - -Feedback is most certainly welcome for this document. Send your additions, -comments and criticisms to the shunit2-users@google.com mailing list. - -Quickstart -========== - -This section will give a very quick start to running unit tests with shUnit2. -More information is located in later sections. - -Here is a quick sample script to show how easy it is to write a unit test in -shell. *Note: the script as it stands expects that you are running it from the -``examples`` directory.* :: - - #! /bin/sh - # file: examples/equality_test.sh - - testEquality() - { - assertEquals 1 1 - } - - # load shunit2 - . ../src/shell/shunit2 - -Running the unit test should give results similar to the following. :: - - testEquality - - Ran 1 test. - - OK - -W00t! You've just run your first successful unit test. So, what just happened? -Quite a bit really, and it all happened simply by sourcing the ``shunit2`` -library. The basic functionality for the script above goes like this: - -- When shUnit2 is sourced, it will walk through any functions defined whose - namestart with the string ``test`` and add those to an internal list of tests - to execute. Once a list of test functions to be run has been determined, - shunit2 will go to work. -- Before any tests are executed, shUnit2 again looks for a function, this time - one named ``oneTimeSetUp()``. If it exists, it will be run. This function is - normally used to setup the environment for all tests to be run. Things like - creating directories for output or setting environment variables are good to - place here. Just so you know, you can also declare a corresponding function - named ``oneTimeTearDown()`` function that does the same thing, but once all - the tests have been completed. It is good for removing temporary directories, - etc. -- shUnit2 is now ready to run tests. Before doing so though, it again looks for - another function that might be declared, one named ``setUp()``. If the - function exists, it will be run before each test. It is good for resetting the - environment so that each test starts with a clean slate. At this stage, the - first test is finally run. The success of the test is recorded for a report - that will be generated later. After the test is run, shUnit2 looks for a final - function that might be declared, one named ``tearDown()``. If it exists, it - will be run after each test. It is a good place for cleaning up after each - test, maybe doing things like removing files that were created, or removing - directories. This set of steps, ``setUp()`` > ``test()`` > ``tearDown()``, is - repeated for all of the available tests. -- Once all the work is done, shUnit2 will generate the nice report you saw - above. A summary of all the successes and failures will be given so that you - know how well your code is doing. - -We should now try adding a test that fails. Change your unit test to look like -this. :: - - #! /bin/sh - # file: examples/party_test.sh - - testEquality() - { - assertEquals 1 1 - } - - testPartyLikeItIs1999() - { - year=`date '+%Y'` - assertEquals "It's not 1999 :-(" \ - '1999' "${year}" - } - - # load shunit2 - . ../src/shell/shunit2 - -So, what did you get? I guess it told you that this isn't 1999. Bummer, eh? -Hopefully, you noticed a couple of things that were different about the second -test. First, we added an optional message that the user will see if the assert -fails. Second, we did comparisons of strings instead of integers as in the first -test. It doesn't matter whether you are testing for equality of strings or -integers. Both work equally well with shUnit2. - -Hopefully, this is enough to get you started with unit testing. If you want a -ton more examples, take a look at the tests provided with log4sh_ or shFlags_. -Both provide excellent examples of more advanced usage. shUnit2 was after all -written to help with the unit testing problems that log4sh_ had. - -Function Reference -================== - -General Info ------------- - -Any string values passed should be properly quoted -- they should must be -surrounded by single-quote (') or double-quote (") characters -- so that the -shell will properly parse them. - -Asserts -------- - -``assertEquals [message] expected actual`` - Asserts that *expected* and *actual* are equal to one another. The *expected* - and *actual* values can be either strings or integer values as both will be - treated as strings. The *message* is optional, and must be quoted. - -``assertNotEquals [message] expected actual`` - Asserts that *unexpected* and *actual* are not equal to one another. The - *unexpected* and *actual* values can be either strings or integer values as - both will be treaded as strings. The *message* is optional, and must be - quoted. - -``assertSame [message] expected actual`` - This function is functionally equivalent to ``assertEquals``. - -``assertNotSame [message] unexpected actual`` - This function is functionally equivalent to ``assertNotEquals``. - -``assertNull [message] value`` - Asserts that *value* is *null*, or in shell terms, a zero-length string. The - *value* must be a string as an integer value does not translate into a - zero-length string. The *message* is optional, and must be quoted. - -``assertNotNull [message] value`` - Asserts that *value* is *not null*, or in shell terms, a non-empty string. The - *value* may be a string or an integer as the later will be parsed as a - non-empty string value. The *message* is optional, and must be quoted. - -``assertTrue [message] condition`` - Asserts that a given shell test *condition* is *true*. The condition can be as - simple as a shell *true* value (the value ``0`` -- equivalent to - ``${SHUNIT_TRUE}``), or a more sophisticated shell conditional expression. The - *message* is optional, and must be quoted. - - A sophisticated shell conditional expression is equivalent to what the **if** - or **while** shell built-ins would use (more specifically, what the **test** - command would use). Testing for example whether some value is greater than - another value can be done this way. :: - - assertTrue "[ 34 -gt 23 ]" - - Testing for the ability to read a file can also be done. This particular test - will fail. :: - - assertTrue 'test failed' "[ -r /some/non-existent/file' ]" - - As the expressions are standard shell **test** expressions, it is possible to - string multiple expressions together with ``-a`` and ``-o`` in the standard - fashion. This test will succeed as the entire expression evaluates to *true*. - :: - - assertTrue 'test failed' '[ 1 -eq 1 -a 2 -eq 2 ]' - - *One word of warning: be very careful with your quoting as shell is not the - most forgiving of bad quoting, and things will fail in strange ways.* - -``assertFalse [message] condition`` - Asserts that a given shell test *condition* is *false*. The condition can be - as simple as a shell *false* value (the value ``1`` -- equivalent to - ``${SHUNIT_FALSE}``), or a more sophisticated shell conditional expression. - The *message* is optional, and must be quoted. - - *For examples of more sophisticated expressions, see ``assertTrue``.* - -Failures --------- - -Just to clarify, failures **do not** test the various arguments against one -another. Failures simply fail, optionally with a message, and that is all they -do. If you need to test arguments against one another, use asserts. - -If all failures do is fail, why might one use them? There are times when you may -have some very complicated logic that you need to test, and the simple asserts -provided are simply not adequate. You can do your own validation of the code, -use an ``assertTrue ${SHUNIT_TRUE}`` if your own tests succeeded, and use a -failure to record a failure. - -``fail [message]`` - Fails the test immediately. The *message* is optional, and must be quoted. - -``failNotEquals [message] unexpected actual`` - Fails the test immediately, reporting that the *unexpected* and *actual* - values are not equal to one another. The *message* is optional, and must be - quoted. - - *Note: no actual comparison of unexpected and actual is done.* - -``failSame [message] expected actual`` - Fails the test immediately, reporting that the *expected* and *actual* values - are the same. The *message* is optional, and must be quoted. - - *Note: no actual comparison of expected and actual is done.* - -``failNotSame [message] expected actual`` - Fails the test immediately, reporting that the *expected* and *actual* values - are not the same. The *message* is optional, and must be quoted. - - *Note: no actual comparison of expected and actual is done.* - -Setup/Teardown --------------- - -``oneTimeSetUp`` - This function can be be optionally overridden by the user in their test suite. - - If this function exists, it will be called once before any tests are run. It - is useful to prepare a common environment for all tests. - -``oneTimeTearDown`` - This function can be be optionally overridden by the user in their test suite. - - If this function exists, it will be called once after all tests are completed. - It is useful to clean up the environment after all tests. - -``setUp`` - This function can be be optionally overridden by the user in their test suite. - - If this function exists, it will be called before each test is run. It is - useful to reset the environment before each test. - -``tearDown`` - This function can be be optionally overridden by the user in their test suite. - - If this function exists, it will be called after each test completes. It is - useful to clean up the environment after each test. - -Skipping --------- - -``startSkipping`` - This function forces the remaining *assert* and *fail* functions to be - "skipped", i.e. they will have no effect. Each function skipped will be - recorded so that the total of asserts and fails will not be altered. - -``endSkipping`` - This function returns calls to the *assert* and *fail* functions to their - default behavior, i.e. they will be called. - -``isSkipping`` - This function returns the current state of skipping. It can be compared - against ``${SHUNIT_TRUE}`` or ``${SHUNIT_FALSE}`` if desired. - -Suites ------- - -The default behavior of shUnit2 is that all tests will be found dynamically. If -you have a specific set of tests you want to run, or you don't want to use the -standard naming scheme of prefixing your tests with ``test``, these functions -are for you. Most users will never use them though. - -``suite`` - This function can be optionally overridden by the user in their test suite. - - If this function exists, it will be called when ``shunit2`` is sourced. If it - does not exist, shUnit2 will search the parent script for all functions - beginning with the word ``test``, and they will be added dynamically to the - test suite. - -``suite_addTest name`` - This function adds a function named *name* to the list of tests scheduled for - execution as part of this test suite. This function should only be called from - within the ``suite()`` function. - -Advanced Usage -============== - -This section covers several advanced usage topics. - -Some constants you can use --------------------------- - -There are several constants provided by shUnit2 as variables that might be of -use to you. - -Predefined - -================== =========================================================== -``SHUNIT_VERSION`` The version of shUnit2 you are running. -``SHUNIT_TRUE`` Standard shell *true* value (the integer value 0). -``SHUNIT_FALSE`` Standard shell *false* value (the integer value 1). -``SHUNIT_ERROR`` The integer value 2. -``SHUNIT_TMPDIR`` Path to temporary directory that will be automatically - cleaned up upon exit of shUnit2. -================== =========================================================== - -User defined - -================== =========================================================== -``SHUNIT_COLOR`` Set this flag to control colored output support. Accepted - values are ``always``, ``auto`` (the default), and ``none``. -``SHUNIT_PARENT`` The filename of the shell script containing the tests. This - is needed specifically for Zsh support. -================== =========================================================== - -Error handling --------------- - -The constants values ``SHUNIT_TRUE``, ``SHUNIT_FALSE``, and ``SHUNIT_ERROR`` are -returned from nearly every function to indicate the success or failure of the -function. Additionally the variable ``flags_error`` is filled with a detailed -error message if any function returns with a ``SHUNIT_ERROR`` value. - -Including Line Numbers in Asserts (Macros) ------------------------------------------- - -If you include lots of assert statements in an individual test function, it can -become difficult to determine exactly which assert was thrown unless your -messages are unique. To help somewhat, line numbers can be included in the -assert messages. To enable this, a special shell "macro" must be used rather -than the standard assert calls. *Shell doesn't actually have macros; the name is -used here as the operation is similar to a standard macro.* - -For example, to include line numbers for a ``assertEquals()`` function call, -replace the ``assertEquals()`` with ``${_ASSERT_EQUALS_}``. - -Example--Asserts with and without line numbers :: - - #! /bin/sh - # file: examples/lineno_test.sh - - testLineNo() - { - # this assert will have line numbers included (e.g. "ASSERT:[123] ...") - echo "ae: ${_ASSERT_EQUALS_}" - ${_ASSERT_EQUALS_} 'not equal' 1 2 - - # this assert will not have line numbers included (e.g. "ASSERT: ...") - assertEquals 'not equal' 1 2 - } - - # load shunit2 - . ../src/shell/shunit2 - -Notes: - -#. Due to how shell parses command-line arguments, all strings used with macros - should be quoted twice. Namely, single-quotes must be converted to - single-double-quotes, and vice-versa. If the string being passed is - absolutely for sure not empty, the extra quoting is not necessary. - - Normal ``assertEquals`` call. :: - - assertEquals 'some message' 'x' '' - - Macro ``_ASSERT_EQUALS_`` call. Note the extra quoting around the *message* - and the *null* value. :: - - _ASSERT_EQUALS_ '"some message"' 'x' '""' - -#. Line numbers are not supported in all shells. If a shell does not support - them, no errors will be thrown. Supported shells include: **bash** (>=3.0), - **ksh**, **pdksh**, and **zsh**. - -Test Skipping -------------- - -There are times where the test code you have written is just not applicable to -the system you are running on. This section describes how to skip these tests -but maintain the total test count. - -Probably the easiest example would be shell code that is meant to run under the -**bash** shell, but the unit test is running under the Bourne shell. There are -things that just won't work. The following test code demonstrates two sample -functions, one that will be run under any shell, and the another that will run -only under the **bash** shell. - -Example-- math include :: - - # available as examples/math.inc - - add_generic() - { - num_a=$1 - num_b=$2 - - expr $1 + $2 - } - - add_bash() - { - num_a=$1 - num_b=$2 - - echo $(($1 + $2)) - } - -And here is a corresponding unit test that correctly skips the ``add_bash()`` -function when the unit test is not running under the **bash** shell. - -Example-- math unit test :: - - #! /bin/sh - # available as examples/math_test.sh - - testAdding() - { - result=`add_generic 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" - - # disable non-generic tests - [ -z "${BASH_VERSION:-}" ] && startSkipping - - result=`add_bash 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" - } - - oneTimeSetUp() - { - # load include to test - . ./math.inc - } - - # load and run shUnit2 - . ../src/shell/shunit2 - -Running the above test under the **bash** shell will result in the following -output. :: - - $ /bin/bash math_test.sh - testAdding - - Ran 1 test. - - OK - -But, running the test under any other Unix shell will result in the following -output. :: - - $ /bin/ksh math_test.sh - testAdding - - Ran 1 test. - - OK (skipped=1) - -As you can see, the total number of tests has not changed, but the report -indicates that some tests were skipped. - -Skipping can be controlled with the following functions: ``startSkipping()``, -``endSkipping()``, and ``isSkipping()``. Once skipping is enabled, it will -remain enabled until the end of the current test function call, after which -skipping is disabled. - -Appendix -======== - -Getting help ------------- - -For help, please send requests to either the shunit2-users@googlegroups.com -mailing list (archives available on the web at -http://groups.google.com/group/shunit2-users) or directly to -Kate Ward . - -Zsh ---- - -For compatibility with Zsh, there is one requirement that must be met -- the -``shwordsplit`` option must be set. There are three ways to accomplish this. - -#. In the unit-test script, add the following shell code snippet before sourcing - the ``shunit2`` library. :: - - setopt shwordsplit - -#. When invoking **zsh** from either the command-line or as a script with - ``#!``, add the ``-y`` parameter. :: - - #! /bin/zsh -y - -#. When invoking **zsh** from the command-line, add ``-o shwordsplit --`` as - parameters before the script name. :: - - $ zsh -o shwordsplit -- some_script - -.. _log4sh: http://log4sh.sourceforge.net/ -.. _log4j: http://logging.apache.org/ -.. _JUnit: http://www.junit.org/ -.. _PyUnit: http://pyunit.sourceforge.net/ -.. _shFlags: http://shflags.googlecode.com/ -.. _shUnit2: http://shunit2.googlecode.com/ -.. _xUnit: http://en.wikipedia.org/wiki/XUnit - -.. generate HTML using rst2html from Docutils of -.. http://docutils.sourceforge.net/ -.. -.. vim:fileencoding=latin1:ft=rst:spell:sts=2:sw=2:tw=80 -.. $Revision: 233 $ diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/equality_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/equality_test.sh deleted file mode 100755 index 7b56640..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/equality_test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh -# file: examples/equality_test.sh - -testEquality() { - assertEquals 1 1 -} - -# Load and run shUnit2. -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/lineno_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/lineno_test.sh deleted file mode 100755 index 11ddfc8..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/lineno_test.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh -# file: examples/lineno_test.sh - -testLineNo() { - # This assert will have line numbers included (e.g. "ASSERT:[123] ...") if - # they are supported. - echo "_ASSERT_EQUALS_ macro value: ${_ASSERT_EQUALS_}" - ${_ASSERT_EQUALS_} '"not equal"' 1 2 - - # This assert will not have line numbers included (e.g. "ASSERT: ..."). - assertEquals 'not equal' 1 2 -} - -# Load and run shUnit2. -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math.inc b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math.inc deleted file mode 100644 index 4097106..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math.inc +++ /dev/null @@ -1,17 +0,0 @@ -# available as examples/math.inc - -add_generic() -{ - num_a=$1 - num_b=$2 - - expr $1 + $2 -} - -add_bash() -{ - num_a=$1 - num_b=$2 - - echo $(($1 + $2)) -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math_test.sh deleted file mode 100755 index c6d0029..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/math_test.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# file: examples/math_test.sh - -testAdding() { - result=`add_generic 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" - - # Disable non-generic tests. - [ -z "${BASH_VERSION:-}" ] && startSkipping - - result=`add_bash 1 2` - assertEquals \ - "the result of '${result}' was wrong" \ - 3 "${result}" -} - -oneTimeSetUp() { - # Load include to test. - . ./math.inc -} - -# Load and run shUnit2. -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mkdir_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mkdir_test.sh deleted file mode 100755 index ca980d9..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mkdir_test.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# Copyright 2008 Kate Ward. All Rights Reserved. -# Released under the LGPL (GNU Lesser General Public License) -# -# Author: kate.ward@forestent.com (Kate Ward) -# -# Example unit test for the mkdir command. -# -# There are times when an existing shell script needs to be tested. In this -# example, we will test several aspects of the the mkdir command, but the -# techniques could be used for any existing shell script. - -testMissingDirectoryCreation() { - ${mkdirCmd} "${testDir}" >${stdoutF} 2>${stderrF} - rtrn=$? - th_assertTrueWithNoOutput ${rtrn} "${stdoutF}" "${stderrF}" - - assertTrue 'directory missing' "[ -d '${testDir}' ]" -} - -testExistingDirectoryCreationFails() { - # Create a directory to test against. - ${mkdirCmd} "${testDir}" - - # Test for expected failure while trying to create directory that exists. - ${mkdirCmd} "${testDir}" >${stdoutF} 2>${stderrF} - rtrn=$? - assertFalse 'expecting return code of 1 (false)' ${rtrn} - assertNull 'unexpected output to stdout' "`cat ${stdoutF}`" - assertNotNull 'expected error message to stderr' "`cat ${stderrF}`" - - assertTrue 'directory missing' "[ -d '${testDir}' ]" -} - -testRecursiveDirectoryCreation() { - testDir2="${testDir}/test2" - - ${mkdirCmd} -p "${testDir2}" >${stdoutF} 2>${stderrF} - rtrn=$? - th_assertTrueWithNoOutput ${rtrn} "${stdoutF}" "${stderrF}" - - assertTrue 'first directory missing' "[ -d '${testDir}' ]" - assertTrue 'second directory missing' "[ -d '${testDir2}' ]" -} - -th_assertTrueWithNoOutput() { - th_return_=$1 - th_stdout_=$2 - th_stderr_=$3 - - assertFalse 'unexpected output to STDOUT' "[ -s '${th_stdout_}' ]" - assertFalse 'unexpected output to STDERR' "[ -s '${th_stderr_}' ]" - - unset th_return_ th_stdout_ th_stderr_ -} - -oneTimeSetUp() { - outputDir="${SHUNIT_TMPDIR}/output" - mkdir "${outputDir}" - stdoutF="${outputDir}/stdout" - stderrF="${outputDir}/stderr" - - mkdirCmd='mkdir' # save command name in variable to make future changes easy - testDir="${SHUNIT_TMPDIR}/some_test_dir" -} - -tearDown() { - rm -fr "${testDir}" -} - -# Load and run shUnit2. -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file.sh deleted file mode 100755 index 812e448..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# -# shUnit2 example for mocking files. -# -# This example demonstrates two different mechanisms for mocking files on the -# system. The first method is preferred for testing specific aspects of a file, -# and the second method is preferred when multiple tests need access to the -# same mock data. -# -# When mocking files, the key thing of importance is providing the code under -# test with the correct file to read. The best practice for writing code where -# files need to be mocked is either: -# - Pass the filename to be tested into a function and test that function, or -# - Provide a function that returns the name of the filename to be read. -# -# The first case is preferred whenever possible as it allows the unit test to -# be explicit about what is being tested. The second case is useful when the -# first case is not achievable. -# -# For the second case, there are two common methods to mock the filename -# returned by the function: -# - Provide a special value (e.g. a mock variable) that is only available -# during testing, or -# - Override something (e.g. the constant) in the test script. -# -# The first case is preferred as it doesn't require the unit test to alter code -# in any way. Yes, it means that the code itself knows that it is under test, -# and it behaves slightly differently than under normal conditions, but a -# visual inspection of the code by the developer should be sufficient to -# validate proper functionality of such a simple function. - -# Treat unset variables as an error. -set -u - -PASSWD='/etc/passwd' - -# Read the root UID from the passwd filename provided as the first argument. -root_uid_from_passed_filename() { - filename=$1 - root_uid "${filename}" - unset filename -} - - -# Read the root UID from the passwd filename derived by call to the -# passwd_filename() function. -root_uid_from_derived_filename() { - root_uid "$(passwd_filename)" -} - -passwd_filename() { - if [ -n "${MOCK_PASSWD:-}" ]; then - echo "${MOCK_PASSWD}" # Mock file for testing. - return - fi - echo "${PASSWD}" -} - - -# Extract the root UID. -root_uid() { awk -F: 'u==$1{print $3}' u=root "$1"; } - - -main() { - echo "root_uid_from_passed_filename:" - root_uid_from_passed_filename "${PASSWD}" - - echo - - echo "root_uid_from_derived_filename:" - root_uid_from_derived_filename -} - - -# Execute main() if this is run in standalone mode (i.e. not in a unit test). -ARGV0="$(basename "$0")" -argv0="$(echo "${ARGV0}" |sed 's/_test$//;s/_test\.sh$//')" -if [ "${ARGV0}" = "${argv0}" ]; then - main "$@" -fi diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file_test.sh deleted file mode 100755 index 1da8dd2..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/mock_file_test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# shUnit2 example for mocking files. - -MOCK_PASSWD='' # This will be overridden in oneTimeSetUp(). - -test_root_uid_from_passed_filename() { - result="$(root_uid_from_passed_filename "${MOCK_PASSWD}")" - assertEquals 'unexpected root uid' '0' "${result}" -} - -test_root_uid_from_derived_filename() { - result="$(root_uid_from_derived_filename)" - assertEquals 'unexpected root uid' '0' "${result}" -} - -oneTimeSetUp() { - # Provide a mock passwd file for testing. This will be cleaned up - # automatically by shUnit2. - MOCK_PASSWD="${SHUNIT_TMPDIR}/passwd" - cat <"${MOCK_PASSWD}" -nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false -root:*:0:0:System Administrator:/var/root:/bin/sh -daemon:*:1:1:System Services:/var/root:/usr/bin/false -EOF - - # Load script under test. - . './mock_file.sh' -} - -# Load and run shUnit2. -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/party_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/party_test.sh deleted file mode 100755 index 41bd124..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/party_test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh -# file: examples/party_test.sh -# -# This test is mostly for fun. Technically, it is a bad example of a unit test -# because of the temporal requirement, namely that the year be 1999. A better -# test would have been to pass in both a known-bad and known-good year into a -# function, and test for the expected result. - -testPartyLikeItIs1999() { - year=`date '+%Y'` - assertEquals "It's not 1999 :-(" \ - '1999' "${year}" -} - -# Load and run shUnit2. -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/suite_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/suite_test.sh deleted file mode 100755 index 278c3a0..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/examples/suite_test.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# file: examples/suite_test.sh -# -# This test demonstrates the use of suites. Note: the suite functionality is -# deprecated as of v2.1.0, and will be removed in a future major release. - -# suite is a special function called by shUnit2 to setup a suite of tests. It -# enables a developer to call a set of functions that contain tests without -# needing to rename the functions to start with "test". -# -# Tests that are to be called from within `suite()` are added to the list of -# executable tests by means of the `suite_addTest()` function. -suite() { - # Add the suite_test_one() function to the list of executable tests. - suite_addTest suite_test_one - - # Call the suite_test_two() function, but note that the test results will not - # be added to the global stats, and therefore not reported at the end of the - # unit test execution. - suite_test_two -} - -suite_test_one() { - assertEquals 1 1 -} - -suite_test_two() { - assertNotEquals 1 2 -} - -# Load and run shUnit2. -. ../shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/gen_test_report.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/gen_test_report.sh deleted file mode 100755 index 28da021..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/gen_test_report.sh +++ /dev/null @@ -1,88 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# This script runs the provided unit tests and sends the output to the -# appropriate file. -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -# Source following. -# shellcheck disable=SC1090,SC1091 -# FLAGS variables are dynamically created. -# shellcheck disable=SC2154 -# Disagree with [ p ] && [ q ] vs [ p -a -q ] recommendation. -# shellcheck disable=SC2166 - -# Treat unset variables as an error. -set -u - -die() { - [ $# -gt 0 ] && echo "error: $*" >&2 - exit 1 -} - -BASE_DIR=$(dirname "$0") -LIB_DIR="${BASE_DIR}/lib" - -### Load libraries. -. "${LIB_DIR}/shflags" || die 'unable to load shflags library' -. "${LIB_DIR}/shlib" || die 'unable to load shlib library' -. "${LIB_DIR}/versions" || die 'unable to load versions library' - -# Redefining BASE_DIR now that we have the shlib functions. We need BASE_DIR so -# that we can properly load things, even in the event that this script is called -# from a different directory. -BASE_DIR=$(shlib_relToAbsPath "${BASE_DIR}") - -# Define flags. -os_name=$(versions_osName |sed 's/ /_/g') -os_version=$(versions_osVersion) - -DEFINE_boolean force false 'force overwrite' f -DEFINE_string output_dir "${TMPDIR}" 'output dir' d -DEFINE_string output_file "${os_name}-${os_version}.txt" 'output file' o -DEFINE_string runner 'test_runner' 'unit test runner' r -DEFINE_boolean dry_run false "suppress logging to a file" n - -main() { - # Determine output filename. - # shellcheck disable=SC2154 - output="${FLAGS_output_dir:+${FLAGS_output_dir}/}${FLAGS_output_file}" - output=$(shlib_relToAbsPath "${output}") - - # Checks. - if [ "${FLAGS_dry_run}" -eq "${FLAGS_FALSE}" -a -f "${output}" ]; then - if [ "${FLAGS_force}" -eq "${FLAGS_TRUE}" ]; then - rm -f "${output}" - else - echo "not overwriting '${output}'" >&2 - exit "${FLAGS_ERROR}" - fi - fi - if [ "${FLAGS_dry_run}" -eq "${FLAGS_FALSE}" ]; then - touch "${output}" 2>/dev/null || die "unable to write to '${output}'" - fi - - # Run tests. - ( - if [ "${FLAGS_dry_run}" -eq "${FLAGS_FALSE}" ]; then - "./${FLAGS_runner}" |tee "${output}" - else - "./${FLAGS_runner}" - fi - ) - - if [ "${FLAGS_dry_run}" -eq "${FLAGS_FALSE}" ]; then - echo >&2 - echo "Output written to '${output}'." >&2 - fi -} - -FLAGS "$@" || exit $? -[ "${FLAGS_help}" -eq "${FLAGS_FALSE}" ] || exit -eval set -- "${FLAGS_ARGV}" -main "${@:-}" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shflags b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shflags deleted file mode 100644 index 70cdea4..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shflags +++ /dev/null @@ -1,1222 +0,0 @@ -# vim:et:ft=sh:sts=2:sw=2 -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the Apache License 2.0 license. -# http://www.apache.org/licenses/LICENSE-2.0 -# -# shFlags -- Advanced command-line flag library for Unix shell scripts. -# https://github.com/kward/shflags -# -# Author: kate.ward@forestent.com (Kate Ward) -# -# This module implements something like the gflags library available -# from https://github.com/gflags/gflags. -# -# FLAG TYPES: This is a list of the DEFINE_*'s that you can do. All flags take -# a name, default value, help-string, and optional 'short' name (one-letter -# name). Some flags have other arguments, which are described with the flag. -# -# DEFINE_string: takes any input, and interprets it as a string. -# -# DEFINE_boolean: does not take any arguments. Say --myflag to set -# FLAGS_myflag to true, or --nomyflag to set FLAGS_myflag to false. For short -# flags, passing the flag on the command-line negates the default value, i.e. -# if the default is true, passing the flag sets the value to false. -# -# DEFINE_float: takes an input and interprets it as a floating point number. As -# shell does not support floats per-se, the input is merely validated as -# being a valid floating point value. -# -# DEFINE_integer: takes an input and interprets it as an integer. -# -# SPECIAL FLAGS: There are a few flags that have special meaning: -# --help (or -?) prints a list of all the flags in a human-readable fashion -# --flagfile=foo read flags from foo. (not implemented yet) -# -- as in getopt(), terminates flag-processing -# -# EXAMPLE USAGE: -# -# -- begin hello.sh -- -# #! /bin/sh -# . ./shflags -# DEFINE_string name 'world' "somebody's name" n -# FLAGS "$@" || exit $? -# eval set -- "${FLAGS_ARGV}" -# echo "Hello, ${FLAGS_name}." -# -- end hello.sh -- -# -# $ ./hello.sh -n Kate -# Hello, Kate. -# -# CUSTOMIZABLE BEHAVIOR: -# -# A script can override the default 'getopt' command by providing the path to -# an alternate implementation by defining the FLAGS_GETOPT_CMD variable. -# -# NOTES: -# -# * Not all systems include a getopt version that supports long flags. On these -# systems, only short flags are recognized. - -#============================================================================== -# shFlags -# -# Shared attributes: -# flags_error: last error message -# flags_output: last function output (rarely valid) -# flags_return: last return value -# -# __flags_longNames: list of long names for all flags -# __flags_shortNames: list of short names for all flags -# __flags_boolNames: list of boolean flag names -# -# __flags_opts: options parsed by getopt -# -# Per-flag attributes: -# FLAGS_: contains value of flag named 'flag_name' -# __flags__default: the default flag value -# __flags__help: the flag help string -# __flags__short: the flag short name -# __flags__type: the flag type -# -# Notes: -# - lists of strings are space separated, and a null value is the '~' char. -# -### ShellCheck (http://www.shellcheck.net/) -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 -# [ p -a q ] are well defined enough (vs [ p ] && [ q ]). -# shellcheck disable=SC2166 - -# Return if FLAGS already loaded. -[ -n "${FLAGS_VERSION:-}" ] && return 0 -FLAGS_VERSION='1.2.3pre' - -# Return values that scripts can use. -FLAGS_TRUE=0 -FLAGS_FALSE=1 -FLAGS_ERROR=2 - -# Logging levels. -FLAGS_LEVEL_DEBUG=0 -FLAGS_LEVEL_INFO=1 -FLAGS_LEVEL_WARN=2 -FLAGS_LEVEL_ERROR=3 -FLAGS_LEVEL_FATAL=4 -__FLAGS_LEVEL_DEFAULT=${FLAGS_LEVEL_WARN} - -# Determine some reasonable command defaults. -__FLAGS_EXPR_CMD='expr --' -__FLAGS_UNAME_S=`uname -s` -if [ "${__FLAGS_UNAME_S}" = 'BSD' ]; then - __FLAGS_EXPR_CMD='gexpr --' -else - _flags_output_=`${__FLAGS_EXPR_CMD} 2>&1` - if [ $? -eq ${FLAGS_TRUE} -a "${_flags_output_}" = '--' ]; then - # We are likely running inside BusyBox. - __FLAGS_EXPR_CMD='expr' - fi - unset _flags_output_ -fi - -# Commands a user can override if desired. -FLAGS_EXPR_CMD=${FLAGS_EXPR_CMD:-${__FLAGS_EXPR_CMD}} -FLAGS_GETOPT_CMD=${FLAGS_GETOPT_CMD:-getopt} - -# Specific shell checks. -if [ -n "${ZSH_VERSION:-}" ]; then - setopt |grep "^shwordsplit$" >/dev/null - if [ $? -ne ${FLAGS_TRUE} ]; then - _flags_fatal 'zsh shwordsplit option is required for proper zsh operation' - fi - if [ -z "${FLAGS_PARENT:-}" ]; then - _flags_fatal "zsh does not pass \$0 through properly. please declare' \ -\"FLAGS_PARENT=\$0\" before calling shFlags" - fi -fi - -# Can we use built-ins? -( echo "${FLAGS_TRUE#0}"; ) >/dev/null 2>&1 -if [ $? -eq ${FLAGS_TRUE} ]; then - __FLAGS_USE_BUILTIN=${FLAGS_TRUE} -else - __FLAGS_USE_BUILTIN=${FLAGS_FALSE} -fi - - -# -# Constants. -# - -# Reserved flag names. -__FLAGS_RESERVED_LIST=' ARGC ARGV ERROR FALSE GETOPT_CMD HELP PARENT TRUE ' -__FLAGS_RESERVED_LIST="${__FLAGS_RESERVED_LIST} VERSION " - -# Determined getopt version (standard or enhanced). -__FLAGS_GETOPT_VERS_STD=0 -__FLAGS_GETOPT_VERS_ENH=1 - -# shellcheck disable=SC2120 -_flags_getopt_vers() { - _flags_getopt_cmd_=${1:-${FLAGS_GETOPT_CMD}} - case "`${_flags_getopt_cmd_} -lfoo '' --foo 2>&1`" in - ' -- --foo') echo ${__FLAGS_GETOPT_VERS_STD} ;; - ' --foo --') echo ${__FLAGS_GETOPT_VERS_ENH} ;; - # Unrecognized output. Assuming standard getopt version. - *) echo ${__FLAGS_GETOPT_VERS_STD} ;; - esac - unset _flags_getopt_cmd_ -} -# shellcheck disable=SC2119 -__FLAGS_GETOPT_VERS=`_flags_getopt_vers` - -# getopt optstring lengths -__FLAGS_OPTSTR_SHORT=0 -__FLAGS_OPTSTR_LONG=1 - -__FLAGS_NULL='~' - -# Flag info strings. -__FLAGS_INFO_DEFAULT='default' -__FLAGS_INFO_HELP='help' -__FLAGS_INFO_SHORT='short' -__FLAGS_INFO_TYPE='type' - -# Flag lengths. -__FLAGS_LEN_SHORT=0 -__FLAGS_LEN_LONG=1 - -# Flag types. -__FLAGS_TYPE_NONE=0 -__FLAGS_TYPE_BOOLEAN=1 -__FLAGS_TYPE_FLOAT=2 -__FLAGS_TYPE_INTEGER=3 -__FLAGS_TYPE_STRING=4 - -# Set the constants readonly. -__flags_constants=`set |awk -F= '/^FLAGS_/ || /^__FLAGS_/ {print $1}'` -for __flags_const in ${__flags_constants}; do - # Skip certain flags. - case ${__flags_const} in - FLAGS_HELP) continue ;; - FLAGS_PARENT) continue ;; - esac - # Set flag readonly. - if [ -z "${ZSH_VERSION:-}" ]; then - readonly "${__flags_const}" - continue - fi - case ${ZSH_VERSION} in - [123].*) readonly "${__flags_const}" ;; - *) readonly -g "${__flags_const}" ;; # Declare readonly constants globally. - esac -done -unset __flags_const __flags_constants - -# -# Internal variables. -# - -# Space separated lists. -__flags_boolNames=' ' # Boolean flag names. -__flags_longNames=' ' # Long flag names. -__flags_shortNames=' ' # Short flag names. -__flags_definedNames=' ' # Defined flag names (used for validation). - -__flags_columns='' # Screen width in columns. -__flags_level=0 # Default logging level. -__flags_opts='' # Temporary storage for parsed getopt flags. - -#------------------------------------------------------------------------------ -# Private functions. -# - -# Logging functions. -_flags_debug() { - [ ${__flags_level} -le ${FLAGS_LEVEL_DEBUG} ] || return - echo "flags:DEBUG $*" >&2 -} -_flags_info() { - [ ${__flags_level} -le ${FLAGS_LEVEL_INFO} ] || return - echo "flags:INFO $*" >&2 -} -_flags_warn() { - [ ${__flags_level} -le ${FLAGS_LEVEL_WARN} ] || return - echo "flags:WARN $*" >&2 -} -_flags_error() { - [ ${__flags_level} -le ${FLAGS_LEVEL_ERROR} ] || return - echo "flags:ERROR $*" >&2 -} -_flags_fatal() { - [ ${__flags_level} -le ${FLAGS_LEVEL_FATAL} ] || return - echo "flags:FATAL $*" >&2 - exit ${FLAGS_ERROR} -} - -# Get the logging level. -flags_loggingLevel() { echo ${__flags_level}; } - -# Set the logging level. -# -# Args: -# _flags_level_: integer: new logging level -# Returns: -# nothing -flags_setLoggingLevel() { - [ $# -ne 1 ] && _flags_fatal "flags_setLevel(): logging level missing" - _flags_level_=$1 - [ "${_flags_level_}" -ge "${FLAGS_LEVEL_DEBUG}" \ - -a "${_flags_level_}" -le "${FLAGS_LEVEL_FATAL}" ] \ - || _flags_fatal "Invalid logging level '${_flags_level_}' specified." - __flags_level=$1 - unset _flags_level_ -} - -# Define a flag. -# -# Calling this function will define the following info variables for the -# specified flag: -# FLAGS_flagname - the name for this flag (based upon the long flag name) -# __flags__default - the default value -# __flags_flagname_help - the help string -# __flags_flagname_short - the single letter alias -# __flags_flagname_type - the type of flag (one of __FLAGS_TYPE_*) -# -# Args: -# _flags_type_: integer: internal type of flag (__FLAGS_TYPE_*) -# _flags_name_: string: long flag name -# _flags_default_: default flag value -# _flags_help_: string: help string -# _flags_short_: string: (optional) short flag name -# Returns: -# integer: success of operation, or error -_flags_define() { - if [ $# -lt 4 ]; then - flags_error='DEFINE error: too few arguments' - flags_return=${FLAGS_ERROR} - _flags_error "${flags_error}" - return ${flags_return} - fi - - _flags_type_=$1 - _flags_name_=$2 - _flags_default_=$3 - _flags_help_=${4:-§} # Special value '§' indicates no help string provided. - _flags_short_=${5:-${__FLAGS_NULL}} - - _flags_debug "type:${_flags_type_} name:${_flags_name_}" \ - "default:'${_flags_default_}' help:'${_flags_help_}'" \ - "short:${_flags_short_}" - - _flags_return_=${FLAGS_TRUE} - _flags_usName_="`_flags_underscoreName "${_flags_name_}"`" - - # Check whether the flag name is reserved. - _flags_itemInList "${_flags_usName_}" "${__FLAGS_RESERVED_LIST}" - if [ $? -eq ${FLAGS_TRUE} ]; then - flags_error="flag name (${_flags_name_}) is reserved" - _flags_return_=${FLAGS_ERROR} - fi - - # Require short option for getopt that don't support long options. - if [ ${_flags_return_} -eq ${FLAGS_TRUE} \ - -a "${__FLAGS_GETOPT_VERS}" -ne "${__FLAGS_GETOPT_VERS_ENH}" \ - -a "${_flags_short_}" = "${__FLAGS_NULL}" ] - then - flags_error="short flag required for (${_flags_name_}) on this platform" - _flags_return_=${FLAGS_ERROR} - fi - - # Check for existing long name definition. - if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then - if _flags_itemInList "${_flags_usName_}" "${__flags_definedNames}"; then - flags_error="definition for ([no]${_flags_name_}) already exists" - _flags_warn "${flags_error}" - _flags_return_=${FLAGS_FALSE} - fi - fi - - # Check for existing short name definition. - if [ ${_flags_return_} -eq ${FLAGS_TRUE} \ - -a "${_flags_short_}" != "${__FLAGS_NULL}" ] - then - if _flags_itemInList "${_flags_short_}" "${__flags_shortNames}"; then - flags_error="flag short name (${_flags_short_}) already defined" - _flags_warn "${flags_error}" - _flags_return_=${FLAGS_FALSE} - fi - fi - - # Handle default value. Note, on several occasions the 'if' portion of an - # if/then/else contains just a ':' which does nothing. A binary reversal via - # '!' is not done because it does not work on all shells. - if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then - case ${_flags_type_} in - ${__FLAGS_TYPE_BOOLEAN}) - if _flags_validBool "${_flags_default_}"; then - case ${_flags_default_} in - true|t|0) _flags_default_=${FLAGS_TRUE} ;; - false|f|1) _flags_default_=${FLAGS_FALSE} ;; - esac - else - flags_error="invalid default flag value '${_flags_default_}'" - _flags_return_=${FLAGS_ERROR} - fi - ;; - - ${__FLAGS_TYPE_FLOAT}) - if _flags_validFloat "${_flags_default_}"; then - : - else - flags_error="invalid default flag value '${_flags_default_}'" - _flags_return_=${FLAGS_ERROR} - fi - ;; - - ${__FLAGS_TYPE_INTEGER}) - if _flags_validInt "${_flags_default_}"; then - : - else - flags_error="invalid default flag value '${_flags_default_}'" - _flags_return_=${FLAGS_ERROR} - fi - ;; - - ${__FLAGS_TYPE_STRING}) ;; # Everything in shell is a valid string. - - *) - flags_error="unrecognized flag type '${_flags_type_}'" - _flags_return_=${FLAGS_ERROR} - ;; - esac - fi - - if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then - # Store flag information. - eval "FLAGS_${_flags_usName_}='${_flags_default_}'" - eval "__flags_${_flags_usName_}_${__FLAGS_INFO_TYPE}=${_flags_type_}" - eval "__flags_${_flags_usName_}_${__FLAGS_INFO_DEFAULT}=\ -\"${_flags_default_}\"" - eval "__flags_${_flags_usName_}_${__FLAGS_INFO_HELP}=\"${_flags_help_}\"" - eval "__flags_${_flags_usName_}_${__FLAGS_INFO_SHORT}='${_flags_short_}'" - - # append flag names to name lists - __flags_shortNames="${__flags_shortNames}${_flags_short_} " - __flags_longNames="${__flags_longNames}${_flags_name_} " - [ "${_flags_type_}" -eq "${__FLAGS_TYPE_BOOLEAN}" ] && \ - __flags_boolNames="${__flags_boolNames}no${_flags_name_} " - - # Append flag names to defined names for later validation checks. - __flags_definedNames="${__flags_definedNames}${_flags_usName_} " - [ "${_flags_type_}" -eq "${__FLAGS_TYPE_BOOLEAN}" ] && \ - __flags_definedNames="${__flags_definedNames}no${_flags_usName_} " - fi - - flags_return=${_flags_return_} - unset _flags_default_ _flags_help_ _flags_name_ _flags_return_ \ - _flags_short_ _flags_type_ _flags_usName_ - [ ${flags_return} -eq ${FLAGS_ERROR} ] && _flags_error "${flags_error}" - return ${flags_return} -} - -# Underscore a flag name by replacing dashes with underscores. -# -# Args: -# unnamed: string: log flag name -# Output: -# string: underscored name -_flags_underscoreName() { - echo "$1" |tr '-' '_' -} - -# Return valid getopt options using currently defined list of long options. -# -# This function builds a proper getopt option string for short (and long) -# options, using the current list of long options for reference. -# -# Args: -# _flags_optStr: integer: option string type (__FLAGS_OPTSTR_*) -# Output: -# string: generated option string for getopt -# Returns: -# boolean: success of operation (always returns True) -_flags_genOptStr() { - _flags_optStrType_=$1 - - _flags_opts_='' - - for _flags_name_ in ${__flags_longNames}; do - _flags_usName_="`_flags_underscoreName "${_flags_name_}"`" - _flags_type_="`_flags_getFlagInfo "${_flags_usName_}" "${__FLAGS_INFO_TYPE}"`" - [ $? -eq ${FLAGS_TRUE} ] || _flags_fatal 'call to _flags_type_ failed' - case ${_flags_optStrType_} in - ${__FLAGS_OPTSTR_SHORT}) - _flags_shortName_="`_flags_getFlagInfo \ - "${_flags_usName_}" "${__FLAGS_INFO_SHORT}"`" - if [ "${_flags_shortName_}" != "${__FLAGS_NULL}" ]; then - _flags_opts_="${_flags_opts_}${_flags_shortName_}" - # getopt needs a trailing ':' to indicate a required argument. - [ "${_flags_type_}" -ne "${__FLAGS_TYPE_BOOLEAN}" ] && \ - _flags_opts_="${_flags_opts_}:" - fi - ;; - - ${__FLAGS_OPTSTR_LONG}) - _flags_opts_="${_flags_opts_:+${_flags_opts_},}${_flags_name_}" - # getopt needs a trailing ':' to indicate a required argument - [ "${_flags_type_}" -ne "${__FLAGS_TYPE_BOOLEAN}" ] && \ - _flags_opts_="${_flags_opts_}:" - ;; - esac - done - - echo "${_flags_opts_}" - unset _flags_name_ _flags_opts_ _flags_optStrType_ _flags_shortName_ \ - _flags_type_ _flags_usName_ - return ${FLAGS_TRUE} -} - -# Returns flag details based on a flag name and flag info. -# -# Args: -# string: underscored flag name -# string: flag info (see the _flags_define function for valid info types) -# Output: -# string: value of dereferenced flag variable -# Returns: -# integer: one of FLAGS_{TRUE|FALSE|ERROR} -_flags_getFlagInfo() { - # Note: adding gFI to variable names to prevent naming conflicts with calling - # functions - _flags_gFI_usName_=$1 - _flags_gFI_info_=$2 - - # Example: given argument usName (underscored flag name) of 'my_flag', and - # argument info of 'help', set the _flags_infoValue_ variable to the value of - # ${__flags_my_flag_help}, and see if it is non-empty. - _flags_infoVar_="__flags_${_flags_gFI_usName_}_${_flags_gFI_info_}" - _flags_strToEval_="_flags_infoValue_=\"\${${_flags_infoVar_}:-}\"" - eval "${_flags_strToEval_}" - if [ -n "${_flags_infoValue_}" ]; then - # Special value '§' indicates no help string provided. - [ "${_flags_gFI_info_}" = ${__FLAGS_INFO_HELP} \ - -a "${_flags_infoValue_}" = '§' ] && _flags_infoValue_='' - flags_return=${FLAGS_TRUE} - else - # See if the _flags_gFI_usName_ variable is a string as strings can be - # empty... - # Note: the DRY principle would say to have this function call itself for - # the next three lines, but doing so results in an infinite loop as an - # invalid _flags_name_ will also not have the associated _type variable. - # Because it doesn't (it will evaluate to an empty string) the logic will - # try to find the _type variable of the _type variable, and so on. Not so - # good ;-) - # - # Example cont.: set the _flags_typeValue_ variable to the value of - # ${__flags_my_flag_type}, and see if it equals '4'. - _flags_typeVar_="__flags_${_flags_gFI_usName_}_${__FLAGS_INFO_TYPE}" - _flags_strToEval_="_flags_typeValue_=\"\${${_flags_typeVar_}:-}\"" - eval "${_flags_strToEval_}" - # shellcheck disable=SC2154 - if [ "${_flags_typeValue_}" = "${__FLAGS_TYPE_STRING}" ]; then - flags_return=${FLAGS_TRUE} - else - flags_return=${FLAGS_ERROR} - flags_error="missing flag info variable (${_flags_infoVar_})" - fi - fi - - echo "${_flags_infoValue_}" - unset _flags_gFI_usName_ _flags_gfI_info_ _flags_infoValue_ _flags_infoVar_ \ - _flags_strToEval_ _flags_typeValue_ _flags_typeVar_ - [ ${flags_return} -eq ${FLAGS_ERROR} ] && _flags_error "${flags_error}" - return ${flags_return} -} - -# Check for presence of item in a list. -# -# Passed a string (e.g. 'abc'), this function will determine if the string is -# present in the list of strings (e.g. ' foo bar abc '). -# -# Args: -# _flags_str_: string: string to search for in a list of strings -# unnamed: list: list of strings -# Returns: -# boolean: true if item is in the list -_flags_itemInList() { - _flags_str_=$1 - shift - - case " ${*:-} " in - *\ ${_flags_str_}\ *) flags_return=${FLAGS_TRUE} ;; - *) flags_return=${FLAGS_FALSE} ;; - esac - - unset _flags_str_ - return ${flags_return} -} - -# Returns the width of the current screen. -# -# Output: -# integer: width in columns of the current screen. -_flags_columns() { - if [ -z "${__flags_columns}" ]; then - if eval stty size >/dev/null 2>&1; then - # stty size worked :-) - # shellcheck disable=SC2046 - set -- `stty size` - __flags_columns="${2:-}" - fi - fi - if [ -z "${__flags_columns}" ]; then - if eval tput cols >/dev/null 2>&1; then - # shellcheck disable=SC2046 - set -- `tput cols` - __flags_columns="${1:-}" - fi - fi - echo "${__flags_columns:-80}" -} - -# Validate a boolean. -# -# Args: -# _flags__bool: boolean: value to validate -# Returns: -# bool: true if the value is a valid boolean -_flags_validBool() { - _flags_bool_=$1 - - flags_return=${FLAGS_TRUE} - case "${_flags_bool_}" in - true|t|0) ;; - false|f|1) ;; - *) flags_return=${FLAGS_FALSE} ;; - esac - - unset _flags_bool_ - return ${flags_return} -} - -# Validate a float. -# -# Args: -# _flags_float_: float: value to validate -# Returns: -# bool: true if the value is a valid integer -_flags_validFloat() { - flags_return=${FLAGS_FALSE} - [ -n "$1" ] || return ${flags_return} - _flags_float_=$1 - - if _flags_validInt "${_flags_float_}"; then - flags_return=${FLAGS_TRUE} - elif _flags_useBuiltin; then - _flags_float_whole_=${_flags_float_%.*} - _flags_float_fraction_=${_flags_float_#*.} - if _flags_validInt "${_flags_float_whole_:-0}" -a \ - _flags_validInt "${_flags_float_fraction_}"; then - flags_return=${FLAGS_TRUE} - fi - unset _flags_float_whole_ _flags_float_fraction_ - else - flags_return=${FLAGS_TRUE} - case ${_flags_float_} in - -*) # Negative floats. - _flags_test_=`${FLAGS_EXPR_CMD} "${_flags_float_}" :\ - '\(-[0-9]*\.[0-9]*\)'` - ;; - *) # Positive floats. - _flags_test_=`${FLAGS_EXPR_CMD} "${_flags_float_}" :\ - '\([0-9]*\.[0-9]*\)'` - ;; - esac - [ "${_flags_test_}" != "${_flags_float_}" ] && flags_return=${FLAGS_FALSE} - unset _flags_test_ - fi - - unset _flags_float_ _flags_float_whole_ _flags_float_fraction_ - return ${flags_return} -} - -# Validate an integer. -# -# Args: -# _flags_int_: integer: value to validate -# Returns: -# bool: true if the value is a valid integer -_flags_validInt() { - flags_return=${FLAGS_FALSE} - [ -n "$1" ] || return ${flags_return} - _flags_int_=$1 - - case ${_flags_int_} in - -*.*) ;; # Ignore negative floats (we'll invalidate them later). - -*) # Strip possible leading negative sign. - if _flags_useBuiltin; then - _flags_int_=${_flags_int_#-} - else - _flags_int_=`${FLAGS_EXPR_CMD} "${_flags_int_}" : '-\([0-9][0-9]*\)'` - fi - ;; - esac - - case ${_flags_int_} in - *[!0-9]*) flags_return=${FLAGS_FALSE} ;; - *) flags_return=${FLAGS_TRUE} ;; - esac - - unset _flags_int_ - return ${flags_return} -} - -# Parse command-line options using the standard getopt. -# -# Note: the flag options are passed around in the global __flags_opts so that -# the formatting is not lost due to shell parsing and such. -# -# Args: -# @: varies: command-line options to parse -# Returns: -# integer: a FLAGS success condition -_flags_getoptStandard() { - flags_return=${FLAGS_TRUE} - _flags_shortOpts_=`_flags_genOptStr ${__FLAGS_OPTSTR_SHORT}` - - # Check for spaces in passed options. - for _flags_opt_ in "$@"; do - # Note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06. - _flags_match_=`echo "x${_flags_opt_}x" |sed 's/ //g'` - if [ "${_flags_match_}" != "x${_flags_opt_}x" ]; then - flags_error='the available getopt does not support spaces in options' - flags_return=${FLAGS_ERROR} - break - fi - done - - if [ ${flags_return} -eq ${FLAGS_TRUE} ]; then - __flags_opts=`getopt "${_flags_shortOpts_}" "$@" 2>&1` - _flags_rtrn_=$? - if [ ${_flags_rtrn_} -ne ${FLAGS_TRUE} ]; then - _flags_warn "${__flags_opts}" - flags_error='unable to parse provided options with getopt.' - flags_return=${FLAGS_ERROR} - fi - fi - - unset _flags_match_ _flags_opt_ _flags_rtrn_ _flags_shortOpts_ - return ${flags_return} -} - -# Parse command-line options using the enhanced getopt. -# -# Note: the flag options are passed around in the global __flags_opts so that -# the formatting is not lost due to shell parsing and such. -# -# Args: -# @: varies: command-line options to parse -# Returns: -# integer: a FLAGS success condition -_flags_getoptEnhanced() { - flags_return=${FLAGS_TRUE} - _flags_shortOpts_=`_flags_genOptStr ${__FLAGS_OPTSTR_SHORT}` - _flags_boolOpts_=`echo "${__flags_boolNames}" \ - |sed 's/^ *//;s/ *$//;s/ /,/g'` - _flags_longOpts_=`_flags_genOptStr ${__FLAGS_OPTSTR_LONG}` - - __flags_opts=`${FLAGS_GETOPT_CMD} \ - -o "${_flags_shortOpts_}" \ - -l "${_flags_longOpts_},${_flags_boolOpts_}" \ - -- "$@" 2>&1` - _flags_rtrn_=$? - if [ ${_flags_rtrn_} -ne ${FLAGS_TRUE} ]; then - _flags_warn "${__flags_opts}" - flags_error='unable to parse provided options with getopt.' - flags_return=${FLAGS_ERROR} - fi - - unset _flags_boolOpts_ _flags_longOpts_ _flags_rtrn_ _flags_shortOpts_ - return ${flags_return} -} - -# Dynamically parse a getopt result and set appropriate variables. -# -# This function does the actual conversion of getopt output and runs it through -# the standard case structure for parsing. The case structure is actually quite -# dynamic to support any number of flags. -# -# Args: -# argc: int: original command-line argument count -# @: varies: output from getopt parsing -# Returns: -# integer: a FLAGS success condition -_flags_parseGetopt() { - _flags_argc_=$1 - shift - - flags_return=${FLAGS_TRUE} - - if [ "${__FLAGS_GETOPT_VERS}" -ne "${__FLAGS_GETOPT_VERS_ENH}" ]; then - # The @$ must be unquoted as it needs to be re-split. - # shellcheck disable=SC2068 - set -- $@ - else - # Note the quotes around the `$@' -- they are essential! - eval set -- "$@" - fi - - # Provide user with the number of arguments to shift by later. - # NOTE: the FLAGS_ARGC variable is obsolete as of 1.0.3 because it does not - # properly give user access to non-flag arguments mixed in between flag - # arguments. Its usage was replaced by FLAGS_ARGV, and it is being kept only - # for backwards compatibility reasons. - FLAGS_ARGC=`_flags_math "$# - 1 - ${_flags_argc_}"` - export FLAGS_ARGC - - # Handle options. note options with values must do an additional shift. - while true; do - _flags_opt_=$1 - _flags_arg_=${2:-} - _flags_type_=${__FLAGS_TYPE_NONE} - _flags_name_='' - - # Determine long flag name. - case "${_flags_opt_}" in - --) shift; break ;; # Discontinue option parsing. - - --*) # Long option. - if _flags_useBuiltin; then - _flags_opt_=${_flags_opt_#*--} - else - _flags_opt_=`${FLAGS_EXPR_CMD} "${_flags_opt_}" : '--\(.*\)'` - fi - _flags_len_=${__FLAGS_LEN_LONG} - if _flags_itemInList "${_flags_opt_}" "${__flags_longNames}"; then - _flags_name_=${_flags_opt_} - else - # Check for negated long boolean version. - if _flags_itemInList "${_flags_opt_}" "${__flags_boolNames}"; then - if _flags_useBuiltin; then - _flags_name_=${_flags_opt_#*no} - else - _flags_name_=`${FLAGS_EXPR_CMD} "${_flags_opt_}" : 'no\(.*\)'` - fi - _flags_type_=${__FLAGS_TYPE_BOOLEAN} - _flags_arg_=${__FLAGS_NULL} - fi - fi - ;; - - -*) # Short option. - if _flags_useBuiltin; then - _flags_opt_=${_flags_opt_#*-} - else - _flags_opt_=`${FLAGS_EXPR_CMD} "${_flags_opt_}" : '-\(.*\)'` - fi - _flags_len_=${__FLAGS_LEN_SHORT} - if _flags_itemInList "${_flags_opt_}" "${__flags_shortNames}"; then - # Yes. Match short name to long name. Note purposeful off-by-one - # (too high) with awk calculations. - _flags_pos_=`echo "${__flags_shortNames}" \ - |awk 'BEGIN{RS=" ";rn=0}$0==e{rn=NR}END{print rn}' \ - e="${_flags_opt_}"` - _flags_name_=`echo "${__flags_longNames}" \ - |awk 'BEGIN{RS=" "}rn==NR{print $0}' rn="${_flags_pos_}"` - fi - ;; - esac - - # Die if the flag was unrecognized. - if [ -z "${_flags_name_}" ]; then - flags_error="unrecognized option (${_flags_opt_})" - flags_return=${FLAGS_ERROR} - break - fi - - # Set new flag value. - _flags_usName_=`_flags_underscoreName "${_flags_name_}"` - [ ${_flags_type_} -eq ${__FLAGS_TYPE_NONE} ] && \ - _flags_type_=`_flags_getFlagInfo \ - "${_flags_usName_}" ${__FLAGS_INFO_TYPE}` - case ${_flags_type_} in - ${__FLAGS_TYPE_BOOLEAN}) - if [ ${_flags_len_} -eq ${__FLAGS_LEN_LONG} ]; then - if [ "${_flags_arg_}" != "${__FLAGS_NULL}" ]; then - eval "FLAGS_${_flags_usName_}=${FLAGS_TRUE}" - else - eval "FLAGS_${_flags_usName_}=${FLAGS_FALSE}" - fi - else - _flags_strToEval_="_flags_val_=\ -\${__flags_${_flags_usName_}_${__FLAGS_INFO_DEFAULT}}" - eval "${_flags_strToEval_}" - # shellcheck disable=SC2154 - if [ "${_flags_val_}" -eq ${FLAGS_FALSE} ]; then - eval "FLAGS_${_flags_usName_}=${FLAGS_TRUE}" - else - eval "FLAGS_${_flags_usName_}=${FLAGS_FALSE}" - fi - fi - ;; - - ${__FLAGS_TYPE_FLOAT}) - if _flags_validFloat "${_flags_arg_}"; then - eval "FLAGS_${_flags_usName_}='${_flags_arg_}'" - else - flags_error="invalid float value (${_flags_arg_})" - flags_return=${FLAGS_ERROR} - break - fi - ;; - - ${__FLAGS_TYPE_INTEGER}) - if _flags_validInt "${_flags_arg_}"; then - eval "FLAGS_${_flags_usName_}='${_flags_arg_}'" - else - flags_error="invalid integer value (${_flags_arg_})" - flags_return=${FLAGS_ERROR} - break - fi - ;; - - ${__FLAGS_TYPE_STRING}) - eval "FLAGS_${_flags_usName_}='${_flags_arg_}'" - ;; - esac - - # Handle special case help flag. - if [ "${_flags_usName_}" = 'help' ]; then - # shellcheck disable=SC2154 - if [ "${FLAGS_help}" -eq ${FLAGS_TRUE} ]; then - flags_help - flags_error='help requested' - flags_return=${FLAGS_FALSE} - break - fi - fi - - # Shift the option and non-boolean arguments out. - shift - [ "${_flags_type_}" != ${__FLAGS_TYPE_BOOLEAN} ] && shift - done - - # Give user back non-flag arguments. - FLAGS_ARGV='' - while [ $# -gt 0 ]; do - FLAGS_ARGV="${FLAGS_ARGV:+${FLAGS_ARGV} }'$1'" - shift - done - - unset _flags_arg_ _flags_len_ _flags_name_ _flags_opt_ _flags_pos_ \ - _flags_strToEval_ _flags_type_ _flags_usName_ _flags_val_ - return ${flags_return} -} - -# Perform some path using built-ins. -# -# Args: -# $@: string: math expression to evaluate -# Output: -# integer: the result -# Returns: -# bool: success of math evaluation -_flags_math() { - if [ $# -eq 0 ]; then - flags_return=${FLAGS_FALSE} - elif _flags_useBuiltin; then - # Variable assignment is needed as workaround for Solaris Bourne shell, - # which cannot parse a bare $((expression)). - # shellcheck disable=SC2016 - _flags_expr_='$(($@))' - eval echo ${_flags_expr_} - flags_return=$? - unset _flags_expr_ - else - eval expr "$@" - flags_return=$? - fi - - return ${flags_return} -} - -# Cross-platform strlen() implementation. -# -# Args: -# _flags_str: string: to determine length of -# Output: -# integer: length of string -# Returns: -# bool: success of strlen evaluation -_flags_strlen() { - _flags_str_=${1:-} - - if [ -z "${_flags_str_}" ]; then - flags_output=0 - elif _flags_useBuiltin; then - flags_output=${#_flags_str_} - else - flags_output=`${FLAGS_EXPR_CMD} "${_flags_str_}" : '.*'` - fi - flags_return=$? - - unset _flags_str_ - echo "${flags_output}" - return ${flags_return} -} - -# Use built-in helper function to enable unit testing. -# -# Args: -# None -# Returns: -# bool: true if built-ins should be used -_flags_useBuiltin() { return ${__FLAGS_USE_BUILTIN}; } - -#------------------------------------------------------------------------------ -# public functions -# -# A basic boolean flag. Boolean flags do not take any arguments, and their -# value is either 1 (false) or 0 (true). For long flags, the false value is -# specified on the command line by prepending the word 'no'. With short flags, -# the presence of the flag toggles the current value between true and false. -# Specifying a short boolean flag twice on the command results in returning the -# value back to the default value. -# -# A default value is required for boolean flags. -# -# For example, lets say a Boolean flag was created whose long name was 'update' -# and whose short name was 'x', and the default value was 'false'. This flag -# could be explicitly set to 'true' with '--update' or by '-x', and it could be -# explicitly set to 'false' with '--noupdate'. -DEFINE_boolean() { _flags_define ${__FLAGS_TYPE_BOOLEAN} "$@"; } - -# Other basic flags. -DEFINE_float() { _flags_define ${__FLAGS_TYPE_FLOAT} "$@"; } -DEFINE_integer() { _flags_define ${__FLAGS_TYPE_INTEGER} "$@"; } -DEFINE_string() { _flags_define ${__FLAGS_TYPE_STRING} "$@"; } - -# Parse the flags. -# -# Args: -# unnamed: list: command-line flags to parse -# Returns: -# integer: success of operation, or error -FLAGS() { - # Define a standard 'help' flag if one isn't already defined. - [ -z "${__flags_help_type:-}" ] && \ - DEFINE_boolean 'help' false 'show this help' 'h' - - # Parse options. - if [ $# -gt 0 ]; then - if [ "${__FLAGS_GETOPT_VERS}" -ne "${__FLAGS_GETOPT_VERS_ENH}" ]; then - _flags_getoptStandard "$@" - else - _flags_getoptEnhanced "$@" - fi - flags_return=$? - else - # Nothing passed; won't bother running getopt. - __flags_opts='--' - flags_return=${FLAGS_TRUE} - fi - - if [ ${flags_return} -eq ${FLAGS_TRUE} ]; then - _flags_parseGetopt $# "${__flags_opts}" - flags_return=$? - fi - - [ ${flags_return} -eq ${FLAGS_ERROR} ] && _flags_fatal "${flags_error}" - return ${flags_return} -} - -# This is a helper function for determining the 'getopt' version for platforms -# where the detection isn't working. It simply outputs debug information that -# can be included in a bug report. -# -# Args: -# none -# Output: -# debug info that can be included in a bug report -# Returns: -# nothing -flags_getoptInfo() { - # Platform info. - _flags_debug "uname -a: `uname -a`" - _flags_debug "PATH: ${PATH}" - - # Shell info. - if [ -n "${BASH_VERSION:-}" ]; then - _flags_debug 'shell: bash' - _flags_debug "BASH_VERSION: ${BASH_VERSION}" - elif [ -n "${ZSH_VERSION:-}" ]; then - _flags_debug 'shell: zsh' - _flags_debug "ZSH_VERSION: ${ZSH_VERSION}" - fi - - # getopt info. - ${FLAGS_GETOPT_CMD} >/dev/null - _flags_getoptReturn=$? - _flags_debug "getopt return: ${_flags_getoptReturn}" - _flags_debug "getopt --version: `${FLAGS_GETOPT_CMD} --version 2>&1`" - - unset _flags_getoptReturn -} - -# Returns whether the detected getopt version is the enhanced version. -# -# Args: -# none -# Output: -# none -# Returns: -# bool: true if getopt is the enhanced version -flags_getoptIsEnh() { - test "${__FLAGS_GETOPT_VERS}" -eq "${__FLAGS_GETOPT_VERS_ENH}" -} - -# Returns whether the detected getopt version is the standard version. -# -# Args: -# none -# Returns: -# bool: true if getopt is the standard version -flags_getoptIsStd() { - test "${__FLAGS_GETOPT_VERS}" -eq "${__FLAGS_GETOPT_VERS_STD}" -} - -# This is effectively a 'usage()' function. It prints usage information and -# exits the program with ${FLAGS_FALSE} if it is ever found in the command line -# arguments. Note this function can be overridden so other apps can define -# their own --help flag, replacing this one, if they want. -# -# Args: -# none -# Returns: -# integer: success of operation (always returns true) -flags_help() { - if [ -n "${FLAGS_HELP:-}" ]; then - echo "${FLAGS_HELP}" >&2 - else - echo "USAGE: ${FLAGS_PARENT:-$0} [flags] args" >&2 - fi - if [ -n "${__flags_longNames}" ]; then - echo 'flags:' >&2 - for flags_name_ in ${__flags_longNames}; do - flags_flagStr_='' - flags_boolStr_='' - flags_usName_=`_flags_underscoreName "${flags_name_}"` - - flags_default_=`_flags_getFlagInfo \ - "${flags_usName_}" ${__FLAGS_INFO_DEFAULT}` - flags_help_=`_flags_getFlagInfo \ - "${flags_usName_}" ${__FLAGS_INFO_HELP}` - flags_short_=`_flags_getFlagInfo \ - "${flags_usName_}" ${__FLAGS_INFO_SHORT}` - flags_type_=`_flags_getFlagInfo \ - "${flags_usName_}" ${__FLAGS_INFO_TYPE}` - - [ "${flags_short_}" != "${__FLAGS_NULL}" ] && \ - flags_flagStr_="-${flags_short_}" - - if [ "${__FLAGS_GETOPT_VERS}" -eq "${__FLAGS_GETOPT_VERS_ENH}" ]; then - [ "${flags_short_}" != "${__FLAGS_NULL}" ] && \ - flags_flagStr_="${flags_flagStr_}," - # Add [no] to long boolean flag names, except the 'help' flag. - [ "${flags_type_}" -eq ${__FLAGS_TYPE_BOOLEAN} \ - -a "${flags_usName_}" != 'help' ] && \ - flags_boolStr_='[no]' - flags_flagStr_="${flags_flagStr_}--${flags_boolStr_}${flags_name_}:" - fi - - case ${flags_type_} in - ${__FLAGS_TYPE_BOOLEAN}) - if [ "${flags_default_}" -eq ${FLAGS_TRUE} ]; then - flags_defaultStr_='true' - else - flags_defaultStr_='false' - fi - ;; - ${__FLAGS_TYPE_FLOAT}|${__FLAGS_TYPE_INTEGER}) - flags_defaultStr_=${flags_default_} ;; - ${__FLAGS_TYPE_STRING}) flags_defaultStr_="'${flags_default_}'" ;; - esac - flags_defaultStr_="(default: ${flags_defaultStr_})" - - flags_helpStr_=" ${flags_flagStr_} ${flags_help_:+${flags_help_} }${flags_defaultStr_}" - _flags_strlen "${flags_helpStr_}" >/dev/null - flags_helpStrLen_=${flags_output} - flags_columns_=`_flags_columns` - - if [ "${flags_helpStrLen_}" -lt "${flags_columns_}" ]; then - echo "${flags_helpStr_}" >&2 - else - echo " ${flags_flagStr_} ${flags_help_}" >&2 - # Note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06 - # because it doesn't like empty strings when used in this manner. - flags_emptyStr_="`echo \"x${flags_flagStr_}x\" \ - |awk '{printf "%"length($0)-2"s", ""}'`" - flags_helpStr_=" ${flags_emptyStr_} ${flags_defaultStr_}" - _flags_strlen "${flags_helpStr_}" >/dev/null - flags_helpStrLen_=${flags_output} - - if [ "${__FLAGS_GETOPT_VERS}" -eq "${__FLAGS_GETOPT_VERS_STD}" \ - -o "${flags_helpStrLen_}" -lt "${flags_columns_}" ]; then - # Indented to match help string. - echo "${flags_helpStr_}" >&2 - else - # Indented four from left to allow for longer defaults as long flag - # names might be used too, making things too long. - echo " ${flags_defaultStr_}" >&2 - fi - fi - done - fi - - unset flags_boolStr_ flags_default_ flags_defaultStr_ flags_emptyStr_ \ - flags_flagStr_ flags_help_ flags_helpStr flags_helpStrLen flags_name_ \ - flags_columns_ flags_short_ flags_type_ flags_usName_ - return ${FLAGS_TRUE} -} - -# Reset shflags back to an uninitialized state. -# -# Args: -# none -# Returns: -# nothing -flags_reset() { - for flags_name_ in ${__flags_longNames}; do - flags_usName_=`_flags_underscoreName "${flags_name_}"` - flags_strToEval_="unset FLAGS_${flags_usName_}" - for flags_type_ in \ - ${__FLAGS_INFO_DEFAULT} \ - ${__FLAGS_INFO_HELP} \ - ${__FLAGS_INFO_SHORT} \ - ${__FLAGS_INFO_TYPE} - do - flags_strToEval_=\ -"${flags_strToEval_} __flags_${flags_usName_}_${flags_type_}" - done - eval "${flags_strToEval_}" - done - - # Reset internal variables. - __flags_boolNames=' ' - __flags_longNames=' ' - __flags_shortNames=' ' - __flags_definedNames=' ' - - # Reset logging level back to default. - flags_setLoggingLevel ${__FLAGS_LEVEL_DEFAULT} - - unset flags_name_ flags_type_ flags_strToEval_ flags_usName_ -} - -# -# Initialization -# - -# Set the default logging level. -flags_setLoggingLevel ${__FLAGS_LEVEL_DEFAULT} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shlib b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shlib deleted file mode 100644 index a843043..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/shlib +++ /dev/null @@ -1,39 +0,0 @@ -# vim:et:ft=sh:sts=2:sw=2 -# -# Copyright 2008 Kate Ward. All Rights Reserved. -# Released under the LGPL (GNU Lesser General Public License). -# -# Author: kate.ward@forestent.com (Kate Ward) -# -# Library of shell functions. - -# Convert a relative path into it's absolute equivalent. -# -# This function will automatically prepend the current working directory if the -# path is not already absolute. It then removes all parent references (../) to -# reconstruct the proper absolute path. -# -# Args: -# shlib_path_: string: relative path -# Outputs: -# string: absolute path -shlib_relToAbsPath() -{ - shlib_path_=$1 - - # prepend current directory to relative paths - echo "${shlib_path_}" |grep '^/' >/dev/null 2>&1 \ - || shlib_path_="${PWD}/${shlib_path_}" - - # clean up the path. if all seds supported true regular expressions, then - # this is what it would be: - shlib_old_=${shlib_path_} - while true; do - shlib_new_=`echo "${shlib_old_}" |sed 's/[^/]*\/\.\.\/*//;s/\/\.\//\//'` - [ "${shlib_old_}" = "${shlib_new_}" ] && break - shlib_old_=${shlib_new_} - done - echo "${shlib_new_}" - - unset shlib_path_ shlib_old_ shlib_new_ -} diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/versions b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/versions deleted file mode 100755 index 7c3badd..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/lib/versions +++ /dev/null @@ -1,272 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# Versions determines the versions of all installed shells. -# -# Copyright 2008-2018 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 License. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shlib -# -# This library provides reusable functions that determine actual names and -# versions of installed shells and the OS. The library can also be run as a -# script if set executable. -# -# Disable checks that aren't fully portable (POSIX != portable). -# shellcheck disable=SC2006 - -ARGV0=`basename "$0"` -LSB_RELEASE='/etc/lsb-release' -VERSIONS_SHELLS='ash /bin/bash /bin/dash /bin/ksh /bin/pdksh /bin/zsh /bin/sh /usr/xpg4/bin/sh /sbin/sh' - -true; TRUE=$? -false; FALSE=$? -ERROR=2 - -UNAME_R=`uname -r` -UNAME_S=`uname -s` - -__versions_haveStrings=${ERROR} - -versions_osName() { - os_name_='unrecognized' - os_system_=${UNAME_S} - os_release_=${UNAME_R} - case ${os_system_} in - CYGWIN_NT-*) os_name_='Cygwin' ;; - Darwin) - os_name_=`/usr/bin/sw_vers -productName` - os_version_=`versions_osVersion` - case ${os_version_} in - 10.4|10.4.[0-9]*) os_name_='Mac OS X Tiger' ;; - 10.5|10.5.[0-9]*) os_name_='Mac OS X Leopard' ;; - 10.6|10.6.[0-9]*) os_name_='Mac OS X Snow Leopard' ;; - 10.7|10.7.[0-9]*) os_name_='Mac OS X Lion' ;; - 10.8|10.8.[0-9]*) os_name_='Mac OS X Mountain Lion' ;; - 10.9|10.9.[0-9]*) os_name_='Mac OS X Mavericks' ;; - 10.10|10.10.[0-9]*) os_name_='Mac OS X Yosemite' ;; - 10.11|10.11.[0-9]*) os_name_='Mac OS X El Capitan' ;; - 10.12|10.12.[0-9]*) os_name_='macOS Sierra' ;; - 10.13|10.13.[0-9]*) os_name_='macOS High Sierra' ;; - *) os_name_='macOS' ;; - esac - ;; - FreeBSD) os_name_='FreeBSD' ;; - Linux) os_name_='Linux' ;; - SunOS) - os_name_='SunOS' - if [ -r '/etc/release' ]; then - if grep 'OpenSolaris' /etc/release >/dev/null; then - os_name_='OpenSolaris' - else - os_name_='Solaris' - fi - fi - ;; - esac - - echo ${os_name_} - unset os_name_ os_system_ os_release_ os_version_ -} - -versions_osVersion() { - os_version_='unrecognized' - os_system_=${UNAME_S} - os_release_=${UNAME_R} - case ${os_system_} in - CYGWIN_NT-*) - os_version_=`expr "${os_release_}" : '\([0-9]*\.[0-9]\.[0-9]*\).*'` - ;; - Darwin) - os_version_=`/usr/bin/sw_vers -productVersion` - ;; - FreeBSD) - os_version_=`expr "${os_release_}" : '\([0-9]*\.[0-9]*\)-.*'` - ;; - Linux) - if [ -r '/etc/os-release' ]; then - os_version_=`awk -F= '$1~/PRETTY_NAME/{print $2}' /etc/os-release \ - |sed 's/"//g'` - elif [ -r '/etc/redhat-release' ]; then - os_version_=`cat /etc/redhat-release` - elif [ -r '/etc/SuSE-release' ]; then - os_version_=`head -n 1 /etc/SuSE-release` - elif [ -r "${LSB_RELEASE}" ]; then - if grep -q 'DISTRIB_ID=Ubuntu' "${LSB_RELEASE}"; then - # shellcheck disable=SC2002 - os_version_=`cat "${LSB_RELEASE}" \ - |awk -F= '$1~/DISTRIB_DESCRIPTION/{print $2}' \ - |sed 's/"//g;s/ /-/g'` - fi - fi - ;; - SunOS) - if [ -r '/etc/release' ]; then - if grep 'OpenSolaris' /etc/release >/dev/null; then # OpenSolaris - os_version_=`grep 'OpenSolaris' /etc/release |awk '{print $2"("$3")"}'` - else # Solaris - major_=`echo "${os_release_}" |sed 's/[0-9]*\.\([0-9]*\)/\1/'` - minor_=`grep Solaris /etc/release |sed 's/[^u]*\(u[0-9]*\).*/\1/'` - os_version_="${major_}${minor_}" - fi - fi - ;; - esac - - echo "${os_version_}" - unset os_release_ os_system_ os_version_ major_ minor_ -} - -versions_shellVersion() { - shell_=$1 - - shell_present_=${FALSE} - case "${shell_}" in - ash) [ -x '/bin/busybox' ] && shell_present_=${TRUE} ;; - *) [ -x "${shell_}" ] && shell_present_=${TRUE} ;; - esac - if [ ${shell_present_} -eq ${FALSE} ]; then - echo 'not installed' - return ${FALSE} - fi - - version_='' - case ${shell_} in - /sbin/sh) ;; # SunOS - /usr/xpg4/bin/sh) - version_=`versions_shell_xpg4 "${shell_}"` - ;; # SunOS - */sh) - # This could be one of any number of shells. Try until one fits. - version_='' - [ -z "${version_}" ] && version_=`versions_shell_bash "${shell_}"` - # dash cannot be self determined yet - [ -z "${version_}" ] && version_=`versions_shell_ksh "${shell_}"` - # pdksh is covered in versions_shell_ksh() - [ -z "${version_}" ] && version_=`versions_shell_xpg4 "${shell_}"` - [ -z "${version_}" ] && version_=`versions_shell_zsh "${shell_}"` - ;; - ash) version_=`versions_shell_ash "${shell_}"` ;; - */bash) version_=`versions_shell_bash "${shell_}"` ;; - */dash) - # Assuming Ubuntu Linux until somebody comes up with a better test. The - # following test will return an empty string if dash is not installed. - version_=`versions_shell_dash` - ;; - */ksh) version_=`versions_shell_ksh "${shell_}"` ;; - */pdksh) version_=`versions_shell_pdksh "${shell_}"` ;; - */zsh) version_=`versions_shell_zsh "${shell_}"` ;; - *) version_='invalid' - esac - - echo "${version_:-unknown}" - unset shell_ version_ -} - -# The ash shell is included in BusyBox. -versions_shell_ash() { - busybox --help |head -1 |sed 's/BusyBox v\([0-9.]*\) .*/\1/' -} - -versions_shell_bash() { - $1 --version : 2>&1 |grep 'GNU bash' |sed 's/.*version \([^ ]*\).*/\1/' -} - -versions_shell_dash() { - eval dpkg >/dev/null 2>&1 - [ $? -eq 127 ] && return # Return if dpkg not found. - - dpkg -l |grep ' dash ' |awk '{print $3}' -} - -versions_shell_ksh() { - versions_shell_=$1 - versions_version_='' - - # Try a few different ways to figure out the version. - versions_version_=`${versions_shell_} --version : 2>&1` - # shellcheck disable=SC2181 - if [ $? -eq 0 ]; then - versions_version_=`echo "${versions_version_}" \ - |sed 's/.*\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*/\1/'` - else - versions_version_='' - fi - if [ -z "${versions_version_}" ]; then - _versions_have_strings - versions_version_=`strings "${versions_shell_}" 2>&1 \ - |grep Version \ - |sed 's/^.*Version \(.*\)$/\1/;s/ s+ \$$//;s/ /-/g'` - fi - if [ -z "${versions_version_}" ]; then - versions_version_=`versions_shell_pdksh "${versions_shell_}"` - fi - - echo "${versions_version_}" - unset versions_shell_ versions_version_ -} - -versions_shell_pdksh() { - _versions_have_strings - strings "$1" 2>&1 \ - |grep 'PD KSH' \ - |sed -e 's/.*PD KSH \(.*\)/\1/;s/ /-/g' -} - -versions_shell_xpg4() { - _versions_have_strings - strings "$1" 2>&1 \ - |grep 'Version' \ - |sed -e 's/^@(#)Version //' -} - -versions_shell_zsh() { - versions_shell_=$1 - - # Try a few different ways to figure out the version. - # shellcheck disable=SC2016 - versions_version_=`echo 'echo ${ZSH_VERSION}' |${versions_shell_}` - if [ -z "${versions_version_}" ]; then - versions_version_=`${versions_shell_} --version : 2>&1` - # shellcheck disable=SC2181 - if [ $? -eq 0 ]; then - versions_version_=`echo "${versions_version_}" |awk '{print $2}'` - else - versions_version_='' - fi - fi - - echo "${versions_version_}" - unset versions_shell_ versions_version_ -} - -# Determine if the 'strings' binary installed. -_versions_have_strings() { - [ ${__versions_haveStrings} -ne ${ERROR} ] && return - if eval strings /dev/null >/dev/null 2>&1; then - __versions_haveStrings=${TRUE} - return - fi - - echo 'WARN: strings not installed. try installing binutils?' >&2 - __versions_haveStrings=${FALSE} -} - -versions_main() { - # Treat unset variables as an error. - set -u - - os_name=`versions_osName` - os_version=`versions_osVersion` - echo "os: ${os_name} version: ${os_version}" - - for shell in ${VERSIONS_SHELLS}; do - shell_version=`versions_shellVersion "${shell}"` - echo "shell: ${shell} version: ${shell_version}" - done -} - -if [ "${ARGV0}" = 'versions' ]; then - versions_main "$@" -fi diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2 b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2 deleted file mode 100755 index d3d4056..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2 +++ /dev/null @@ -1,1169 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# Copyright 2008-2018 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# shUnit2 -- Unit testing framework for Unix shell scripts. -# https://github.com/kward/shunit2 -# -# Author: kate.ward@forestent.com (Kate Ward) -# -# shUnit2 is a xUnit based unit test framework for Bourne shell scripts. It is -# based on the popular JUnit unit testing framework for Java. -# -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 -# expr may be antiquated, but it is the only solution in some cases. -# shellcheck disable=SC2003 - -# Return if shunit2 already loaded. -command [ -n "${SHUNIT_VERSION:-}" ] && exit 0 -SHUNIT_VERSION='2.1.8pre' - -# Return values that scripts can use. -SHUNIT_TRUE=0 -SHUNIT_FALSE=1 -SHUNIT_ERROR=2 - -# Logging functions. -_shunit_warn() { - ${__SHUNIT_CMD_ECHO_ESC} \ - "${__shunit_ansi_yellow}shunit2:WARN${__shunit_ansi_none} $*" >&2 -} -_shunit_error() { - ${__SHUNIT_CMD_ECHO_ESC} \ - "${__shunit_ansi_red}shunit2:ERROR${__shunit_ansi_none} $*" >&2 -} -_shunit_fatal() { - ${__SHUNIT_CMD_ECHO_ESC} \ - "${__shunit_ansi_red}shunit2:FATAL${__shunit_ansi_none} $*" >&2 - exit ${SHUNIT_ERROR} -} - -# Determine some reasonable command defaults. -__SHUNIT_UNAME_S=`uname -s` -case "${__SHUNIT_UNAME_S}" in - BSD) __SHUNIT_CMD_EXPR='gexpr' ;; - *) __SHUNIT_CMD_EXPR='expr' ;; -esac - -__SHUNIT_CMD_ECHO_ESC='echo -e' -# shellcheck disable=SC2039 -command [ "`echo -e test`" = '-e test' ] && __SHUNIT_CMD_ECHO_ESC='echo' - -# Commands a user can override if needed. -SHUNIT_CMD_EXPR=${SHUNIT_CMD_EXPR:-${__SHUNIT_CMD_EXPR}} - -# Enable color output. Options are 'never', 'always', or 'auto'. -SHUNIT_COLOR=${SHUNIT_COLOR:-auto} - -# Specific shell checks. -if command [ -n "${ZSH_VERSION:-}" ]; then - setopt |grep "^shwordsplit$" >/dev/null - if command [ $? -ne ${SHUNIT_TRUE} ]; then - _shunit_fatal 'zsh shwordsplit option is required for proper operation' - fi - if command [ -z "${SHUNIT_PARENT:-}" ]; then - _shunit_fatal "zsh does not pass \$0 through properly. please declare \ -\"SHUNIT_PARENT=\$0\" before calling shUnit2" - fi -fi - -# -# Constants -# - -__SHUNIT_MODE_SOURCED='sourced' -__SHUNIT_MODE_STANDALONE='standalone' -__SHUNIT_PARENT=${SHUNIT_PARENT:-$0} - -# User provided test prefix -- define SHUNIT_TEST_PREFIX variable. -__SHUNIT_TEST_PREFIX=${SHUNIT_TEST_PREFIX:-} - -# ANSI colors. -__SHUNIT_ANSI_NONE='\033[0m' -__SHUNIT_ANSI_RED='\033[1;31m' -__SHUNIT_ANSI_GREEN='\033[1;32m' -__SHUNIT_ANSI_YELLOW='\033[1;33m' -__SHUNIT_ANSI_CYAN='\033[1;36m' - -# Set the constants readonly. -__shunit_constants=`set |grep '^__SHUNIT_' |cut -d= -f1` -echo "${__shunit_constants}" |grep '^Binary file' >/dev/null && \ - __shunit_constants=`set |grep -a '^__SHUNIT_' |cut -d= -f1` -for __shunit_const in ${__shunit_constants}; do - if command [ -z "${ZSH_VERSION:-}" ]; then - readonly "${__shunit_const}" - else - case ${ZSH_VERSION} in - [123].*) readonly "${__shunit_const}" ;; - *) readonly -g "${__shunit_const}" # Declare readonly constants globally. - esac - fi -done -unset __shunit_const __shunit_constants - -# -# Internal variables. -# - -# Variables. -__shunit_lineno='' # Line number of executed test. -__shunit_mode=${__SHUNIT_MODE_SOURCED} # Operating mode. -__shunit_reportGenerated=${SHUNIT_FALSE} # Is report generated. -__shunit_script='' # Filename of unittest script (standalone mode). -__shunit_skip=${SHUNIT_FALSE} # Is skipping enabled. -__shunit_suite='' # Suite of tests to execute. - -# ANSI colors (populated by _shunit_configureColor()). -__shunit_ansi_none='' -__shunit_ansi_red='' -__shunit_ansi_green='' -__shunit_ansi_yellow='' -__shunit_ansi_cyan='' - -# Counts of tests. -__shunit_testSuccess=${SHUNIT_TRUE} -__shunit_testsTotal=0 -__shunit_testsPassed=0 -__shunit_testsFailed=0 - -# Counts of asserts. -__shunit_assertsTotal=0 -__shunit_assertsPassed=0 -__shunit_assertsFailed=0 -__shunit_assertsSkipped=0 - -# -# Macros. -# - -# shellcheck disable=SC2016,SC2089 -_SHUNIT_LINENO_='eval __shunit_lineno=""; if command [ "${1:-}" = "--lineno" ]; then command [ -n "$2" ] && __shunit_lineno="[$2] "; shift 2; fi' - -#----------------------------------------------------------------------------- -# Assertion functions. -# - -# Assert that two values are equal to one another. -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertEquals() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "assertEquals() requires two or three arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_expected_=$1 - shunit_actual_=$2 - - shunit_return=${SHUNIT_TRUE} - if command [ "${shunit_expected_}" = "${shunit_actual_}" ]; then - _shunit_assertPass - else - failNotEquals "${shunit_message_}" "${shunit_expected_}" "${shunit_actual_}" - shunit_return=${SHUNIT_FALSE} - fi - - unset shunit_message_ shunit_expected_ shunit_actual_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_EQUALS_='eval assertEquals --lineno "${LINENO:-}"' - -# Assert that two values are not equal to one another. -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertNotEquals() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "assertNotEquals() requires two or three arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_expected_=$1 - shunit_actual_=$2 - - shunit_return=${SHUNIT_TRUE} - if command [ "${shunit_expected_}" != "${shunit_actual_}" ]; then - _shunit_assertPass - else - failSame "${shunit_message_}" "$@" - shunit_return=${SHUNIT_FALSE} - fi - - unset shunit_message_ shunit_expected_ shunit_actual_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_NOT_EQUALS_='eval assertNotEquals --lineno "${LINENO:-}"' - -# Assert that a value is null (i.e. an empty string) -# -# Args: -# message: string: failure message [optional] -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertNull() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 1 -o $# -gt 2 ]; then - _shunit_error "assertNull() requires one or two arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 2 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - assertTrue "${shunit_message_}" "[ -z '$1' ]" - shunit_return=$? - - unset shunit_message_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_NULL_='eval assertNull --lineno "${LINENO:-}"' - -# Assert that a value is not null (i.e. a non-empty string) -# -# Args: -# message: string: failure message [optional] -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertNotNull() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -gt 2 ]; then # allowing 0 arguments as $1 might actually be null - _shunit_error "assertNotNull() requires one or two arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 2 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_actual_=`_shunit_escapeCharactersInString "${1:-}"` - test -n "${shunit_actual_}" - assertTrue "${shunit_message_}" $? - shunit_return=$? - - unset shunit_actual_ shunit_message_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_NOT_NULL_='eval assertNotNull --lineno "${LINENO:-}"' - -# Assert that two values are the same (i.e. equal to one another). -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertSame() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "assertSame() requires two or three arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - assertEquals "${shunit_message_}" "$1" "$2" - shunit_return=$? - - unset shunit_message_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_SAME_='eval assertSame --lineno "${LINENO:-}"' - -# Assert that two values are not the same (i.e. not equal to one another). -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertNotSame() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "assertNotSame() requires two or three arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_:-}$1" - shift - fi - assertNotEquals "${shunit_message_}" "$1" "$2" - shunit_return=$? - - unset shunit_message_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_NOT_SAME_='eval assertNotSame --lineno "${LINENO:-}"' - -# Assert that a value or shell test condition is true. -# -# In shell, a value of 0 is true and a non-zero value is false. Any integer -# value passed can thereby be tested. -# -# Shell supports much more complicated tests though, and a means to support -# them was needed. As such, this function tests that conditions are true or -# false through evaluation rather than just looking for a true or false. -# -# The following test will succeed: -# assertTrue 0 -# assertTrue "[ 34 -gt 23 ]" -# The following test will fail with a message: -# assertTrue 123 -# assertTrue "test failed" "[ -r '/non/existent/file' ]" -# -# Args: -# message: string: failure message [optional] -# condition: string: integer value or shell conditional statement -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertTrue() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 1 -o $# -gt 2 ]; then - _shunit_error "assertTrue() takes one or two arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 2 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_condition_=$1 - - # See if condition is an integer, i.e. a return value. - shunit_match_=`expr "${shunit_condition_}" : '\([0-9]*\)'` - shunit_return=${SHUNIT_TRUE} - if command [ -z "${shunit_condition_}" ]; then - # Null condition. - shunit_return=${SHUNIT_FALSE} - elif command [ -n "${shunit_match_}" -a "${shunit_condition_}" = "${shunit_match_}" ] - then - # Possible return value. Treating 0 as true, and non-zero as false. - command [ "${shunit_condition_}" -ne 0 ] && shunit_return=${SHUNIT_FALSE} - else - # Hopefully... a condition. - ( eval "${shunit_condition_}" ) >/dev/null 2>&1 - command [ $? -ne 0 ] && shunit_return=${SHUNIT_FALSE} - fi - - # Record the test. - if command [ ${shunit_return} -eq ${SHUNIT_TRUE} ]; then - _shunit_assertPass - else - _shunit_assertFail "${shunit_message_}" - fi - - unset shunit_message_ shunit_condition_ shunit_match_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_TRUE_='eval assertTrue --lineno "${LINENO:-}"' - -# Assert that a value or shell test condition is false. -# -# In shell, a value of 0 is true and a non-zero value is false. Any integer -# value passed can thereby be tested. -# -# Shell supports much more complicated tests though, and a means to support -# them was needed. As such, this function tests that conditions are true or -# false through evaluation rather than just looking for a true or false. -# -# The following test will succeed: -# assertFalse 1 -# assertFalse "[ 'apples' = 'oranges' ]" -# The following test will fail with a message: -# assertFalse 0 -# assertFalse "test failed" "[ 1 -eq 1 -a 2 -eq 2 ]" -# -# Args: -# message: string: failure message [optional] -# condition: string: integer value or shell conditional statement -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -assertFalse() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 1 -o $# -gt 2 ]; then - _shunit_error "assertFalse() quires one or two arguments; $# given" - _shunit_assertFail - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 2 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_condition_=$1 - - # See if condition is an integer, i.e. a return value. - shunit_match_=`expr "${shunit_condition_}" : '\([0-9]*\)'` - shunit_return=${SHUNIT_TRUE} - if command [ -z "${shunit_condition_}" ]; then - # Null condition. - shunit_return=${SHUNIT_FALSE} - elif command [ -n "${shunit_match_}" -a "${shunit_condition_}" = "${shunit_match_}" ] - then - # Possible return value. Treating 0 as true, and non-zero as false. - command [ "${shunit_condition_}" -eq 0 ] && shunit_return=${SHUNIT_FALSE} - else - # Hopefully... a condition. - ( eval "${shunit_condition_}" ) >/dev/null 2>&1 - command [ $? -eq 0 ] && shunit_return=${SHUNIT_FALSE} - fi - - # Record the test. - if command [ "${shunit_return}" -eq "${SHUNIT_TRUE}" ]; then - _shunit_assertPass - else - _shunit_assertFail "${shunit_message_}" - fi - - unset shunit_message_ shunit_condition_ shunit_match_ - return "${shunit_return}" -} -# shellcheck disable=SC2016,SC2034 -_ASSERT_FALSE_='eval assertFalse --lineno "${LINENO:-}"' - -#----------------------------------------------------------------------------- -# Failure functions. -# - -# Records a test failure. -# -# Args: -# message: string: failure message [optional] -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -fail() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -gt 1 ]; then - _shunit_error "fail() requires zero or one arguments; $# given" - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 1 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - - _shunit_assertFail "${shunit_message_}" - - unset shunit_message_ - return ${SHUNIT_FALSE} -} -# shellcheck disable=SC2016,SC2034 -_FAIL_='eval fail --lineno "${LINENO:-}"' - -# Records a test failure, stating two values were not equal. -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -failNotEquals() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "failNotEquals() requires one or two arguments; $# given" - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - shunit_expected_=$1 - shunit_actual_=$2 - - shunit_message_=${shunit_message_%% } - _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_expected_}> but was:<${shunit_actual_}>" - - unset shunit_message_ shunit_expected_ shunit_actual_ - return ${SHUNIT_FALSE} -} -# shellcheck disable=SC2016,SC2034 -_FAIL_NOT_EQUALS_='eval failNotEquals --lineno "${LINENO:-}"' - -# Records a test failure, stating two values should have been the same. -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -failSame() -{ - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "failSame() requires two or three arguments; $# given" - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - - shunit_message_=${shunit_message_%% } - _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected not same" - - unset shunit_message_ - return ${SHUNIT_FALSE} -} -# shellcheck disable=SC2016,SC2034 -_FAIL_SAME_='eval failSame --lineno "${LINENO:-}"' - -# Records a test failure, stating two values were not equal. -# -# This is functionally equivalent to calling failNotEquals(). -# -# Args: -# message: string: failure message [optional] -# expected: string: expected value -# actual: string: actual value -# Returns: -# integer: success (TRUE/FALSE/ERROR constant) -failNotSame() { - # shellcheck disable=SC2090 - ${_SHUNIT_LINENO_} - if command [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "failNotSame() requires one or two arguments; $# given" - return ${SHUNIT_ERROR} - fi - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - shunit_message_=${__shunit_lineno} - if command [ $# -eq 3 ]; then - shunit_message_="${shunit_message_}$1" - shift - fi - failNotEquals "${shunit_message_}" "$1" "$2" - shunit_return=$? - - unset shunit_message_ - return ${shunit_return} -} -# shellcheck disable=SC2016,SC2034 -_FAIL_NOT_SAME_='eval failNotSame --lineno "${LINENO:-}"' - -#----------------------------------------------------------------------------- -# Skipping functions. -# - -# Force remaining assert and fail functions to be "skipped". -# -# This function forces the remaining assert and fail functions to be "skipped", -# i.e. they will have no effect. Each function skipped will be recorded so that -# the total of asserts and fails will not be altered. -# -# Args: -# None -startSkipping() { __shunit_skip=${SHUNIT_TRUE}; } - -# Resume the normal recording behavior of assert and fail calls. -# -# Args: -# None -endSkipping() { __shunit_skip=${SHUNIT_FALSE}; } - -# Returns the state of assert and fail call skipping. -# -# Args: -# None -# Returns: -# boolean: (TRUE/FALSE constant) -isSkipping() { return ${__shunit_skip}; } - -#----------------------------------------------------------------------------- -# Suite functions. -# - -# Stub. This function should contains all unit test calls to be made. -# -# DEPRECATED (as of 2.1.0) -# -# This function can be optionally overridden by the user in their test suite. -# -# If this function exists, it will be called when shunit2 is sourced. If it -# does not exist, shunit2 will search the parent script for all functions -# beginning with the word 'test', and they will be added dynamically to the -# test suite. -# -# This function should be overridden by the user in their unit test suite. -# Note: see _shunit_mktempFunc() for actual implementation -# -# Args: -# None -#suite() { :; } # DO NOT UNCOMMENT THIS FUNCTION - -# Adds a function name to the list of tests schedule for execution. -# -# This function should only be called from within the suite() function. -# -# Args: -# function: string: name of a function to add to current unit test suite -suite_addTest() { - shunit_func_=${1:-} - - __shunit_suite="${__shunit_suite:+${__shunit_suite} }${shunit_func_}" - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` - - unset shunit_func_ -} - -# Stub. This function will be called once before any tests are run. -# -# Common one-time environment preparation tasks shared by all tests can be -# defined here. -# -# This function should be overridden by the user in their unit test suite. -# Note: see _shunit_mktempFunc() for actual implementation -# -# Args: -# None -#oneTimeSetUp() { :; } # DO NOT UNCOMMENT THIS FUNCTION - -# Stub. This function will be called once after all tests are finished. -# -# Common one-time environment cleanup tasks shared by all tests can be defined -# here. -# -# This function should be overridden by the user in their unit test suite. -# Note: see _shunit_mktempFunc() for actual implementation -# -# Args: -# None -#oneTimeTearDown() { :; } # DO NOT UNCOMMENT THIS FUNCTION - -# Stub. This function will be called before each test is run. -# -# Common environment preparation tasks shared by all tests can be defined here. -# -# This function should be overridden by the user in their unit test suite. -# Note: see _shunit_mktempFunc() for actual implementation -# -# Args: -# None -#setUp() { :; } # DO NOT UNCOMMENT THIS FUNCTION - -# Note: see _shunit_mktempFunc() for actual implementation -# Stub. This function will be called after each test is run. -# -# Common environment cleanup tasks shared by all tests can be defined here. -# -# This function should be overridden by the user in their unit test suite. -# Note: see _shunit_mktempFunc() for actual implementation -# -# Args: -# None -#tearDown() { :; } # DO NOT UNCOMMENT THIS FUNCTION - -#------------------------------------------------------------------------------ -# Internal shUnit2 functions. -# - -# Create a temporary directory to store various run-time files in. -# -# This function is a cross-platform temporary directory creation tool. Not all -# OSes have the `mktemp` function, so one is included here. -# -# Args: -# None -# Outputs: -# string: the temporary directory that was created -_shunit_mktempDir() { - # Try the standard `mktemp` function. - ( exec mktemp -dqt shunit.XXXXXX 2>/dev/null ) && return - - # The standard `mktemp` didn't work. Use our own. - # shellcheck disable=SC2039 - if command [ -r '/dev/urandom' -a -x '/usr/bin/od' ]; then - _shunit_random_=`/usr/bin/od -vAn -N4 -tx4 "${_shunit_file_}" -#! /bin/sh -exit ${SHUNIT_TRUE} -EOF - command chmod +x "${_shunit_file_}" - done - - unset _shunit_file_ -} - -# Final cleanup function to leave things as we found them. -# -# Besides removing the temporary directory, this function is in charge of the -# final exit code of the unit test. The exit code is based on how the script -# was ended (e.g. normal exit, or via Ctrl-C). -# -# Args: -# name: string: name of the trap called (specified when trap defined) -_shunit_cleanup() { - _shunit_name_=$1 - - case ${_shunit_name_} in - EXIT) _shunit_signal_=0 ;; - INT) _shunit_signal_=2 ;; - TERM) _shunit_signal_=15 ;; - *) - _shunit_error "unrecognized trap value (${_shunit_name_})" - _shunit_signal_=0 - ;; - esac - - # Do our work. - command rm -fr "${__shunit_tmpDir}" - - # Exit for all non-EXIT signals. - if command [ "${_shunit_name_}" != 'EXIT' ]; then - _shunit_warn "trapped and now handling the (${_shunit_name_}) signal" - # Disable EXIT trap. - trap 0 - # Add 128 to signal and exit. - exit "`expr "${_shunit_signal_}" + 128`" - elif command [ ${__shunit_reportGenerated} -eq ${SHUNIT_FALSE} ] ; then - _shunit_assertFail 'Unknown failure encountered running a test' - _shunit_generateReport - exit ${SHUNIT_ERROR} - fi - - unset _shunit_name_ _shunit_signal_ -} - -# configureColor based on user color preference. -# -# Args: -# color: string: color mode (one of `always`, `auto`, or `none`). -_shunit_configureColor() { - _shunit_color_=${SHUNIT_FALSE} # By default, no color. - case $1 in - 'always') _shunit_color_=${SHUNIT_TRUE} ;; - 'auto') - ( exec tput >/dev/null 2>&1 ) # Check for existence of tput command. - if command [ $? -lt 127 ]; then - _shunit_tput_=`tput colors` - # shellcheck disable=SC2166,SC2181 - command [ $? -eq 0 -a "${_shunit_tput_}" -ge 16 ] && _shunit_color_=${SHUNIT_TRUE} - fi - ;; - 'none') ;; - *) _shunit_fatal "unrecognized color option '$1'" ;; - esac - - case ${_shunit_color_} in - ${SHUNIT_TRUE}) - __shunit_ansi_none=${__SHUNIT_ANSI_NONE} - __shunit_ansi_red=${__SHUNIT_ANSI_RED} - __shunit_ansi_green=${__SHUNIT_ANSI_GREEN} - __shunit_ansi_yellow=${__SHUNIT_ANSI_YELLOW} - __shunit_ansi_cyan=${__SHUNIT_ANSI_CYAN} - ;; - ${SHUNIT_FALSE}) - __shunit_ansi_none='' - __shunit_ansi_red='' - __shunit_ansi_green='' - __shunit_ansi_yellow='' - __shunit_ansi_cyan='' - ;; - esac - - unset _shunit_color_ _shunit_tput_ -} - -# The actual running of the tests happens here. -# -# Args: -# None -_shunit_execSuite() { - for _shunit_test_ in ${__shunit_suite}; do - __shunit_testSuccess=${SHUNIT_TRUE} - - # Disable skipping. - endSkipping - - # Execute the per-test setup function. - setUp - command [ $? -eq ${SHUNIT_TRUE} ] \ - || _shunit_fatal "setup() returned non-zero return code." - - # Execute the test. - echo "${__SHUNIT_TEST_PREFIX}${_shunit_test_}" - eval "${_shunit_test_}" - if command [ $? -ne ${SHUNIT_TRUE} ]; then - _shunit_error "${_shunit_test_}() returned non-zero return code." - __shunit_testSuccess=${SHUNIT_ERROR} - _shunit_incFailedCount - fi - - # Execute the per-test tear-down function. - tearDown - command [ $? -eq ${SHUNIT_TRUE} ] \ - || _shunit_fatal "tearDown() returned non-zero return code." - - # Update stats. - if command [ ${__shunit_testSuccess} -eq ${SHUNIT_TRUE} ]; then - __shunit_testsPassed=`expr ${__shunit_testsPassed} + 1` - else - __shunit_testsFailed=`expr ${__shunit_testsFailed} + 1` - fi - done - - unset _shunit_test_ -} - -# Generates the user friendly report with appropriate OK/FAILED message. -# -# Args: -# None -# Output: -# string: the report of successful and failed tests, as well as totals. -_shunit_generateReport() { - _shunit_ok_=${SHUNIT_TRUE} - - # If no exit code was provided one, determine an appropriate one. - command [ "${__shunit_testsFailed}" -gt 0 \ - -o ${__shunit_testSuccess} -eq ${SHUNIT_FALSE} ] \ - && _shunit_ok_=${SHUNIT_FALSE} - - echo - _shunit_msg_="Ran ${__shunit_ansi_cyan}${__shunit_testsTotal}${__shunit_ansi_none}" - if command [ "${__shunit_testsTotal}" -eq 1 ]; then - ${__SHUNIT_CMD_ECHO_ESC} "${_shunit_msg_} test." - else - ${__SHUNIT_CMD_ECHO_ESC} "${_shunit_msg_} tests." - fi - - _shunit_failures_=0 - _shunit_skipped_=0 - command [ "${__shunit_assertsFailed}" -gt 0 ] \ - && _shunit_failures_="failures=${__shunit_assertsFailed}" - command [ "${__shunit_assertsSkipped}" -gt 0 ] \ - && _shunit_skipped_="skipped=${__shunit_assertsSkipped}" - - if command [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then - _shunit_msg_="${__shunit_ansi_green}OK${__shunit_ansi_none}" - command [ "${_shunit_skipped_}" -gt 0 ] \ - && _shunit_msg_="${_shunit_msg_} (${__shunit_ansi_yellow}${_shunit_skipped_}${__shunit_ansi_none})" - else - _shunit_msg_="${__shunit_ansi_red}FAILED${__shunit_ansi_none}" - _shunit_msg_="${_shunit_msg_} (${__shunit_ansi_red}${_shunit_failures_}${__shunit_ansi_none}" - command [ "${_shunit_skipped_}" -gt 0 ] \ - && _shunit_msg_="${_shunit_msg_},${__shunit_ansi_yellow}${_shunit_skipped_}${__shunit_ansi_none}" - _shunit_msg_="${_shunit_msg_})" - fi - - echo - ${__SHUNIT_CMD_ECHO_ESC} "${_shunit_msg_}" - __shunit_reportGenerated=${SHUNIT_TRUE} - - unset _shunit_failures_ _shunit_msg_ _shunit_ok_ _shunit_skipped_ -} - -# Test for whether a function should be skipped. -# -# Args: -# None -# Returns: -# boolean: whether the test should be skipped (TRUE/FALSE constant) -_shunit_shouldSkip() { - command [ ${__shunit_skip} -eq ${SHUNIT_FALSE} ] && return ${SHUNIT_FALSE} - _shunit_assertSkip -} - -# Records a successful test. -# -# Args: -# None -_shunit_assertPass() { - __shunit_assertsPassed=`expr ${__shunit_assertsPassed} + 1` - __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` -} - -# Records a test failure. -# -# Args: -# message: string: failure message to provide user -_shunit_assertFail() { - __shunit_testSuccess=${SHUNIT_FALSE} - _shunit_incFailedCount - - \[ $# -gt 0 ] && ${__SHUNIT_CMD_ECHO_ESC} \ - "${__shunit_ansi_red}ASSERT:${__shunit_ansi_none}$*" -} - -# Increment the count of failed asserts. -# -# Args: -# none -_shunit_incFailedCount() { - __shunit_assertsFailed=`expr "${__shunit_assertsFailed}" + 1` - __shunit_assertsTotal=`expr "${__shunit_assertsTotal}" + 1` -} - - -# Records a skipped test. -# -# Args: -# None -_shunit_assertSkip() { - __shunit_assertsSkipped=`expr "${__shunit_assertsSkipped}" + 1` - __shunit_assertsTotal=`expr "${__shunit_assertsTotal}" + 1` -} - -# Prepare a script filename for sourcing. -# -# Args: -# script: string: path to a script to source -# Returns: -# string: filename prefixed with ./ (if necessary) -_shunit_prepForSourcing() { - _shunit_script_=$1 - case "${_shunit_script_}" in - /*|./*) echo "${_shunit_script_}" ;; - *) echo "./${_shunit_script_}" ;; - esac - unset _shunit_script_ -} - -# Escape a character in a string. -# -# Args: -# c: string: unescaped character -# s: string: to escape character in -# Returns: -# string: with escaped character(s) -_shunit_escapeCharInStr() { - command [ -n "$2" ] || return # No point in doing work on an empty string. - - # Note: using shorter variable names to prevent conflicts with - # _shunit_escapeCharactersInString(). - _shunit_c_=$1 - _shunit_s_=$2 - - # Escape the character. - # shellcheck disable=SC1003,SC2086 - echo ''${_shunit_s_}'' |sed 's/\'${_shunit_c_}'/\\\'${_shunit_c_}'/g' - - unset _shunit_c_ _shunit_s_ -} - -# Escape a character in a string. -# -# Args: -# str: string: to escape characters in -# Returns: -# string: with escaped character(s) -_shunit_escapeCharactersInString() { - command [ -n "$1" ] || return # No point in doing work on an empty string. - - _shunit_str_=$1 - - # Note: using longer variable names to prevent conflicts with - # _shunit_escapeCharInStr(). - for _shunit_char_ in '"' '$' "'" '`'; do - _shunit_str_=`_shunit_escapeCharInStr "${_shunit_char_}" "${_shunit_str_}"` - done - - echo "${_shunit_str_}" - unset _shunit_char_ _shunit_str_ -} - -# Extract list of functions to run tests against. -# -# Args: -# script: string: name of script to extract functions from -# Returns: -# string: of function names -_shunit_extractTestFunctions() { - _shunit_script_=$1 - - # Extract the lines with test function names, strip of anything besides the - # function name, and output everything on a single line. - _shunit_regex_='^[ ]*(function )*test[A-Za-z0-9_]* *\(\)' - # shellcheck disable=SC2196 - egrep "${_shunit_regex_}" "${_shunit_script_}" \ - |sed 's/^[^A-Za-z0-9_]*//;s/^function //;s/\([A-Za-z0-9_]*\).*/\1/g' \ - |xargs - - unset _shunit_regex_ _shunit_script_ -} - -#------------------------------------------------------------------------------ -# Main. -# - -# Determine the operating mode. -if command [ $# -eq 0 ]; then - __shunit_script=${__SHUNIT_PARENT} - __shunit_mode=${__SHUNIT_MODE_SOURCED} -else - __shunit_script=$1 - command [ -r "${__shunit_script}" ] || \ - _shunit_fatal "unable to read from ${__shunit_script}" - __shunit_mode=${__SHUNIT_MODE_STANDALONE} -fi - -# Create a temporary storage location. -__shunit_tmpDir=`_shunit_mktempDir` - -# Provide a public temporary directory for unit test scripts. -# TODO(kward): document this. -SHUNIT_TMPDIR="${__shunit_tmpDir}/tmp" -command mkdir "${SHUNIT_TMPDIR}" - -# Setup traps to clean up after ourselves. -trap '_shunit_cleanup EXIT' 0 -trap '_shunit_cleanup INT' 2 -trap '_shunit_cleanup TERM' 15 - -# Create phantom functions to work around issues with Cygwin. -_shunit_mktempFunc -PATH="${__shunit_tmpDir}:${PATH}" - -# Make sure phantom functions are executable. This will bite if `/tmp` (or the -# current `$TMPDIR`) points to a path on a partition that was mounted with the -# 'noexec' option. The noexec command was created with `_shunit_mktempFunc()`. -noexec 2>/dev/null || _shunit_fatal \ - 'Please declare TMPDIR with path on partition with exec permission.' - -# We must manually source the tests in standalone mode. -if command [ "${__shunit_mode}" = "${__SHUNIT_MODE_STANDALONE}" ]; then - # shellcheck disable=SC1090 - command . "`_shunit_prepForSourcing \"${__shunit_script}\"`" -fi - -# Configure default output coloring behavior. -_shunit_configureColor "${SHUNIT_COLOR}" - -# Execute the oneTimeSetUp function (if it exists). -oneTimeSetUp -command [ $? -eq ${SHUNIT_TRUE} ] \ - || _shunit_fatal "oneTimeSetUp() returned non-zero return code." - -# Execute the suite function defined in the parent test script. -# DEPRECATED as of 2.1.0. -suite - -# If no suite function was defined, dynamically build a list of functions. -if command [ -z "${__shunit_suite}" ]; then - shunit_funcs_=`_shunit_extractTestFunctions "${__shunit_script}"` - for shunit_func_ in ${shunit_funcs_}; do - suite_addTest "${shunit_func_}" - done -fi -unset shunit_func_ shunit_funcs_ - -# Execute the suite of unit tests. -_shunit_execSuite - -# Execute the oneTimeTearDown function (if it exists). -oneTimeTearDown -command [ $? -eq ${SHUNIT_TRUE} ] \ - || _shunit_fatal "oneTimeTearDown() returned non-zero return code." - -# Generate a report summary. -_shunit_generateReport - -# That's it folks. -command [ "${__shunit_testsFailed}" -eq 0 ] -exit $? diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_asserts_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_asserts_test.sh deleted file mode 100755 index 959ad98..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_asserts_test.sh +++ /dev/null @@ -1,197 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# shunit2 unit test for assert functions. -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -# Disable source following. -# shellcheck disable=SC1090,SC1091 - -# These variables will be overridden by the test helpers. -stdoutF="${TMPDIR:-/tmp}/STDOUT" -stderrF="${TMPDIR:-/tmp}/STDERR" - -# Load test helpers. -. ./shunit2_test_helpers - -commonEqualsSame() { - fn=$1 - - ( ${fn} 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'equal' $? "${stdoutF}" "${stderrF}" - - ( ${fn} "${MSG}" 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'equal; with msg' $? "${stdoutF}" "${stderrF}" - - ( ${fn} 'abc def' 'abc def' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'equal with spaces' $? "${stdoutF}" "${stderrF}" - - ( ${fn} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not equal' $? "${stdoutF}" "${stderrF}" - - ( ${fn} '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( ${fn} arg1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( ${fn} arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -commonNotEqualsSame() { - fn=$1 - - ( ${fn} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not same' $? "${stdoutF}" "${stderrF}" - - ( ${fn} "${MSG}" 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not same, with msg' $? "${stdoutF}" "${stderrF}" - - ( ${fn} 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same' $? "${stdoutF}" "${stderrF}" - - ( ${fn} '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( ${fn} arg1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( ${fn} arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testAssertEquals() { - commonEqualsSame 'assertEquals' -} - -testAssertNotEquals() { - commonNotEqualsSame 'assertNotEquals' -} - -testAssertSame() { - commonEqualsSame 'assertSame' -} - -testAssertNotSame() { - commonNotEqualsSame 'assertNotSame' -} - -testAssertNull() { - ( assertNull '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'null' $? "${stdoutF}" "${stderrF}" - - ( assertNull "${MSG}" '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'null, with msg' $? "${stdoutF}" "${stderrF}" - - ( assertNull 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not null' $? "${stdoutF}" "${stderrF}" - - ( assertNull >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( assertNull arg1 arg2 arg3 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testAssertNotNull() -{ - ( assertNotNull 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null' $? "${stdoutF}" "${stderrF}" - - ( assertNotNull "${MSG}" 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null, with msg' $? "${stdoutF}" "${stderrF}" - - ( assertNotNull 'x"b' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null, with double-quote' $? \ - "${stdoutF}" "${stderrF}" - - ( assertNotNull "x'b" >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null, with single-quote' $? \ - "${stdoutF}" "${stderrF}" - - # shellcheck disable=SC2016 - ( assertNotNull 'x$b' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null, with dollar' $? \ - "${stdoutF}" "${stderrF}" - - ( assertNotNull 'x`b' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'not null, with backtick' $? \ - "${stdoutF}" "${stderrF}" - - ( assertNotNull '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null' $? "${stdoutF}" "${stderrF}" - - # There is no test for too few arguments as $1 might actually be null. - - ( assertNotNull arg1 arg2 arg3 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testAssertTrue() { - ( assertTrue 0 >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'true' $? "${stdoutF}" "${stderrF}" - - ( assertTrue "${MSG}" 0 >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'true, with msg' $? "${stdoutF}" "${stderrF}" - - ( assertTrue '[ 0 -eq 0 ]' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'true condition' $? "${stdoutF}" "${stderrF}" - - ( assertTrue 1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'false' $? "${stdoutF}" "${stderrF}" - - ( assertTrue '[ 0 -eq 1 ]' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'false condition' $? "${stdoutF}" "${stderrF}" - - ( assertTrue '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null' $? "${stdoutF}" "${stderrF}" - - ( assertTrue >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( assertTrue arg1 arg2 arg3 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testAssertFalse() { - ( assertFalse 1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'false' $? "${stdoutF}" "${stderrF}" - - ( assertFalse "${MSG}" 1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'false, with msg' $? "${stdoutF}" "${stderrF}" - - ( assertFalse '[ 0 -eq 1 ]' >"${stdoutF}" 2>"${stderrF}" ) - th_assertTrueWithNoOutput 'false condition' $? "${stdoutF}" "${stderrF}" - - ( assertFalse 0 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'true' $? "${stdoutF}" "${stderrF}" - - ( assertFalse '[ 0 -eq 0 ]' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'true condition' $? "${stdoutF}" "${stderrF}" - - ( assertFalse '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'true condition' $? "${stdoutF}" "${stderrF}" - - ( assertFalse >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( assertFalse arg1 arg2 arg3 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -oneTimeSetUp() { - th_oneTimeSetUp - - MSG='This is a test message' -} - -# Load and run shunit2. -# shellcheck disable=SC2034 -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. "${TH_SHUNIT}" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_failures_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_failures_test.sh deleted file mode 100755 index 97ade24..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_failures_test.sh +++ /dev/null @@ -1,82 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# shUnit2 unit test for failure functions -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the LGPL (GNU Lesser General Public License) -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -# Disable source following. -# shellcheck disable=SC1090,SC1091 - -# These variables will be overridden by the test helpers. -stdoutF="${TMPDIR:-/tmp}/STDOUT" -stderrF="${TMPDIR:-/tmp}/STDERR" - -# Load test helpers. -. ./shunit2_test_helpers - -testFail() { - ( fail >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'fail' $? "${stdoutF}" "${stderrF}" - - ( fail "${MSG}" >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'fail with msg' $? "${stdoutF}" "${stderrF}" - - ( fail arg1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testFailNotEquals() { - ( failNotEquals 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals "${MSG}" 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same with msg' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not same' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testFailSame() { - ( failSame 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same' $? "${stdoutF}" "${stderrF}" - - ( failSame "${MSG}" 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same with msg' $? "${stdoutF}" "${stderrF}" - - ( failSame 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not same' $? "${stdoutF}" "${stderrF}" - - ( failSame '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( failSame >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( failSame arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -oneTimeSetUp() { - th_oneTimeSetUp - - MSG='This is a test message' -} - -# Load and run shUnit2. -# shellcheck disable=SC2034 -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. "${TH_SHUNIT}" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_macros_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_macros_test.sh deleted file mode 100755 index bf1e468..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_macros_test.sh +++ /dev/null @@ -1,241 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# shunit2 unit test for macros. -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -### ShellCheck http://www.shellcheck.net/ -# Disable source following. -# shellcheck disable=SC1090,SC1091 -# Presence of LINENO variable is checked. -# shellcheck disable=SC2039 - -# These variables will be overridden by the test helpers. -stdoutF="${TMPDIR:-/tmp}/STDOUT" -stderrF="${TMPDIR:-/tmp}/STDERR" - -# Load test helpers. -. ./shunit2_test_helpers - -testAssertEquals() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_EQUALS_} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_EQUALS_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_EQUALS_} '"some msg"' 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_EQUALS_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testAssertNotEquals() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_NOT_EQUALS_} 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_EQUALS_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_NOT_EQUALS_} '"some msg"' 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_EQUALS_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testSame() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_SAME_} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_SAME_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_SAME_} '"some msg"' 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_SAME_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testNotSame() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_NOT_SAME_} 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_SAME_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_NOT_SAME_} '"some msg"' 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_SAME_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testNull() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_NULL_} 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NULL_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_NULL_} '"some msg"' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NULL_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testNotNull() -{ - # start skipping if LINENO not available - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_NOT_NULL_} '' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_NULL_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_NOT_NULL_} '"some msg"' '""' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_NOT_NULL_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stdoutF}" "${stderrF}" >&2 -} - -testAssertTrue() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_TRUE_} "${SHUNIT_FALSE}" >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_TRUE_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_TRUE_} '"some msg"' "${SHUNIT_FALSE}" >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_TRUE_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testAssertFalse() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_ASSERT_FALSE_} "${SHUNIT_TRUE}" >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_FALSE_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_ASSERT_FALSE_} '"some msg"' "${SHUNIT_TRUE}" >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_ASSERT_FALSE_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testFail() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_FAIL_} >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_FAIL_} '"some msg"' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testFailNotEquals() -{ - # start skipping if LINENO not available - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_FAIL_NOT_EQUALS_} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_NOT_EQUALS_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_FAIL_NOT_EQUALS_} '"some msg"' 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_NOT_EQUALS_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testFailSame() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_FAIL_SAME_} 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_SAME_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_FAIL_SAME_} '"some msg"' 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_SAME_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -testFailNotSame() { - # Start skipping if LINENO not available. - [ -z "${LINENO:-}" ] && startSkipping - - ( ${_FAIL_NOT_SAME_} 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_NOT_SAME_ failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 - - ( ${_FAIL_NOT_SAME_} '"some msg"' 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - grep '^ASSERT:\[[0-9]*\] *' "${stdoutF}" >/dev/null - rtrn=$? - assertTrue '_FAIL_NOT_SAME_ w/ msg failure' ${rtrn} - [ "${rtrn}" -ne "${SHUNIT_TRUE}" ] && cat "${stderrF}" >&2 -} - -oneTimeSetUp() { - th_oneTimeSetUp -} - -# Disable output coloring as it breaks the tests. -SHUNIT_COLOR='none'; export SHUNIT_COLOR - -# Load and run shUnit2. -# shellcheck disable=SC2034 -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT="$0" -. "${TH_SHUNIT}" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_misc_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_misc_test.sh deleted file mode 100755 index 6fa2de3..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_misc_test.sh +++ /dev/null @@ -1,262 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# shUnit2 unit tests of miscellaneous things -# -# Copyright 2008-2018 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -### ShellCheck http://www.shellcheck.net/ -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 -# Disable source following. -# shellcheck disable=SC1090,SC1091 -# Not wanting to escape single quotes. -# shellcheck disable=SC1003 - -# These variables will be overridden by the test helpers. -stdoutF="${TMPDIR:-/tmp}/STDOUT" -stderrF="${TMPDIR:-/tmp}/STDERR" - -# Load test helpers. -. ./shunit2_test_helpers - -# Note: the test script is prefixed with '#' chars so that shUnit2 does not -# incorrectly interpret the embedded functions as real functions. -testUnboundVariable() { - unittestF="${SHUNIT_TMPDIR}/unittest" - sed 's/^#//' >"${unittestF}" <"${stdoutF}" 2>"${stderrF}" ) - assertFalse 'expected a non-zero exit value' $? - grep '^ASSERT:Unknown failure' "${stdoutF}" >/dev/null - assertTrue 'assert message was not generated' $? - grep '^Ran [0-9]* test' "${stdoutF}" >/dev/null - assertTrue 'test count message was not generated' $? - grep '^FAILED' "${stdoutF}" >/dev/null - assertTrue 'failure message was not generated' $? -} - -# assertEquals repeats message argument. -# https://github.com/kward/shunit2/issues/7 -testIssue7() { - # Disable coloring so 'ASSERT:' lines can be matched correctly. - _shunit_configureColor 'none' - - ( assertEquals 'Some message.' 1 2 >"${stdoutF}" 2>"${stderrF}" ) - diff "${stdoutF}" - >/dev/null < but was:<2> -EOF - rtrn=$? - assertEquals "${SHUNIT_TRUE}" "${rtrn}" - [ "${rtrn}" -eq "${SHUNIT_TRUE}" ] || cat "${stderrF}" >&2 -} - -# Support prefixes on test output. -# https://github.com/kward/shunit2/issues/29 -testIssue29() { - unittestF="${SHUNIT_TMPDIR}/unittest" - sed 's/^#//' >"${unittestF}" <"${stdoutF}" 2>"${stderrF}" ) - grep '^--- test_assert' "${stdoutF}" >/dev/null - rtrn=$? - assertEquals "${SHUNIT_TRUE}" "${rtrn}" - [ "${rtrn}" -eq "${SHUNIT_TRUE}" ] || cat "${stdoutF}" >&2 -} - -# shUnit2 should not exit with 0 when it has syntax errors. -# https://github.com/kward/shunit2/issues/69 -testIssue69() { - unittestF="${SHUNIT_TMPDIR}/unittest" - - for t in Equals NotEquals Null NotNull Same NotSame True False; do - assert="assert${t}" - sed 's/^#//' >"${unittestF}" <"${stdoutF}" 2>"${stderrF}" ) - grep '^FAILED' "${stdoutF}" >/dev/null - assertTrue "failure message for ${assert} was not generated" $? - done -} - -# Ensure that test fails if setup/teardown functions fail. -testIssue77() { - unittestF="${SHUNIT_TMPDIR}/unittest" - for func in oneTimeSetUp setUp tearDown oneTimeTearDown; do - sed 's/^#//' >"${unittestF}" <"${stdoutF}" 2>"${stderrF}" ) - grep '^FAILED' "${stdoutF}" >/dev/null - assertTrue "failure of ${func}() did not end test" $? - done -} - -# Ensure a test failure is recorded for code containing syntax errors. -# https://github.com/kward/shunit2/issues/84 -testIssue84() { - unittestF="${SHUNIT_TMPDIR}/unittest" - sed 's/^#//' >"${unittestF}" <<\EOF -## Function with syntax error. -#syntax_error() { ${!#3442} -334 a$@2[1]; } -#test_syntax_error() { -# syntax_error -# assertTrue ${SHUNIT_TRUE} -#} -#SHUNIT_COLOR='none' -#SHUNIT_TEST_PREFIX='--- ' -#. ${TH_SHUNIT} -EOF - ( exec "${SHUNIT_SHELL:-sh}" "${unittestF}" >"${stdoutF}" 2>"${stderrF}" ) - grep '^FAILED' "${stdoutF}" >/dev/null - assertTrue "failure message for ${assert} was not generated" $? -} - -testPrepForSourcing() { - assertEquals '/abc' "`_shunit_prepForSourcing '/abc'`" - assertEquals './abc' "`_shunit_prepForSourcing './abc'`" - assertEquals './abc' "`_shunit_prepForSourcing 'abc'`" -} - -testEscapeCharInStr() { - while read -r desc char str want; do - got=`_shunit_escapeCharInStr "${char}" "${str}"` - assertEquals "${desc}" "${want}" "${got}" - done <<'EOF' -backslash \ '' '' -backslash_pre \ \def \\def -backslash_mid \ abc\def abc\\def -backslash_post \ abc\ abc\\ -quote " '' '' -quote_pre " "def \"def -quote_mid " abc"def abc\"def -quote_post " abc" abc\" -string $ '' '' -string_pre $ $def \$def -string_mid $ abc$def abc\$def -string_post $ abc$ abc\$ -EOF - - # TODO(20170924:kward) fix or remove. -# actual=`_shunit_escapeCharInStr "'" ''` -# assertEquals '' "${actual}" -# assertEquals "abc\\'" `_shunit_escapeCharInStr "'" "abc'"` -# assertEquals "abc\\'def" `_shunit_escapeCharInStr "'" "abc'def"` -# assertEquals "\\'def" `_shunit_escapeCharInStr "'" "'def"` - -# # Must put the backtick in a variable so the shell doesn't misinterpret it -# # while inside a backticked sequence (e.g. `echo '`'` would fail). -# backtick='`' -# actual=`_shunit_escapeCharInStr ${backtick} ''` -# assertEquals '' "${actual}" -# assertEquals '\`abc' \ -# `_shunit_escapeCharInStr "${backtick}" ${backtick}'abc'` -# assertEquals 'abc\`' \ -# `_shunit_escapeCharInStr "${backtick}" 'abc'${backtick}` -# assertEquals 'abc\`def' \ -# `_shunit_escapeCharInStr "${backtick}" 'abc'${backtick}'def'` -} - -testEscapeCharInStr_specialChars() { - # Make sure our forward slash doesn't upset sed. - assertEquals '/' "`_shunit_escapeCharInStr '\' '/'`" - - # Some shells escape these differently. - # TODO(20170924:kward) fix or remove. - #assertEquals '\\a' `_shunit_escapeCharInStr '\' '\a'` - #assertEquals '\\b' `_shunit_escapeCharInStr '\' '\b'` -} - -# Test the various ways of declaring functions. -# -# Prefixing (then stripping) with comment symbol so these functions aren't -# treated as real functions by shUnit2. -testExtractTestFunctions() { - f="${SHUNIT_TMPDIR}/extract_test_functions" - sed 's/^#//' <"${f}" -## Function on a single line. -#testABC() { echo 'ABC'; } -## Multi-line function with '{' on next line. -#test_def() -# { -# echo 'def' -#} -## Multi-line function with '{' on first line. -#testG3 () { -# echo 'G3' -#} -## Function with numerical values in name. -#function test4() { echo '4'; } -## Leading space in front of function. -# test5() { echo '5'; } -## Function with '_' chars in name. -#some_test_function() { echo 'some func'; } -## Function that sets variables. -#func_with_test_vars() { -# testVariable=1234 -#} -EOF - - actual=`_shunit_extractTestFunctions "${f}"` - assertEquals 'testABC test_def testG3 test4 test5' "${actual}" -} - -# Test that certain external commands sometimes "stubbed" by users -# are escaped. See Issue #54. -testProtectedCommands() { - for c in mkdir rm cat chmod; do - grep "^[^#]*${c} " "${TH_SHUNIT}" | grep -qv "command ${c}" - assertFalse "external call to ${c} not protected somewhere" $? - done - grep '^[^#]*[^ ] *\[' "${TH_SHUNIT}" | grep -qv 'command \[' - assertFalse "call to [ ... ] not protected somewhere" $? - grep '^[^#]* *\.' "${TH_SHUNIT}" | grep -qv 'command \.' - assertFalse "call to . not protected somewhere" $? -} - -setUp() { - for f in "${stdoutF}" "${stderrF}"; do - cp /dev/null "${f}" - done - - # Reconfigure coloring as some tests override default behavior. - _shunit_configureColor "${SHUNIT_COLOR_DEFAULT}" -} - -oneTimeSetUp() { - SHUNIT_COLOR_DEFAULT="${SHUNIT_COLOR}" - th_oneTimeSetUp -} - -# Load and run shUnit2. -# shellcheck disable=SC2034 -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. "${TH_SHUNIT}" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_standalone_test.sh b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_standalone_test.sh deleted file mode 100755 index 2109d8f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_standalone_test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# shUnit2 unit test for standalone operation. -# -# Copyright 2010-2017 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -# This unit test is purely to test that calling shunit2 directly, while passing -# the name of a unit test script, works. When run, this script determines if it -# is running as a standalone program, and calls main() if it is. -# -### ShellCheck http://www.shellcheck.net/ -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 -# Disable source following. -# shellcheck disable=SC1090,SC1091 - -ARGV0="`basename "$0"`" - -# Load test helpers. -. ./shunit2_test_helpers - -testStandalone() { - assertTrue "${SHUNIT_TRUE}" -} - -main() { - ${TH_SHUNIT} "${ARGV0}" -} - -# Are we running as a standalone? -if [ "${ARGV0}" = 'shunit2_test_standalone.sh' ]; then - if [ $# -gt 0 ]; then main "$@"; else main; fi -fi diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_test_helpers b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_test_helpers deleted file mode 100644 index 7ff4c9c..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/shunit2_test_helpers +++ /dev/null @@ -1,234 +0,0 @@ -# vim:et:ft=sh:sts=2:sw=2 -# -# shUnit2 unit test common functions -# -# Copyright 2008 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shunit2 -# -### ShellCheck (http://www.shellcheck.net/) -# Commands are purposely escaped so they can be mocked outside shUnit2. -# shellcheck disable=SC1001,SC1012 -# expr may be antiquated, but it is the only solution in some cases. -# shellcheck disable=SC2003 -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 - -# Treat unset variables as an error when performing parameter expansion. -set -u - -# Set shwordsplit for zsh. -\[ -n "${ZSH_VERSION:-}" ] && setopt shwordsplit - -# -# Constants. -# - -# Path to shUnit2 library. Can be overridden by setting SHUNIT_INC. -TH_SHUNIT=${SHUNIT_INC:-./shunit2}; export TH_SHUNIT - -# Configure debugging. Set the DEBUG environment variable to any -# non-empty value to enable debug output, or TRACE to enable trace -# output. -TRACE=${TRACE:+'th_trace '} -\[ -n "${TRACE}" ] && DEBUG=1 -\[ -z "${TRACE}" ] && TRACE=':' - -DEBUG=${DEBUG:+'th_debug '} -\[ -z "${DEBUG}" ] && DEBUG=':' - -# -# Variables. -# - -th_RANDOM=0 - -# -# Functions. -# - -# Logging functions. -th_trace() { echo "${MY_NAME}:TRACE $*" >&2; } -th_debug() { echo "${MY_NAME}:DEBUG $*" >&2; } -th_info() { echo "${MY_NAME}:INFO $*" >&2; } -th_warn() { echo "${MY_NAME}:WARN $*" >&2; } -th_error() { echo "${MY_NAME}:ERROR $*" >&2; } -th_fatal() { echo "${MY_NAME}:FATAL $*" >&2; } - -# Output subtest name. -th_subtest() { echo " $*" >&2; } - -th_oneTimeSetUp() { - # These files will be cleaned up automatically by shUnit2. - stdoutF="${SHUNIT_TMPDIR}/stdout" - stderrF="${SHUNIT_TMPDIR}/stderr" - returnF="${SHUNIT_TMPDIR}/return" - expectedF="${SHUNIT_TMPDIR}/expected" - export stdoutF stderrF returnF expectedF -} - -# Generate a random number. -th_generateRandom() { - tfgr_random=${th_RANDOM} - - while \[ "${tfgr_random}" = "${th_RANDOM}" ]; do - # shellcheck disable=SC2039 - if \[ -n "${RANDOM:-}" ]; then - # $RANDOM works - # shellcheck disable=SC2039 - tfgr_random=${RANDOM}${RANDOM}${RANDOM}$$ - elif \[ -r '/dev/urandom' ]; then - tfgr_random=`od -vAn -N4 -tu4 >> STDOUT' >&2 - \cat "${_th_stdout_}" >&2 - fi - if \[ -n "${_th_stderr_}" -a -s "${_th_stderr_}" ]; then - echo '>>> STDERR' >&2 - \cat "${_th_stderr_}" >&2 - fi - if \[ -n "${_th_stdout_}" -o -n "${_th_stderr_}" ]; then - echo '<<< end output' >&2 - fi - fi - - unset _th_return_ _th_stdout_ _th_stderr_ -} - -# -# Main. -# - -${TRACE} 'trace output enabled' -${DEBUG} 'debug output enabled' diff --git a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/test_runner b/.zprezto/modules/prompt/external/powerlevel9k/shunit2/test_runner deleted file mode 100755 index 415cc8b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/shunit2/test_runner +++ /dev/null @@ -1,165 +0,0 @@ -#! /bin/sh -# vim:et:ft=sh:sts=2:sw=2 -# -# Unit test suite runner. -# -# Copyright 2008-2017 Kate Ward. All Rights Reserved. -# Released under the Apache 2.0 license. -# -# Author: kate.ward@forestent.com (Kate Ward) -# https://github.com/kward/shlib -# -# This script runs all the unit tests that can be found, and generates a nice -# report of the tests. -# -### ShellCheck (http://www.shellcheck.net/) -# Disable source following. -# shellcheck disable=SC1090,SC1091 -# expr may be antiquated, but it is the only solution in some cases. -# shellcheck disable=SC2003 -# $() are not fully portable (POSIX != portable). -# shellcheck disable=SC2006 - -# Return if test_runner already loaded. -[ -z "${RUNNER_LOADED:-}" ] || return 0 -RUNNER_LOADED=0 - -RUNNER_ARGV0=`basename "$0"` -RUNNER_SHELLS='/bin/sh ash /bin/bash /bin/dash /bin/ksh /bin/pdksh /bin/zsh' -RUNNER_TEST_SUFFIX='_test.sh' - -runner_warn() { echo "runner:WARN $*" >&2; } -runner_error() { echo "runner:ERROR $*" >&2; } -runner_fatal() { echo "runner:FATAL $*" >&2; exit 1; } - -runner_usage() { - echo "usage: ${RUNNER_ARGV0} [-e key=val ...] [-s shell(s)] [-t test(s)]" -} - -_runner_tests() { echo ./*${RUNNER_TEST_SUFFIX} |sed 's#./##g'; } -_runner_testName() { - # shellcheck disable=SC1117 - _runner_testName_=`expr "${1:-}" : "\(.*\)${RUNNER_TEST_SUFFIX}"` - if [ -n "${_runner_testName_}" ]; then - echo "${_runner_testName_}" - else - echo 'unknown' - fi - unset _runner_testName_ -} - -main() { - # Find and load versions library. - for _runner_dir_ in . ${LIB_DIR:-lib}; do - if [ -r "${_runner_dir_}/versions" ]; then - _runner_lib_dir_="${_runner_dir_}" - break - fi - done - [ -n "${_runner_lib_dir_}" ] || runner_fatal 'Unable to find versions library.' - . "${_runner_lib_dir_}/versions" || runner_fatal 'Unable to load versions library.' - unset _runner_dir_ _runner_lib_dir_ - - # Process command line flags. - env='' - while getopts 'e:hs:t:' opt; do - case ${opt} in - e) # set an environment variable - key=`expr "${OPTARG}" : '\([^=]*\)='` - val=`expr "${OPTARG}" : '[^=]*=\(.*\)'` - # shellcheck disable=SC2166 - if [ -z "${key}" -o -z "${val}" ]; then - runner_usage - exit 1 - fi - eval "${key}='${val}'" - eval "export ${key}" - env="${env:+${env} }${key}" - ;; - h) runner_usage; exit 0 ;; # help output - s) shells=${OPTARG} ;; # list of shells to run - t) tests=${OPTARG} ;; # list of tests to run - *) runner_usage; exit 1 ;; - esac - done - shift "`expr ${OPTIND} - 1`" - - # Fill shells and/or tests. - shells=${shells:-${RUNNER_SHELLS}} - [ -z "${tests}" ] && tests=`_runner_tests` - - # Error checking. - if [ -z "${tests}" ]; then - runner_error 'no tests found to run; exiting' - exit 1 - fi - - cat <&1; ) - done - done -} - -# Execute main() if this is run in standalone mode (i.e. not from a unit test). -[ -z "${SHUNIT_VERSION}" ] && main "$@" diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/Vagrantfile b/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/Vagrantfile deleted file mode 100644 index 7df512a..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/Vagrantfile +++ /dev/null @@ -1,87 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure("2") do |config| - # The most common configuration options are documented and commented below. - # For a complete reference, please see the online documentation at - # https://docs.vagrantup.com. - - # Every Vagrant development environment requires a box. You can search for - # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "freebsd/FreeBSD-11.0-STABLE" - - # Bootstrap - config.vm.provision :shell, path: "bootstrap-zero.sh", privileged: true - config.vm.provision :shell, path: "bootstrap.sh", privileged: false - config.vm.provision :shell, path: "../test-vm-providers/plain.sh", privileged: false - - # Disable automatic box update checking. If you disable this, then - # boxes will only be checked for updates when the user runs - # `vagrant box outdated`. This is not recommended. - # config.vm.box_check_update = false - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - # config.vm.network "forwarded_port", guest: 80, host: 8080 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - #config.vm.network "public_network" - - # The BSD base box does not define a MAC address. Whysoever. - config.vm.base_mac = "8AAB4975994A" - - # There is no BASH for root on BSD. We need to set another shell. - # See https://www.freebsd.org/doc/en/articles/linux-users/shells.html - config.ssh.shell = "/bin/sh" - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder "..", "/vagrant_data", type: "nfs" - config.vm.synced_folder ".", "/vagrant", type: "nfs" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - config.vm.provider "virtualbox" do |vb| - - # Change name to "powerlevel9k-bsd" - vb.name = "powerlevel9k-bsd" - - # Display the VirtualBox GUI when booting the machine - #vb.gui = true - - # Customize the amount of memory on the VM: - vb.memory = "256" - end - - # View the documentation for the provider you are using for more - # information on available options. - - # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies - # such as FTP and Heroku are also available. See the documentation at - # https://docs.vagrantup.com/v2/push/atlas.html for more information. - # config.push.define "atlas" do |push| - # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" - # end - - # Enable provisioning with a shell script. Additional provisioners such as - # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the - # documentation for more information about their specific syntax and use. - # config.vm.provision "shell", inline: <<-SHELL - # apt-get update - # apt-get install -y apache2 - # SHELL -end diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap-zero.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap-zero.sh deleted file mode 100644 index 35dcd7f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap-zero.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -pkg install -y sudo \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap.sh deleted file mode 100644 index ba27ffb..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-bsd-vm/bootstrap.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Install ZSH -sudo pkg install -y zsh -sudo chsh -s `which zsh` vagrant -sudo ln -s /usr/local/bin/zsh /usr/bin/zsh - -# Install git -sudo pkg install -y git -# Install mercurial -sudo pkg install -y mercurial -# Install subversion -sudo pkg install -y subversion \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-in-docker b/.zprezto/modules/prompt/external/powerlevel9k/test-in-docker deleted file mode 100755 index 0ed1254..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-in-docker +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env zsh - -set -eu - -# The default ZSH to use; it can just be the first few characters. -# This should be the oldest version we support. -default_version='4.' - -setopt extended_glob glob_subst numeric_glob_sort -setopt warn_create_global warn_nested_var 2> /dev/null -cd "${${(%):-%x}:A:h}" - -# TODO: Crazy Logic to munge TERM to something supported in Ubuntu 14.04 -term=screen-256color - -# Note: If versions and frameworks looks complicated, it isn't that bad... -# ...see Modifiers in zshexpn(1) for details. - -# List of ZSH versions -typeset -aU versions -versions=( docker/base-*/Dockerfile(N.on:h:t:s/base-//) ) -typeset -r versions - -# List of frameworks -typeset -aU frameworks -frameworks=( docker/*/Dockerfile(N.on:h:t) ) -for i in {$#frameworks..1}; do - # Remove all base entries - [[ "${frameworks[$i]}" == base-* ]] && frameworks[$i]=() -done -typeset -r frameworks - -# Known Issues -typeset -A known_issues -known_issues["4.3.11-antigen"]="Antigen commands that need git won't work; it needs a newer version of git." -known_issues["4.3.11-zim"]="BROKEN: Zim wants ZSH 5.2 or newer." -known_issues["5.0.3-zim"]="DEPRECATED: Zim wants ZSH 5.2 or newer." -known_issues["5.1.1-zim"]="DEPRECATED: Zim wants ZSH 5.2 or newer." -known_issues["4.3.11-zulu"]="Zulu doesn't work; it needs a newer version of git." -typeset -r known_issues - -err() -{ - print -P "%F{red}Error:%f $*" - exit 2 -} - -resolve_framework() { - local f=$1 found - found=${frameworks[(In:-1:)$f*]} - if (( found <= $#frameworks )); then - echo "${frameworks[$found]}" - fi -} - -resolve_version() { - local v=$1 found - found=${versions[(In:-1:)$v*]} - if (( found <= $#versions )); then - echo "${versions[$found]}" - fi -} - -check_for_known_issues() { - local version="$1" - local framework="$2" - local name="${version}-${framework}" - - if (( ${+known_issues["$name"]} )); then - echo - print -P "%F{red}Known Issue: %F{yellow}${known_issues["$name"]}%f" - echo - fi -} - -cmd() { - if (( dry_run )); then - echo "${(@q)*}" 1>&2 - else - "${(@)*}" - fi -} - -build_and_run() { - local version="$1" - local framework="$2" - local name="${version}-${framework}" - - check_for_known_issues "$version" "$framework" - - print -P "%F{green}Preparing containers...%f" - - echo -n "p9k:base-${version}: " - cmd docker build \ - --quiet \ - --tag "p9k:base-${version}" \ - --file "docker/base-${version}/Dockerfile" \ - . - - echo -n "p9k:${version}-${framework}: " - cmd docker build \ - --quiet \ - --build-arg="base=base-${version}" \ - --tag "p9k:${version}-${framework}" \ - --file "docker/${framework}/Dockerfile" \ - . - - print -P "%F{green}Starting ${name} container...%f" - cmd docker run \ - --rm \ - --interactive \ - --tty \ - --hostname="${name//./_}" \ - --env="TERM=${term}" \ - "p9k:${version}-${framework}" -} - -show_help() { - local f v - echo "Usage: ${(%):-%x} |--list" - echo - echo "Loads up a docker image with powershell9k configured in " - echo - echo " -f --frameworks Lists all available frameworks, newline separated." - echo " -v --versions Lists all available ZSH versions, newline separated." - echo " -z --zsh VER Uses ZSH with version VER." - echo " -n --dry-run Just prints the docker commands that would be run." - echo " --help You're soaking in it." - echo - echo "ZSH versions:" - for v in "${(@)versions}"; do - echo " $v" - done - echo - echo "Framework containers:" - for f in "${(@)frameworks}"; do - echo " $f" - done -} - -# No arguments -if (( $# == 0 )); then - show_help - exit -fi - -# Parse flags and such. -asked_for_version=$default_version -asked_for_framework= -dry_run=0 -while (( $# > 0 )); do - case "$1" in - -f | --frameworks ) - print -l "${(@)frameworks}" - exit - ;; - -v | --versions ) - print -l "${(@)versions}" - exit - ;; - -z | --zsh ) - shift - asked_for_version=$1 - ;; - -n | --dry-run ) dry_run=1 ;; - -h | --help ) - show_help - exit - ;;; - -* ) - err "Unknown option ${1}" - show_help - exit 1 - ;; - * ) - if [[ -z "$asked_for_framework" ]]; then - asked_for_framework=$1 - else - err "You can only specify one framework at a time; you already specified '${asked_for_framework}'" - fi - ;; - esac - shift -done - -typeset -r asked_for_version asked_for_framework - -typeset -r use_version="$(resolve_version "${asked_for_version}")" -if [[ -z "$use_version" ]]; then - err "No such ZSH version '${asked_for_version}'" -fi - -typeset -r use_framework="$(resolve_framework "${asked_for_framework}")" -if [[ -z "$use_framework" ]]; then - err "No such framework '${asked_for_framework}'" -fi - -build_and_run "$use_version" "$use_framework" - -# EOF diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/plain.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/plain.sh deleted file mode 100644 index b827a0c..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/plain.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/zsh - -echo 'LANG=en_US.UTF-8' >! ~/.zshrc -echo 'source /vagrant_data/powerlevel9k.zsh-theme' >> ~/.zshrc - -echo 'echo "Have a look at the ~/p9k folder for prepared test setups."' >> ~/.zshrc - -# setup environment -/vagrant_data/test-vm-providers/setup-environment.sh \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/setup-environment.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/setup-environment.sh deleted file mode 100755 index 0e8beb6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm-providers/setup-environment.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/zsh - -OLDPWD="$(pwd)" -cd $HOME - -TESTFOLDER="${HOME}/p9k" -mkdir -p $TESTFOLDER -cd $TESTFOLDER - -# Make a deep test folder -mkdir -p deep-folder/1/12/123/1234/12345/123456/1234567/123455678/123456789 - -# Make a git repo -mkdir git-repo -cd git-repo -git config --global user.email "test@powerlevel9k.theme" -git config --global user.name "Testing Tester" -git init -echo "TEST" >> testfile -git add testfile -git commit -m "Initial commit" -cd $TESTFOLDER - -# Make a Mercurial repo -mkdir hg-repo -cd hg-repo -export HGUSER="Test bot " -hg init -echo "TEST" >> testfile -hg add testfile -hg ci -m "Initial commit" -cd $TESTFOLDER - -# Setup a SVN folder -svnadmin create ~/.svn-repo -mkdir svn-repo -svn checkout "file://${HOME}/.svn-repo" "svn-repo" -cd svn-repo -echo "TEST" >> testfile -svn add testfile -svn commit -m "Initial commit" -cd $TESTFOLDER - -cd $OLDPWD \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/README.md b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/README.md deleted file mode 100644 index 9f0861e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Test-VM for powerlevel9k - -In this virtual machine you will find a recent ubuntu with preinstalled ZSH, oh-my-zsh, antigen, prezto and - of course - powerlevel9k. The main use-case is to test the powerlevel9k theme. - -## Installation - -In order to run this virtual machine, you need [vagrant](https://www.vagrantup.com/) and [VirtualBox](http://www.virtualbox.org/). - -## Running - -`vagrant` is a quite easy to use command line tool to configure a virtual machine. To fire the machine up, just run `vagrant up`. At the first run, it will install a whole ubuntu. With `vagrant ssh` you can log in into the machine. - -## Testing - -Once you have SSH'd into the machine, you'll see a plain ZSH. To test the other frameworks, you just have to switch to one of the following users: - - * `vagrant-antigen` - * `vagrant-prezto` - * `vagrant-omz` - -To switch use `sudo -i -H -u `. `-i` stands for "simulate initial login", `-H` sets the "$HOME" variable to the directory of the user , `-u` for the username. - -All users have `vagrant` as password and are in the /etc/sudoers. - -The regular `vagrant` user has a plain ZSH with the powerlevel9k theme. diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/Vagrantfile b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/Vagrantfile deleted file mode 100644 index a421c70..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/Vagrantfile +++ /dev/null @@ -1,82 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure(2) do |config| - # The most common configuration options are documented and commented below. - # For a complete reference, please see the online documentation at - # https://docs.vagrantup.com. - - # Every Vagrant development environment requires a box. You can search for - # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "ubuntu/precise64" - - # Bootstrap - config.vm.provision :shell, path: "bootstrap.sh", privileged: false - config.vm.provision :shell, path: "../test-vm-providers/plain.sh", privileged: false - config.vm.provision :shell, path: "antigen.sh" - config.vm.provision :shell, path: "prezto.sh" - config.vm.provision :shell, path: "omz.sh" - - # Disable automatic box update checking. If you disable this, then - # boxes will only be checked for updates when the user runs - # `vagrant box outdated`. This is not recommended. - # config.vm.box_check_update = false - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - # config.vm.network "forwarded_port", guest: 80, host: 8080 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network "public_network" - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder "..", "/vagrant_data" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - - config.vm.provider "virtualbox" do |vb| - - # Change name to "powerlevel9k" - vb.name = "powerlevel9k" - - # Display the VirtualBox GUI when booting the machine - #vb.gui = true - - # Customize the amount of memory on the VM: - vb.memory = "256" - end - # - # View the documentation for the provider you are using for more - # information on available options. - - # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies - # such as FTP and Heroku are also available. See the documentation at - # https://docs.vagrantup.com/v2/push/atlas.html for more information. - # config.push.define "atlas" do |push| - # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" - # end - - # Enable provisioning with a shell script. Additional provisioners such as - # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the - # documentation for more information about their specific syntax and use. - # config.vm.provision "shell", inline: <<-SHELL - # sudo apt-get update - # sudo apt-get install -y apache2 - # SHELL -end diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/antigen.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/antigen.sh deleted file mode 100644 index 2c56332..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/antigen.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/zsh -# We need to run this script in ZSH, so that switching user works! -NEW_USER=vagrant-antigen -# Create User -PASSWORD='$6$OgLg9v2Z$Db38Jr9inZG7y8BzL8kqFK23fF5jZ7FU1oiIBLFjNYR9XVX03fwQayMgA6Rm1rzLbXaf.gkZaTWhB9pv5XLq11' -useradd -p $PASSWORD -g vagrant -s $(which zsh) -m $NEW_USER -echo "$NEW_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$NEW_USER -chmod 440 /etc/sudoers.d/$NEW_USER - -( - # Change User (See http://unix.stackexchange.com/questions/86778/why-cant-we-execute-a-list-of-commands-as-different-user-without-sudo) - USERNAME=$NEW_USER - #UID=$(id -u $NEW_USER) - #EUID=$(id -u $NEW_USER) - HOME=/home/$NEW_USER - - echo " -source ~/antigen/antigen.zsh\n -antigen theme /vagrant_data powerlevel9k --no-local-clone\n -antigen apply -" > ~/.zshrc - - # install antigen - mkdir ~/antigen - curl -qL https://raw.githubusercontent.com/zsh-users/antigen/master/antigen.zsh > ~/antigen/antigen.zsh - source ~/antigen/antigen.zsh - - # setup environment - /vagrant_data/test-vm-providers/setup-environment.sh -) diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/bootstrap.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/bootstrap.sh deleted file mode 100644 index f680d4b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/bootstrap.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -#sudo apt-get update - -sudo apt-get install -y curl -sudo apt-get install -y git - -sudo apt-get install -y zsh -sudo chsh -s $(which zsh) vagrant - -# Install mercurial -sudo apt-get install -y mercurial -# Install Subversion -sudo apt-get install -y subversion -# install golang -echo 'golang-go golang-go/dashboard boolean false' | sudo debconf-set-selections -sudo apt-get install -y golang -# Install dependencies for tests -sudo apt-get install -y jq node ruby python python-virtualenv \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/omz.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/omz.sh deleted file mode 100644 index 73b659f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/omz.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/zsh -# We need to run this script in ZSH, so that switching user works! -NEW_USER=vagrant-omz -# Create User -PASSWORD='$6$OgLg9v2Z$Db38Jr9inZG7y8BzL8kqFK23fF5jZ7FU1oiIBLFjNYR9XVX03fwQayMgA6Rm1rzLbXaf.gkZaTWhB9pv5XLq11' -useradd -p $PASSWORD -g vagrant -s $(which zsh) -m $NEW_USER -echo "$NEW_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$NEW_USER -chmod 440 /etc/sudoers.d/$NEW_USER - -( - # Change User (See http://unix.stackexchange.com/questions/86778/why-cant-we-execute-a-list-of-commands-as-different-user-without-sudo) - USERNAME=$NEW_USER - #UID=$(id -u $NEW_USER) - #EUID=$(id -u $NEW_USER) - HOME=/home/$NEW_USER - SHELL=$(which zsh) - - sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - - mkdir -p ~/.oh-my-zsh/custom/themes - ln -s /vagrant_data ~/.oh-my-zsh/custom/themes/powerlevel9k - - echo ' -export ZSH=$HOME/.oh-my-zsh -ZSH_THEME="powerlevel9k/powerlevel9k" -plugins=(git rake ruby) - -source $ZSH/oh-my-zsh.sh -' > $HOME/.zshrc - - # setup environment - /vagrant_data/test-vm-providers/setup-environment.sh -) diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/prezto.sh b/.zprezto/modules/prompt/external/powerlevel9k/test-vm/prezto.sh deleted file mode 100644 index 3ac3850..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test-vm/prezto.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/zsh -# We need to run this script in ZSH, so that switching user works! -NEW_USER=vagrant-prezto -# Create User -PASSWORD='$6$OgLg9v2Z$Db38Jr9inZG7y8BzL8kqFK23fF5jZ7FU1oiIBLFjNYR9XVX03fwQayMgA6Rm1rzLbXaf.gkZaTWhB9pv5XLq11' -useradd -p $PASSWORD -g vagrant -s $(which zsh) -m $NEW_USER -echo "$NEW_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$NEW_USER -chmod 440 /etc/sudoers.d/$NEW_USER - -( - # Change User (See http://unix.stackexchange.com/questions/86778/why-cant-we-execute-a-list-of-commands-as-different-user-without-sudo) - USERNAME=$NEW_USER - #UID=$(id -u $NEW_USER) - #EUID=$(id -u $NEW_USER) - HOME=/home/$NEW_USER - - git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" - - setopt EXTENDED_GLOB - for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" - done - - ln -s /vagrant_data/powerlevel9k.zsh-theme ~/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup - sed -i "s/theme\ 'sorin'/theme\ 'powerlevel9k'/g" ~/.zpreztorc - - # setup environment - /vagrant_data/test-vm-providers/setup-environment.sh -) diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/core/color_overriding.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/core/color_overriding.spec deleted file mode 100755 index f2c3d89..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/core/color_overriding.spec +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme -} - -function testDynamicColoringOfSegmentsWork() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(date) - local POWERLEVEL9K_DATE_ICON="date-icon" - local POWERLEVEL9K_DATE_BACKGROUND='red' - - assertEquals "%K{001} %F{000}date-icon %f%F{000}%D{%d.%m.%y} %k%F{001}%f " "$(build_left_prompt)" -} - -function testDynamicColoringOfVisualIdentifiersWork() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(date) - local POWERLEVEL9K_DATE_ICON="date-icon" - local POWERLEVEL9K_DATE_VISUAL_IDENTIFIER_COLOR='green' - - assertEquals "%K{007} %F{002}date-icon %f%F{000}%D{%d.%m.%y} %k%F{007}%f " "$(build_left_prompt)" -} - -function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(date) - local POWERLEVEL9K_DATE_ICON="date-icon" - local POWERLEVEL9K_DATE_VISUAL_IDENTIFIER_COLOR='green' - local POWERLEVEL9K_DATE_FOREGROUND='red' - local POWERLEVEL9K_DATE_BACKGROUND='yellow' - - assertEquals "%K{003} %F{002}date-icon %f%F{001}%D{%d.%m.%y} %k%F{003}%f " "$(build_left_prompt)" -} - -function testColorOverridingOfStatefulSegment() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(host) - local POWERLEVEL9K_SSH_ICON="ssh-icon" - local POWERLEVEL9K_HOST_REMOTE_BACKGROUND='red' - local POWERLEVEL9K_HOST_REMOTE_FOREGROUND='green' - # Provoke state - local SSH_CLIENT="x" - - assertEquals "%K{001} %F{002}ssh-icon %f%F{002}%m %k%F{001}%f " "$(build_left_prompt)" -} - -function testColorOverridingOfCustomSegment() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_CUSTOM_WORLD_ICON='CW' - local POWERLEVEL9K_CUSTOM_WORLD_VISUAL_IDENTIFIER_COLOR='green' - local POWERLEVEL9K_CUSTOM_WORLD_FOREGROUND='red' - local POWERLEVEL9K_CUSTOM_WORLD_BACKGROUND='red' - - assertEquals "%K{001} %F{002}CW %f%F{001}world %k%F{001}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/core/joining_segments.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/core/joining_segments.spec deleted file mode 100755 index 18213a5..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/core/joining_segments.spec +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme -} - -function testLeftNormalSegmentsShouldNotBeJoined() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3 custom_world4_joined custom_world5 custom_world6) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD6="echo world6" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000} %F{000}world2 %K{007}%F{000} %F{000}world4 %K{007}%F{000} %F{000}world6 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftJoinedSegments() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000}%F{000}world2 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftTransitiveJoinedSegments() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined custom_world3_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo world3" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000}%F{000}world2 %K{007}%F{000}%F{000}world3 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftTransitiveJoiningWithConditionalJoinedSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined custom_world3_joined custom_world4_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000}%F{000}world2 %K{007}%F{000}%F{000}world4 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftPromotingSegmentWithConditionalPredecessor() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo world3" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000} %F{000}world3 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftPromotingSegmentWithJoinedConditionalPredecessor() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined custom_world4_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000} %F{000}world4 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftPromotingSegmentWithDeepJoinedConditionalPredecessor() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined custom_world4_joined custom_world5_joined custom_world6_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD6="echo world6" - - assertEquals "%K{007} %F{000}world1 %K{007}%F{000} %F{000}world4 %K{007}%F{000}%F{000}world6 %k%F{007}%f " "$(build_left_prompt)" -} - -function testLeftJoiningBuiltinSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(php_version php_version_joined) - alias php="echo PHP 1.2.3" - - assertEquals "%K{013} %F{255}PHP 1.2.3 %K{013}%F{255}%F{255}PHP 1.2.3 %k%F{013}%f " "$(build_left_prompt)" - - unalias php -} - -function testRightNormalSegmentsShouldNotBeJoined() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3 custom_world4 custom_world5_joined custom_world6) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD6="echo world6" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%F{000}%f%K{007}%F{000} world2 %f%F{000}%f%K{007}%F{000} world4 %f%F{000}%f%K{007}%F{000} world6%E" "$(build_right_prompt)" -} - -function testRightJoinedSegments() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%K{007}%F{000}world2%E" "$(build_right_prompt)" -} - -function testRightTransitiveJoinedSegments() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined custom_world3_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo world3" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%K{007}%F{000}world2 %f%K{007}%F{000}world3%E" "$(build_right_prompt)" -} - -function testRightTransitiveJoiningWithConditionalJoinedSegment() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2_joined custom_world3_joined custom_world4_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%K{007}%F{000}world2 %f%K{007}%F{000}world4%E" "$(build_right_prompt)" -} - -function testRightPromotingSegmentWithConditionalPredecessor() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo world3" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%F{000}%f%K{007}%F{000} world3%E" "$(build_right_prompt)" -} - -function testRightPromotingSegmentWithJoinedConditionalPredecessor() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined custom_world4_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%F{000}%f%K{007}%F{000} world4%E" "$(build_right_prompt)" -} - -function testRightPromotingSegmentWithDeepJoinedConditionalPredecessor() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2 custom_world3_joined custom_world4_joined custom_world5_joined custom_world6_joined) - local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" - local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD4="echo world4" - local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions - local POWERLEVEL9K_CUSTOM_WORLD6="echo world6" - - assertEquals "%F{007}%f%K{007}%F{000} world1 %f%F{000}%f%K{007}%F{000} world4 %f%K{007}%F{000}world6%E" "$(build_right_prompt)" -} - -function testRightJoiningBuiltinSegmentWorks() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(php_version php_version_joined) - alias php="echo PHP 1.2.3" - - assertEquals "%F{013}%f%K{013}%F{255} PHP 1.2.3 %f%K{013}%F{255}PHP 1.2.3%E" "$(build_right_prompt)" - - unalias php -} -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/core/prompt.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/core/prompt.spec deleted file mode 100755 index 47d3ac7..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/core/prompt.spec +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme -} - -function testSegmentOnRightSide() { - # Reset RPROMPT, so a running P9K does not interfere with the test - local RPROMPT= - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD2='echo world2' - - powerlevel9k_prepare_prompts - - local reset_attributes=$'\e[00m' - assertEquals "%f%b%k%F{007}%f%K{007}%F{000} world1 %f%F{000}%f%K{007}%F{000} world2%E%{${reset_attributes}%}" "${(e)RPROMPT}" -} - -function testDisablingRightPrompt() { - # Reset RPROMPT, so a running P9K does not interfere with the test - local RPROMPT= - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1 custom_world2) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD2='echo world2' - local POWERLEVEL9K_DISABLE_RPROMPT=true - - powerlevel9k_prepare_prompts - - assertEquals "" "${(e)RPROMPT}" -} - -function testLeftMultilinePrompt() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_PROMPT_ON_NEWLINE=true - - powerlevel9k_prepare_prompts - - local nl=$'\n' - assertEquals "╭─%f%b%k%K{007} %F{000}world1 %k%F{007}%f ${nl}╰─ " "${(e)PROMPT}" -} - -function testRightPromptOnSameLine() { - # Reset RPROMPT, so a running P9K does not interfere with the test - local RPROMPT= - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - - local POWERLEVEL9K_PROMPT_ON_NEWLINE=true - local POWERLEVEL9K_RPROMPT_ON_NEWLINE=false # We want the RPROMPT on the same line as our left prompt - - # Skip test, as this cannot be tested properly. - # The "go one line up" instruction does not get - # printed as real characters in RPROMPT. - # On command line the assert statement produces - # a visually identical output as we expect, but - # it fails anyway. :( - startSkipping - - powerlevel9k_prepare_prompts - assertEquals "%{\e[1A%}%F{007}%f%K{007}%F{000} world1 %f%{\e[1B%}" "${(e)RPROMPT}" -} - -function testPrefixingFirstLineOnLeftPrompt() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - - local POWERLEVEL9K_PROMPT_ON_NEWLINE=true - local POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='XXX' - - powerlevel9k_prepare_prompts - - local nl=$'\n' - assertEquals "XXX%f%b%k%K{007} %F{000}world1 %k%F{007}%f ${nl}╰─ " "${(e)PROMPT}" -} - -function testPrefixingSecondLineOnLeftPrompt() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - - local POWERLEVEL9K_PROMPT_ON_NEWLINE=true - local POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='XXX' - - powerlevel9k_prepare_prompts - - local nl=$'\n' - assertEquals "╭─%f%b%k%K{007} %F{000}world1 %k%F{007}%f ${nl}XXX" "${(e)PROMPT}" -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/core/visual_identifier.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/core/visual_identifier.spec deleted file mode 100755 index c6c6bef..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/core/visual_identifier.spec +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme - source functions/* -} - -function testOverwritingIconsWork() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - - assertEquals "%K{007} %F{000}icon-here %f%F{000}world1 %k%F{007}%f " "$(build_left_prompt)" -} - -function testVisualIdentifierAppearsBeforeSegmentContentOnLeftSegments() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - - assertEquals "%K{007} %F{000}icon-here %f%F{000}world1 %k%F{007}%f " "$(build_left_prompt)" -} - -function testVisualIdentifierAppearsAfterSegmentContentOnRightSegments() { - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - - assertEquals "%F{007}%f%K{007}%F{000} world1%F{000} icon-here%f%E" "$(build_right_prompt)" -} - -function testVisualIdentifierPrintsNothingIfNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - - assertEquals "%K{007} %F{000}world1 %k%F{007}%f " "$(build_left_prompt)" -} - -function testVisualIdentifierIsPrintedInNumericalColorCode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) - local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' - local POWERLEVEL9K_CUSTOM_WORLD1_ICON="xxx" - local POWERLEVEL9K_CUSTOM_WORLD1_VISUAL_IDENTIFIER_COLOR="purple3" - - assertEquals "%K{007} %F{056}xxx %f%F{000}world1 %k%F{007}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/colors.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/functions/colors.spec deleted file mode 100755 index 4ee7120..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/colors.spec +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - # Load Powerlevel9k - source functions/colors.zsh -} - -function testGetColorCodeWithAnsiForegroundColor() { - assertEquals '002' "$(getColorCode 'green')" -} - -function testGetColorCodeWithAnsiBackgroundColor() { - assertEquals '002' "$(getColorCode 'bg-green')" -} - -function testGetColorCodeWithNumericalColor() { - assertEquals '002' "$(getColorCode '002')" -} - -function testGetColorCodeWithNoneColor() { - assertEquals 'none' "$(getColorCode 'NONE')" -} - -function testIsSameColorComparesAnsiForegroundAndNumericalColorCorrectly() { - assertTrue "isSameColor 'green' '002'" -} - -function testIsSameColorComparesAnsiBackgroundAndNumericalColorCorrectly() { - assertTrue "isSameColor 'bg-green' '002'" -} - -function testIsSameColorComparesShortCodesCorrectly() { - assertTrue "isSameColor '002' '2'" -} - -function testIsSameColorDoesNotYieldNotEqualColorsTruthy() { - assertFalse "isSameColor 'green' '003'" -} - -function testIsSameColorHandlesNoneCorrectly() { - assertTrue "isSameColor 'none' 'NOnE'" -} - -function testIsSameColorCompareTwoNoneColorsCorrectly() { - assertTrue "isSameColor 'none' 'none'" -} - -function testIsSameColorComparesColorWithNoneCorrectly() { - assertFalse "isSameColor 'green' 'none'" -} - -function testBrightColorsWork() { - # We had some code in the past that equalized bright colors - # with normal ones. This code is now gone, and this test should - # ensure that all input channels for bright colors are handled - # correctly. - assertTrue "isSameColor 'cyan' '006'" - assertEquals '006' "$(getColorCode 'cyan')" - assertEquals '006' "$(getColor 'cyan')" -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/icons.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/functions/icons.spec deleted file mode 100755 index ec0cb1f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/icons.spec +++ /dev/null @@ -1,473 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - # Store old value for LC_CTYPE - _OLD_LC_CTYPE="${LC_CTYPE}" - # Reset actual LC_CTYPE - unset LC_CTYPE -} - -function tearDown() { - # Restore LC_CTYPE - LC_CTYPE="${_OLD_LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInDefaultMode() { - local POWERLEVEL9K_MODE="default" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInAwesomePatchedMode() { - local POWERLEVEL9K_MODE="awesome-patched" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInAwesomeFontconfigMode() { - local POWERLEVEL9K_MODE="awesome-fontconfig" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInNerdfontFontconfigMode() { - local POWERLEVEL9K_MODE="nerdfont-fontconfig" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInFlatMode() { - local POWERLEVEL9K_MODE="flat" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -function testLcCtypeIsSetCorrectlyInCompatibleMode() { - local POWERLEVEL9K_MODE="compatible" - # Load Powerlevel9k - source functions/icons.zsh - - assertEquals 'en_US.UTF-8' "${LC_CTYPE}" -} - -# Go through all icons defined in default mode, and -# check if all of them are defined in the other modes. -function testAllIconsAreDefinedLikeInDefaultMode() { - # Always compare against this mode - local _P9K_TEST_MODE="default" - local POWERLEVEL9K_MODE="${_P9K_TEST_MODE}" - source functions/icons.zsh - # _ICONS_UNDER_TEST is an array of just the keys of $icons. - # We later check via (r) "subscript" flag that our key - # is in the values of our flat array. - typeset -ah _ICONS_UNDER_TEST - _ICONS_UNDER_TEST=(${(k)icons[@]}) - - # Switch to "awesome-patched" mode - POWERLEVEL9K_MODE="awesome-patched" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - # Iterate over all keys found in the _ICONS_UNDER_TEST - # array and compare it with the icons array of the - # current POWERLEVEL9K_MODE. - # Use parameter expansion, to directly check if the - # key exists in the flat current array of keys. That - # is quite complicated, but there seems no easy way - # to check the mere existance of a key in an array. - # The usual way would always return the value, so that - # would do the wrong thing as we have some (on purpose) - # empty values. - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-fontconfig" mode - POWERLEVEL9K_MODE="awesome-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-fontconfig" mode - POWERLEVEL9K_MODE="nerdfont-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-complete" mode - POWERLEVEL9K_MODE="nerdfont-complete" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "flat" mode - POWERLEVEL9K_MODE="flat" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "compatible" mode - POWERLEVEL9K_MODE="compatible" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - unset current_icons - unset _ICONS_UNDER_TEST -} - -# Go through all icons defined in awesome-patched mode, and -# check if all of them are defined in the other modes. -function testAllIconsAreDefinedLikeInAwesomePatchedMode() { - # Always compare against this mode - local _P9K_TEST_MODE="awesome-patched" - local POWERLEVEL9K_MODE="$_P9K_TEST_MODE" - source functions/icons.zsh - # _ICONS_UNDER_TEST is an array of just the keys of $icons. - # We later check via (r) "subscript" flag that our key - # is in the values of our flat array. - typeset -ah _ICONS_UNDER_TEST - _ICONS_UNDER_TEST=(${(k)icons[@]}) - - # Switch to "default" mode - POWERLEVEL9K_MODE="default" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - # Iterate over all keys found in the _ICONS_UNDER_TEST - # array and compare it with the icons array of the - # current POWERLEVEL9K_MODE. - # Use parameter expansion, to directly check if the - # key exists in the flat current array of keys. That - # is quite complicated, but there seems no easy way - # to check the mere existance of a key in an array. - # The usual way would always return the value, so that - # would do the wrong thing as we have some (on purpose) - # empty values. - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-fontconfig" mode - POWERLEVEL9K_MODE="awesome-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-fontconfig" mode - POWERLEVEL9K_MODE="nerdfont-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-complete" mode - POWERLEVEL9K_MODE="nerdfont-complete" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "flat" mode - POWERLEVEL9K_MODE="flat" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "compatible" mode - POWERLEVEL9K_MODE="compatible" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - unset current_icons - unset _ICONS_UNDER_TEST -} - -# Go through all icons defined in awesome-fontconfig mode, and -# check if all of them are defined in the other modes. -function testAllIconsAreDefinedLikeInAwesomeFontconfigMode() { - # Always compare against this mode - local _P9K_TEST_MODE="awesome-fontconfig" - local POWERLEVEL9K_MODE="$_P9K_TEST_MODE" - source functions/icons.zsh - # _ICONS_UNDER_TEST is an array of just the keys of $icons. - # We later check via (r) "subscript" flag that our key - # is in the values of our flat array. - typeset -ah _ICONS_UNDER_TEST - _ICONS_UNDER_TEST=(${(k)icons[@]}) - - # Switch to "default" mode - POWERLEVEL9K_MODE="default" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - # Iterate over all keys found in the _ICONS_UNDER_TEST - # array and compare it with the icons array of the - # current POWERLEVEL9K_MODE. - # Use parameter expansion, to directly check if the - # key exists in the flat current array of keys. That - # is quite complicated, but there seems no easy way - # to check the mere existance of a key in an array. - # The usual way would always return the value, so that - # would do the wrong thing as we have some (on purpose) - # empty values. - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-patched" mode - POWERLEVEL9K_MODE="awesome-patched" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-fontconfig" mode - POWERLEVEL9K_MODE="nerdfont-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-complete" mode - POWERLEVEL9K_MODE="nerdfont-complete" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "flat" mode - POWERLEVEL9K_MODE="flat" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "compatible" mode - POWERLEVEL9K_MODE="compatible" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - unset current_icons - unset _ICONS_UNDER_TEST -} - -# Go through all icons defined in nerdfont-fontconfig mode, and -# check if all of them are defined in the other modes. -function testAllIconsAreDefinedLikeInNerdfontFontconfigMode() { - # Always compare against this mode - local _P9K_TEST_MODE="nerdfont-fontconfig" - local POWERLEVEL9K_MODE="$_P9K_TEST_MODE" - source functions/icons.zsh - # _ICONS_UNDER_TEST is an array of just the keys of $icons. - # We later check via (r) "subscript" flag that our key - # is in the values of our flat array. - typeset -ah _ICONS_UNDER_TEST - _ICONS_UNDER_TEST=(${(k)icons[@]}) - - # Switch to "default" mode - POWERLEVEL9K_MODE="default" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - # Iterate over all keys found in the _ICONS_UNDER_TEST - # array and compare it with the icons array of the - # current POWERLEVEL9K_MODE. - # Use parameter expansion, to directly check if the - # key exists in the flat current array of keys. That - # is quite complicated, but there seems no easy way - # to check the mere existance of a key in an array. - # The usual way would always return the value, so that - # would do the wrong thing as we have some (on purpose) - # empty values. - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-patched" mode - POWERLEVEL9K_MODE="awesome-patched" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-fontconfig" mode - POWERLEVEL9K_MODE="awesome-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-complete" mode - POWERLEVEL9K_MODE="nerdfont-complete" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "flat" mode - POWERLEVEL9K_MODE="flat" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "compatible" mode - POWERLEVEL9K_MODE="compatible" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - unset current_icons - unset _ICONS_UNDER_TEST -} - -# Go through all icons defined in nerdfont-complete mode, and -# check if all of them are defined in the other modes. -function testAllIconsAreDefinedLikeInNerdfontCompleteMode() { - # Always compare against this mode - local _P9K_TEST_MODE="nerdfont-complete" - local POWERLEVEL9K_MODE="$_P9K_TEST_MODE" - source functions/icons.zsh - # _ICONS_UNDER_TEST is an array of just the keys of $icons. - # We later check via (r) "subscript" flag that our key - # is in the values of our flat array. - typeset -ah _ICONS_UNDER_TEST - _ICONS_UNDER_TEST=(${(k)icons[@]}) - - # Switch to "default" mode - POWERLEVEL9K_MODE="default" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - # Iterate over all keys found in the _ICONS_UNDER_TEST - # array and compare it with the icons array of the - # current POWERLEVEL9K_MODE. - # Use parameter expansion, to directly check if the - # key exists in the flat current array of keys. That - # is quite complicated, but there seems no easy way - # to check the mere existance of a key in an array. - # The usual way would always return the value, so that - # would do the wrong thing as we have some (on purpose) - # empty values. - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-patched" mode - POWERLEVEL9K_MODE="awesome-patched" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "awesome-fontconfig" mode - POWERLEVEL9K_MODE="awesome-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "nerdfont-fontconfig" mode - POWERLEVEL9K_MODE="nerdfont-fontconfig" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "flat" mode - POWERLEVEL9K_MODE="flat" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - # Switch to "compatible" mode - POWERLEVEL9K_MODE="compatible" - source functions/icons.zsh - typeset -ah current_icons - current_icons=(${(k)icons[@]}) - for key in ${_ICONS_UNDER_TEST}; do - assertTrue "The key ${key} does exist in ${_P9K_TEST_MODE} mode, but not in ${POWERLEVEL9K_MODE}!" "(( ${+current_icons[(r)$key]} ))" - done - - unset current_icons - unset _ICONS_UNDER_TEST -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/utilities.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/functions/utilities.spec deleted file mode 100755 index b727c1f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/functions/utilities.spec +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - # Load Powerlevel9k - source functions/icons.zsh - source functions/utilities.zsh -} - -function testDefinedFindsDefinedVariable() { - my_var='X' - - assertTrue "defined 'my_var'" - unset my_var -} - -function testDefinedDoesNotFindUndefinedVariable() { - assertFalse "defined 'my_var'" -} - -function testSetDefaultSetsVariable() { - set_default 'my_var' 'x' - - assertEquals 'x' "$my_var" - unset my_var -} - -function testPrintSizeHumanReadableWithBigNumber() { - # Interesting: Currently we can't support numbers bigger than that. - assertEquals '0.87E' "$(printSizeHumanReadable 1000000000000000000)" -} - -function testPrintSizeHumanReadableWithExabytesAsBase() { - assertEquals '9.77Z' "$(printSizeHumanReadable 10000 'E')" -} - -function testGetRelevantItem() { - typeset -a list - list=(a b c) - local callback='[[ "$item" == "b" ]] && echo "found"' - - local result=$(getRelevantItem "$list" "$callback") - assertEquals 'found' "$result" - - unset list -} - -function testGetRelevantItemDoesNotReturnNotFoundItems() { - typeset -a list - list=(a b c) - local callback='[[ "$item" == "d" ]] && echo "found"' - - local result=$(getRelevantItem "$list" "$callback") - assertEquals '' '' - - unset list -} - -function testSegmentShouldBeJoinedIfDirectPredecessingSegmentIsJoined() { - typeset -a segments - segments=(a b_joined c_joined) - # Look at the third segment - local current_index=3 - local last_element_index=2 - - local joined - segmentShouldBeJoined $current_index $last_element_index "$segments" && joined=true || joined=false - assertTrue "$joined" - - unset segments -} - -function testSegmentShouldBeJoinedIfPredecessingSegmentIsJoinedTransitivley() { - typeset -a segments - segments=(a b_joined c_joined) - # Look at the third segment - local current_index=3 - # The last printed segment was the first one, - # the second segmend was conditional. - local last_element_index=1 - - local joined - segmentShouldBeJoined $current_index $last_element_index "$segments" && joined=true || joined=false - assertTrue "$joined" - - unset segments -} - -function testSegmentShouldNotBeJoinedIfPredecessingSegmentIsNotJoinedButConditional() { - typeset -a segments - segments=(a b_joined c d_joined) - # Look at the fourth segment - local current_index=4 - # The last printed segment was the first one, - # the second segmend was conditional. - local last_element_index=1 - - local joined - segmentShouldBeJoined $current_index $last_element_index "$segments" && joined=true || joined=false - assertFalse "$joined" - - unset segments -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/powerlevel9k.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/powerlevel9k.spec deleted file mode 100755 index 586c2b2..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/powerlevel9k.spec +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme - source functions/* - - # Unset mode, so that user settings - # do not interfere with tests - unset POWERLEVEL9K_MODE -} - -function testJoinedSegments() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_joined) - cd /tmp - - assertEquals "%K{004} %F{000}/tmp %K{004}%F{000}%F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testTransitiveJoinedSegments() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir root_indicator_joined dir_joined) - cd /tmp - - assertEquals "%K{004} %F{000}/tmp %K{004}%F{000}%F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testJoiningWithConditionalSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir background_jobs dir_joined) - cd /tmp - - assertEquals "%K{004} %F{000}/tmp %K{004}%F{000} %F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testDynamicColoringOfSegmentsWork() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='red' - cd /tmp - - assertEquals "%K{001} %F{000}/tmp %k%F{001}%f " "$(build_left_prompt)" - - cd - -} - -function testDynamicColoringOfVisualIdentifiersWork() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_DEFAULT_VISUAL_IDENTIFIER_COLOR='green' - local POWERLEVEL9K_FOLDER_ICON="icon-here" - - cd /tmp - - assertEquals "%K{004} %F{002}icon-here %f%F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_DEFAULT_VISUAL_IDENTIFIER_COLOR='green' - local POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='red' - local POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='yellow' - local POWERLEVEL9K_FOLDER_ICON="icon-here" - - # Re-Source the icons, as the POWERLEVEL9K_MODE is directly - # evaluated there. - source functions/icons.zsh - - cd /tmp - - assertEquals "%K{003} %F{002}icon-here %f%F{001}/tmp %k%F{003}%f " "$(build_left_prompt)" - - cd - -} - -function testOverwritingIconsWork() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_FOLDER_ICON='icon-here' - #local testFolder=$(mktemp -d -p p9k) - # Move testFolder under home folder - #mv testFolder ~ - # Go into testFolder - #cd ~/$testFolder - - cd /tmp - assertEquals "%K{004} %F{000}icon-here %f%F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - - # rm -fr ~/$testFolder -} - -function testNewlineOnRpromptCanBeDisabled() { - local POWERLEVEL9K_PROMPT_ON_NEWLINE=true - local POWERLEVEL9K_RPROMPT_ON_NEWLINE=false - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_CUSTOM_RWORLD='echo rworld' - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_rworld) - - powerlevel9k_prepare_prompts - assertEquals '$(print_icon MULTILINE_FIRST_PROMPT_PREFIX) world  $(print_icon MULTILINE_LAST_PROMPT_PREFIX) rworld' "$(print -P ${PROMPT}${RPROMPT})" -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/anaconda.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/anaconda.spec deleted file mode 100755 index efcfc03..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/anaconda.spec +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testAnacondaSegmentPrintsNothingIfNoAnacondaPathIsSet() { - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda custom_world) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Unset anacona variables - unset CONDA_ENV_PATH - unset CONDA_PREFIX - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testAnacondaSegmentWorksIfOnlyAnacondaPathIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) - local POWERLEVEL9K_PYTHON_ICON="icon-here" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - CONDA_ENV_PATH=/tmp - unset CONDA_PREFIX - - assertEquals "%K{004} %F{000}icon-here %f%F{000}(tmp) %k%F{004}%f " "$(build_left_prompt)" -} - -function testAnacondaSegmentWorksIfOnlyAnacondaPrefixIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) - local POWERLEVEL9K_PYTHON_ICON="icon-here" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - unset CONDA_ENV_PATH - local CONDA_PREFIX="test" - - assertEquals "%K{004} %F{000}icon-here %f%F{000}(test) %k%F{004}%f " "$(build_left_prompt)" -} - -function testAnacondaSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) - local POWERLEVEL9K_PYTHON_ICON="icon-here" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - local CONDA_ENV_PATH=/tmp - local CONDA_PREFIX="test" - - assertEquals "%K{004} %F{000}icon-here %f%F{000}(tmptest) %k%F{004}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/aws_eb_env.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/aws_eb_env.spec deleted file mode 100755 index 99b418e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/aws_eb_env.spec +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testAwsEbEnvSegmentPrintsNothingIfNoElasticBeanstalkEnvironmentIsSet() { - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env custom_world) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testAwsEbEnvSegmentWorksIfElasticBeanstalkEnvironmentIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/.elasticbeanstalk - echo "test:\n environment: test" > /tmp/powerlevel9k-test/.elasticbeanstalk/config.yml - cd /tmp/powerlevel9k-test - - assertEquals "%K{000} %F{002}🌱 %f%F{002}test %k%F{000}%f " "$(build_left_prompt)" - - rm -fr /tmp/powerlevel9k-test - cd - -} - -function testAwsEbEnvSegmentWorksIfElasticBeanstalkEnvironmentIsSetInParentDirectory() { - # Skip test, because currently we cannot detect - # if the configuration is in a parent directory - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(aws_eb_env) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/.elasticbeanstalk - mkdir -p /tmp/powerlevel9k-test/1/12/123/1234/12345 - echo "test:\n environment: test" > /tmp/powerlevel9k-test/.elasticbeanstalk/config.yml - cd /tmp/powerlevel9k-test/1/12/123/1234/12345 - - assertEquals "%K{000} %F{002}🌱 %f%F{002}test %k%F{000}%f " "$(build_left_prompt)" - - rm -fr /tmp/powerlevel9k-test - cd - -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/background_jobs.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/background_jobs.spec deleted file mode 100755 index 3d83e17..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/background_jobs.spec +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testBackgroundJobsSegmentPrintsNothingWithoutBackgroundJobs() { - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(background_jobs custom_world) - alias jobs="nojobs 2>/dev/null" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias jobs -} - -function testBackgroundJobsSegmentWorksWithOneBackgroundJob() { - unset POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(background_jobs) - jobs() { - echo '[1] + 30444 suspended nvim xx' - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{006}⚙%f %k%F{000}%f " "$(build_left_prompt)" - - unfunction jobs -} - -function testBackgroundJobsSegmentWorksWithMultipleBackgroundJobs() { - local POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(background_jobs) - jobs() { - echo "[1] 31190 suspended nvim xx" - echo "[2] - 31194 suspended nvim xx2" - echo "[3] + 31206 suspended nvim xx3" - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{006}⚙%f %k%F{000}%f " "$(build_left_prompt)" - - unfunction jobs -} - -function testBackgroundJobsSegmentWithVerboseMode() { - local POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=true - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(background_jobs) - jobs() { - echo "[1] 31190 suspended nvim xx" - echo "[2] - 31194 suspended nvim xx2" - echo "[3] + 31206 suspended nvim xx3" - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{006}⚙ %f%F{006}3 %k%F{000}%f " "$(build_left_prompt)" - - unfunction jobs -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/battery.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/battery.spec deleted file mode 100755 index 79e25d6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/battery.spec +++ /dev/null @@ -1,177 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder - FOLDER=/tmp/powerlevel9k-test - mkdir -p "${FOLDER}" - cd $FOLDER - - # Prepare folder for pmset (OSX) - PMSET_PATH=$FOLDER/usr/bin - mkdir -p $PMSET_PATH - # Prepare folder for $BATTERY (Linux) - BATTERY_PATH=$FOLDER/sys/class/power_supply - mkdir -p $BATTERY_PATH - mkdir -p $BATTERY_PATH/BAT0 - mkdir -p $BATTERY_PATH/BAT1 -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" &>/dev/null - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test &>/dev/null - unset PMSET_PATH - unset BATTERY_PATH - unset FOLDER - unset P9K_HOME -} - -# Mock Battery -# For mocking pmset on OSX this function takes one argument (the -# content that pmset should echo). -# For mocking the battery on Linux this function takes two -# arguments: $1 is the capacity; $2 the battery status. -function makeBatterySay() { - if [[ -z "${FOLDER}" ]]; then - echo "Fake root path is not correctly set!" - exit 1 - fi - # OSX - echo "#!/bin/sh" > $PMSET_PATH/pmset - echo "echo \"$1\"" >> $PMSET_PATH/pmset - chmod +x $PMSET_PATH/pmset - - # Linux - local capacity="$1" - echo "$capacity" > $BATTERY_PATH/BAT0/capacity - echo "$capacity" > $BATTERY_PATH/BAT1/capacity - local battery_status="$2" - echo "$battery_status" > $BATTERY_PATH/BAT0/status - echo "$battery_status" > $BATTERY_PATH/BAT1/status -} - -function testBatterySegmentIfBatteryIsLowWhileDischargingOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'Battery Power' - -InternalBattery-0 (id=1234567) 4%; discharging; 0:05 remaining present: true" - - assertEquals "%K{000} %F{001}🔋 %f%F{001}4%% (0:05) " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsLowWhileChargingOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'Battery Power' - -InternalBattery-0 (id=1234567) 4%; charging; 0:05 remaining present: true" - - assertEquals "%K{000} %F{003}🔋 %f%F{003}4%% (0:05) " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsAlmostFullWhileDischargingOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'Battery Power' - -InternalBattery-0 (id=1234567) 98%; discharging; 3:57 remaining present: true" - - assertEquals "%K{000} %F{007}🔋 %f%F{007}98%% (3:57) " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsAlmostFullWhileChargingOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'Battery Power' - -InternalBattery-0 (id=1234567) 98%; charging; 3:57 remaining present: true" - - assertEquals "%K{000} %F{003}🔋 %f%F{003}98%% (3:57) " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsFullOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'AC Power' - -InternalBattery-0 (id=1234567) 99%; charged; 0:00 remaining present: true" - - assertEquals "%K{000} %F{002}🔋 %f%F{002}99%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsCalculatingOnOSX() { - local OS='OSX' # Fake OSX - makeBatterySay "Now drawing from 'Battery Power' - -InternalBattery-0 (id=1234567) 99%; discharging; (no estimate) present: true" - - assertEquals "%K{000} %F{007}🔋 %f%F{007}99%% (...) " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsLowWhileDischargingOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "4" "Discharging" - - assertEquals "%K{000} %F{001}🔋 %f%F{001}4%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsLowWhileChargingOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "4" "Charging" - - assertEquals "%K{000} %F{003}🔋 %f%F{003}4%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsNormalWhileDischargingOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "10" "Discharging" - - assertEquals "%K{000} %F{007}🔋 %f%F{007}10%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsNormalWhileChargingOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "10" "Charging" - - assertEquals "%K{000} %F{003}🔋 %f%F{003}10%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsFullOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "100" "Full" - - assertEquals "%K{000} %F{002}🔋 %f%F{002}100%% " "$(prompt_battery left 1 false ${FOLDER})" -} - -function testBatterySegmentIfBatteryIsNormalWithAcpiEnabledOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "50" "Discharging" - echo "echo 'Batter 0: Discharging, 50%, 01:38:54 remaining'" > ${FOLDER}/usr/bin/acpi - chmod +x ${FOLDER}/usr/bin/acpi - # For running on Mac, we need to mock date :( - [[ -f /usr/local/bin/gdate ]] && alias date=gdate - - assertEquals "%K{000} %F{007}🔋 %f%F{007}50%% (1:38) " "$(prompt_battery left 1 false ${FOLDER})" - - unalias date &>/dev/null - # unaliasing date fails where it was never aliased (e.g. on Linux). - # This causes the whole test to fail, because the return code is - # non-zero. - return 0 -} - -function testBatterySegmentIfBatteryIsCalculatingWithAcpiEnabledOnLinux() { - local OS='Linux' # Fake Linux - makeBatterySay "50" "Discharging" - # Todo: Include real acpi output! - echo "echo 'Batter 0: Discharging, 50%, rate remaining'" > ${FOLDER}/usr/bin/acpi - chmod +x ${FOLDER}/usr/bin/acpi - - assertEquals "%K{000} %F{007}🔋 %f%F{007}50%% (...) " "$(prompt_battery left 1 false ${FOLDER})" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/command_execution_time.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/command_execution_time.spec deleted file mode 100755 index b7c3fae..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/command_execution_time.spec +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testCommandExecutionTimeIsNotShownIfTimeIsBelowThreshold() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world command_execution_time) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=2 - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimeThresholdCouldBeChanged() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - local POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=1 - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=2.03 - - assertEquals "%K{001} %F{226}Dur %f%F{226}2.03 %k%F{001}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimeThresholdCouldBeSetToZero() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - local POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 - local _P9K_COMMAND_DURATION=0.03 - - assertEquals "%K{001} %F{226}Dur %f%F{226}0.03 %k%F{001}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimePrecisionCouldBeChanged() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - local POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 - local POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=4 - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=0.0001 - - assertEquals "%K{001} %F{226}Dur %f%F{226}0.0001 %k%F{001}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimePrecisionCouldBeSetToZero() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - local POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=23.5001 - - assertEquals "%K{001} %F{226}Dur %f%F{226}23 %k%F{001}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimeIsFormattedHumandReadbleForMinuteLongCommand() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=180 - - assertEquals "%K{001} %F{226}Dur %f%F{226}03:00 %k%F{001}%f " "$(build_left_prompt)" -} - -function testCommandExecutionTimeIsFormattedHumandReadbleForHourLongCommand() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(command_execution_time) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # Override payload - local _P9K_COMMAND_DURATION=7200 - - assertEquals "%K{001} %F{226}Dur %f%F{226}02:00:00 %k%F{001}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/context.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/context.spec deleted file mode 100755 index 0730037..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/context.spec +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - # Test specific settings - OLD_DEFAULT_USER=$DEFAULT_USER - unset DEFAULT_USER -} - -function tearDown() { - # Restore old variables - [[ -n "$OLD_DEFAULT_USER" ]] && DEFAULT_USER=$OLD_DEFAULT_USER - - return 0 -} - -function testContextSegmentDoesNotGetRenderedWithDefaultUser() { - local DEFAULT_USER=$(whoami) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context custom_world) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() { - function sudo() { - return 0 - } - local SSH_CLIENT="putty" - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}%n@%m %k%F{000}%f " "$(build_left_prompt)" - - unfunction sudo -} - -function testContextSegmentWithForeignUser() { - function sudo() { - return 0 - } - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}%n@%m %k%F{000}%f " "$(build_left_prompt)" - - unfunction sudo -} - -# TODO: How to test root? -function testContextSegmentWithRootUser() { - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}%n@%m %k%F{000}%f " "$(build_left_prompt)" -} - -function testOverridingContextTemplate() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - local POWERLEVEL9K_CONTEXT_TEMPLATE=xx - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}xx %k%F{000}%f " "$(build_left_prompt)" -} - -function testContextSegmentIsShownIfDefaultUserIsSetWhenForced() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - local POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true - local DEFAULT_USER=$(whoami) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}%n@%m %k%F{000}%f " "$(build_left_prompt)" -} - -function testContextSegmentIsShownIfForced() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - local POWERLEVEL9K_ALWAYS_SHOW_USER=true - local DEFAULT_USER=$(whoami) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}$(whoami) %k%F{000}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/custom.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/custom.spec deleted file mode 100755 index 0f66c82..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/custom.spec +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testCustomDirectOutputSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD="echo world" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testCustomClosureSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - function p9k_hello_world() { - echo "world" - } - local POWERLEVEL9K_CUSTOM_WORLD='p9k_hello_world' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testSettingBackgroundForCustomSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD="echo world" - local POWERLEVEL9K_CUSTOM_WORLD_BACKGROUND="yellow" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000}world %k%F{003}%f " "$(build_left_prompt)" -} - -function testSettingForegroundForCustomSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD="echo world" - local POWERLEVEL9K_CUSTOM_WORLD_FOREGROUND="red" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{001}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testSettingVisualIdentifierForCustomSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD="echo world" - local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}hw %f%F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testSettingVisualIdentifierForegroundColorForCustomSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world) - local POWERLEVEL9K_CUSTOM_WORLD="echo world" - local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw" - local POWERLEVEL9K_CUSTOM_WORLD_VISUAL_IDENTIFIER_COLOR="red" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{001}hw %f%F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/detect_virt.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/detect_virt.spec deleted file mode 100755 index 910f52e..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/detect_virt.spec +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme -} - -function testDetectVirtSegmentPrintsNothingIfSystemdIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias systemd-detect-virt="novirt" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias systemd-detect-virt -} - -function testDetectVirtSegmentIfSystemdReturnsPlainName() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) - alias systemd-detect-virt="echo 'xxx'" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}xxx %k%F{000}%f " "$(build_left_prompt)" - - unalias systemd-detect-virt -} - -function testDetectVirtSegmentIfRootFsIsOnExpectedInode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) - # Well. This is a weak test, as it fixates the implementation, - # but it is necessary, as the implementation relys on the root - # directory having the inode number "2".. - alias systemd-detect-virt="echo 'none'" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # The original command in the implementation is "ls -di / | grep -o 2", - # which translates to: Show the inode number of "/" and test if it is "2". - alias ls="echo '2'" - - assertEquals "%K{000} %F{003}none %k%F{000}%f " "$(build_left_prompt)" - - unalias ls - unalias systemd-detect-virt -} - -function testDetectVirtSegmentIfRootFsIsNotOnExpectedInode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) - # Well. This is a weak test, as it fixates the implementation, - # but it is necessary, as the implementation relys on the root - # directory having the inode number "2".. - alias systemd-detect-virt="echo 'none'" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - # The original command in the implementation is "ls -di / | grep -o 2", - # which translates to: Show the inode number of "/" and test if it is "2". - alias ls="echo '3'" - - assertEquals "%K{000} %F{003}chroot %k%F{000}%f " "$(build_left_prompt)" - - unalias ls - unalias systemd-detect-virt -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/dir.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/dir.spec deleted file mode 100755 index 7e65cb7..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/dir.spec +++ /dev/null @@ -1,771 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME="${PWD}" -} - -function tearDown() { - unset P9K_HOME -} - -function testDirPathAbsoluteWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_ABSOLUTE=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd ~ - - # Unfortunately, we cannot fake Linux or OSX here, because - # of /home or /Users path.. That is why we change the test - # according to the OS of the host. - if [[ "${OS}" == 'Linux' ]]; then - assertEquals "%K{004} %F{000}/home/${USER} %k%F{004}%f " "$(build_left_prompt)" - elif [[ "${OS}" == 'OSX' ]]; then - assertEquals "%K{004} %F{000}/Users/${USER} %k%F{004}%f " "$(build_left_prompt)" - fi - - cd - -} - -function testTruncateFoldersWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_folders' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}…/12345678/123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateFolderWithHomeDirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - local CURRENT_DIR=$(pwd) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd ~ - local FOLDER="powerlevel9k-test-${RANDOM}" - mkdir -p $FOLDER - cd $FOLDER - # Switch back to home folder as this causes the problem. - cd .. - - assertEquals "%K{004} %F{000}~ %k%F{004}%f " "$(build_left_prompt)" - - rmdir $FOLDER - cd ${CURRENT_DIR} -} - -function testTruncateMiddleWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_middle' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}/tmp/po…st/1/12/123/1234/12…45/12…56/12…67/12…78/123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncationFromRightWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_from_right' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}/tmp/po…/1/12/123/12…/12…/12…/12…/12…/123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateToLastWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY="truncate_to_last" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateToFirstAndLastWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY="truncate_to_first_and_last" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}/tmp/powerlevel9k-test/…/…/…/…/…/…/…/12345678/123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateAbsoluteWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY="truncate_absolute" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}…89 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncationFromRightWithEmptyDelimiter() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_DELIMITER="" - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_from_right' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}/tmp/po/1/12/123/12/12/12/12/12/123456789 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateWithFolderMarkerWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_folder_marker" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local BASEFOLDER=/tmp/powerlevel9k-test - local FOLDER=$BASEFOLDER/1/12/123/1234/12345/123456/1234567 - mkdir -p $FOLDER - # Setup folder marker - touch $BASEFOLDER/1/12/.shorten_folder_marker - cd $FOLDER - assertEquals "%K{004} %F{000}/…/12/123/1234/12345/123456/1234567 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr $BASEFOLDER -} - -function testTruncateWithFolderMarkerWithChangedFolderMarker() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_folder_marker" - local POWERLEVEL9K_SHORTEN_FOLDER_MARKER='.xxx' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local BASEFOLDER=/tmp/powerlevel9k-test - local FOLDER=$BASEFOLDER/1/12/123/1234/12345/123456/1234567 - mkdir -p $FOLDER - # Setup folder marker - touch $BASEFOLDER/1/12/.xxx - cd $FOLDER - assertEquals "%K{004} %F{000}/…/12/123/1234/12345/123456/1234567 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr $BASEFOLDER -} - -function testTruncateWithPackageNameWorks() { - local p9kFolder=$(pwd) - local BASEFOLDER=/tmp/powerlevel9k-test - local FOLDER=$BASEFOLDER/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - - cd /tmp/powerlevel9k-test - echo ' -{ - "name": "My_Package" -} -' > package.json - # Unfortunately: The main folder must be a git repo.. - git init &>/dev/null - - # Go back to deeper folder - cd "${FOLDER}" - - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_with_package_name' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}My_Package/1/12/123/12…/12…/12…/12…/12…/123456789 %k%F{004}%f " "$(build_left_prompt)" - - # Go back - cd $p9kFolder - rm -fr $BASEFOLDER -} - -function testTruncateWithPackageNameIfRepoIsSymlinkedInsideDeepFolder() { - local p9kFolder=$(pwd) - local BASEFOLDER=/tmp/powerlevel9k-test - local FOLDER=$BASEFOLDER/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - # Unfortunately: The main folder must be a git repo.. - git init &>/dev/null - - echo ' -{ - "name": "My_Package" -} -' > package.json - - # Create a subdir inside the repo - mkdir -p asdfasdf/qwerqwer - - cd $BASEFOLDER - ln -s ${FOLDER} linked-repo - - # Go to deep folder inside linked repo - cd linked-repo/asdfasdf/qwerqwer - - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_with_package_name' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}My_Package/as…/qwerqwer %k%F{004}%f " "$(build_left_prompt)" - - # Go back - cd $p9kFolder - rm -fr $BASEFOLDER -} - -function testTruncateWithPackageNameIfRepoIsSymlinkedInsideGitDir() { - local p9kFolder=$(pwd) - local BASEFOLDER=/tmp/powerlevel9k-test - local FOLDER=$BASEFOLDER/1/12/123/1234/12345/123456/1234567/12345678/123456789 - mkdir -p $FOLDER - cd $FOLDER - - # Unfortunately: The main folder must be a git repo.. - git init &>/dev/null - - echo ' -{ - "name": "My_Package" -} -' > package.json - - cd $BASEFOLDER - ln -s ${FOLDER} linked-repo - - cd linked-repo/.git/refs/heads - - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_with_package_name' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}My_Package/.g…/re…/heads %k%F{004}%f " "$(build_left_prompt)" - - # Go back - cd $p9kFolder - rm -fr $BASEFOLDER -} - -function testHomeFolderDetectionWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_HOME_ICON='home-icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd ~ - assertEquals "%K{004} %F{000}home-icon %f%F{000}~ %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testHomeSubfolderDetectionWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_HOME_SUB_ICON='sub-icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=~/powerlevel9k-test - mkdir $FOLDER - cd $FOLDER - assertEquals "%K{004} %F{000}sub-icon %f%F{000}~/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr $FOLDER -} - -function testOtherFolderDetectionWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_FOLDER_ICON='folder-icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER=/tmp/powerlevel9k-test - mkdir $FOLDER - cd $FOLDER - assertEquals "%K{004} %F{000}folder-icon %f%F{000}/tmp/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr $FOLDER -} - -function testChangingDirPathSeparator() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - local FOLDER="/tmp/powerlevel9k-test/1/2" - mkdir -p $FOLDER - cd $FOLDER - - assertEquals "%K{004} %F{000}xXxtmpxXxpowerlevel9k-testxXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testHomeFolderAbbreviation() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local dir=$PWD - - cd ~/ - # default - local POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='~' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}~ %k%F{004}%f " "$(build_left_prompt)" - - # substituted - local POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='qQq' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}qQq %k%F{004}%f " "$(build_left_prompt)" - - cd /tmp - # default - local POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='~' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - # substituted - local POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='qQq' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{004} %F{000}/tmp %k%F{004}%f " "$(build_left_prompt)" - - cd "$dir" -} - -function testOmittingFirstCharacterWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_FOLDER_ICON='folder-icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd /tmp - - assertEquals "%K{004} %F{000}folder-icon %f%F{000}tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testOmittingFirstCharacterWorksWithChangingPathSeparator() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - local POWERLEVEL9K_FOLDER_ICON='folder-icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/1/2 - cd /tmp/powerlevel9k-test/1/2 - - assertEquals "%K{004} %F{000}folder-icon %f%F{000}tmpxXxpowerlevel9k-testxXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -# This test makes it obvious that combining a truncation strategy -# that cuts off folders from the left and omitting the the first -# character does not make much sense. The truncation strategy -# comes first, prints an ellipsis and that gets then cut off by -# POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER.. -# But it does more sense in combination with other truncation -# strategies. -function testOmittingFirstCharacterWorksWithChangingPathSeparatorAndDefaultTruncation() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_folders' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/1/2 - cd /tmp/powerlevel9k-test/1/2 - - assertEquals "%K{004} %F{000}xXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testOmittingFirstCharacterWorksWithChangingPathSeparatorAndMiddleTruncation() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_middle' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/1/2 - cd /tmp/powerlevel9k-test/1/2 - - assertEquals "%K{004} %F{000}tmpxXxpo…stxXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testOmittingFirstCharacterWorksWithChangingPathSeparatorAndRightTruncation() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_from_right' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/1/2 - cd /tmp/powerlevel9k-test/1/2 - - assertEquals "%K{004} %F{000}tmpxXxpo…xXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testTruncateToUniqueWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true - local POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' - local POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 - local POWERLEVEL9K_SHORTEN_STRATEGY='truncate_to_unique' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test/adam/devl - mkdir -p /tmp/powerlevel9k-test/alice/devl - mkdir -p /tmp/powerlevel9k-test/alice/docs - mkdir -p /tmp/powerlevel9k-test/bob/docs - cd /tmp/powerlevel9k-test/alice/devl - - assertEquals "%K{004} %F{000}txXxpxXxalxXxde %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testBoldHomeDirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd ~ - - assertEquals "%K{004} %F{000}%B~%b %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testBoldHomeSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p ~/powerlevel9k-test - cd ~/powerlevel9k-test - - assertEquals "%K{004} %F{000}~/%Bpowerlevel9k-test%b %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr ~/powerlevel9k-test -} - -function testBoldRootDirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd / - - assertEquals "%K{004} %F{000}%B/%b %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testBoldRootSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd /tmp - - assertEquals "%K{004} %F{000}/%Btmp%b %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testBoldRootSubSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test - cd /tmp/powerlevel9k-test - - assertEquals "%K{004} %F{000}/tmp/%Bpowerlevel9k-test%b %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testHighlightHomeWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd ~ - - assertEquals "%K{004} %F{000}%F{red}~ %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testHighlightHomeSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p ~/powerlevel9k-test - cd ~/powerlevel9k-test - - assertEquals "%K{004} %F{000}~/%F{red}powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr ~/powerlevel9k-test -} - -function testHighlightRootWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd / - - assertEquals "%K{004} %F{000}%F{red}/ %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testHighlightRootSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - cd /tmp - - assertEquals "%K{004} %F{000}/%F{red}tmp %k%F{004}%f " "$(build_left_prompt)" - - cd - -} - -function testHighlightRootSubSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir /tmp/powerlevel9k-test - cd /tmp/powerlevel9k-test - - assertEquals "%K{004} %F{000}/tmp/%F{red}powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -function testDirSeparatorColorHomeSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p ~/powerlevel9k-test - cd ~/powerlevel9k-test - - assertEquals "%K{004} %F{000}~%F{red}/%F{black}powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr ~/powerlevel9k-test -} - -function testDirSeparatorColorRootSubSubdirWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) - local POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND='red' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - mkdir -p /tmp/powerlevel9k-test - cd /tmp/powerlevel9k-test - - assertEquals "%K{004} %F{000}%F{red}/%F{black}tmp%F{red}/%F{black}powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" - - cd - - rm -fr /tmp/powerlevel9k-test -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/disk_usage.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/disk_usage.spec deleted file mode 100755 index ebafe31..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/disk_usage.spec +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - # Test specific - P9K_HOME=$(pwd) - FOLDER=/tmp/powerlevel9k-test - mkdir -p $FOLDER - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test - unset FOLDER - unset P9K_HOME - - # Remove IP cache file - rm -f ${POWERLEVEL9K_PUBLIC_IP_FILE} -} - -function testDiskUsageSegmentWhenDiskIsAlmostFull() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage) - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 97% /" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{001} %F{007}hdd %f%F{007}97%% %k%F{001}%f " "$(build_left_prompt)" - - unfunction df -} - -function testDiskUsageSegmentWhenDiskIsVeryFull() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage) - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 94% /" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000}hdd %f%F{000}94%% %k%F{003}%f " "$(build_left_prompt)" - - unfunction df -} - -function testDiskUsageSegmentWhenDiskIsQuiteEmpty() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage) - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 4% /" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}hdd %f%F{003}4%% %k%F{000}%f " "$(build_left_prompt)" - - unfunction df -} - -function testDiskUsageSegmentPrintsNothingIfDiskIsQuiteEmptyAndOnlyWarningsShouldBeDisplayed() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage custom_world) - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 4% /" - } - - local POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=true - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unfunction df -} - -function testDiskUsageSegmentWarningLevelCouldBeAdjusted() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage) - local POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=10 - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 11% /" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000}hdd %f%F{000}11%% %k%F{003}%f " "$(build_left_prompt)" - - unfunction df -} - -function testDiskUsageSegmentCriticalLevelCouldBeAdjusted() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(disk_usage) - local POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=5 - local POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=10 - df() { - echo "Filesystem 1K-blocks Used Available Use% Mounted on -/dev/disk1 487219288 471466944 15496344 11% /" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{001} %F{007}hdd %f%F{007}11%% %k%F{001}%f " "$(build_left_prompt)" - - unfunction df -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/go_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/go_version.spec deleted file mode 100755 index d7a1c2c..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/go_version.spec +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function mockGo() { - case "$1" in - 'version') - echo 'go version go1.5.3 darwin/amd64' - ;; - 'env') - echo "$HOME/go" - ;; - esac -} - -function mockGoEmptyGopath() { - case "$1" in - 'version') - echo 'go version go1.5.3 darwin/amd64' - ;; - 'env') - echo "" - ;; - esac -} - -function testGo() { - alias go=mockGo - local POWERLEVEL9K_GO_ICON="" - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(go_version) - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - local PWD="$HOME/go/src/github.com/bhilburn/powerlevel9k" - - assertEquals "%K{002} %F{255} %f%F{255}go1.5.3 %k%F{002}%f " "$(build_left_prompt)" - - unalias go -} - -function testGoSegmentPrintsNothingIfEmptyGopath() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world go_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias go=mockGoEmptyGopath - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testGoSegmentPrintsNothingIfNotInGopath() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world go_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias go=mockGo - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testGoSegmentPrintsNothingIfGoIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world go_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias go=noGo - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias go -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ip.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ip.spec deleted file mode 100755 index 254f11c..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ip.spec +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testIpSegmentPrintsNothingOnOsxIfNotConnected() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip custom_world) - alias networksetup='echo "not connected"' - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS="OSX" # Fake OSX - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias networksetup -} - -function testIpSegmentPrintsNothingOnLinuxIfNotConnected() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip custom_world) - alias ip='echo "not connected"' - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias ip -} - -function testIpSegmentWorksOnOsxWithNoInterfaceSpecified() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - alias networksetup="echo 'An asterisk (*) denotes that a network service is disabled. -(1) Ethernet -(Hardware Port: Ethernet, Device: en0) - -(2) FireWire -(Hardware Port: FireWire, Device: fw0) - -(3) Wi-Fi -(Hardware Port: Wi-Fi, Device: en1) - -(4) Bluetooth PAN -(Hardware Port: Bluetooth PAN, Device: en3) - -(5) Thunderbolt Bridge -(Hardware Port: Thunderbolt Bridge, Device: bridge0) - -(6) Apple USB Ethernet Adapter -(Hardware Port: Apple USB Ethernet Adapter, Device: en4) -'" - - alias ipconfig="_(){ echo '1.2.3.4'; };_" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='OSX' # Fake OSX - - assertEquals "%K{006} %F{000}IP %f%F{000}1.2.3.4 %k%F{006}%f " "$(build_left_prompt)" - - unalias ipconfig - unalias networksetup -} - -# There could be more than one confiured network interfaces. -# `networksetup -listnetworkserviceorder` lists the interfaces -# in hierarchical order, but from outside this is not obvious -# (implementation detail). So we need a test for this case. -function testIpSegmentWorksOnOsxWithMultipleInterfacesSpecified() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - alias networksetup="echo 'An asterisk (*) denotes that a network service is disabled. -(1) Ethernet -(Hardware Port: Ethernet, Device: en0) - -(2) FireWire -(Hardware Port: FireWire, Device: fw0) - -(3) Wi-Fi -(Hardware Port: Wi-Fi, Device: en1) - -(4) Bluetooth PAN -(Hardware Port: Bluetooth PAN, Device: en3) - -(5) Thunderbolt Bridge -(Hardware Port: Thunderbolt Bridge, Device: bridge0) - -(6) Apple USB Ethernet Adapter -(Hardware Port: Apple USB Ethernet Adapter, Device: en4) -'" - - # Return a unique IP address for every interface - ipconfig() { - case "${2}" { - en0) - echo 1.2.3.4 - ;; - fw0) - echo 2.3.4.5 - ;; - en1) - echo 3.4.5.6 - ;; - en3) - echo 4.5.6.7 - ;; - } - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='OSX' # Fake OSX - - assertEquals "%K{006} %F{000}IP %f%F{000}1.2.3.4 %k%F{006}%f " "$(build_left_prompt)" - - unfunction ipconfig - unalias networksetup -} - -function testIpSegmentWorksOnOsxWithInterfaceSpecified() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - local POWERLEVEL9K_IP_INTERFACE='xxx' - alias ipconfig="_(){ echo '1.2.3.4'; };_" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='OSX' # Fake OSX - - assertEquals "%K{006} %F{000}IP %f%F{000}1.2.3.4 %k%F{006}%f " "$(build_left_prompt)" - - unalias ipconfig -} - -function testIpSegmentWorksOnLinuxWithNoInterfaceSpecified() { - setopt aliases - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - # That command is harder to test, as it is used at first - # to get all relevant network interfaces and then for - # getting the configuration of that segment.. - ip(){ - if [[ "$*" == 'link ls up' ]]; then - echo "1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -2: eth0: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 - link/ether 08:00:27:7e:84:45 brd ff:ff:ff:ff:ff:ff"; - fi - - if [[ "$*" == '-4 a show eth0' ]]; then - echo '2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 - valid_lft forever preferred_lft forever'; - fi - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='Linux' # Fake Linux - - assertEquals "%K{006} %F{000}IP %f%F{000}10.0.2.15 %k%F{006}%f " "$(build_left_prompt)" - - unfunction ip -} - -function testIpSegmentWorksOnLinuxWithMultipleInterfacesSpecified() { - setopt aliases - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - # That command is harder to test, as it is used at first - # to get all relevant network interfaces and then for - # getting the configuration of that segment.. - ip(){ - if [[ "$*" == 'link ls up' ]]; then - echo "1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -2: eth0: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 - link/ether 08:00:27:7e:84:45 brd ff:ff:ff:ff:ff:ff -3: eth1: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 - link/ether 08:00:27:7e:84:45 brd ff:ff:ff:ff:ff:ff -4: wlan0: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 - link/ether 08:00:27:7e:84:45 brd ff:ff:ff:ff:ff:ff"; - fi - - if [[ "$*" == '-4 a show eth1' ]]; then - echo '3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 - valid_lft forever preferred_lft forever'; - fi - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='Linux' # Fake Linux - - assertEquals "%K{006} %F{000}IP %f%F{000}10.0.2.15 %k%F{006}%f " "$(build_left_prompt)" - - unfunction ip -} - -function testIpSegmentWorksOnLinuxWithInterfaceSpecified() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ip) - local POWERLEVEL9K_IP_INTERFACE='xxx' - ip(){ - echo '2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 -inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 - valid_lft forever preferred_lft forever'; - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local OS='Linux' # Fake Linux - - assertEquals "%K{006} %F{000}IP %f%F{000}10.0.2.15 %k%F{006}%f " "$(build_left_prompt)" - - unfunction ip -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/kubecontext.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/kubecontext.spec deleted file mode 100755 index 76b35c3..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/kubecontext.spec +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function mockKubectl() { - case "$1" in - 'version') - echo 'non-empty text' - ;; - 'config') - case "$2" in - 'view') - case "$3" in - '-o=jsonpath={.current-context}') - echo 'minikube' - ;; - '-o=jsonpath={.contexts'*) - echo '' - ;; - *) - echo "Mock value missed" - exit 1 - ;; - esac - ;; - esac - ;; - esac -} - -function mockKubectlOtherNamespace() { - case "$1" in - 'version') - echo 'non-empty text' - ;; - 'config') - case "$2" in - 'view') - case "$3" in - # Get Current Context - '-o=jsonpath={.current-context}') - echo 'minikube' - ;; - # Get current namespace - '-o=jsonpath={.contexts'*) - echo 'kube-system' - ;; - *) - echo "Mock value missed" - exit 1 - ;; - esac - ;; - esac - ;; - esac -} - -function testKubeContext() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(kubecontext) - alias kubectl=mockKubectl - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{005} %F{007}⎈ %f%F{007}minikube/default %k%F{005}%f " "$(build_left_prompt)" - - unalias kubectl -} -function testKubeContextOtherNamespace() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(kubecontext) - alias kubectl=mockKubectlOtherNamespace - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{005} %F{007}⎈ %f%F{007}minikube/kube-system %k%F{005}%f " "$(build_left_prompt)" - - unalias kubectl -} -function testKubeContextPrintsNothingIfKubectlNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world kubecontext) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias kubectl=noKubectl - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias kubectl -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/laravel_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/laravel_version.spec deleted file mode 100755 index c4f09e5..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/laravel_version.spec +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function mockLaravelVersion() { - case "$1" in - "artisan") - # artisan --version follows the format Laravel Framework - echo "Laravel Framework 5.4.23" - ;; - default) - esac -} - -function mockNoLaravelVersion() { - # When php can't find a file it will output a message - echo "Could not open input file: artisan" - return 0 -} - -function testLaravelVersionSegment() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(laravel_version) - local POWERLEVEL9K_LARAVEL_ICON='x' - alias php=mockLaravelVersion - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{009} %F{007}x %f%F{007}5.4.23 %k%F{009}%f " "$(build_left_prompt)" - - unalias php -} - -function testLaravelVersionSegmentIfArtisanIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world laravel_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_LARAVEL_ICON='x' - alias php=mockNoLaravelVersion - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias php -} - -function testLaravelVersionSegmentPrintsNothingIfPhpIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world laravel_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_LARAVEL_ICON='x' - alias php=noPhp - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias php -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/load.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/load.spec deleted file mode 100755 index 0f8ee33..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/load.spec +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test/load-test - mkdir -p "${FOLDER}" - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testLoadSegmentWorksOnOsx() { - sysctl() { - if [[ "$*" == 'vm.loadavg' ]]; then - echo "vm.loadavg: { 1,38 1,45 2,16 }"; - fi - - if [[ "$*" == '-n hw.logicalcpu' ]]; then - echo "4"; - fi - } - - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="OSX" # Fake OSX - - assertEquals "%K{002} %F{000}L %f%F{000}1.38 " "$(prompt_load left 1 false ${FOLDER})" - - unfunction sysctl -} - -function testLoadSegmentWorksOnBsd() { - sysctl() { - if [[ "$*" == 'vm.loadavg' ]]; then - echo "vm.loadavg: { 1,38 1,45 2,16 }"; - fi - - if [[ "$*" == '-n hw.ncpu' ]]; then - echo "4"; - fi - } - - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="BSD" # Fake BSD - - assertEquals "%K{002} %F{000}L %f%F{000}1.38 " "$(prompt_load left 1 false ${FOLDER})" - - unfunction sysctl -} - -function testLoadSegmentWorksOnLinux() { - # Prepare loadavg - mkdir proc - echo "1.38 0.01 0.05 1/87 8641" > proc/loadavg - - alias nproc="echo 4" - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{002} %F{000}L %f%F{000}1.38 " "$(prompt_load left 1 false ${FOLDER})" - - unalias nproc -} - -# Test normal state. This test is not OS specific. -# We test it as the Linux version, but that -# does not matter here. -function testLoadSegmentNormalState() { - # Prepare loadavg - mkdir proc - echo "1.00 0.01 0.05 1/87 8641" > proc/loadavg - - alias nproc="echo 4" - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{002} %F{000}L %f%F{000}1.00 " "$(prompt_load left 1 false ${FOLDER})" - - unalias nproc -} - -# Test warning state. This test is not OS specific. -# We test it as the Linux version, but that -# does not matter here. -function testLoadSegmentWarningState() { - # Prepare loadavg - mkdir proc - echo "2.01 0.01 0.05 1/87 8641" > proc/loadavg - - alias nproc="echo 4" - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{003} %F{000}L %f%F{000}2.01 " "$(prompt_load left 1 false ${FOLDER})" - - unalias nproc -} - -# Test critical state. This test is not OS specific. -# We test it as the Linux version, but that -# does not matter here. -function testLoadSegmentCriticalState() { - # Prepare loadavg - mkdir proc - echo "2.81 0.01 0.05 1/87 8641" > proc/loadavg - - alias nproc="echo 4" - local POWERLEVEL9K_LOAD_WHICH=1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{001} %F{000}L %f%F{000}2.81 " "$(prompt_load left 1 false ${FOLDER})" - - unalias nproc -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/node_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/node_version.spec deleted file mode 100755 index 69b9cbb..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/node_version.spec +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testNodeVersionSegmentPrintsNothingWithoutNode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(node_version custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias node="nonode 2>/dev/null" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias node -} - -function testNodeVersionSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(node_version) - node() { - echo "v1.2.3" - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{007}⬢ %f%F{007}1.2.3 %k%F{002}%f " "$(build_left_prompt)" - - unfunction node -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nodeenv.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nodeenv.spec deleted file mode 100755 index 2e9d779..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nodeenv.spec +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - # Test specfic - # unset all possible user specified variables - unset NODE_VIRTUAL_ENV_DISABLE_PROMPT - unset NODE_VIRTUAL_ENV -} - -function testNodeenvSegmentPrintsNothingWithoutNode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias node="nonode 2>/dev/null" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias node -} - -function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvIsNotSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - node() { - echo "v1.2.3" - } - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unfunction node -} - -function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvDisablePromptIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - node() { - echo "v1.2.3" - } - NODE_VIRTUAL_ENV="node-env" - NODE_VIRTUAL_ENV_DISABLE_PROMPT=true - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unset NODE_VIRTUAL_ENV_DISABLE_PROMPT - unset NODE_VIRTUAL_ENV - unfunction node -} - -function testNodeenvSegmentPrintsAtLeastNodeEnvWithoutNode() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv) - alias node="nonode 2>/dev/null" - NODE_VIRTUAL_ENV="node-env" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{002}⬢ %f%F{002}[node-env] %k%F{000}%f " "$(build_left_prompt)" - - unset NODE_VIRTUAL_ENV - unalias node -} - -function testNodeenvSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv) - node() { - echo "v1.2.3" - } - NODE_VIRTUAL_ENV="node-env" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{002}⬢ %f%F{002}v1.2.3[node-env] %k%F{000}%f " "$(build_left_prompt)" - - unfunction node - unset NODE_VIRTUAL_ENV -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nvm.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nvm.spec deleted file mode 100755 index c9ed430..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/nvm.spec +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test/nvm-test - mkdir -p "${FOLDER}/bin" - OLD_PATH=$PATH - PATH=${FOLDER}/bin:$PATH - cd $FOLDER -} - -function tearDown() { - # Restore old path - PATH="${OLD_PATH}" - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testNvmSegmentPrintsNothingIfNvmIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testNvmSegmentWorksWithoutHavingADefaultAlias() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - function nvm_version() { - [[ ${1} == 'current' ]] && echo 'v4.6.0' || echo 'v1.4.0' - } - - assertEquals "%K{005} %F{000}⬢ %f%F{000}4.6.0 %k%F{005}%f " "$(build_left_prompt)" -} - -function testNvmSegmentPrintsNothingWhenOnDefaultVersion() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nvm custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - function nvm_version() { - [[ ${1} == 'current' ]] && echo 'v4.6.0' || echo 'v4.6.0' - } - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/php_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/php_version.spec deleted file mode 100755 index 6d64c57..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/php_version.spec +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testPhpVersionSegmentPrintsNothingIfPhpIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(php_version custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias php="nophp" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias php -} - -function testPhpVersionSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(php_version) - alias php="echo 'PHP 5.6.27 (cli) (built: Oct 23 2016 11:47:58) -Copyright (c) 1997-2016 The PHP Group -Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies -'" - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{013} %F{255}PHP 5.6.27 %k%F{013}%f " "$(build_left_prompt)" - - unalias php -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/public_ip.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/public_ip.spec deleted file mode 100755 index 334a642..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/public_ip.spec +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - # Test specific - P9K_HOME=$(pwd) - FOLDER=/tmp/powerlevel9k-test - mkdir -p $FOLDER - cd $FOLDER - - # Change cache file, so that the users environment don't - # interfere with the tests. - POWERLEVEL9K_PUBLIC_IP_FILE=$FOLDER/public_ip_file -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test - unset FOLDER - unset P9K_HOME - - # Unset cache file - unset POWERLEVEL9K_PUBLIC_IP_FILE -} - -function testPublicIpSegmentPrintsNothingByDefaultIfHostIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip custom_world) - local POWERLEVEL9K_PUBLIC_IP_HOST='http://unknown.xyz' - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - # We need to overwrite dig, as this is a fallback method that - # uses an alternative host. - alias dig='nodig' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias dig -} - -function testPublicIpSegmentPrintsNoticeIfNotConnected() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - local POWERLEVEL9K_PUBLIC_IP_HOST='http://unknown.xyz' - local POWERLEVEL9K_PUBLIC_IP_NONE="disconnected" - # We need to overwrite dig, as this is a fallback method that - # uses an alternative host. - alias dig='nodig' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}disconnected %k%F{000}%f " "$(build_left_prompt)" - - unalias dig -} - -function testPublicIpSegmentWorksWithWget() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - alias dig='nodig' - alias curl='nocurl' - wget() { - echo "wget 1.2.3.4" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}wget 1.2.3.4 %k%F{000}%f " "$(build_left_prompt)" - - unfunction wget - unalias dig - unalias curl -} - -function testPublicIpSegmentUsesCurlAsFallbackMethodIfWgetIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - alias dig='nodig' - alias wget='nowget' - curl() { - echo "curl 1.2.3.4" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}curl 1.2.3.4 %k%F{000}%f " "$(build_left_prompt)" - - unfunction curl - unalias dig - unalias wget -} - -function testPublicIpSegmentUsesDigAsFallbackMethodIfWgetAndCurlAreNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - alias curl='nocurl' - alias wget='nowget' - dig() { - echo "dig 1.2.3.4" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}dig 1.2.3.4 %k%F{000}%f " "$(build_left_prompt)" - - unfunction dig - unalias curl - unalias wget -} - -function testPublicIpSegmentCachesFile() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - dig() { - echo "first" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}first %k%F{000}%f " "$(build_left_prompt)" - - dig() { - echo "second" - } - - # Segment should not have changed! - assertEquals "%K{000} %F{007}first %k%F{000}%f " "$(build_left_prompt)" - - unfunction dig -} - -function testPublicIpSegmentRefreshesCachesFileAfterTimeout() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - local POWERLEVEL9K_PUBLIC_IP_TIMEOUT=2 - dig() { - echo "first" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}first %k%F{000}%f " "$(build_left_prompt)" - - sleep 3 - dig() { - echo "second" - } - - # Segment should not have changed! - assertEquals "%K{000} %F{007}second %k%F{000}%f " "$(build_left_prompt)" - - unfunction dig -} - -function testPublicIpSegmentRefreshesCachesFileIfEmpty() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - dig() { - echo "first" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}first %k%F{000}%f " "$(build_left_prompt)" - - # Truncate cache file - echo "" >! $POWERLEVEL9K_PUBLIC_IP_FILE - - dig() { - echo "second" - } - - # Segment should not have changed! - assertEquals "%K{000} %F{007}second %k%F{000}%f " "$(build_left_prompt)" - - unfunction dig -} - -function testPublicIpSegmentWhenGoingOnline() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(public_ip) - local POWERLEVEL9K_PUBLIC_IP_METHODS="dig" - local POWERLEVEL9K_PUBLIC_IP_NONE="disconnected" - alias dig="nodig" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}disconnected %k%F{000}%f " "$(build_left_prompt)" - - unalias dig - - dig() { - echo "second" - } - - # Segment should not have changed! - assertEquals "%K{000} %F{007}second %k%F{000}%f " "$(build_left_prompt)" - - unfunction dig -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ram.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ram.spec deleted file mode 100755 index 2c9f169..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ram.spec +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test/ram-test - mkdir -p "${FOLDER}" - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testRamSegmentWorksOnOsx() { - alias vm_stat="echo 'Mach Virtual Memory Statistics: (page size of 4096 bytes) -Pages free: 299687. -Pages active: 1623792. -Pages inactive: 1313411. -'" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="OSX" # Fake OSX - - assertEquals "%K{003} %F{000}RAM %f%F{000}6.15G " "$(prompt_ram left 1 false ${FOLDER})" - - unalias vm_stat -} - -function testRamSegmentWorksOnBsd() { - mkdir -p var/run - echo "avail memory 5678B 299687 4444G 299" > var/run/dmesg.boot - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="BSD" # Fake BSD - - assertEquals "%K{003} %F{000}RAM %f%F{000}0.29M " "$(prompt_ram left 1 false ${FOLDER})" -} - -function testRamSegmentWorksOnLinux() { - mkdir proc - echo "MemAvailable: 299687" > proc/meminfo - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{003} %F{000}RAM %f%F{000}0.29G " "$(prompt_ram left 1 false ${FOLDER})" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/rust_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/rust_version.spec deleted file mode 100755 index 07331ed..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/rust_version.spec +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -TEST_BASE_FOLDER=/tmp/powerlevel9k-test -RUST_TEST_FOLDER="${TEST_BASE_FOLDER}/rust-test" - -function setUp() { - OLDPATH="${PATH}" - mkdir -p "${RUST_TEST_FOLDER}" - PATH="${RUST_TEST_FOLDER}:${PATH}" - - export TERM="xterm-256color" -} - -function tearDown() { - PATH="${OLDPATH}" - rm -fr "${TEST_BASE_FOLDER}" -} - -function mockRust() { - echo "#!/bin/sh\n\necho 'rustc 0.4.1a-alpha'" > "${RUST_TEST_FOLDER}/rustc" - chmod +x "${RUST_TEST_FOLDER}/rustc" -} - -function testRust() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(rust_version) - mockRust - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{208} %F{000}Rust %f%F{000}0.4.1a-alpha %k%F{208}%f " "$(build_left_prompt)" -} - -function testRustPrintsNothingIfRustIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world rust_version) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ssh.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ssh.spec deleted file mode 100755 index 3245231..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/ssh.spec +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testSshSegmentPrintsNothingIfNoSshConnection() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo "world"' - local POWERLEVEL9K_SSH_ICON="ssh-icon" - # Weak test: Emulate No SSH connection by unsetting - # $SSH_CLIENT and $SSH_TTY - unset SSH_CLIENT - unset SSH_TTY - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testSshSegmentWorksIfOnlySshClientIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh) - local POWERLEVEL9K_SSH_ICON="ssh-icon" - # Weak test: Emulate No SSH connection by unsetting - # $SSH_CLIENT and $SSH_TTY - SSH_CLIENT='ssh-client' - unset SSH_TTY - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}ssh-icon%f %k%F{000}%f " "$(build_left_prompt)" - - unset SSH_CLIENT -} - -function testSshSegmentWorksIfOnlySshTtyIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh) - local POWERLEVEL9K_SSH_ICON="ssh-icon" - # Weak test: Emulate No SSH connection by unsetting - # $SSH_CLIENT and $SSH_TTY - SSH_TTY='ssh-tty' - unset SSH_CLIENT - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}ssh-icon%f %k%F{000}%f " "$(build_left_prompt)" - - unset SSH_TTY -} - -function testSshSegmentWorksIfAllNecessaryVariablesAreSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh) - local POWERLEVEL9K_SSH_ICON="ssh-icon" - # Weak test: Emulate No SSH connection by unsetting - # $SSH_CLIENT and $SSH_TTY - SSH_CLIENT='ssh-client' - SSH_TTY='ssh-tty' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{003}ssh-icon%f %k%F{000}%f " "$(build_left_prompt)" - - unset SSH_TTY - unset SSH_CLIENT -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/status.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/status.spec deleted file mode 100755 index 9fb34e0..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/status.spec +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - ### Test specific - # Resets if someone has set these in his/hers env - unset POWERLEVEL9K_STATUS_VERBOSE - unset POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE -} - -function testStatusPrintsNothingIfReturnCodeIsZeroAndVerboseIsUnset() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_STATUS_VERBOSE=false - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testStatusWorksAsExpectedIfReturnCodeIsZeroAndVerboseIsSet() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local POWERLEVEL9K_STATUS_VERBOSE=true - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false - local POWERLEVEL9K_STATUS_HIDE_SIGNAME=true - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{002}✔%f %k%F{000}%f " "$(build_left_prompt)" -} - -function testStatusInGeneralErrorCase() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local POWERLEVEL9K_STATUS_VERBOSE=true - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local RETVAL=1 - - assertEquals "%K{001} %F{226}↵ %f%F{226}1 %k%F{001}%f " "$(build_left_prompt)" -} - -function testPipestatusInErrorCase() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local POWERLEVEL9K_STATUS_VERBOSE=true - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=true - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local -a RETVALS - RETVALS=(0 0 1 0) - - assertEquals "%K{001} %F{226}↵ %f%F{226}0|0|1|0 %k%F{001}%f " "$(build_left_prompt)" -} - -function testStatusCrossWinsOverVerbose() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false - local POWERLEVEL9K_STATUS_VERBOSE=true - local POWERLEVEL9K_STATUS_CROSS=true - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local RETVAL=1 - - assertEquals "%K{000} %F{001}✘%f %k%F{000}%f " "$(build_left_prompt)" -} - -function testStatusShowsSignalNameInErrorCase() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false - local POWERLEVEL9K_STATUS_VERBOSE=true - local POWERLEVEL9K_STATUS_HIDE_SIGNAME=false - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - local RETVAL=132 - - assertEquals "%K{001} %F{226}↵ %f%F{226}SIGILL(4) %k%F{001}%f " "$(build_left_prompt)" -} - -function testStatusSegmentIntegrated() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) - local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=() - local POWERLEVEL9K_STATUS_CROSS=true - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - false; powerlevel9k_prepare_prompts - - assertEquals "%f%b%k%K{000} %F{001}✘%f %k%F{000}%f " "${(e)PROMPT}" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swap.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swap.spec deleted file mode 100755 index 7db5416..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swap.spec +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test/swap-test - mkdir -p "${FOLDER}" - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testSwapSegmentWorksOnOsx() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(swap) - sysctl() { - echo "vm.swapusage: total = 3072,00M used = 1620,50M free = 1451,50M (encrypted)" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="OSX" # Fake OSX - - assertEquals "%K{003} %F{000}SWP %f%F{000}1.58G " "$(prompt_swap left 1 false ${FOLDER})" - - unfunction sysctl -} - -function testSwapSegmentWorksOnLinux() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(swap) - mkdir proc - echo "SwapTotal: 1000000" > proc/meminfo - echo "SwapFree: 1000" >> proc/meminfo - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - local OS="Linux" # Fake Linux - - assertEquals "%K{003} %F{000}SWP %f%F{000}0.95G " "$(prompt_swap left 1 false ${FOLDER})" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swift_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swift_version.spec deleted file mode 100755 index 47fc0b7..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/swift_version.spec +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test - mkdir -p "${FOLDER}" - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testSwiftSegmentPrintsNothingIfSwiftIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(swift_version custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias swift="noswift" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias swift -} - -function testSwiftSegmentWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(swift_version) - function swift() { - echo "Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)\nTarget: x86_64-apple-macosx10.9" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{005} %F{007}Swift %f%F{007}3.0.1 %k%F{005}%f " "$(build_left_prompt)" - - unfunction swift -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/symfony_version.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/symfony_version.spec deleted file mode 100755 index cb48072..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/symfony_version.spec +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test - mkdir -p "${FOLDER}" - cd $FOLDER -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testSymfonyVersionSegmentPrintsNothingIfPhpIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(symfony2_version custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - alias php="nophp" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unalias php -} - -function testSymfonyVersionSegmentPrintsNothingIfSymfonyIsNotAvailable() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(symfony2_version custom_world) - # "Symfony" is not a command, but rather a framework. - # To sucessfully execute this test, we just need to - # navigate into a folder that does not contain symfony. - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testSymfonyVersionPrintsNothingIfPhpThrowsAnError() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(symfony2_version custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - mkdir app - touch app/AppKernel.php - function php() { - echo "Warning: Unsupported declare strict_types in /Users/dr/Privat/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 19 - - Parse error: parse error, expecting `;´ or `{´ in /Users/dr/Privat/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 97" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" - - unfunction php -} - -function testSymfonyVersionSegmentWorks() { - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(symfony2_version) - mkdir app - touch app/AppKernel.php - - function php() { - echo "Symfony version 3.1.4 - app/dev/debug" - } - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{240} %F{000}SF %f%F{000}3.1.4 %k%F{240}%f " "$(build_left_prompt)" - - unfunction php -} - -function testSymfonyVersionSegmentWorksInNestedFolder() { - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(symfony2_version) - mkdir app - touch app/AppKernel.php - - function php() { - echo "Symfony version 3.1.4 - app/dev/debug" - } - - mkdir -p src/P9K/AppBundle - cd src/P9K/AppBundle - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{240} %F{000}SF %f%F{000}3.1.4 %k%F{240}%f " "$(build_left_prompt)" - - unfunction php -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/todo.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/todo.spec deleted file mode 100755 index 875c45f..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/todo.spec +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test - mkdir -p "${FOLDER}" - mkdir ${FOLDER}/bin - OLD_PATH=$PATH - PATH=${FOLDER}/bin:$PATH - cd $FOLDER -} - -function tearDown() { - # Reset PATH - PATH=$OLD_PATH - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test -} - -function testTodoSegmentPrintsNothingIfTodoShIsNotInstalled() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(todo custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)" -} - -function testTodoSegmentWorksAsExpected() { - # TODO: Skript in den PATH legen! - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(todo) - echo '#!/bin/sh' > ${FOLDER}/bin/todo.sh - echo 'echo "TODO: 34 of 100 tasks shown";' >> ${FOLDER}/bin/todo.sh - chmod +x ${FOLDER}/bin/todo.sh - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{244} %F{000}☑ %f%F{000}100 %k%F{244}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-git.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-git.spec deleted file mode 100755 index bddecf6..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-git.spec +++ /dev/null @@ -1,378 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and git init it. - FOLDER=/tmp/powerlevel9k-test/vcs-test - mkdir -p "${FOLDER}" - cd $FOLDER - - # Set username and email - OLD_GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME - GIT_AUTHOR_NAME="Testing Tester" - OLD_GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL - GIT_AUTHOR_EMAIL="test@powerlevel9k.theme" - - # Set default username if not already set! - if [[ -z $(git config user.name) ]]; then - GIT_AUTHOR_NAME_SET_BY_TEST=true - git config --global user.name "${GIT_AUTHOR_NAME}" - fi - # Set default email if not already set! - if [[ -z $(git config user.email) ]]; then - GIT_AUTHOR_EMAIL_SET_BY_TEST=true - git config --global user.email "${GIT_AUTHOR_EMAIL}" - fi - - # Initialize FOLDER as git repository - git init 1>/dev/null -} - -function tearDown() { - if [[ -n "${OLD_GIT_AUTHOR_NAME}" ]]; then - GIT_AUTHOR_NAME=$OLD_GIT_AUTHOR - unset OLD_GIT_AUTHOR_NAME - else - unset GIT_AUTHOR_NAME - fi - - if [[ -n "${OLD_GIT_AUTHOR_EMAIL}" ]]; then - GIT_AUTHOR_EMAIL=$OLD_GIT_AUTHOR_EMAIL - unset OLD_GIT_AUTHOR_EMAIL - else - unset GIT_AUTHOR_EMAIL - fi - - if [[ "${GIT_AUTHOR_NAME_SET_BY_TEST}" == "true" ]]; then - git config --global --unset user.name - fi - if [[ "${GIT_AUTHOR_EMAIL_SET_BY_TEST}" == "true" ]]; then - git config --global --unset user.email - fi - - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test - unset FOLDER -} - -function testColorOverridingForCleanStateWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_CLEAN_FOREGROUND='cyan' - local POWERLEVEL9K_VCS_CLEAN_BACKGROUND='white' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{006} master %k%F{007}%f " "$(build_left_prompt)" -} - -function testColorOverridingForModifiedStateWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='red' - local POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow' - - touch testfile - git add testfile - git commit -m "test" 1>/dev/null - echo "test" > testfile - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{001} master ● %k%F{003}%f " "$(build_left_prompt)" -} - -function testColorOverridingForUntrackedStateWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='cyan' - local POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow' - - touch testfile - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{006} master ? %k%F{003}%f " "$(build_left_prompt)" -} - -function testGitIconWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_GIT_ICON='Git-Icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000}Git-Icon %f%F{000} master %k%F{002}%f " "$(build_left_prompt)" -} - -function testGitlabIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_GIT_GITLAB_ICON='GL-Icon' - - # Add a GitLab project as remote origin. This is - # sufficient to show the GitLab-specific icon. - git remote add origin https://gitlab.com/dritter/gitlab-test-project.git - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000}GL-Icon %f%F{000} master %k%F{002}%f " "$(build_left_prompt)" -} - -function testBitbucketIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_GIT_BITBUCKET_ICON='BB-Icon' - - # Add a BitBucket project as remote origin. This is - # sufficient to show the BitBucket-specific icon. - git remote add origin https://dritter@bitbucket.org/dritter/dr-test.git - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000}BB-Icon %f%F{000} master %k%F{002}%f " "$(build_left_prompt)" -} - -function testGitHubIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_GIT_GITHUB_ICON='GH-Icon' - - # Add a GitHub project as remote origin. This is - # sufficient to show the GitHub-specific icon. - git remote add origin https://github.com/dritter/test.git - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000}GH-Icon %f%F{000} master %k%F{002}%f " "$(build_left_prompt)" -} - -function testUntrackedFilesIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Create untracked file - touch "i-am-untracked.txt" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} master ? %k%F{002}%f " "$(build_left_prompt)" -} - -function testStagedFilesIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_STAGED_ICON='+' - - # Create staged file - touch "i-am-added.txt" - git add i-am-added.txt &>/dev/null - git commit -m "initial commit" &>/dev/null - echo "xx" >> i-am-added.txt - git add i-am-added.txt &>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000} master + %k%F{003}%f " "$(build_left_prompt)" -} - -function testUnstagedFilesIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_UNSTAGED_ICON='M' - - # Create unstaged (modified, but not added to index) file - touch "i-am-modified.txt" - git add i-am-modified.txt - git commit -m "Add File" 1>/dev/null - echo "xx" > i-am-modified.txt - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000} master M %k%F{003}%f " "$(build_left_prompt)" -} - -function testStashIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_STASH_ICON='S' - - # Create modified file - touch "i-am-modified.txt" - git add i-am-modified.txt - git commit -m "Add File" 1>/dev/null - echo "xx" > i-am-modified.txt - git stash 1>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} master S1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testTagIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_TAG_ICON='T' - - touch "file.txt" - git add file.txt - git commit -m "Add File" 1>/dev/null - git tag "v0.0.1" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} master Tv0.0.1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testTagIconInDetachedHeadState() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_TAG_ICON='T' - - touch "file.txt" - git add file.txt - git commit -m "Add File" &>/dev/null - git tag "v0.0.1" - touch "file2.txt" - git add file2.txt - git commit -m "Add File2" &>/dev/null - git checkout v0.0.1 &>/dev/null - local hash=$(git rev-list -n 1 --abbrev-commit --abbrev=8 HEAD) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} ${hash} Tv0.0.1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testActionHintWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - - touch "i-am-modified.txt" - git add i-am-modified.txt - git commit -m "Add File" &>/dev/null - - git clone . ../vcs-test2 &>/dev/null - echo "xx" >> i-am-modified.txt - git commit -a -m "Modified file" &>/dev/null - - cd ../vcs-test2 - echo "yy" >> i-am-modified.txt - git commit -a -m "Provoke conflict" &>/dev/null - git pull &>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000} master %F{red}| merge%f %k%F{003}%f " "$(build_left_prompt)" -} - -function testIncomingHintWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='I' - - touch "i-am-modified.txt" - git add i-am-modified.txt - git commit -m "Add File" &>/dev/null - - git clone . ../vcs-test2 &>/dev/null - echo "xx" >> i-am-modified.txt - git commit -a -m "Modified file" &>/dev/null - - cd ../vcs-test2 - git fetch &>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} master I1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testOutgoingHintWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='o' - - touch "i-am-modified.txt" - git add i-am-modified.txt - git commit -m "Add File" &>/dev/null - - git clone . ../vcs-test2 &>/dev/null - - cd ../vcs-test2 - - echo "xx" >> i-am-modified.txt - git commit -a -m "Modified file" &>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} master o1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testShorteningCommitHashWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_SHOW_CHANGESET=true - local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' - - touch "file.txt" - git add file.txt - git commit -m "Add File" 1>/dev/null - local hash=$(git rev-list -n 1 --abbrev-commit --abbrev=3 HEAD) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - # This test needs to call powerlevel9k_vcs_init, where - # the changeset is truncated. - powerlevel9k_vcs_init - assertEquals "%K{002} %F{000}${hash}  master %k%F{002}%f " "$(build_left_prompt)" -} - -function testShorteningCommitHashIsNotShownIfShowChangesetIsFalse() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_SHOW_CHANGESET=false - local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' - - touch "file.txt" - git add file.txt - git commit -m "Add File" 1>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - # This test needs to call powerlevel9k_vcs_init, where - # the changeset is truncated. - powerlevel9k_vcs_init - assertEquals "%K{002} %F{000} master %k%F{002}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-hg.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-hg.spec deleted file mode 100755 index 2903f54..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vcs-hg.spec +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" - - P9K_HOME=$(pwd) - ### Test specific - # Create default folder and hg init it. - FOLDER=/tmp/powerlevel9k-test/vcs-test - mkdir -p "${FOLDER}" - cd $FOLDER - - export HGUSER="Test bot " - - hg init 1>/dev/null -} - -function tearDown() { - # Go back to powerlevel9k folder - cd "${P9K_HOME}" - # Remove eventually created test-specific folder - rm -fr "${FOLDER}" &>/dev/null - # At least remove test folder completely - rm -fr /tmp/powerlevel9k-test &>/dev/null - unset FOLDER - unset HGUSER -} - -function testColorOverridingForCleanStateWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_CLEAN_FOREGROUND='cyan' - local POWERLEVEL9K_VCS_CLEAN_BACKGROUND='white' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{007} %F{006} default %k%F{007}%f " "$(build_left_prompt)" -} - -function testColorOverridingForModifiedStateWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='red' - local POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow' - - touch testfile - hg add testfile - hg commit -m "test" 1>/dev/null - echo "test" > testfile - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{001} default ● %k%F{003}%f " "$(build_left_prompt)" -} - -# There is no staging area in mercurial, therefore there are no "untracked" -# files.. In case there are added files, we show the VCS segment with a -# yellow background. -# This may be improved in future versions, to be a bit more consistent with -# the git part. -function testAddedFilesIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - touch "myfile.txt" - hg add myfile.txt - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000} default ● %k%F{003}%f " "$(build_left_prompt)" -} - -# We don't support tagging in mercurial right now.. -function testTagIconWorks() { - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_TAG_ICON='T' - - touch "file.txt" - hg add file.txt - hg commit -m "Add File" 1>/dev/null - hg tag "v0.0.1" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} default Tv0.0.1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testTagIconInDetachedHeadState() { - startSkipping # Skip test - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_TAG_ICON='T' - - touch "file.txt" - hg add file.txt - hg commit -m "Add File" &>/dev/null - hg tag "v0.0.1" - touch "file2.txt" - hg add file2.txt - hg commit -m "Add File2" &>/dev/null - hg checkout v0.0.1 &>/dev/null - local hash=$(hg id) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} ${hash} Tv0.0.1 %k%F{002}%f " "$(build_left_prompt)" -} - -function testActionHintWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - touch "i-am-modified.txt" - hg add i-am-modified.txt - hg commit -m "Add File" &>/dev/null - - hg clone . ../vcs-test2 &>/dev/null - echo "xx" >> i-am-modified.txt - hg commit -m "Modified file" &>/dev/null - - cd ../vcs-test2 - echo "yy" >> i-am-modified.txt - hg commit -m "Provoke conflict" 2>/dev/null - hg pull 1>/dev/null - hg merge --tool internal:merge >/dev/null 2>&1 - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{003} %F{000} default %F{red}| merging%f %k%F{003}%f " "$(build_left_prompt)" -} - -function testShorteningCommitHashWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_SHOW_CHANGESET=true - local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' - - touch "file.txt" - hg add file.txt - hg commit -m "Add File" 1>/dev/null - local hash=$(hg id | head -c ${POWERLEVEL9K_CHANGESET_HASH_LENGTH}) - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - # This test needs to call powerlevel9k_vcs_init, where - # the changeset is truncated. - powerlevel9k_vcs_init - - assertEquals "%K{002} %F{000}${hash}  default %k%F{002}%f " "$(build_left_prompt)" -} - -function testShorteningCommitHashIsNotShownIfShowChangesetIsFalse() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_SHOW_CHANGESET=false - local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' - - touch "file.txt" - hg add file.txt - hg commit -m "Add File" 1>/dev/null - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - # This test needs to call powerlevel9k_vcs_init, where - # the changeset is truncated. - powerlevel9k_vcs_init - - assertEquals "%K{002} %F{000} default %k%F{002}%f " "$(build_left_prompt)" -} - -function testMercurialIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_HG_ICON='HG-Icon' - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000}HG-Icon %f%F{000} default %k%F{002}%f " "$(build_left_prompt)" -} - -function testBookmarkIconWorks() { - local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) - local POWERLEVEL9K_VCS_BOOKMARK_ICON='B' - hg bookmark "initial" - - # Load Powerlevel9k - source ${P9K_HOME}/powerlevel9k.zsh-theme - - assertEquals "%K{002} %F{000} default Binitial %k%F{002}%f " "$(build_left_prompt)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vi_mode.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vi_mode.spec deleted file mode 100755 index 6a3a07b..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/segments/vi_mode.spec +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -# Required for shunit2 to run correctly -setopt shwordsplit -SHUNIT_PARENT=$0 - -function setUp() { - export TERM="xterm-256color" -} - -function testViInsertModeWorks() { - local KEYMAP='viins' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{004}INSERT " "$(prompt_vi_mode left 1 false)" -} - -function testViInsertModeWorksWhenLabeledAsMain() { - local KEYMAP='main' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{004}INSERT " "$(prompt_vi_mode left 1 false)" -} - -function testViCommandModeWorks() { - local KEYMAP='vicmd' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{007}NORMAL " "$(prompt_vi_mode left 1 false)" -} - -function testViInsertModeStringIsCustomizable() { - local KEYMAP='viins' - - # Load Powerlevel9k - source powerlevel9k.zsh-theme - - assertEquals "%K{000} %F{004}INSERT " "$(prompt_vi_mode left 1 false)" -} - -source shunit2/shunit2 \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerlevel9k/test/suite.spec b/.zprezto/modules/prompt/external/powerlevel9k/test/suite.spec deleted file mode 100755 index 0e51d32..0000000 --- a/.zprezto/modules/prompt/external/powerlevel9k/test/suite.spec +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -local failed=false - -for test in **/*.spec; do - echo - echo "Now executing ${test}" - if [[ "${test}" == "test/suite.spec" ]]; then - continue; - fi - ./${test} || failed=true -done - -if [[ "${failed}" == "true" ]]; then - exit 1 -fi \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerline/README.md b/.zprezto/modules/prompt/external/powerline/README.md deleted file mode 100644 index 8b2b6df..0000000 --- a/.zprezto/modules/prompt/external/powerline/README.md +++ /dev/null @@ -1,60 +0,0 @@ -Powerline for [Prezto](http://github.com/sorin-ionescu/prezto) ZSH - - -## Features - -* Single line prompt -* Git branch info (current branch and modified states) -* Time since last commit -* RVM current ruby version / gemset - -![Example](https://raw.github.com/davidjrice/prezto_powerline/master/prompt.png) - -## Dependencies - -* [skwp/dotfiles](http://github.com/skwp/dotfiles) *(YADR)* -* [prezto](https://github.com/sorin-ionescu/prezto) (included by YADR) - -## Installation - - # Install YADR - git clone https://github.com/skwp/dotfiles ~/.yadr - cd ~/.yadr && rake install - - # Create a ~/.secrets file (required by YADR) - touch ~/.secrets - - # Install the prompt - curl https://raw.github.com/davidjrice/prezto_powerline/master/prompt_powerline_setup > ~/.zsh.prompts/prompt_powerline_setup - - # Install Solarized - git clone https://github.com/altercation/solarized - cd solarized - - # e.g. for iTerm - cd iterm2-colors-solarized/ - open Solarized\ Dark.itermcolors - # this should load the colours for iTerm, but they are not configured yet - - # in iTerm2 open preferences - # profiles > default > colours > load presets > Solarized Dark - # profiles > default > terminal > report terminal type > "xterm-256color" - - # Enable - echo "prompt powerline" > ~/.zsh.after/prompt.zsh - - -## Inspiration - -This prompt is inspired by: - -* [oh-my-zsh-powerline-theme](http://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme) -* [robbl oh-my-zsh theme](http://github.com/robbl/oh-my-zsh-config) -* [SKWP prezto theme](http://github.com/skwp/dotfiles/blob/master/zsh/prezto-themes/prompt_skwp_setup) - -## TODO - -* Moar configurable -* Extract functions to Prezto modules? -* Use better Prezto best practices...? -* Handle NVM version info? \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/powerline/prompt.png b/.zprezto/modules/prompt/external/powerline/prompt.png deleted file mode 100644 index b62616d..0000000 Binary files a/.zprezto/modules/prompt/external/powerline/prompt.png and /dev/null differ diff --git a/.zprezto/modules/prompt/external/powerline/prompt_powerline_setup b/.zprezto/modules/prompt/external/powerline/prompt_powerline_setup deleted file mode 100644 index a27b67b..0000000 --- a/.zprezto/modules/prompt/external/powerline/prompt_powerline_setup +++ /dev/null @@ -1,185 +0,0 @@ -# -# A ZSH theme based on a combination of the skwp prezto theme and the robl ohmyzsh theme. -# * RVM info shown on the right -# * Git branch info on the left -# * Single line prompt -# * Time since last commit on the left -# * Time in place of user@hostname -# -# Authors: -# David Rice - -ZSH_THEME_REP_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}" -ZSH_THEME_REP_TIME_SINCE_COMMIT_MEDIUM="%{$fg[yellow]%}" -ZSH_THEME_REP_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" -ZSH_THEME_REP_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" - -# returns the time since last git commit -git_time_details()() { - # only proceed if there is actually a git repository - if $(git rev-parse --git-dir > /dev/null 2>&1); then - # only proceed if there is actually a commit - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then - # get the last commit hash - # lc_hash=$(git log --pretty=format:'%h' -1 2> /dev/null) - # get the last commit time - lc_time=$(git log --pretty=format:'%at' -1 2> /dev/null) - - now=$(date +%s) - seconds_since_last_commit=$((now-lc_time)) - lc_time_since=$(time_since_commit $seconds_since_last_commit) - - echo "$lc_time_since" - else - echo "" - fi - else - echo "" - fi -} - -# returns the time by given seconds -time_since_commit()() { - seconds_since_last_commit=$(($1 + 0)) - - # totals - MINUTES=$((seconds_since_last_commit / 60)) - HOURS=$((seconds_since_last_commit/3600)) - - # sub-hours and sub-minutes - DAYS=$((seconds_since_last_commit / 86400)) - SUB_HOURS=$((HOURS % 24)) - SUB_MINUTES=$((MINUTES % 60)) - - if [ "$HOURS" -gt 24 ]; then - echo "${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m" - elif [ "$MINUTES" -gt 60 ]; then - echo "${HOURS}h${SUB_MINUTES}m" - else - echo "${MINUTES}m" - fi -} - -rvm_info_for_prompt() { - if [[ -d ~/.rvm/ ]]; then - local ruby_version=$(~/.rvm/bin/rvm-prompt) - if [ -n "$ruby_version" ]; then - echo "$ruby_version" - fi - else - echo "" - fi -} - -prompt_powerline_precmd() { - # Check for untracked files or updated submodules since vcs_info doesn't. - if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - fmt_branch="%b%u%c${__PROMPT_SKWP_COLORS[4]}●%f" - else - fmt_branch="%b%u%c" - fi - zstyle ':vcs_info:*:prompt:*' formats "${fmt_branch}" - - vcs_info 'prompt' - RVM_PRECMD_INFO=$(rvm_info_for_prompt) - - # zstyle ':prezto:module:ruby' rvm '%r' -} - -prompt_powerline_setup() { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent subst) - - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - add-zsh-hook precmd prompt_powerline_precmd - - # Use extended color pallete if available. - if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then - __PROMPT_SKWP_COLORS=( - "%F{81}" # turquoise - "%F{166}" # orange - "%F{135}" # purple - "%F{161}" # hotpink - "%F{118}" # limegreen - ) - else - __PROMPT_SKWP_COLORS=( - "%F{cyan}" - "%F{yellow}" - "%F{magenta}" - "%F{red}" - "%F{green}" - ) - fi - - # Enable VCS systems you use. - zstyle ':vcs_info:*' enable bzr git hg svn - - # check-for-changes can be really slow. - # You should disable it if you work with large repositories. - zstyle ':vcs_info:*:prompt:*' check-for-changes true - - # Formats: - # %b - branchname - # %u - unstagedstr (see below) - # %c - stagedstr (see below) - # %a - action (e.g. rebase-i) - # %R - repository path - # %S - path in the repository - # %n - user - # %m - machine hostname - - # local fmt_branch="(${__PROMPT_SKWP_COLORS[1]}%b%f%u%c)" - local fmt_branch="${__PROMPT_SKWP_COLORS[2]}%b%f%u%c" - local fmt_action="${__PROMPT_SKWP_COLORS[5]}%a%f" - local fmt_unstaged="${__PROMPT_SKWP_COLORS[2]}●%f" - local fmt_staged="${__PROMPT_SKWP_COLORS[5]}●%f" - - zstyle ':vcs_info:*:prompt:*' unstagedstr "${fmt_unstaged}" - zstyle ':vcs_info:*:prompt:*' stagedstr "${fmt_staged}" - zstyle ':vcs_info:*:prompt:*' actionformats "${fmt_branch}${fmt_action}" - zstyle ':vcs_info:*:prompt:*' formats "${fmt_branch}" - zstyle ':vcs_info:*:prompt:*' nvcsformats "" - - # SPLIT RVM PROMPT INFO - # TODO: should assign this to local variable? somehow doesn't work correctly. - rvm_split=("${(s/@/)$(rvm_info_for_prompt)}") - - # if [ "$POWERLINE_RIGHT_B" = "" ]; then - # POWERLINE_RIGHT_B=%D{%H:%M:%S} - local powerline_right_b=$rvm_split[1] - # fi - - # if [ "$POWERLINE_RIGHT_A" = "" ]; then - local powerline_right_a=$rvm_split[2] - # fi - - # Setup powerline style colouring - POWERLINE_COLOR_BG_GRAY=%K{240} - POWERLINE_COLOR_BG_LIGHT_GRAY=%K{240} - POWERLINE_COLOR_BG_WHITE=%K{255} - - POWERLINE_COLOR_FG_GRAY=%F{240} - POWERLINE_COLOR_FG_LIGHT_GRAY=%F{240} - POWERLINE_COLOR_FG_WHITE=%F{255} - - POWERLINE_SEPARATOR=$'\uE0B0' - POWERLINE_R_SEPARATOR=$'\uE0B2' - - POWERLINE_LEFT_A="%K{green}%F{white} %~ %k%f%F{green}%K{blue}"$POWERLINE_SEPARATOR - POWERLINE_LEFT_B="%k%f%F{white}%K{blue} "'${vcs_info_msg_0_}'" %k%f%F{blue}%K{black}"$POWERLINE_SEPARATOR - POWERLINE_LEFT_C=" %k%f%F{white}%K{black}"'$(git_time_details)'" %k%f%F{black}"$POWERLINE_SEPARATOR"%f " - - PROMPT=$POWERLINE_LEFT_A$POWERLINE_LEFT_B$POWERLINE_LEFT_C - # RPROMPT=$POWERLINE_COLOR_FG_WHITE$POWERLINE_R_SEPARATOR"%f$POWERLINE_COLOR_BG_WHITE $POWERLINE_COLOR_FG_GRAY$powerline_right_b "$POWERLINE_R_SEPARATOR"%f%k$POWERLINE_COLOR_BG_GRAY$POWERLINE_COLOR_FG_WHITE $powerline_right_a %f%k" - # RPROMPT=$POWERLINE_COLOR_FG_WHITE$POWERLINE_R_SEPARATOR"%f$POWERLINE_COLOR_BG_WHITE $POWERLINE_COLOR_FG_GRAY"'$powerline_right_b'" "$POWERLINE_R_SEPARATOR"%f%k$POWERLINE_COLOR_BG_GRAY$POWERLINE_COLOR_FG_WHITE "'$powerline_right_a'" %f%k" - RPROMPT=$POWERLINE_COLOR_FG_WHITE$POWERLINE_R_SEPARATOR"%f$POWERLINE_COLOR_BG_WHITE $POWERLINE_COLOR_FG_GRAY"'$(rvm_info_for_prompt)'" " -} - -prompt_powerline_setup "$@" - - - diff --git a/.zprezto/modules/prompt/external/pure/arch/PKGBUILD b/.zprezto/modules/prompt/external/pure/arch/PKGBUILD deleted file mode 100644 index 18cdc92..0000000 --- a/.zprezto/modules/prompt/external/pure/arch/PKGBUILD +++ /dev/null @@ -1,26 +0,0 @@ -# Author: Sindre Sorhus -# Maintainer: Pat Brisbin -# Contributor: Emil Falk -pkgname=zsh-pure-prompt-git -pkgver=r61.7d3b317 -pkgrel=1 -pkgdesc='A minimal and pure prompt for zsh.' -arch=('any') -url='https://github.com/sindresorhus/pure' -license=('MIT') -depends=('zsh' 'git') -source=("$pkgname::git://github.com/sindresorhus/pure.git") -sha256sums=('SKIP') - -pkgver() { - cd $srcdir/$pkgname - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" -} - -package() { - cd $srcdir/$pkgname - install -Dm644 pure.zsh \ - "$pkgdir/usr/share/zsh/functions/Prompts/prompt_pure_setup" - install -Dm644 async.zsh \ - "$pkgdir/usr/share/zsh/functions/async" -} diff --git a/.zprezto/modules/prompt/external/pure/async.zsh b/.zprezto/modules/prompt/external/pure/async.zsh deleted file mode 100644 index 3e3830d..0000000 --- a/.zprezto/modules/prompt/external/pure/async.zsh +++ /dev/null @@ -1,497 +0,0 @@ -#!/usr/bin/env zsh - -# -# zsh-async -# -# version: 1.6.0 -# author: Mathias Fredriksson -# url: https://github.com/mafredri/zsh-async -# - -# Produce debug output from zsh-async when set to 1. -typeset -g ASYNC_DEBUG=${ASYNC_DEBUG:-0} - -# Wrapper for jobs executed by the async worker, gives output in parseable format with execution time -_async_job() { - # Disable xtrace as it would mangle the output. - setopt localoptions noxtrace - - # Store start time for job. - float -F duration=$EPOCHREALTIME - - # Run the command and capture both stdout (`eval`) and stderr (`cat`) in - # separate subshells. When the command is complete, we grab write lock - # (mutex token) and output everything except stderr inside the command - # block, after the command block has completed, the stdin for `cat` is - # closed, causing stderr to be appended with a $'\0' at the end to mark the - # end of output from this job. - local stdout stderr ret tok - { - stdout=$(eval "$@") - ret=$? - duration=$(( EPOCHREALTIME - duration )) # Calculate duration. - - # Grab mutex lock, stalls until token is available. - read -r -k 1 -p tok || exit 1 - - # Return output ( ). - print -r -n - ${(q)1} $ret ${(q)stdout} $duration - } 2> >(stderr=$(cat) && print -r -n - " "${(q)stderr}$'\0') - - # Unlock mutex by inserting a token. - print -n -p $tok -} - -# The background worker manages all tasks and runs them without interfering with other processes -_async_worker() { - # Reset all options to defaults inside async worker. - emulate -R zsh - - # Make sure monitor is unset to avoid printing the - # pids of child processes. - unsetopt monitor - - # Redirect stderr to `/dev/null` in case unforseen errors produced by the - # worker. For example: `fork failed: resource temporarily unavailable`. - # Some older versions of zsh might also print malloc errors (know to happen - # on at least zsh 5.0.2 and 5.0.8) likely due to kill signals. - exec 2>/dev/null - - # When a zpty is deleted (using -d) all the zpty instances created before - # the one being deleted receive a SIGHUP, unless we catch it, the async - # worker would simply exit (stop working) even though visible in the list - # of zpty's (zpty -L). - TRAPHUP() { - return 0 # Return 0, indicating signal was handled. - } - - local -A storage - local unique=0 - local notify_parent=0 - local parent_pid=0 - local coproc_pid=0 - local processing=0 - - local -a zsh_hooks zsh_hook_functions - zsh_hooks=(chpwd periodic precmd preexec zshexit zshaddhistory) - zsh_hook_functions=(${^zsh_hooks}_functions) - unfunction $zsh_hooks &>/dev/null # Deactivate all zsh hooks inside the worker. - unset $zsh_hook_functions # And hooks with registered functions. - unset zsh_hooks zsh_hook_functions # Cleanup. - - child_exit() { - local -a pids - pids=(${${(v)jobstates##*:*:}%\=*}) - - # If coproc (cat) is the only child running, we close it to avoid - # leaving it running indefinitely and cluttering the process tree. - if (( ! processing )) && [[ $#pids = 1 ]] && [[ $coproc_pid = $pids[1] ]]; then - coproc : - coproc_pid=0 - fi - - # On older version of zsh (pre 5.2) we notify the parent through a - # SIGWINCH signal because `zpty` did not return a file descriptor (fd) - # prior to that. - if (( notify_parent )); then - # We use SIGWINCH for compatibility with older versions of zsh - # (pre 5.1.1) where other signals (INFO, ALRM, USR1, etc.) could - # cause a deadlock in the shell under certain circumstances. - kill -WINCH $parent_pid - fi - } - - # Register a SIGCHLD trap to handle the completion of child processes. - trap child_exit CHLD - - # Process option parameters passed to worker - while getopts "np:u" opt; do - case $opt in - n) notify_parent=1;; - p) parent_pid=$OPTARG;; - u) unique=1;; - esac - done - - killjobs() { - local tok - local -a pids - pids=(${${(v)jobstates##*:*:}%\=*}) - - # No need to send SIGHUP if no jobs are running. - (( $#pids == 0 )) && continue - (( $#pids == 1 )) && [[ $coproc_pid = $pids[1] ]] && continue - - # Grab lock to prevent half-written output in case a child - # process is in the middle of writing to stdin during kill. - (( coproc_pid )) && read -r -k 1 -p tok - - kill -HUP -$$ # Send to entire process group. - coproc : # Quit coproc. - coproc_pid=0 # Reset pid. - } - - local request - local -a cmd - while :; do - # Wait for jobs sent by async_job. - read -r -d $'\0' request || { - # Since we handle SIGHUP above (and thus do not know when `zpty -d`) - # occurs, a failure to read probably indicates that stdin has - # closed. This is why we propagate the signal to all children and - # exit manually. - kill -HUP -$$ # Send SIGHUP to all jobs. - exit 0 - } - - # Check for non-job commands sent to worker - case $request in - _unset_trap) notify_parent=0; continue;; - _killjobs) killjobs; continue;; - esac - - # Parse the request using shell parsing (z) to allow commands - # to be parsed from single strings and multi-args alike. - cmd=("${(z)request}") - - # Name of the job (first argument). - local job=$cmd[1] - - # If worker should perform unique jobs - if (( unique )); then - # Check if a previous job is still running, if yes, let it finnish - for pid in ${${(v)jobstates##*:*:}%\=*}; do - if [[ ${storage[$job]} == $pid ]]; then - continue 2 - fi - done - fi - - # Guard against closing coproc from trap before command has started. - processing=1 - - # Because we close the coproc after the last job has completed, we must - # recreate it when there are no other jobs running. - if (( ! coproc_pid )); then - # Use coproc as a mutex for synchronized output between children. - coproc cat - coproc_pid="$!" - # Insert token into coproc - print -n -p "t" - fi - - # Run job in background, completed jobs are printed to stdout. - _async_job $cmd & - # Store pid because zsh job manager is extremely unflexible (show jobname as non-unique '$job')... - storage[$job]="$!" - - processing=0 # Disable guard. - done -} - -# -# Get results from finnished jobs and pass it to the to callback function. This is the only way to reliably return the -# job name, return code, output and execution time and with minimal effort. -# -# usage: -# async_process_results -# -# callback_function is called with the following parameters: -# $1 = job name, e.g. the function passed to async_job -# $2 = return code -# $3 = resulting stdout from execution -# $4 = execution time, floating point e.g. 2.05 seconds -# $5 = resulting stderr from execution -# $6 = has next result in buffer (0 = buffer empty, 1 = yes) -# -async_process_results() { - setopt localoptions unset noshwordsplit noksharrays noposixidentifiers noposixstrings - - local worker=$1 - local callback=$2 - local caller=$3 - local -a items - local null=$'\0' data - integer -l len pos num_processed - - typeset -gA ASYNC_PROCESS_BUFFER - - # Read output from zpty and parse it if available. - while zpty -r -t $worker data 2>/dev/null; do - ASYNC_PROCESS_BUFFER[$worker]+=$data - len=${#ASYNC_PROCESS_BUFFER[$worker]} - pos=${ASYNC_PROCESS_BUFFER[$worker][(i)$null]} # Get index of NULL-character (delimiter). - - # Keep going until we find a NULL-character. - if (( ! len )) || (( pos > len )); then - continue - fi - - while (( pos <= len )); do - # Take the content from the beginning, until the NULL-character and - # perform shell parsing (z) and unquoting (Q) as an array (@). - items=("${(@Q)${(z)ASYNC_PROCESS_BUFFER[$worker][1,$pos-1]}}") - - # Remove the extracted items from the buffer. - ASYNC_PROCESS_BUFFER[$worker]=${ASYNC_PROCESS_BUFFER[$worker][$pos+1,$len]} - - len=${#ASYNC_PROCESS_BUFFER[$worker]} - if (( len > 1 )); then - pos=${ASYNC_PROCESS_BUFFER[$worker][(i)$null]} # Get index of NULL-character (delimiter). - fi - - if (( $#items == 5 )); then - items+=($(( len != 0 ))) - $callback "${(@)items}" # Send all parsed items to the callback. - else - # In case of corrupt data, invoke callback with *async* as job - # name, non-zero exit status and an error message on stderr. - $callback "async" 1 "" 0 "$0:$LINENO: error: bad format, got ${#items} items (${(@q)items})" - fi - - (( num_processed++ )) - done - done - - (( num_processed )) && return 0 - - # Avoid printing exit value when `setopt printexitvalue` is active.` - [[ $caller = trap || $caller = watcher ]] && return 0 - - # No results were processed - return 1 -} - -# Watch worker for output -_async_zle_watcher() { - setopt localoptions noshwordsplit - typeset -gA ASYNC_PTYS ASYNC_CALLBACKS - local worker=$ASYNC_PTYS[$1] - local callback=$ASYNC_CALLBACKS[$worker] - - if [[ -n $callback ]]; then - async_process_results $worker $callback watcher - fi -} - -# -# Start a new asynchronous job on specified worker, assumes the worker is running. -# -# usage: -# async_job [] -# -async_job() { - setopt localoptions noshwordsplit noksharrays noposixidentifiers noposixstrings - - local worker=$1; shift - - local -a cmd - cmd=("$@") - if (( $#cmd > 1 )); then - cmd=(${(q)cmd}) # Quote special characters in multi argument commands. - fi - - # Quote the cmd in case RC_EXPAND_PARAM is set. - zpty -w $worker "$cmd"$'\0' -} - -# This function traps notification signals and calls all registered callbacks -_async_notify_trap() { - setopt localoptions noshwordsplit - - local k - for k in ${(k)ASYNC_CALLBACKS}; do - async_process_results $k ${ASYNC_CALLBACKS[$k]} trap - done -} - -# -# Register a callback for completed jobs. As soon as a job is finnished, async_process_results will be called with the -# specified callback function. This requires that a worker is initialized with the -n (notify) option. -# -# usage: -# async_register_callback -# -async_register_callback() { - setopt localoptions noshwordsplit nolocaltraps - - typeset -gA ASYNC_CALLBACKS - local worker=$1; shift - - ASYNC_CALLBACKS[$worker]="$*" - - # Enable trap when the ZLE watcher is unavailable, allows - # workers to notify (via -n) when a job is done. - if [[ ! -o interactive ]] || [[ ! -o zle ]]; then - trap '_async_notify_trap' WINCH - fi -} - -# -# Unregister the callback for a specific worker. -# -# usage: -# async_unregister_callback -# -async_unregister_callback() { - typeset -gA ASYNC_CALLBACKS - - unset "ASYNC_CALLBACKS[$1]" -} - -# -# Flush all current jobs running on a worker. This will terminate any and all running processes under the worker, use -# with caution. -# -# usage: -# async_flush_jobs -# -async_flush_jobs() { - setopt localoptions noshwordsplit - - local worker=$1; shift - - # Check if the worker exists - zpty -t $worker &>/dev/null || return 1 - - # Send kill command to worker - async_job $worker "_killjobs" - - # Clear the zpty buffer. - local junk - if zpty -r -t $worker junk '*'; then - (( ASYNC_DEBUG )) && print -n "async_flush_jobs $worker: ${(V)junk}" - while zpty -r -t $worker junk '*'; do - (( ASYNC_DEBUG )) && print -n "${(V)junk}" - done - (( ASYNC_DEBUG )) && print - fi - - # Finally, clear the process buffer in case of partially parsed responses. - typeset -gA ASYNC_PROCESS_BUFFER - unset "ASYNC_PROCESS_BUFFER[$worker]" -} - -# -# Start a new async worker with optional parameters, a worker can be told to only run unique tasks and to notify a -# process when tasks are complete. -# -# usage: -# async_start_worker [-u] [-n] [-p ] -# -# opts: -# -u unique (only unique job names can run) -# -n notify through SIGWINCH signal -# -p pid to notify (defaults to current pid) -# -async_start_worker() { - setopt localoptions noshwordsplit - - local worker=$1; shift - zpty -t $worker &>/dev/null && return - - typeset -gA ASYNC_PTYS - typeset -h REPLY - typeset has_xtrace=0 - - # Make sure async worker is started without xtrace - # (the trace output interferes with the worker). - [[ -o xtrace ]] && { - has_xtrace=1 - unsetopt xtrace - } - - if (( ! ASYNC_ZPTY_RETURNS_FD )) && [[ -o interactive ]] && [[ -o zle ]]; then - # When zpty doesn't return a file descriptor (on older versions of zsh) - # we try to guess it anyway. - integer -l zptyfd - exec {zptyfd}>&1 # Open a new file descriptor (above 10). - exec {zptyfd}>&- # Close it so it's free to be used by zpty. - fi - - zpty -b $worker _async_worker -p $$ $@ || { - async_stop_worker $worker - return 1 - } - - # Re-enable it if it was enabled, for debugging. - (( has_xtrace )) && setopt xtrace - - if [[ $ZSH_VERSION < 5.0.8 ]]; then - # For ZSH versions older than 5.0.8 we delay a bit to give - # time for the worker to start before issuing commands, - # otherwise it will not be ready to receive them. - sleep 0.001 - fi - - if [[ -o interactive ]] && [[ -o zle ]]; then - if (( ! ASYNC_ZPTY_RETURNS_FD )); then - REPLY=$zptyfd # Use the guessed value for the file desciptor. - fi - - ASYNC_PTYS[$REPLY]=$worker # Map the file desciptor to the worker. - zle -F $REPLY _async_zle_watcher # Register the ZLE handler. - - # Disable trap in favor of ZLE handler when notify is enabled (-n). - async_job $worker _unset_trap - fi -} - -# -# Stop one or multiple workers that are running, all unfetched and incomplete work will be lost. -# -# usage: -# async_stop_worker [] -# -async_stop_worker() { - setopt localoptions noshwordsplit - - local ret=0 worker k v - for worker in $@; do - # Find and unregister the zle handler for the worker - for k v in ${(@kv)ASYNC_PTYS}; do - if [[ $v == $worker ]]; then - zle -F $k - unset "ASYNC_PTYS[$k]" - fi - done - async_unregister_callback $worker - zpty -d $worker 2>/dev/null || ret=$? - - # Clear any partial buffers. - typeset -gA ASYNC_PROCESS_BUFFER - unset "ASYNC_PROCESS_BUFFER[$worker]" - done - - return $ret -} - -# -# Initialize the required modules for zsh-async. To be called before using the zsh-async library. -# -# usage: -# async_init -# -async_init() { - (( ASYNC_INIT_DONE )) && return - typeset -g ASYNC_INIT_DONE=1 - - zmodload zsh/zpty - zmodload zsh/datetime - - # Check if zsh/zpty returns a file descriptor or not, - # shell must also be interactive with zle enabled. - typeset -g ASYNC_ZPTY_RETURNS_FD=0 - [[ -o interactive ]] && [[ -o zle ]] && { - typeset -h REPLY - zpty _async_test : - (( REPLY )) && ASYNC_ZPTY_RETURNS_FD=1 - zpty -d _async_test - } -} - -async() { - async_init -} - -async "$@" diff --git a/.zprezto/modules/prompt/external/pure/license b/.zprezto/modules/prompt/external/pure/license deleted file mode 100644 index 654d0bf..0000000 --- a/.zprezto/modules/prompt/external/pure/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/.zprezto/modules/prompt/external/pure/package.json b/.zprezto/modules/prompt/external/pure/package.json deleted file mode 100644 index 467f8f4..0000000 --- a/.zprezto/modules/prompt/external/pure/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "pure-prompt", - "version": "1.8.0", - "description": "Pretty, minimal and fast ZSH prompt", - "license": "MIT", - "repository": "sindresorhus/pure", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "Mathias Fredriksson", - "url": "github.com/mafredri" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "postinstall": "PURE_DEST=/usr/local/share/zsh/site-functions npm run --silent postinstall-link && exit 0; PURE_DEST=\"$PWD/functions\" npm run postinstall-link && npm run postinstall-fail-instructions", - "postinstall-link": "mkdir -p \"$PURE_DEST\" && ln -sf \"$PWD/pure.zsh\" \"$PURE_DEST/prompt_pure_setup\" && ln -sf \"$PWD/async.zsh\" \"$PURE_DEST/async\"", - "postinstall-fail-instructions": "echo \"ERROR: Could not automagically symlink the prompt. Either:\\n1. Check out the readme on how to do it manually: https://github.com/sindresorhus/pure#manually\\n2. Or add the following to your \\`.zshrc\\`:\\n\\n fpath+=('$PWD/functions')\"" - }, - "files": [ - "pure.zsh", - "async.zsh" - ], - "keywords": [ - "zsh", - "zshell", - "sh", - "shell", - "bash", - "pure", - "prompt", - "theme", - "git", - "async", - "fast", - "minimal", - "pretty" - ] -} diff --git a/.zprezto/modules/prompt/external/pure/pure.plugin.zsh b/.zprezto/modules/prompt/external/pure/pure.plugin.zsh deleted file mode 120000 index f5f60e7..0000000 --- a/.zprezto/modules/prompt/external/pure/pure.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -pure.zsh \ No newline at end of file diff --git a/.zprezto/modules/prompt/external/pure/pure.zsh b/.zprezto/modules/prompt/external/pure/pure.zsh deleted file mode 100644 index 429cbbf..0000000 --- a/.zprezto/modules/prompt/external/pure/pure.zsh +++ /dev/null @@ -1,619 +0,0 @@ -# Pure -# by Sindre Sorhus -# https://github.com/sindresorhus/pure -# MIT License - -# For my own and others sanity -# git: -# %b => current branch -# %a => current action (rebase/merge) -# prompt: -# %F => color dict -# %f => reset color -# %~ => current path -# %* => time -# %n => username -# %m => shortname host -# %(?..) => prompt conditional - %(condition.true.false) -# terminal codes: -# \e7 => save cursor position -# \e[2A => move cursor 2 lines up -# \e[1G => go to position 1 in terminal -# \e8 => restore cursor position -# \e[K => clears everything after the cursor on the current line -# \e[2K => clear everything on the current line - - -# turns seconds into human readable time -# 165392 => 1d 21h 56m 32s -# https://github.com/sindresorhus/pretty-time-zsh -prompt_pure_human_time_to_var() { - local human total_seconds=$1 var=$2 - local days=$(( total_seconds / 60 / 60 / 24 )) - local hours=$(( total_seconds / 60 / 60 % 24 )) - local minutes=$(( total_seconds / 60 % 60 )) - local seconds=$(( total_seconds % 60 )) - (( days > 0 )) && human+="${days}d " - (( hours > 0 )) && human+="${hours}h " - (( minutes > 0 )) && human+="${minutes}m " - human+="${seconds}s" - - # store human readable time in variable as specified by caller - typeset -g "${var}"="${human}" -} - -# stores (into prompt_pure_cmd_exec_time) the exec time of the last command if set threshold was exceeded -prompt_pure_check_cmd_exec_time() { - integer elapsed - (( elapsed = EPOCHSECONDS - ${prompt_pure_cmd_timestamp:-$EPOCHSECONDS} )) - typeset -g prompt_pure_cmd_exec_time= - (( elapsed > ${PURE_CMD_MAX_EXEC_TIME:-5} )) && { - prompt_pure_human_time_to_var $elapsed "prompt_pure_cmd_exec_time" - } -} - -prompt_pure_set_title() { - setopt localoptions noshwordsplit - - # emacs terminal does not support settings the title - (( ${+EMACS} )) && return - - case $TTY in - # Don't set title over serial console. - /dev/ttyS[0-9]*) return;; - esac - - # Show hostname if connected via ssh. - local hostname= - if [[ -n $prompt_pure_state[username] ]]; then - # Expand in-place in case ignore-escape is used. - hostname="${(%):-(%m) }" - fi - - local -a opts - case $1 in - expand-prompt) opts=(-P);; - ignore-escape) opts=(-r);; - esac - - # Set title atomically in one print statement so that it works - # when XTRACE is enabled. - print -n $opts $'\e]0;'${hostname}${2}$'\a' -} - -prompt_pure_preexec() { - if [[ -n $prompt_pure_git_fetch_pattern ]]; then - # detect when git is performing pull/fetch (including git aliases). - local -H MATCH MBEGIN MEND match mbegin mend - if [[ $2 =~ (git|hub)\ (.*\ )?($prompt_pure_git_fetch_pattern)(\ .*)?$ ]]; then - # we must flush the async jobs to cancel our git fetch in order - # to avoid conflicts with the user issued pull / fetch. - async_flush_jobs 'prompt_pure' - fi - fi - - typeset -g prompt_pure_cmd_timestamp=$EPOCHSECONDS - - # shows the current dir and executed command in the title while a process is active - prompt_pure_set_title 'ignore-escape' "$PWD:t: $2" - - # Disallow python virtualenv from updating the prompt, set it to 12 if - # untouched by the user to indicate that Pure modified it. Here we use - # magic number 12, same as in psvar. - export VIRTUAL_ENV_DISABLE_PROMPT=${VIRTUAL_ENV_DISABLE_PROMPT:-12} -} - -prompt_pure_preprompt_render() { - setopt localoptions noshwordsplit - - # Set color for git branch/dirty status, change color if dirty checking has - # been delayed. - local git_color=242 - [[ -n ${prompt_pure_git_last_dirty_check_timestamp+x} ]] && git_color=red - - # Initialize the preprompt array. - local -a preprompt_parts - - # Set the path. - preprompt_parts+=('%F{blue}%~%f') - - # Add git branch and dirty status info. - typeset -gA prompt_pure_vcs_info - if [[ -n $prompt_pure_vcs_info[branch] ]]; then - preprompt_parts+=("%F{$git_color}"'${prompt_pure_vcs_info[branch]}${prompt_pure_git_dirty}%f') - fi - # Git pull/push arrows. - if [[ -n $prompt_pure_git_arrows ]]; then - preprompt_parts+=('%F{cyan}${prompt_pure_git_arrows}%f') - fi - - # Username and machine, if applicable. - [[ -n $prompt_pure_state[username] ]] && preprompt_parts+=('${prompt_pure_state[username]}') - # Execution time. - [[ -n $prompt_pure_cmd_exec_time ]] && preprompt_parts+=('%F{yellow}${prompt_pure_cmd_exec_time}%f') - - local cleaned_ps1=$PROMPT - local -H MATCH MBEGIN MEND - if [[ $PROMPT = *$prompt_newline* ]]; then - # Remove everything from the prompt until the newline. This - # removes the preprompt and only the original PROMPT remains. - cleaned_ps1=${PROMPT##*${prompt_newline}} - fi - unset MATCH MBEGIN MEND - - # Construct the new prompt with a clean preprompt. - local -ah ps1 - ps1=( - ${(j. .)preprompt_parts} # Join parts, space separated. - $prompt_newline # Separate preprompt and prompt. - $cleaned_ps1 - ) - - PROMPT="${(j..)ps1}" - - # Expand the prompt for future comparision. - local expanded_prompt - expanded_prompt="${(S%%)PROMPT}" - - if [[ $1 == precmd ]]; then - # Initial newline, for spaciousness. - print - elif [[ $prompt_pure_last_prompt != $expanded_prompt ]]; then - # Redraw the prompt. - zle && zle .reset-prompt - fi - - typeset -g prompt_pure_last_prompt=$expanded_prompt -} - -prompt_pure_precmd() { - # check exec time and store it in a variable - prompt_pure_check_cmd_exec_time - unset prompt_pure_cmd_timestamp - - # shows the full path in the title - prompt_pure_set_title 'expand-prompt' '%~' - - # preform async git dirty check and fetch - prompt_pure_async_tasks - - # Check if we should display the virtual env, we use a sufficiently high - # index of psvar (12) here to avoid collisions with user defined entries. - psvar[12]= - # When VIRTUAL_ENV_DISABLE_PROMPT is empty, it was unset by the user and - # Pure should take back control. - if [[ -n $VIRTUAL_ENV ]] && [[ -z $VIRTUAL_ENV_DISABLE_PROMPT || $VIRTUAL_ENV_DISABLE_PROMPT = 12 ]]; then - psvar[12]="${VIRTUAL_ENV:t}" - export VIRTUAL_ENV_DISABLE_PROMPT=12 - fi - - # Make sure VIM prompt is reset. - prompt_pure_reset_vim_prompt - - # print the preprompt - prompt_pure_preprompt_render "precmd" - - if [[ -n $ZSH_THEME ]]; then - print "WARNING: Oh My Zsh themes are enabled (ZSH_THEME='${ZSH_THEME}'). Pure might not be working correctly." - print "For more information, see: https://github.com/sindresorhus/pure#oh-my-zsh" - unset ZSH_THEME # Only show this warning once. - fi -} - -prompt_pure_async_git_aliases() { - setopt localoptions noshwordsplit - local dir=$1 - local -a gitalias pullalias - - # we enter repo to get local aliases as well. - builtin cd -q $dir - - # list all aliases and split on newline. - gitalias=(${(@f)"$(command git config --get-regexp "^alias\.")"}) - for line in $gitalias; do - parts=(${(@)=line}) # split line on spaces - aliasname=${parts[1]#alias.} # grab the name (alias.[name]) - shift parts # remove aliasname - - # check alias for pull or fetch (must be exact match). - if [[ $parts =~ ^(.*\ )?(pull|fetch)(\ .*)?$ ]]; then - pullalias+=($aliasname) - fi - done - - print -- ${(j:|:)pullalias} # join on pipe (for use in regex). -} - -prompt_pure_async_vcs_info() { - setopt localoptions noshwordsplit - builtin cd -q $1 2>/dev/null - - # configure vcs_info inside async task, this frees up vcs_info - # to be used or configured as the user pleases. - zstyle ':vcs_info:*' enable git - zstyle ':vcs_info:*' use-simple true - # only export two msg variables from vcs_info - zstyle ':vcs_info:*' max-exports 2 - # export branch (%b) and git toplevel (%R) - zstyle ':vcs_info:git*' formats '%b' '%R' - zstyle ':vcs_info:git*' actionformats '%b|%a' '%R' - - vcs_info - - local -A info - info[top]=$vcs_info_msg_1_ - info[branch]=$vcs_info_msg_0_ - - print -r - ${(@kvq)info} -} - -# fastest possible way to check if repo is dirty -prompt_pure_async_git_dirty() { - setopt localoptions noshwordsplit - local untracked_dirty=$1 dir=$2 - - # use cd -q to avoid side effects of changing directory, e.g. chpwd hooks - builtin cd -q $dir - - if [[ $untracked_dirty = 0 ]]; then - command git diff --no-ext-diff --quiet --exit-code - else - test -z "$(command git status --porcelain --ignore-submodules -unormal)" - fi - - return $? -} - -prompt_pure_async_git_fetch() { - setopt localoptions noshwordsplit - # use cd -q to avoid side effects of changing directory, e.g. chpwd hooks - builtin cd -q $1 - - # set GIT_TERMINAL_PROMPT=0 to disable auth prompting for git fetch (git 2.3+) - export GIT_TERMINAL_PROMPT=0 - # set ssh BachMode to disable all interactive ssh password prompting - export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-"ssh"} -o BatchMode=yes" - - # Default return code, indicates Git fetch failure. - local fail_code=99 - - # Guard against all forms of password prompts. By setting the shell into - # MONITOR mode we can notice when a child process prompts for user input - # because it will be suspended. Since we are inside an async worker, we - # have no way of transmitting the password and the only option is to - # kill it. If we don't do it this way, the process will corrupt with the - # async worker. - setopt localtraps monitor - - # Make sure local HUP trap is unset to allow for signal propagation when - # the async worker is flushed. - trap - HUP - - trap ' - # Unset trap to prevent infinite loop - trap - CHLD - if [[ $jobstates = suspended* ]]; then - # Set fail code to password prompt and kill the fetch. - fail_code=98 - kill %% - fi - ' CHLD - - command git -c gc.auto=0 fetch >/dev/null & - wait $! || return $fail_code - - unsetopt monitor - - # check arrow status after a successful git fetch - prompt_pure_async_git_arrows $1 -} - -prompt_pure_async_git_arrows() { - setopt localoptions noshwordsplit - builtin cd -q $1 - command git rev-list --left-right --count HEAD...@'{u}' -} - -prompt_pure_async_tasks() { - setopt localoptions noshwordsplit - - # initialize async worker - ((!${prompt_pure_async_init:-0})) && { - async_start_worker "prompt_pure" -u -n - async_register_callback "prompt_pure" prompt_pure_async_callback - typeset -g prompt_pure_async_init=1 - } - - typeset -gA prompt_pure_vcs_info - - local -H MATCH MBEGIN MEND - if ! [[ $PWD = ${prompt_pure_vcs_info[pwd]}* ]]; then - # stop any running async jobs - async_flush_jobs "prompt_pure" - - # reset git preprompt variables, switching working tree - unset prompt_pure_git_dirty - unset prompt_pure_git_last_dirty_check_timestamp - unset prompt_pure_git_arrows - unset prompt_pure_git_fetch_pattern - prompt_pure_vcs_info[branch]= - prompt_pure_vcs_info[top]= - fi - unset MATCH MBEGIN MEND - - async_job "prompt_pure" prompt_pure_async_vcs_info $PWD - - # # only perform tasks inside git working tree - [[ -n $prompt_pure_vcs_info[top] ]] || return - - prompt_pure_async_refresh -} - -prompt_pure_async_refresh() { - setopt localoptions noshwordsplit - - if [[ -z $prompt_pure_git_fetch_pattern ]]; then - # we set the pattern here to avoid redoing the pattern check until the - # working three has changed. pull and fetch are always valid patterns. - typeset -g prompt_pure_git_fetch_pattern="pull|fetch" - async_job "prompt_pure" prompt_pure_async_git_aliases $working_tree - fi - - async_job "prompt_pure" prompt_pure_async_git_arrows $PWD - - # do not preform git fetch if it is disabled or working_tree == HOME - if (( ${PURE_GIT_PULL:-1} )) && [[ $working_tree != $HOME ]]; then - # tell worker to do a git fetch - async_job "prompt_pure" prompt_pure_async_git_fetch $PWD - fi - - # if dirty checking is sufficiently fast, tell worker to check it again, or wait for timeout - integer time_since_last_dirty_check=$(( EPOCHSECONDS - ${prompt_pure_git_last_dirty_check_timestamp:-0} )) - if (( time_since_last_dirty_check > ${PURE_GIT_DELAY_DIRTY_CHECK:-1800} )); then - unset prompt_pure_git_last_dirty_check_timestamp - # check check if there is anything to pull - async_job "prompt_pure" prompt_pure_async_git_dirty ${PURE_GIT_UNTRACKED_DIRTY:-1} $PWD - fi -} - -prompt_pure_check_git_arrows() { - setopt localoptions noshwordsplit - local arrows left=${1:-0} right=${2:-0} - - (( right > 0 )) && arrows+=${PURE_GIT_DOWN_ARROW:-⇣} - (( left > 0 )) && arrows+=${PURE_GIT_UP_ARROW:-⇡} - - [[ -n $arrows ]] || return - typeset -g REPLY=$arrows -} - -prompt_pure_async_callback() { - setopt localoptions noshwordsplit - local job=$1 code=$2 output=$3 exec_time=$4 next_pending=$6 - local do_render=0 - - case $job in - prompt_pure_async_vcs_info) - local -A info - typeset -gA prompt_pure_vcs_info - - # parse output (z) and unquote as array (Q@) - info=("${(Q@)${(z)output}}") - local -H MATCH MBEGIN MEND - # check if git toplevel has changed - if [[ $info[top] = $prompt_pure_vcs_info[top] ]]; then - # if stored pwd is part of $PWD, $PWD is shorter and likelier - # to be toplevel, so we update pwd - if [[ $prompt_pure_vcs_info[pwd] = ${PWD}* ]]; then - prompt_pure_vcs_info[pwd]=$PWD - fi - else - # store $PWD to detect if we (maybe) left the git path - prompt_pure_vcs_info[pwd]=$PWD - fi - unset MATCH MBEGIN MEND - - # update has a git toplevel set which means we just entered a new - # git directory, run the async refresh tasks - [[ -n $info[top] ]] && [[ -z $prompt_pure_vcs_info[top] ]] && prompt_pure_async_refresh - - # always update branch and toplevel - prompt_pure_vcs_info[branch]=$info[branch] - prompt_pure_vcs_info[top]=$info[top] - - do_render=1 - ;; - prompt_pure_async_git_aliases) - if [[ -n $output ]]; then - # append custom git aliases to the predefined ones. - prompt_pure_git_fetch_pattern+="|$output" - fi - ;; - prompt_pure_async_git_dirty) - local prev_dirty=$prompt_pure_git_dirty - if (( code == 0 )); then - unset prompt_pure_git_dirty - else - typeset -g prompt_pure_git_dirty="*" - fi - - [[ $prev_dirty != $prompt_pure_git_dirty ]] && do_render=1 - - # When prompt_pure_git_last_dirty_check_timestamp is set, the git info is displayed in a different color. - # To distinguish between a "fresh" and a "cached" result, the preprompt is rendered before setting this - # variable. Thus, only upon next rendering of the preprompt will the result appear in a different color. - (( $exec_time > 5 )) && prompt_pure_git_last_dirty_check_timestamp=$EPOCHSECONDS - ;; - prompt_pure_async_git_fetch|prompt_pure_async_git_arrows) - # prompt_pure_async_git_fetch executes prompt_pure_async_git_arrows - # after a successful fetch. - case $code in - 0) - local REPLY - prompt_pure_check_git_arrows ${(ps:\t:)output} - if [[ $prompt_pure_git_arrows != $REPLY ]]; then - typeset -g prompt_pure_git_arrows=$REPLY - do_render=1 - fi - ;; - 99|98) - # Git fetch failed. - ;; - *) - # Non-zero exit status from prompt_pure_async_git_arrows, - # indicating that there is no upstream configured. - if [[ -n $prompt_pure_git_arrows ]]; then - unset prompt_pure_git_arrows - do_render=1 - fi - ;; - esac - ;; - esac - - if (( next_pending )); then - (( do_render )) && typeset -g prompt_pure_async_render_requested=1 - return - fi - - [[ ${prompt_pure_async_render_requested:-$do_render} = 1 ]] && prompt_pure_preprompt_render - unset prompt_pure_async_render_requested -} - -prompt_pure_update_vim_prompt() { - setopt localoptions noshwordsplit - prompt_pure_state[prompt]=${${KEYMAP/vicmd/${PURE_PROMPT_VICMD_SYMBOL:-❮}}/(main|viins)/${PURE_PROMPT_SYMBOL:-❯}} - zle && zle .reset-prompt -} - -prompt_pure_reset_vim_prompt() { - setopt localoptions noshwordsplit - prompt_pure_state[prompt]=${PURE_PROMPT_SYMBOL:-❯} - zle && zle .reset-prompt -} - -prompt_pure_state_setup() { - setopt localoptions noshwordsplit - - # Check SSH_CONNECTION and the current state. - local ssh_connection=${SSH_CONNECTION:-$PROMPT_PURE_SSH_CONNECTION} - local username - if [[ -z $ssh_connection ]] && (( $+commands[who] )); then - # When changing user on a remote system, the $SSH_CONNECTION - # environment variable can be lost, attempt detection via who. - local who_out - who_out=$(who -m 2>/dev/null) - if (( $? )); then - # Who am I not supported, fallback to plain who. - who_out=$(who 2>/dev/null | grep ${TTY#/dev/}) - fi - - local reIPv6='(([0-9a-fA-F]+:)|:){2,}[0-9a-fA-F]+' # Simplified, only checks partial pattern. - local reIPv4='([0-9]{1,3}\.){3}[0-9]+' # Simplified, allows invalid ranges. - # Here we assume two non-consecutive periods represents a - # hostname. This matches foo.bar.baz, but not foo.bar. - local reHostname='([.][^. ]+){2}' - - # Usually the remote address is surrounded by parenthesis, but - # not on all systems (e.g. busybox). - local -H MATCH MBEGIN MEND - if [[ $who_out =~ "\(?($reIPv4|$reIPv6|$reHostname)\)?\$" ]]; then - ssh_connection=$MATCH - - # Export variable to allow detection propagation inside - # shells spawned by this one (e.g. tmux does not always - # inherit the same tty, which breaks detection). - export PROMPT_PURE_SSH_CONNECTION=$ssh_connection - fi - unset MATCH MBEGIN MEND - fi - - # show username@host if logged in through SSH - [[ -n $ssh_connection ]] && username='%F{242}%n@%m%f' - - # show username@host if root, with username in white - [[ $UID -eq 0 ]] && username='%F{white}%n%f%F{242}@%m%f' - - typeset -gA prompt_pure_state - prompt_pure_state=( - username "$username" - prompt "${PURE_PROMPT_SYMBOL:-❯}" - ) -} - -prompt_pure_setup() { - # Prevent percentage showing up if output doesn't end with a newline. - export PROMPT_EOL_MARK='' - - prompt_opts=(subst percent) - - # borrowed from promptinit, sets the prompt options in case pure was not - # initialized via promptinit. - setopt noprompt{bang,cr,percent,subst} "prompt${^prompt_opts[@]}" - - if [[ -z $prompt_newline ]]; then - # This variable needs to be set, usually set by promptinit. - typeset -g prompt_newline=$'\n%{\r%}' - fi - - zmodload zsh/datetime - zmodload zsh/zle - zmodload zsh/parameter - - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - autoload -Uz async && async - - # The add-zle-hook-widget function is not guaranteed - # to be available, it was added in Zsh 5.3. - autoload -Uz +X add-zle-hook-widget 2>/dev/null - - add-zsh-hook precmd prompt_pure_precmd - add-zsh-hook preexec prompt_pure_preexec - - prompt_pure_state_setup - - zle -N prompt_pure_update_vim_prompt - zle -N prompt_pure_reset_vim_prompt - if (( $+functions[add-zle-hook-widget] )); then - add-zle-hook-widget zle-line-finish prompt_pure_reset_vim_prompt - add-zle-hook-widget zle-keymap-select prompt_pure_update_vim_prompt - fi - - # if a virtualenv is activated, display it in grey - PROMPT='%(12V.%F{242}%12v%f .)' - - # prompt turns red if the previous command didn't exit with 0 - PROMPT+='%(?.%F{magenta}.%F{red})${prompt_pure_state[prompt]}%f ' - - # Store prompt expansion symbols for in-place expansion via (%). For - # some reason it does not work without storing them in a variable first. - typeset -ga prompt_pure_debug_depth - prompt_pure_debug_depth=('%e' '%N' '%x') - - # Compare is used to check if %N equals %x. When they differ, the main - # prompt is used to allow displaying both file name and function. When - # they match, we use the secondary prompt to avoid displaying duplicate - # information. - local -A ps4_parts - ps4_parts=( - depth '%F{yellow}${(l:${(%)prompt_pure_debug_depth[1]}::+:)}%f' - compare '${${(%)prompt_pure_debug_depth[2]}:#${(%)prompt_pure_debug_depth[3]}}' - main '%F{blue}${${(%)prompt_pure_debug_depth[3]}:t}%f%F{242}:%I%f %F{242}@%f%F{blue}%N%f%F{242}:%i%f' - secondary '%F{blue}%N%f%F{242}:%i' - prompt '%F{242}>%f ' - ) - # Combine the parts with conditional logic. First the `:+` operator is - # used to replace `compare` either with `main` or an ampty string. Then - # the `:-` operator is used so that if `compare` becomes an empty - # string, it is replaced with `secondary`. - local ps4_symbols='${${'${ps4_parts[compare]}':+"'${ps4_parts[main]}'"}:-"'${ps4_parts[secondary]}'"}' - - # Improve the debug prompt (PS4), show depth by repeating the +-sign and - # add colors to highlight essential parts like file and function name. - PROMPT4="${ps4_parts[depth]} ${ps4_symbols}${ps4_parts[prompt]}" - - unset ZSH_THEME # Guard against Oh My Zsh themes overriding Pure. -} - -prompt_pure_setup "$@" diff --git a/.zprezto/modules/prompt/external/pure/readme.md b/.zprezto/modules/prompt/external/pure/readme.md deleted file mode 100644 index 9c93517..0000000 --- a/.zprezto/modules/prompt/external/pure/readme.md +++ /dev/null @@ -1,208 +0,0 @@ -# Pure - -> Pretty, minimal and fast ZSH prompt - - - - -## Overview - -Most prompts are cluttered, ugly and slow. I wanted something visually pleasing that stayed out of my way. - -### Why? - -- Comes with the perfect prompt character. - Author went through the whole Unicode range to find it. -- Shows `git` branch and whether it's dirty (with a `*`). -- Indicates when you have unpushed/unpulled `git` commits with up/down arrows. *(Check is done asynchronously!)* -- Prompt character turns red if the last command didn't exit with `0`. -- Command execution time will be displayed if it exceeds the set threshold. -- Username and host only displayed when in an SSH session. -- Shows the current path in the title and the [current folder & command](screenshot-title-cmd.png) when a process is running. -- Support VI-mode indication by reverse prompt symbol (Zsh 5.3+). -- Makes an excellent starting point for your own custom prompt. - - -## Install - -Can be installed with `npm` or manually. Requires Git 2.0.0+ and ZSH 5.2+. Older versions of ZSH are known to work, but they are **not** recommended. - -### npm - -```console -$ npm install --global pure-prompt -``` - -That's it. Skip to [Getting started](#getting-started). - -### Manually - -1. Either… - - Clone this repo - - add it as a submodule, or - - just download [`pure.zsh`](pure.zsh) and [`async.zsh`](async.zsh) - -2. Symlink `pure.zsh` to somewhere in [`$fpath`](https://www.refining-linux.org/archives/46-ZSH-Gem-12-Autoloading-functions.html) with the name `prompt_pure_setup`. - -3. Symlink `async.zsh` in `$fpath` with the name `async`. - -#### Example - -```console -$ ln -s "$PWD/pure.zsh" /usr/local/share/zsh/site-functions/prompt_pure_setup -$ ln -s "$PWD/async.zsh" /usr/local/share/zsh/site-functions/async -``` -*Run `echo $fpath` to see possible locations.* - -For a user-specific installation (which would not require escalated privileges), simply add a directory to `$fpath` for that user: - -```sh -# .zshenv or .zshrc -fpath=( "$HOME/.zfunctions" $fpath ) -``` - -Then install the theme there: - -```console -$ ln -s "$PWD/pure.zsh" "$HOME/.zfunctions/prompt_pure_setup" -$ ln -s "$PWD/async.zsh" "$HOME/.zfunctions/async" -``` - - -## Getting started - -Initialize the prompt system (if not so already) and choose `pure`: - -```sh -# .zshrc -autoload -U promptinit; promptinit -prompt pure -``` - - -## Options - -| Option | Description | Default value | -| :------------------------------- | :--------------------------------------------------------------------------------------------- | :------------- | -| **`PURE_CMD_MAX_EXEC_TIME`** | The max execution time of a process before its run time is shown when it exits. | `5` seconds | -| **`PURE_GIT_PULL=0`** | Prevents Pure from checking whether the current Git remote has been updated. | | -| **`PURE_GIT_UNTRACKED_DIRTY=0`** | Do not include untracked files in dirtiness check. Mostly useful on large repos (like WebKit). | | -| **`PURE_GIT_DELAY_DIRTY_CHECK`** | Time in seconds to delay git dirty checking when `git status` takes > 5 seconds. | `1800` seconds | -| **`PURE_PROMPT_SYMBOL`** | Defines the prompt symbol. | `❯` | -| **`PURE_PROMPT_VICMD_SYMBOL`** | Defines the prompt symbol used when the `vicmd` keymap is active (VI-mode). | `❮` | -| **`PURE_GIT_DOWN_ARROW`** | Defines the git down arrow symbol. | `⇣` | -| **`PURE_GIT_UP_ARROW`** | Defines the git up arrow symbol. | `⇡` | - -## Example - -```sh -# .zshrc - -autoload -U promptinit; promptinit - -# optionally define some options -PURE_CMD_MAX_EXEC_TIME=10 - -prompt pure -``` - - -## Tips - -In the screenshot you see Pure running in [Hyper](https://hyper.is) with the [hyper-snazzy](https://github.com/sindresorhus/hyper-snazzy) theme and Menlo font. - -The [Tomorrow Night Eighties](https://github.com/chriskempson/tomorrow-theme) theme with the [Droid Sans Mono](https://www.fontsquirrel.com/fonts/droid-sans-mono) font (15pt) is also a [nice combination](https://github.com/sindresorhus/pure/blob/95ee3e7618c6e2162a1e3cdac2a88a20ac3beb27/screenshot.png).
-*Just make sure you have anti-aliasing enabled in your terminal.* - -To have commands colorized as seen in the screenshot, install [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting). - - -## Integration - -### [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) - -1. Set `ZSH_THEME=""` in your `.zshrc` to disable oh-my-zsh themes. -2. Follow the Pure [Install](#install) instructions. -3. Do not enable the following (incompatible) plugins: `vi-mode`, `virtualenv`. - -**NOTE:** `oh-my-zsh` overrides the prompt so Pure must be activated *after* `source $ZSH/oh-my-zsh.sh`. - -### [prezto](https://github.com/sorin-ionescu/prezto) - -Pure is bundled with Prezto. No need to install it. - -Add `prompt pure` to your `~/.zpreztorc`. - -### [zim](https://github.com/Eriner/zim) - -Pure is bundled with Zim. No need to install it. - -Set `zprompt_theme='pure'` in `~/.zimrc`. - -### [antigen](https://github.com/zsh-users/antigen) - -Update your `.zshrc` file with the following two lines (order matters). Do not use the `antigen theme` function. - -```sh -antigen bundle mafredri/zsh-async -antigen bundle sindresorhus/pure -``` - -### [antibody](https://github.com/getantibody/antibody) - -Update your `.zshrc` file with the following two lines (order matters): - -```sh -antibody bundle mafredri/zsh-async -antibody bundle sindresorhus/pure -``` - -### [zplug](https://github.com/zplug/zplug) - -Update your `.zshrc` file with the following two lines: - -```sh -zplug mafredri/zsh-async, from:github -zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme -``` - -### [zplugin](https://github.com/zdharma/zplugin) - -Update your `.zshrc` file with the following two lines (order matters): - -```sh -zplugin ice pick"async.zsh" src"pure.zsh" -zplugin light sindresorhus/pure -``` - -## FAQ - -There are currently no FAQs. - -See [FAQ Archive](https://github.com/sindresorhus/pure/wiki/FAQ-Archive) for previous FAQs. - -## Ports - -- **ZSH** - - [therealklanni/purity](https://github.com/therealklanni/purity) - More compact current working directory, important details on the main prompt line, and extra Git indicators. - - [intelfx/pure](https://github.com/intelfx/pure) - Solarized-friendly colors, highly verbose, and fully async Git integration. - - [dfurnes/purer](https://github.com/dfurnes/purer) - Compact single-line prompt with built-in Vim-mode indicator. -- **Bash** - - [sapegin/dotfiles](https://github.com/sapegin/dotfiles) - [Prompt](https://github.com/sapegin/dotfiles/blob/dd063f9c30de7d2234e8accdb5272a5cc0a3388b/includes/bash_prompt.bash) and [color theme](https://github.com/sapegin/dotfiles/tree/master/color) for Terminal.app. -- **Fish** - - [brandonweiss/pure.fish](https://github.com/brandonweiss/pure.fish) - Pure-inspired prompt for Fish. Not intended to have feature parity. - - [rafaelrinaldi/pure](https://github.com/rafaelrinaldi/pure) - Support for bare Fish and various framework ([Oh-My-Fish](https://github.com//oh-my-fish/oh-my-fish), [Fisherman](https://github.com//fisherman/fisherman), and [Wahoo](https://github.com//bucaran/wahoo)). -- **Rust** - - [xcambar/purs](https://github.com/xcambar/purs) - Pure-inspired prompt in Rust. - - -## Team - -[![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](http://sindresorhus.com) | [![Mathias Fredriksson](https://github.com/mafredri.png?size=100)](https://github.com/mafredri) ----|--- -[Sindre Sorhus](https://github.com/sindresorhus) | [Mathias Fredriksson](https://github.com/mafredri) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/.zprezto/modules/prompt/external/pure/screenshot-title-cmd.png b/.zprezto/modules/prompt/external/pure/screenshot-title-cmd.png deleted file mode 100644 index 3f4b77c..0000000 Binary files a/.zprezto/modules/prompt/external/pure/screenshot-title-cmd.png and /dev/null differ diff --git a/.zprezto/modules/prompt/external/pure/screenshot.png b/.zprezto/modules/prompt/external/pure/screenshot.png deleted file mode 100644 index 1a27678..0000000 Binary files a/.zprezto/modules/prompt/external/pure/screenshot.png and /dev/null differ diff --git a/.zprezto/modules/prompt/functions/async b/.zprezto/modules/prompt/functions/async deleted file mode 120000 index ae0ec55..0000000 --- a/.zprezto/modules/prompt/functions/async +++ /dev/null @@ -1 +0,0 @@ -../external/async/async.zsh \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt-pwd b/.zprezto/modules/prompt/functions/prompt-pwd deleted file mode 100644 index 53613e7..0000000 --- a/.zprezto/modules/prompt/functions/prompt-pwd +++ /dev/null @@ -1,30 +0,0 @@ -# -# Prompt setup function commonly used by prompt themes. -# -# Authors: -# Sorin Ionescu -# - -# function prompt-pwd { - -setopt localoptions extendedglob - -local current_pwd="${PWD/#$HOME/~}" -local ret_directory - -if [[ "$current_pwd" == (#m)[/~] ]]; then - ret_directory="$MATCH" - unset MATCH -elif zstyle -m ':prezto:module:prompt' pwd-length 'full'; then - ret_directory=${PWD} -elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then - ret_directory=${current_pwd} -else - ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}" -fi - -unset current_pwd - -print "$ret_directory" - -# } diff --git a/.zprezto/modules/prompt/functions/prompt_abra_setup b/.zprezto/modules/prompt/functions/prompt_abra_setup deleted file mode 120000 index 5012044..0000000 --- a/.zprezto/modules/prompt/functions/prompt_abra_setup +++ /dev/null @@ -1 +0,0 @@ -../../../abra/prompt_abra_setup.zsh \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt_agnoster_setup b/.zprezto/modules/prompt/functions/prompt_agnoster_setup deleted file mode 120000 index 34d8bc6..0000000 --- a/.zprezto/modules/prompt/functions/prompt_agnoster_setup +++ /dev/null @@ -1 +0,0 @@ -../external/agnoster/agnoster.zsh-theme \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt_cloud_setup b/.zprezto/modules/prompt/functions/prompt_cloud_setup deleted file mode 100644 index 0637208..0000000 --- a/.zprezto/modules/prompt/functions/prompt_cloud_setup +++ /dev/null @@ -1,121 +0,0 @@ -# -# A minimal two-color theme. -# -# Authors: -# Kevin Laude -# -# Features: -# - One line, left aligned. -# - The prompt is prefixed by a character sequence of your choice. -# - Only displays the current directory instead of the full path. -# - Displays the current branch when in a git project (this requires loading -# the git module before prompt in ~/.zpreztorc). -# - Displays a character at the end of the prompt when in a git project with -# "dirty" files. -# -# Usage: -# This prompt's prefix symbol and colors are customizable: -# prompt cloud [] [] [] -# -# In ~/.zpreztorc: -# zstyle ':prezto:module:prompt' theme 'cloud' \ -# [''] \ -# [''] \ -# [''] -# -# If these options are not provided, the symbol defaults to "☁" with colors -# cyan and green. -# -# Screenshots: -# http://i.imgur.com/mJCZ8rE.png -# -# Note: -# This is a port of the oh-my-zsh cloud theme, originally written by Phillip -# Ridlen and Mark Drago -# - -# Load dependencies. -pmodload 'helper' - -function prompt_cloud_precmd { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi -} - -function prompt_cloud_help { - cat <] [] [] - -In ~/.zpreztorc: - zstyle ':prezto:module:prompt' theme 'cloud' [''] [''] [''] - -If these options are not provided, the symbol defaults to ☁ with colors cyan -and green. -EOT -} - -function prompt_cloud_preview { - if (( $# > 0 )); then - prompt_preview_theme 'cloud' "$@" - else - prompt_preview_theme 'cloud' - print - prompt_preview_theme 'cloud' "✯" - print - prompt_preview_theme 'cloud' ">" "yellow" "red" - fi -} - -function prompt_cloud_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Set the theme prefix to a cloud or to the user's given characters. - if [[ -n "$1" ]]; then - prefix="$1" - else - prefix='☁' - fi - - # Assign colors. - if [[ -n "$2" ]]; then - primary_color="$2" - else - primary_color='cyan' - fi - - if [[ -n "$3" ]]; then - secondary_color="$3" - else - secondary_color='green' - fi - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_cloud_precmd - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:dirty' format "%%B%F{$secondary_color}]%f%%b %F{yellow}⚡%f" - zstyle ':prezto:module:git:info:clean' format "%B%F{$secondary_color}]%f%b" - zstyle ':prezto:module:git:info:branch' format "%%B%F{$secondary_color}[%f%%b%%B%F{$primary_color}%b%f%%b" - zstyle ':prezto:module:git:info:keys' format \ - 'prompt' '%b%C%D' \ - 'rprompt' '' - - # Define prompts. - PROMPT='%B%F{$primary_color}${prefix}%f%b %B%F{$secondary_color}%c%f%b ${git_info:+${(e)git_info[prompt]}} ' - RPROMPT='' -} - -prompt_cloud_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_damoekri_setup b/.zprezto/modules/prompt/functions/prompt_damoekri_setup deleted file mode 100644 index 4fe132d..0000000 --- a/.zprezto/modules/prompt/functions/prompt_damoekri_setup +++ /dev/null @@ -1,65 +0,0 @@ -# -# A simple theme inspired by the Sorin and PeepCode themes. -# -# Authors: -# Daniel Møller Kristensen -# -# Screenshots: -# http://i.imgur.com/AX9HnPF.png -# - -# Load dependencies. -pmodload 'helper' - -prompt_damoekri_precmd() { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Format PWD. - _prompt_damoekri_pwd=$(prompt-pwd) - - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Ruby version information. - if (( $+functions[ruby-info] )); then - ruby-info - fi -} - -function prompt_damoekri_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook for calling git-info and ruby-info before each command. - add-zsh-hook precmd prompt_damoekri_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:keymap:primary' format ' %F{green}»%f' - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:action' format ':%F{magenta}%s%f' - zstyle ':prezto:module:git:info:branch' format '%F{blue}%b%f' - zstyle ':prezto:module:git:info:clean' format ' %F{green}✔%f' - zstyle ':prezto:module:git:info:dirty' format ' %F{red}✗%f' - zstyle ':prezto:module:git:info:commit' format '%F{blue}%.7c%f' - zstyle ':prezto:module:git:info:position' format '%F{blue}%p%f' - zstyle ':prezto:module:git:info:keys' format \ - 'rprompt' ' $(coalesce "%b" "%p" "%c")%s%C%D' - - # Set ruby-info parameters. - zstyle ':prezto:module:ruby:info:version' format ' %F{yellow}%v%f' - - # Define prompts. - PROMPT='%F{cyan}${_prompt_damoekri_pwd}%f${editor_info[keymap]} ' - RPROMPT='${git_info:+${(e)git_info[rprompt]}}${ruby_info:+${ruby_info[version]}}' -} - -prompt_damoekri_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_giddie_setup b/.zprezto/modules/prompt/functions/prompt_giddie_setup deleted file mode 100644 index 3c194fb..0000000 --- a/.zprezto/modules/prompt/functions/prompt_giddie_setup +++ /dev/null @@ -1,76 +0,0 @@ -# -# A colorful, friendly, multiline theme with some handy features. -# -# Authors: -# Paul Gideon Dann -# Sorin Ionescu -# -# Features: -# - Simple VCS branch, staged, and unstaged indication. -# - Prompt character is different in a VCS repository. -# - Last command exit status is displayed when non-zero. -# -# Screenshots: -# http://i.imgur.com/rCo3S.png -# - -function +vi-set_novcs_prompt_symbol { - _prompt_giddie_symbol=')' -} - -function +vi-set_vcs_prompt_symbol { - _prompt_giddie_symbol='±' -} - -function +vi-git_precmd { - # Check for untracked files, since vcs_info does not. - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - hook_com[unstaged]+='%F{green}?%f' - fi -} - -function prompt_giddie_precmd { - # Replace '/home/' with '~'. - _prompt_giddie_pwd="${PWD/#$HOME/~}" - vcs_info -} - -function prompt_giddie_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz vcs_info - autoload -Uz add-zsh-hook - - # Add hook to set up prompt parameters before each command. - add-zsh-hook precmd prompt_giddie_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:completing' format '%F{green}...%f' - zstyle ':prezto:module:editor:info:keymap:alternate' format '%F{yellow}--- COMMAND ---%f' - - # Set vcs_info parameters. - zstyle ':vcs_info:*' check-for-changes true - zstyle ':vcs_info:*' formats ' on %F{magenta}%b%f%c%u' - zstyle ':vcs_info:*' actionformats ' on %F{magenta}%b%f%c%u %F{yellow}(%a)%f' - zstyle ':vcs_info:*' stagedstr '%F{green}+%f' - zstyle ':vcs_info:*' unstagedstr '%F{green}!%f' - - # Set vcs_info hooks. - # NOTE: Prior to Zsh v4.3.12, there are no static hooks, no vcs_info_hookadd - # function, and no 'no-vcs' hook. - zstyle ':vcs_info:*+start-up:*' hooks set_novcs_prompt_symbol - zstyle ':vcs_info:git*+set-message:*' hooks set_vcs_prompt_symbol git_precmd - zstyle ':vcs_info:*+set-message:*' hooks set_vcs_prompt_symbol - - # Define prompts. - PROMPT='%(?..%F{red}%B-> [%?]%b%f -)%F{magenta}%n%f@%F{yellow}%m%f|%F{green}${_prompt_giddie_pwd}%f${vcs_info_msg_0_} -%F{blue}${_prompt_giddie_symbol}%f ' - RPROMPT='${editor_info[keymap]}' - SPROMPT='zsh: correct %F{magenta}%R%f to %F{green}%r%f [nyae]? ' -} - -prompt_giddie_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_kylewest_setup b/.zprezto/modules/prompt/functions/prompt_kylewest_setup deleted file mode 100644 index 70b6a54..0000000 --- a/.zprezto/modules/prompt/functions/prompt_kylewest_setup +++ /dev/null @@ -1,65 +0,0 @@ -# -# A single line theme with Git information on the left and Ruby on the right. -# -# Authors: -# Kyle West -# Sorin Ionescu -# -# Features: -# - Indicates dirty Git repository. -# - Indicates the Ruby version. -# - Indicates vi modes. -# -# Screenshots: -# http://i.imgur.com/dCwhynn.png -# - -function prompt_kylewest_precmd { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Ruby information. - if (( $+functions[ruby-info] )); then - ruby-info - fi -} - -function prompt_kylewest_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_kylewest_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' - zstyle ':prezto:module:editor:info:keymap:primary' format "%B%F{green}❯%f%b" - zstyle ':prezto:module:editor:info:keymap:alternate' format "%B%F{magenta}❮%f%b" - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'no' - zstyle ':prezto:module:git:info:branch' format '%F{yellow}%b%f' - zstyle ':prezto:module:git:info:dirty' format '%B%F{red}!%f%b' - zstyle ':prezto:module:git:info:indexed' format ' ' - zstyle ':prezto:module:git:info:unindexed' format ' ' - zstyle ':prezto:module:git:info:untracked' format ' ' - zstyle ':prezto:module:git:info:keys' format 'prompt' '- %b%D ' - - # Set ruby-info parameters. - zstyle ':prezto:module:ruby:info:version' format '%F{blue}[%v]%f' - - # Define prompts. - PROMPT='%F{cyan}%c%f ${git_info:+${(e)git_info[prompt]}}${editor_info[keymap]} ' - RPROMPT='${ruby_info[version]}' -} - -prompt_kylewest_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_minimal_setup b/.zprezto/modules/prompt/functions/prompt_minimal_setup deleted file mode 100644 index b600768..0000000 --- a/.zprezto/modules/prompt/functions/prompt_minimal_setup +++ /dev/null @@ -1,59 +0,0 @@ -# -# A monochrome theme that displays basic information. -# -# Authors: -# Brian Tse -# Sorin Ionescu -# -# Screenshots: -# http://i.imgur.com/zLZNK.png -# - -function +vi-git_status { - # Check for untracked files or updated submodules since vcs_info does not. - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - hook_com[unstaged]='%F{red}●%f' - fi -} - -function prompt_minimal_precmd { - vcs_info -} - -function prompt_minimal_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - # Add hook for calling vcs_info before each command. - add-zsh-hook precmd prompt_minimal_precmd - - # Set vcs_info parameters. - zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*' check-for-changes true - zstyle ':vcs_info:*' stagedstr '%F{green}●%f' - zstyle ':vcs_info:*' unstagedstr '%F{yellow}●%f' - zstyle ':vcs_info:*' formats ' - [%b%c%u]' - zstyle ':vcs_info:*' actionformats " - [%b%c%u|%F{cyan}%a%f]" - zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b|%F{cyan}%r%f' - zstyle ':vcs_info:git*+set-message:*' hooks git_status - - # Define prompts. - PROMPT='%2~${vcs_info_msg_0_} » ' - RPROMPT='' -} - -function prompt_minimal_preview { - local +h PROMPT='' - local +h RPROMPT='' - local +h SPROMPT='' - - editor-info 2> /dev/null - prompt_preview_theme 'minimal' -} - -prompt_minimal_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_nicoulaj_setup b/.zprezto/modules/prompt/functions/prompt_nicoulaj_setup deleted file mode 100644 index 447ba1f..0000000 --- a/.zprezto/modules/prompt/functions/prompt_nicoulaj_setup +++ /dev/null @@ -1,60 +0,0 @@ -# -# A simple theme that displays only relevant information. -# -# Authors: -# Julien Nicoulaud -# Sorin Ionescu -# -# Features: -# - One line. -# - VCS information in the right prompt. -# - Only shows the path on the left prompt by default. -# - Crops the path to a defined length and only shows the path relative to -# the current VCS repository root. -# - Uses a different color depending on if the last command succeeded/failed. -# - Shows user@hostname if connected through SSH. -# - Shows if logged in as root or not. -# -# Screenshots: -# http://i.imgur.com/Xe1bu.png -# - -function prompt_nicoulaj_precmd { - vcs_info -} - -function prompt_nicoulaj_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - # Add hook for calling vcs_info before each command. - add-zsh-hook precmd prompt_nicoulaj_precmd - - # Customizable parameters. - local max_path_chars=30 - local user_char='❯' - local root_char='❯❯❯' - local success_color='%F{071}' - local failure_color='%F{124}' - local vcs_info_color='%F{242}' - - # Set vcs_info parameters. - zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*' check-for-changes true - zstyle ':vcs_info:*' unstagedstr '!' - zstyle ':vcs_info:*' stagedstr '+' - zstyle ':vcs_info:*' actionformats "%S" "%r/%s/%b %u%c (%a)" - zstyle ':vcs_info:*' formats "%S" "%r/%s/%b %u%c" - zstyle ':vcs_info:*' nvcsformats "%~" "" - - # Define prompts. - PROMPT="%(?.${success_color}.${failure_color})${SSH_TTY:+[%n@%m]}%B%${max_path_chars}<...<"'${vcs_info_msg_0_%%.}'"%<<%(!.${root_char}.${user_char})%b%f " - RPROMPT="${vcs_info_color}"'${vcs_info_msg_1_}'"%f" -} - -prompt_nicoulaj_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_paradox_setup b/.zprezto/modules/prompt/functions/prompt_paradox_setup deleted file mode 100644 index 4f19989..0000000 --- a/.zprezto/modules/prompt/functions/prompt_paradox_setup +++ /dev/null @@ -1,156 +0,0 @@ -# -# A two-line, Powerline-inspired theme that displays contextual information. -# -# This theme requires a patched Powerline font, get them from -# https://github.com/Lokaltog/powerline-fonts. -# -# Authors: -# Isaac Wolkerstorfer -# Jeff Sandberg -# Sorin Ionescu -# Patrick Bos -# -# Screenshots: -# http://i.imgur.com/0XIWX.png -# - -# Load dependencies. -pmodload 'helper' - -# Define variables. -_prompt_paradox_current_bg='NONE' -_prompt_paradox_segment_separator='' -_prompt_paradox_start_time=$SECONDS - -function prompt_paradox_start_segment { - local bg fg - [[ -n "$1" ]] && bg="%K{$1}" || bg="%k" - [[ -n "$2" ]] && fg="%F{$2}" || fg="%f" - if [[ "$_prompt_paradox_current_bg" != 'NONE' && "$1" != "$_prompt_paradox_current_bg" ]]; then - print -n " $bg%F{$_prompt_paradox_current_bg}$_prompt_paradox_segment_separator$fg " - else - print -n "$bg$fg " - fi - _prompt_paradox_current_bg="$1" - [[ -n "$3" ]] && print -n "$3" -} - -function prompt_paradox_end_segment { - if [[ -n "$_prompt_paradox_current_bg" ]]; then - print -n " %k%F{$_prompt_paradox_current_bg}$_prompt_paradox_segment_separator" - else - print -n "%k" - fi - print -n "%f" - _prompt_paradox_current_bg='' -} - -function prompt_paradox_build_prompt { - prompt_paradox_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{blue}%n%F{red}@%F{green}%m%f' - prompt_paradox_start_segment blue black '$_prompt_paradox_pwd' - - if [[ -n "$git_info" ]]; then - prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}' - fi - - if [[ -n "$python_info" ]]; then - prompt_paradox_start_segment white black '${(e)python_info[virtualenv]}' - fi - - prompt_paradox_end_segment -} - -prompt_paradox_print_elapsed_time() { - local end_time=$(( SECONDS - _prompt_paradox_start_time )) - local hours minutes seconds remainder - - if (( end_time >= 3600 )); then - hours=$(( end_time / 3600 )) - remainder=$(( end_time % 3600 )) - minutes=$(( remainder / 60 )) - seconds=$(( remainder % 60 )) - print -P "%B%F{red}>>> elapsed time ${hours}h${minutes}m${seconds}s%b" - elif (( end_time >= 60 )); then - minutes=$(( end_time / 60 )) - seconds=$(( end_time % 60 )) - print -P "%B%F{yellow}>>> elapsed time ${minutes}m${seconds}s%b" - elif (( end_time > 10 )); then - print -P "%B%F{green}>>> elapsed time ${end_time}s%b" - fi -} - -function prompt_paradox_precmd { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Format PWD. - _prompt_paradox_pwd=$(prompt-pwd) - - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Python environment information. - if (( $+functions[python-info] )); then - python-info - fi - - # Calculate and print the elapsed time. - prompt_paradox_print_elapsed_time -} - -function prompt_paradox_preexec { - _prompt_paradox_start_time="$SECONDS" -} - -function prompt_paradox_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook for calling git-info before each command. - add-zsh-hook preexec prompt_paradox_preexec - add-zsh-hook precmd prompt_paradox_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' - zstyle ':prezto:module:editor:info:keymap:primary' format '%B%F{blue}❯%f%b' - zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format '%F{red}♺%f' - zstyle ':prezto:module:editor:info:keymap:alternate' format '%B%F{red}❮%f%b' - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:action' format ' ⁝ %s' - zstyle ':prezto:module:git:info:added' format ' ✚' - zstyle ':prezto:module:git:info:ahead' format ' ⬆' - zstyle ':prezto:module:git:info:behind' format ' ⬇' - zstyle ':prezto:module:git:info:branch' format ' %b' - zstyle ':prezto:module:git:info:commit' format '➦ %.7c' - zstyle ':prezto:module:git:info:deleted' format ' ✖' - zstyle ':prezto:module:git:info:dirty' format ' ⁝' - zstyle ':prezto:module:git:info:modified' format ' ✱' - zstyle ':prezto:module:git:info:position' format '%p' - zstyle ':prezto:module:git:info:renamed' format ' ➙' - zstyle ':prezto:module:git:info:stashed' format ' S' - zstyle ':prezto:module:git:info:unmerged' format ' ═' - zstyle ':prezto:module:git:info:untracked' format ' ?' - zstyle ':prezto:module:git:info:keys' format \ - 'ref' '$(coalesce "%b" "%p" "%c")' \ - 'status' '%s%D%A%B%S%a%d%m%r%U%u' - - # %v - virtualenv name. - zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v' - - # Define prompts. - PROMPT=' -${(e)$(prompt_paradox_build_prompt)} - ${editor_info[keymap]} ' - RPROMPT='%F{blue}[%F{green}%D{%H:%M:%S}%F{blue}]%f' - SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' -} - -prompt_paradox_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_peepcode_setup b/.zprezto/modules/prompt/functions/prompt_peepcode_setup deleted file mode 100644 index 2081961..0000000 --- a/.zprezto/modules/prompt/functions/prompt_peepcode_setup +++ /dev/null @@ -1,85 +0,0 @@ -# -# A simple theme from PeepCode. -# http://peepcode.com/blog/2012/my-command-line-prompt -# -# Authors: -# Geoffrey Grosenbach -# Sorin Ionescu -# -# Screenshots: -# http://i.imgur.com/LhgmW.png -# - -function prompt_peepcode_precmd { - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Ruby information. - if (( $+functions[ruby-info] )); then - ruby-info - fi -} - -function prompt_peepcode_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - # Add a hook for calling info functions before each command. - add-zsh-hook precmd prompt_peepcode_precmd - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'no' - zstyle ':prezto:module:git:info:action' format ' +%s' - zstyle ':prezto:module:git:info:branch' format ' %F{8}%b%f' - zstyle ':prezto:module:git:info:commit' format ' %F{white}%.7c%f' - zstyle ':prezto:module:git:info:indexed' format ' ' - zstyle ':prezto:module:git:info:unindexed' format ' ' - zstyle ':prezto:module:git:info:untracked' format ' ' - zstyle ':prezto:module:git:info:dirty' format ' %F{8}✗%f' - zstyle ':prezto:module:git:info:keys' format 'rprompt' '%b%c%s%D' - - # Set ruby-info parameters. - zstyle ':prezto:module:ruby:info:version' format ' %F{white}%v%f' - - # Define prompts. - PROMPT=" -%~ -%(?.%F{green}${1:-☻ }%f.%F{red}${1:-☻ }%f) " -RPROMPT='${ruby_info[version]}${git_info[rprompt]}' - -} - -function prompt_peepcode_help { - cat <] - -If this option is not provided, the symbol defaults to ☻. -EOH -} - -function prompt_peepcode_preview { - local +h PROMPT='%# ' - local +h RPROMPT='' - local +h SPROMPT='' - - if (( $# > 0 )); then - prompt_preview_theme 'peepcode' "$@" - else - prompt_preview_theme 'peepcode' - print - prompt_preview_theme 'peepcode' "❯" - print - prompt_preview_theme 'peepcode' "$" - fi -} - -prompt_peepcode_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup b/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup deleted file mode 120000 index f692e0a..0000000 --- a/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup +++ /dev/null @@ -1 +0,0 @@ -../external/powerlevel9k/powerlevel9k.zsh-theme \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt_powerline_setup b/.zprezto/modules/prompt/functions/prompt_powerline_setup deleted file mode 120000 index 3715d75..0000000 --- a/.zprezto/modules/prompt/functions/prompt_powerline_setup +++ /dev/null @@ -1 +0,0 @@ -../external/powerline/prompt_powerline_setup \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt_pure_setup b/.zprezto/modules/prompt/functions/prompt_pure_setup deleted file mode 120000 index 1480fcf..0000000 --- a/.zprezto/modules/prompt/functions/prompt_pure_setup +++ /dev/null @@ -1 +0,0 @@ -../external/pure/pure.zsh \ No newline at end of file diff --git a/.zprezto/modules/prompt/functions/prompt_skwp_setup b/.zprezto/modules/prompt/functions/prompt_skwp_setup deleted file mode 100644 index f69dcdd..0000000 --- a/.zprezto/modules/prompt/functions/prompt_skwp_setup +++ /dev/null @@ -1,75 +0,0 @@ -# -# A single line theme with Git information on the left and Ruby on the right. -# -# Authors: -# Steve Losh -# Bart Trojanowski -# Brian Carper -# steeef -# Sorin Ionescu -# Yan Pritzker -# -# Screenshots: -# http://i.imgur.com/gLgVp6Y.png -# - -function prompt_skwp_precmd { - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Ruby information. - if (( $+functions[ruby-info] )); then - ruby-info - fi -} - -function prompt_skwp_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - - # Add hook to set up prompt parameters before each command. - add-zsh-hook precmd prompt_skwp_precmd - - # Use extended color pallete if available. - if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then - _prompt_skwp_colors=( - "%F{81}" # Turquoise - "%F{166}" # Orange - "%F{135}" # Purple - "%F{161}" # Hotpink - "%F{118}" # Limegreen - ) - else - _prompt_skwp_colors=( - "%F{cyan}" - "%F{yellow}" - "%F{magenta}" - "%F{red}" - "%F{green}" - ) - fi - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:branch' format "${_prompt_skwp_colors[1]}%b%f" - zstyle ':prezto:module:git:info:added' format "${_prompt_skwp_colors[5]}●%f" - zstyle ':prezto:module:git:info:deleted' format "${_prompt_skwp_colors[2]}●%f" - zstyle ':prezto:module:git:info:modified' format "${_prompt_skwp_colors[4]}●%f" - zstyle ':prezto:module:git:info:untracked' format "${_prompt_skwp_colors[3]}●%f" - zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%d%a%m%u)' - - # Set ruby-info parameters. - zstyle ':prezto:module:ruby:info:version' format '[%v]' - - # Define prompts. - PROMPT="${_prompt_skwp_colors[3]}%n%f@${_prompt_skwp_colors[2]}%m%f ${_prompt_skwp_colors[5]}%~%f "'${git_info:+${(e)git_info[prompt]}}'"$ " - RPROMPT='%F{blue}${ruby_info[version]}' -} - -prompt_skwp_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_smiley_setup b/.zprezto/modules/prompt/functions/prompt_smiley_setup deleted file mode 100644 index 3d41b3a..0000000 --- a/.zprezto/modules/prompt/functions/prompt_smiley_setup +++ /dev/null @@ -1,65 +0,0 @@ -# -# A simple theme that displays: -# - Python virtual environment. -# - Git branch. -# - Git state. -# - Last command exit state (smiley/X). -# -# Authors: -# Nadav Shatz -# -# Screenshots: -# http://i.imgur.com/ijycV6n.png -# - -# Load dependencies. -pmodload 'helper' - -function prompt_smiley_precmd { - unsetopt XTRACE KSH_ARRAYS - - # Get Git repository information. - if (( $+functions[git-info] )); then - git-info - fi - - # Get Python environment information. - if (( $+functions[python-info] )); then - python-info - fi - - # Get Ruby version information. - if (( $+functions[ruby-info] )); then - ruby-info - fi -} - -function prompt_smiley_setup { - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_smiley_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' - - # Set python-info parameters. - zstyle ':prezto:module:python:info:virtualenv' format '%F{yellow}[%v]%f ' - - # Set ruby-info parameters. - zstyle ':prezto:module:ruby:info:version' format '%F{yellow}[%v]%f ' - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:branch' format '%F{blue}%b%f' - zstyle ':prezto:module:git:info:dirty' format '%%B%F{red} ±%f%%b' - zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%D)' - - # Define prompts. - PROMPT='$python_info[virtualenv]$ruby_info[version]${git_info:+${(e)git_info[prompt]}} %B%c%b %(?:%F{green}ツ%f:%F{red}✖%f) ' - RPROMPT='${editor_info[overwrite]}${VIM:+" %B%F{green}V%f%b"}' - SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' -} - -prompt_smiley_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_sorin_setup b/.zprezto/modules/prompt/functions/prompt_sorin_setup deleted file mode 100644 index 14f8858..0000000 --- a/.zprezto/modules/prompt/functions/prompt_sorin_setup +++ /dev/null @@ -1,180 +0,0 @@ -# -# A simple theme that displays relevant, contextual information. -# -# Authors: -# Sorin Ionescu -# -# Screenshots: -# http://i.imgur.com/nrGV6pg.png -# - -# -# 16 Terminal Colors -# -- --------------- -# 0 black -# 1 red -# 2 green -# 3 yellow -# 4 blue -# 5 magenta -# 6 cyan -# 7 white -# 8 bright black -# 9 bright red -# 10 bright green -# 11 bright yellow -# 12 bright blue -# 13 bright magenta -# 14 bright cyan -# 15 bright white -# - -# Load dependencies. -pmodload 'helper' - -function prompt_sorin_async_callback { - case $1 in - prompt_sorin_async_git) - # We can safely split on ':' because it isn't allowed in ref names. - IFS=':' read _git_target _git_post_target <<<"$3" - - # The target actually contains 3 space separated possibilities, so we need to - # make sure we grab the first one. - _git_target=$(coalesce ${(@)${(z)_git_target}}) - - if [[ -z "$_git_target" ]]; then - # No git target detected, flush the git fragment and redisplay the prompt. - if [[ -n "$_prompt_sorin_git" ]]; then - _prompt_sorin_git='' - zle && zle reset-prompt - fi - else - # Git target detected, update the git fragment and redisplay the prompt. - _prompt_sorin_git="${_git_target}${_git_post_target}" - zle && zle reset-prompt - fi - ;; - esac -} - -function prompt_sorin_async_git { - cd -q "$1" - if (( $+functions[git-info] )); then - git-info - print ${git_info[status]} - fi -} - -function prompt_sorin_async_tasks { - # Initialize async worker. This needs to be done here and not in - # prompt_sorin_setup so the git formatting can be overridden by other prompts. - if (( !${prompt_prezto_async_init:-0} )); then - async_start_worker prompt_sorin -n - async_register_callback prompt_sorin prompt_sorin_async_callback - typeset -g prompt_prezto_async_init=1 - fi - - # Kill the old process of slow commands if it is still running. - async_flush_jobs prompt_sorin - - # Compute slow commands in the background. - async_job prompt_sorin prompt_sorin_async_git "$PWD" -} - -function prompt_sorin_precmd { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - - # Format PWD. - _prompt_sorin_pwd=$(prompt-pwd) - - # Handle updating git data. We also clear the git prompt data if we're in a - # different git root now. - if (( $+functions[git-dir] )); then - local new_git_root="$(git-dir 2> /dev/null)" - if [[ $new_git_root != $_sorin_cur_git_root ]]; then - _prompt_sorin_git='' - _sorin_cur_git_root=$new_git_root - fi - fi - - # Run python info (this should be fast and not require any async) - if (( $+functions[python-info] )); then - python-info - fi - - prompt_sorin_async_tasks -} - -function prompt_sorin_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - _prompt_sorin_precmd_async_pid=0 - _prompt_sorin_precmd_async_data=$(mktemp "${TMPDIR:-/tmp}/sorin-prompt-async-XXXXXXXXXX") - - # Load required functions. - autoload -Uz add-zsh-hook - autoload -Uz async && async - - # Add hook for calling git-info before each command. - add-zsh-hook precmd prompt_sorin_precmd - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:completing' format '%B%F{7}...%f%b' - zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{1}❯%F{3}❯%F{2}❯%f%b' - zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format ' %F{3}♺%f' - zstyle ':prezto:module:editor:info:keymap:alternate' format ' %B%F{2}❮%F{3}❮%F{1}❮%f%b' - - # Set git-info parameters. - zstyle ':prezto:module:git:info' verbose 'yes' - zstyle ':prezto:module:git:info:action' format '%F{7}:%f%%B%F{9}%s%f%%b' - zstyle ':prezto:module:git:info:added' format ' %%B%F{2}✚%f%%b' - zstyle ':prezto:module:git:info:ahead' format ' %%B%F{13}⬆%f%%b' - zstyle ':prezto:module:git:info:behind' format ' %%B%F{13}⬇%f%%b' - zstyle ':prezto:module:git:info:branch' format ' %%B%F{2}%b%f%%b' - zstyle ':prezto:module:git:info:commit' format ' %%B%F{3}%.7c%f%%b' - zstyle ':prezto:module:git:info:deleted' format ' %%B%F{1}✖%f%%b' - zstyle ':prezto:module:git:info:modified' format ' %%B%F{4}✱%f%%b' - zstyle ':prezto:module:git:info:position' format ' %%B%F{13}%p%f%%b' - zstyle ':prezto:module:git:info:renamed' format ' %%B%F{5}➜%f%%b' - zstyle ':prezto:module:git:info:stashed' format ' %%B%F{6}✭%f%%b' - zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{3}═%f%%b' - zstyle ':prezto:module:git:info:untracked' format ' %%B%F{7}◼%f%%b' - zstyle ':prezto:module:git:info:keys' format \ - 'status' '%b %p %c:%s%A%B%S%a%d%m%r%U%u' - - # Set python-info parameters. - zstyle ':prezto:module:python:info:virtualenv' format '%f%F{3}(%v)%F{7} ' - - # Set up non-zero return value display - local show_return="✘ " - # Default is to show the return value - if zstyle -T ':prezto:module:prompt' show-return-val; then - show_return+='%? ' - fi - - # Get the async worker set up. - _sorin_cur_git_root='' - - _prompt_sorin_git='' - _prompt_sorin_pwd='' - - # Define prompts. - PROMPT='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%f "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} ' - RPROMPT='$python_info[virtualenv]${editor_info[overwrite]}%(?:: %F{1}' - RPROMPT+=${show_return} - RPROMPT+='%f)${VIM:+" %B%F{6}V%f%b"}${_prompt_sorin_git}' - SPROMPT='zsh: correct %F{1}%R%f to %F{2}%r%f [nyae]? ' -} - -function prompt_sorin_preview { - local +h PROMPT='' - local +h RPROMPT='' - local +h SPROMPT='' - - editor-info 2> /dev/null - prompt_preview_theme 'sorin' -} - -prompt_sorin_setup "$@" diff --git a/.zprezto/modules/prompt/functions/prompt_steeef_setup b/.zprezto/modules/prompt/functions/prompt_steeef_setup deleted file mode 100644 index ca39f93..0000000 --- a/.zprezto/modules/prompt/functions/prompt_steeef_setup +++ /dev/null @@ -1,106 +0,0 @@ -# -# A theme based on Steve Losh's Extravagant Prompt with vcs_info integration. -# -# Authors: -# Steve Losh -# Bart Trojanowski -# Brian Carper -# steeef -# Sorin Ionescu -# -# Screenshots: -# http://i.imgur.com/HyRvv.png -# - -function prompt_steeef_precmd { - # Check for untracked files or updated submodules since vcs_info does not. - if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then - branch_format="(${_prompt_steeef_colors[1]}%b%f%u%c${_prompt_steeef_colors[4]}●%f)" - else - branch_format="(${_prompt_steeef_colors[1]}%b%f%u%c)" - fi - - zstyle ':vcs_info:*:prompt:*' formats "${branch_format}" - - vcs_info 'prompt' - - if (( $+functions[python-info] )); then - python-info - fi -} - -function prompt_steeef_setup { - setopt LOCAL_OPTIONS - unsetopt XTRACE KSH_ARRAYS - prompt_opts=(cr percent sp subst) - - # Load required functions. - autoload -Uz add-zsh-hook - autoload -Uz vcs_info - - # Add hook for calling vcs_info before each command. - add-zsh-hook precmd prompt_steeef_precmd - - # Use extended color pallete if available. - if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then - _prompt_steeef_colors=( - "%F{81}" # Turquoise - "%F{166}" # Orange - "%F{135}" # Purple - "%F{161}" # Hotpink - "%F{118}" # Limegreen - ) - else - _prompt_steeef_colors=( - "%F{cyan}" - "%F{yellow}" - "%F{magenta}" - "%F{red}" - "%F{green}" - ) - fi - - # Formats: - # %b - branchname - # %u - unstagedstr (see below) - # %c - stagedstr (see below) - # %a - action (e.g. rebase-i) - # %R - repository path - # %S - path in the repository - local branch_format="(${_prompt_steeef_colors[1]}%b%f%u%c)" - local action_format="(${_prompt_steeef_colors[5]}%a%f)" - local unstaged_format="${_prompt_steeef_colors[2]}●%f" - local staged_format="${_prompt_steeef_colors[5]}●%f" - - # Set editor-info parameters. - zstyle ':prezto:module:editor:info:keymap:primary' format '$' - - # Set vcs_info parameters. - zstyle ':vcs_info:*' enable bzr git hg svn - zstyle ':vcs_info:*:prompt:*' check-for-changes true - zstyle ':vcs_info:*:prompt:*' unstagedstr "${unstaged_format}" - zstyle ':vcs_info:*:prompt:*' stagedstr "${staged_format}" - zstyle ':vcs_info:*:prompt:*' actionformats "${branch_format}${action_format}" - zstyle ':vcs_info:*:prompt:*' formats "${branch_format}" - zstyle ':vcs_info:*:prompt:*' nvcsformats "" - - # Set python-info parameters. - zstyle ':prezto:module:python:info:virtualenv' format '(%v)' - - # Define prompts. - PROMPT=" -${_prompt_steeef_colors[3]}%n%f at ${_prompt_steeef_colors[2]}%m%f in ${_prompt_steeef_colors[5]}%~%f "'${vcs_info_msg_0_}'" -"'$python_info[virtualenv]${editor_info[keymap]} ' - RPROMPT='' -} - -function prompt_steeef_preview { - local +h PROMPT='' - local +h RPROMPT='' - local +h SPROMPT='' - - editor-info 2> /dev/null - prompt_preview_theme 'steeef' -} - -prompt_steeef_setup "$@" diff --git a/.zprezto/modules/prompt/init.zsh b/.zprezto/modules/prompt/init.zsh deleted file mode 100644 index 0ec007c..0000000 --- a/.zprezto/modules/prompt/init.zsh +++ /dev/null @@ -1,18 +0,0 @@ -# -# Loads prompt themes. -# -# Authors: -# Sorin Ionescu -# - -# Load and execute the prompt theming system. -autoload -Uz promptinit && promptinit - -# Load the prompt theme. -zstyle -a ':prezto:module:prompt' theme 'prompt_argv' -if [[ "$TERM" == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then - prompt 'off' -else - prompt "$prompt_argv[@]" -fi -unset prompt_argv diff --git a/.zprezto/modules/python/README.md b/.zprezto/modules/python/README.md deleted file mode 100644 index 121ea37..0000000 --- a/.zprezto/modules/python/README.md +++ /dev/null @@ -1,161 +0,0 @@ -Python -====== - -Enables local Python and local Python package installation. - -Settings --------- - -This module supports virtual environments from conda and virtualenvwrapper. By -default, only virtualenvwrapper is enabled. To disable virtualenvwrapper, add -the following to *zpreztorc*. - -```sh -zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on' -``` - -Conda support is enabled by adding the following to *zpreztorc*. - -```sh -zstyle ':prezto:module:python' conda-init 'on' -``` - -Caution: using conda and virtualenvwrapper at the same time may cause conflicts. - -Local Python Installation -------------------------- - -[pyenv][4] builds and installs multiple Python versions locally in the home -directory. - -This module prepends the pyenv directory to the path variable to enable the -execution of `pyenv`. - -### Usage - -Install Python versions with `pyenv install` into `~/.pyenv/versions`. - -Local Package Installation --------------------------- - -Since version 2.6, Python supports per user package installation, as defined in -[PEP 370][1]. - -This module prepends per user site directories to the relevant path variables -to enable the execution of user installed scripts and the reading of -documentation. - -### Usage - -Install packages into the per user site directory with `pip install --user`. - -virtualenvwrapper ------------------ - -[`virtualenvwrapper`][2] is a frontend to the popular [`virtualenv`][3] utility. - -`virtualenv` creates isolated Python environments and `virtualenvwrapper` -provides convenient shell functions to create, switch, and manage them. - -### Usage - -Install `virtualenvwrapper`. - -Virtual environments are stored in `~/.virtualenvs`. - -There are configuration variables that have to be set to enable certain features. -If you wish to use these features, export the variables in [`zshenv`][6]. - -The variable `$PROJECT_HOME` tells `virtualenvwrapper` where to place project -working directories. It must be set and the directory created before `mkproject` -is used. Replace *Developer* with your projects directory. - -```sh -export PROJECT_HOME="$HOME/Developer" -``` - -The variable `VIRTUALENVWRAPPER_PYTHON` tells `virtualenvwrapper` to use the -specified full path of the `python` interpreter overriding the `$PATH` search. - -```sh -export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python -``` - -The variable `VIRTUALENVWRAPPER_VIRTUALENV` tells `virtualenvwrapper` to use the -specified full path of `virtualenv` binary overriding the `$PATH` search. - -```sh -export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv -``` - -The variable `$VIRTUALENVWRAPPER_VIRTUALENV_ARGS` tells `virtualenvwrapper` what -arguments to pass to `virtualenv`. For example, set the value to -`--system-site-packages` to ensure that all new environments have access to the -system site-packages directory. - -```sh -export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--system-site-packages' -``` - -### Additional Options - -There is a hook to enable auto-switching to virtualenvs when switching into a -directory where the root of the project matches a virtualenv name. - -This can be enabled with: - -```sh -zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' -``` - -`virtualenvwrapper` is automatically initialized if pre-requisites are met -(`$VIRTUALENVWRAPPER_VIRTUALENV` is explicitly set or `virtualenv` is in -`$PATH`). This can be disabled with: - -```sh -zstyle ':prezto:module:python:virtualenv' initialize 'no' -``` - -Aliases -------- - - - `py` is short for `python`. - - `py2` is short for `python2`. - - `py3` is short for `python3`. - -Functions ---------- - - - `python-info` exposes information about the Python environment via the - `$python_info` associative array. - -Theming -------- - -To display the name of the current virtual enviroment in a prompt, define the -following style in the `prompt_name_setup` function. - - # %v - virtualenv name. - zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v' - -Then add `$python_info[virtualenv]` to `$PROMPT` or `$RPROMPT` and call -`python-info` in the `prompt_name_preexec` hook function. - -Similarly, you can use `:prezto:module:python:info:version:format` with `%v` for -the version and add `$python_info[version]` to your prompt for the current -python version/ - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][5].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Sebastian Wiesner](https://github.com/lunaryorn) - -[1]: http://www.python.org/dev/peps/pep-0370/ -[2]: http://www.doughellmann.com/projects/virtualenvwrapper/ -[3]: http://pypi.python.org/pypi/virtualenv -[4]: https://github.com/yyuu/pyenv -[5]: https://github.com/sorin-ionescu/prezto/issues -[6]: https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zshenv diff --git a/.zprezto/modules/python/functions/python-info b/.zprezto/modules/python/functions/python-info deleted file mode 100644 index 144a5b6..0000000 --- a/.zprezto/modules/python/functions/python-info +++ /dev/null @@ -1,53 +0,0 @@ -# -# Exposes information about the Python environment via the $python_info -# associative array. -# -# Authors: -# Sorin Ionescu -# Patrick Bos -# - -# function python-info { - -local virtualenv_format -local virtualenv_formatted -local version_format -local version_formatted -local version - -# Clean up previous $python_info. -unset python_info -typeset -gA python_info - -# Grab the styling we might have to do -zstyle -s ':prezto:module:python:info:virtualenv' format 'virtualenv_format' -zstyle -s ':prezto:module:python:info:version' format 'version_format' - -# Format virtualenv. -if [[ -n "$virtualenv_format" ]]; then - if [[ -n "$VIRTUAL_ENV" ]]; then - zformat -f virtualenv_formatted "$virtualenv_format" "v:${VIRTUAL_ENV:t}" - python_info[virtualenv]="$virtualenv_formatted" - fi - - # Do the same for Conda virtual environments - if [[ -n "$CONDA_DEFAULT_ENV" ]]; then - zformat -f virtualenv_formatted "$virtualenv_format" "v:${CONDA_DEFAULT_ENV:t}" - python_info[virtualenv]="$virtualenv_formatted" - fi -fi - -if [[ -n "$version_format" ]]; then - if (( $+commands[pyenv] )); then - version="${"$(pyenv version)"%% *}" - elif (( $+commands[python] )); then - version="${$(python3 --version)#Python }" - fi - - if [[ -n "$version" && "$version" != "system" ]]; then - zformat -f version_formatted "$version_format" "v:$version" - python_info[version]="$version_formatted" - fi -fi - -# } diff --git a/.zprezto/modules/python/init.zsh b/.zprezto/modules/python/init.zsh deleted file mode 100644 index 9796294..0000000 --- a/.zprezto/modules/python/init.zsh +++ /dev/null @@ -1,189 +0,0 @@ -# -# Enables local Python package installation. -# -# Authors: -# Sorin Ionescu -# Sebastian Wiesner -# Patrick Bos -# - -# Load manually installed pyenv into the path -if [[ -n "$PYENV_ROOT" && -s "$PYENV_ROOT/bin/pyenv" ]]; then - path=("$PYENV_ROOT/bin" $path) -elif [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then - path=("$HOME/.pyenv/bin" $path) -fi - -# Load pyenv into the current python session -if (( $+commands[pyenv] )); then - if [[ -z "$PYENV_ROOT" ]]; then - export PYENV_ROOT=$(pyenv root) - fi - eval "$(pyenv init - --no-rehash zsh)" - -# Prepend PEP 370 per user site packages directory, which defaults to -# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The -# path can be overridden using PYTHONUSERBASE. -else - if [[ -n "$PYTHONUSERBASE" ]]; then - path=($PYTHONUSERBASE/bin $path) - elif [[ "$OSTYPE" == darwin* ]]; then - path=($HOME/Library/Python/*/bin(N) $path) - else - # This is subject to change. - path=($HOME/.local/bin $path) - fi -fi - -# Return if requirements are not found. -if (( ! $+commands[python] && ! $+commands[pyenv] )); then - return 1 -fi - -function _python-workon-cwd { - # Check if this is a Git repo - local GIT_REPO_ROOT="" - local GIT_TOPLEVEL="$(git rev-parse --show-toplevel 2> /dev/null)" - if [[ $? == 0 ]]; then - GIT_REPO_ROOT="$GIT_TOPLEVEL" - fi - # Get absolute path, resolving symlinks - local PROJECT_ROOT="${PWD:A}" - while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" \ - && ! -d "$PROJECT_ROOT/.git" && "$PROJECT_ROOT" != "$GIT_REPO_ROOT" ]]; do - PROJECT_ROOT="${PROJECT_ROOT:h}" - done - if [[ "$PROJECT_ROOT" == "/" ]]; then - PROJECT_ROOT="." - fi - # Check for virtualenv name override - local ENV_NAME="" - if [[ -f "$PROJECT_ROOT/.venv" ]]; then - ENV_NAME="$(cat "$PROJECT_ROOT/.venv")" - elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]]; then - ENV_NAME="$PROJECT_ROOT/.venv" - elif [[ "$PROJECT_ROOT" != "." ]]; then - ENV_NAME="${PROJECT_ROOT:t}" - fi - if [[ -n $CD_VIRTUAL_ENV && "$ENV_NAME" != "$CD_VIRTUAL_ENV" ]]; then - # We've just left the repo, deactivate the environment - # Note: this only happens if the virtualenv was activated automatically - deactivate && unset CD_VIRTUAL_ENV - fi - if [[ "$ENV_NAME" != "" ]]; then - # Activate the environment only if it is not already active - if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then - if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then - workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" - elif [[ -e "$ENV_NAME/bin/activate" ]]; then - source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME" - fi - fi - fi -} - -# Load auto workon cwd hook -if zstyle -t ':prezto:module:python:virtualenv' auto-switch 'yes'; then - # Auto workon when changing directory - autoload -Uz add-zsh-hook - add-zsh-hook chpwd _python-workon-cwd -fi - -# Load virtualenvwrapper into the shell session, if pre-requisites are met -# and unless explicitly requested not to -if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ - zstyle -T ':prezto:module:python:virtualenv' initialize ; then - # Set the directory where virtual environments are stored. - export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}" - - # Disable the virtualenv prompt. Note that we use the magic value used by the - # pure prompt because there's some additional logic in that prompt which tries - # to figure out if a user set this variable and disable the python portion of - # that prompt based on it which is the exact opposite of what we want to do. - export VIRTUAL_ENV_DISABLE_PROMPT=12 - - # Create a sorted array of available virtualenv related 'pyenv' commands to - # look for plugins of interest. Scanning shell '$path' isn't enough as they - # can exist in 'pyenv' synthesized paths (e.g., '~/.pyenv/plugins') instead. - local -a pyenv_plugins - if (( $+commands[pyenv] )); then - pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2>/dev/null)"}:#virtualenv*}) - fi - - if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then - # Enable 'virtualenv' with 'pyenv'. - eval "$(pyenv virtualenv-init - zsh)" - - # Optionally activate 'virtualenvwrapper' plugin when available. - if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then - pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" - fi - else - # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if available - # in '$path' or in an alternative location on a Debian based system. - # - # If homebrew is installed and the python location wasn't overridden via - # environment variable we fall back to python3 then python2 in that order. - # This is needed to fix an issue with virtualenvwrapper as homebrew no - # longer shadows the system python. - if [[ -z "$VIRTUALENVWRAPPER_PYTHON" ]] && (( $+commands[brew] )); then - if (( $+commands[python3] )); then - export VIRTUALENVWRAPPER_PYTHON=$commands[python3] - elif (( $+commands[python2] )); then - export VIRTUALENVWRAPPER_PYTHON=$commands[python2] - fi - fi - - virtenv_sources=( - ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} - /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) - ) - if (( $#virtenv_sources )); then - source "${virtenv_sources[1]}" - fi - - unset virtenv_sources - fi - - unset pyenv_plugins -fi - -# Load PIP completion. -if (( $#commands[(i)pip(|[23])] )); then - cache_file="${TMPDIR:-/tmp}/prezto-python-cache.$UID.zsh" - - # Detect and use one available from among 'pip', 'pip2', 'pip3' variants - pip_command="$commands[(i)pip(|[23])]" - - if [[ "$pip_command" -nt "$cache_file" \ - || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ! -s "$cache_file" ]]; then - # pip is slow; cache its output. And also support 'pip2', 'pip3' variants - $pip_command completion --zsh \ - | sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null - fi - - source "$cache_file" - unset cache_file pip_command -fi - -# Load conda into the shell session, if requested -zstyle -T ':prezto:module:python' conda-init -if (( $? && $+commands[conda] )); then - if (( $(conda ..changeps1) )); then - echo "To make sure Conda doesn't change your prompt (should do that in the prompt module) run:\n conda config --set changeps1 false" - # TODO: - # We could just run this ourselves. In an exit hook - # (add zsh-hook zshexit [(anonymous) function]) we could then set it back - # to the way it was before we changed it. However, I'm not sure if this is - # exception safe, so left it like this for now. - fi -fi - -# -# Aliases -# - -alias py='python' -alias py2='python2' -alias py3='python3' diff --git a/.zprezto/modules/rails/README.md b/.zprezto/modules/rails/README.md deleted file mode 100644 index 19bea1d..0000000 --- a/.zprezto/modules/rails/README.md +++ /dev/null @@ -1,34 +0,0 @@ -Ruby on Rails -============= - -Defines [Ruby on Rails][1] aliases. - -Aliases -------- - - - `ror` is short for `rails`. - - `rorc` starts the Rails console. - - `rordc` starts the Rails console connected to the database. - - `rordm` migrates the database. - - `rordM` migrates the database and recreates the test database. - - `rordr` rolls the database schema back to the previous version. - - `rorg` generates new code. - - `rorl` displays the log. - - `rorlc` truncates logs to zero bytes. - - `rorp` installs a plugin. - - `rorr` runs code in the application environment. - - `rors` starts the Rails server. - - `rorsd` starts the Rails server with the debugger. - - `rorx` destroys newly generated code. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Robby Russell](https://github.com/robbyrussell) - - [Jake Bell](https://github.com/theunraveler) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://rubyonrails.org -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/rails/init.zsh b/.zprezto/modules/rails/init.zsh deleted file mode 100644 index 44b53e9..0000000 --- a/.zprezto/modules/rails/init.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# -# Defines Ruby on Rails aliases. -# -# Authors: -# Robby Russell -# Jake Bell -# Sorin Ionescu -# - -# Load dependencies. -pmodload 'ruby' - -# Return if requirements are not found. -if (( ! $+commands[bundle] )); then - return 1 -fi - -# -# Aliases -# - -alias ror='bundle exec rails' -alias rorc='bundle exec rails console' -alias rordc='bundle exec rails dbconsole' -alias rordm='bundle exec rake db:migrate' -alias rordM='bundle exec rake db:migrate db:test:clone' -alias rordr='bundle exec rake db:rollback' -alias rorg='bundle exec rails generate' -alias rorl='tail -f "$(ruby-app-root)/log/development.log"' -alias rorlc='bundle exec rake log:clear' -alias rorp='bundle exec rails plugin' -alias rorr='bundle exec rails runner' -alias rors='bundle exec rails server' -alias rorsd='bundle exec rails server --debugger' -alias rorx='bundle exec rails destroy' diff --git a/.zprezto/modules/rsync/README.md b/.zprezto/modules/rsync/README.md deleted file mode 100644 index 77d78ea..0000000 --- a/.zprezto/modules/rsync/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Rsync -===== - -Defines [rsync][1] aliases. - -macOS users are encouraged to use [Bombich's rsync][2], which has HFS+ -enhancements. - -Aliases -------- - - - `rsync-copy` copies files and directories from *source* to *destination*. - - `rsync-move` moves files and directories from *source* to *destination*. - - `rsync-update` updates files and directories on *destination*. - - `rsync-synchronize` synchronizes files and directories between *source* and - *destination*. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://rsync.samba.org -[2]: https://bombich.com/kb/ccc5/credits#rsync -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/rsync/init.zsh b/.zprezto/modules/rsync/init.zsh deleted file mode 100644 index 3618812..0000000 --- a/.zprezto/modules/rsync/init.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# -# Defines Rsync aliases. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[rsync] )); then - return 1 -fi - -# -# Aliases -# - -_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive \ - --hard-links --one-file-system' - -if grep -q 'xattrs' <(rsync --help 2>&1); then - _rsync_cmd="${_rsync_cmd} --acls --xattrs" -fi - -# macOS and HFS+ Enhancements -# http://help.bombich.com/kb/overview/credits#opensource -if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then - _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" -fi - -alias rsync-copy="${_rsync_cmd}" -alias rsync-move="${_rsync_cmd} --remove-source-files" -alias rsync-update="${_rsync_cmd} --update" -alias rsync-synchronize="${_rsync_cmd} --update --delete" - -unset _rsync_cmd diff --git a/.zprezto/modules/ruby/README.md b/.zprezto/modules/ruby/README.md deleted file mode 100644 index 12848d8..0000000 --- a/.zprezto/modules/ruby/README.md +++ /dev/null @@ -1,112 +0,0 @@ -Ruby -==== - -Configures [Ruby][1] local gem installation, loads version managers, and defines -aliases. - -Local Gem Installation ----------------------- - -When a Ruby version manager is not detected, local gems are installed in -`~/.gems`; otherwise, they are installed according to the manager. - -RVM ---- - -An alternative to the above is to use [The Ruby Version Manager (RVM)][2], which -allows for managing multiple, isolated Ruby installations and gem sets in the -home directory. - -Since RVM is loaded into the shell and is known to override shell commands, it -may conflict with shell scripts. - -Load this module as late as possible when using RVM since RVM will complain if -it is not first in `$PATH`. - -rbenv ------ - -An alternative RVM is to use [rbenv][3], which allows for switching between -multiple, isolated Ruby installations in the home directory. - -While it is not as feature rich as RVM, it is not loaded into the shell and is -not known to cause conflicts with shell scripts. - -chruby ------- - -Yet another alternative is [chruby][4], which is simpler than both RVM and -rbenv. - -### Settings - -#### Auto-Switch - -To enable auto switching the Ruby version on directory change based on the -`.ruby-version` file, add the following line to [`zpreztorc`][5]: - -```sh -zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' -``` - -Bundler -------- - -Manage gems that are not meant to be used as commands, such as application -dependencies, with [Bundler][6]. - -Aliases -------- - -### General - - - `rb` is short for `ruby`. - -### Bundler - - - `rbb` manages ruby dependencies (`bundle`). - - `rbbc` cleans up unused gems in your bundler directory. - - `rbbe` executes a script in the context of the current bundle. - - `rbbi` installs the gems specified in the `Gemfile` in `vendor/bundle`. - - `rbbI` installs the following: - - gems specified in the `Gemfile` in `vendor/bundle`. - - packages the gems into `vendor/cache`. - - appends bundler directories to `.gitignore`. - - `rbbl` lists all gems in the current bundle. - - `rbbo` opens an installed gem in the editor. - - `rbbp` packages gem files into `vendor/cache`. - - `rbbu` updates gems to their latest version. - -Functions ---------- - - - `ruby-app-root` displays the path to the Ruby application root directory. - - `ruby-info` exposes information about the Ruby environment via the - `$ruby_info` associative array. - -Theming -------- - -To display the name of the current Ruby version in a prompt, define the -following style in the `prompt_name_setup` function. - - # %v - ruby version. - zstyle ':prezto:module:ruby:info:version' format 'version:%v' - -Then add `$ruby_info[version]` to `$PROMPT` or `$RPROMPT` and call -`ruby-info` in the `prompt_name_preexec` hook function. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][7].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.ruby-lang.org -[2]: https://rvm.io -[3]: https://github.com/sstephenson/rbenv -[4]: https://github.com/postmodern/chruby -[5]: https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zpreztorc -[6]: http://gembundler.com -[7]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/ruby/functions/ruby-app-root b/.zprezto/modules/ruby/functions/ruby-app-root deleted file mode 100644 index ef28c5b..0000000 --- a/.zprezto/modules/ruby/functions/ruby-app-root +++ /dev/null @@ -1,22 +0,0 @@ -# -# Displays the path to the Ruby application root directory. -# -# Authors: -# Sorin Ionescu -# - -# function ruby-app-root { - -local root_dir="$PWD" - -while [[ "$root_dir" != '/' ]]; do - if [[ -f "$root_dir/Gemfile" ]]; then - print "$root_dir" - break - fi - root_dir="$root_dir:h" -done - -return 1 - -# } diff --git a/.zprezto/modules/ruby/functions/ruby-info b/.zprezto/modules/ruby/functions/ruby-info deleted file mode 100644 index cba0188..0000000 --- a/.zprezto/modules/ruby/functions/ruby-info +++ /dev/null @@ -1,38 +0,0 @@ -# -# Exposes information about the Ruby environment via the $ruby_info associative -# array. -# -# Authors: -# Sorin Ionescu -# - -# function ruby-info { - -local version -local version_format -local version_formatted - -# Clean up previous $ruby_info. -unset ruby_info -typeset -gA ruby_info - -# Grab formatting for anything we might have to do -zstyle -s ':prezto:module:ruby:info:version' format 'version_format' - -if [[ -n "$version_format" ]]; then - if (( $+commands[rvm-prompt] )); then - version="$(rvm-prompt)" - elif (( $+commands[rbenv] )); then - version="$(rbenv version-name)" - elif (( $+commands[ruby] )); then - version="${${$(ruby --version)[(w)1,(w)2]}/ /-}" - fi - - # Format version. - if [[ -n "$version" && "$version" != "system" ]]; then - zformat -f version_formatted "$version_format" "v:$version" - ruby_info[version]="$version_formatted" - fi -fi - -# } diff --git a/.zprezto/modules/ruby/init.zsh b/.zprezto/modules/ruby/init.zsh deleted file mode 100644 index 4ede366..0000000 --- a/.zprezto/modules/ruby/init.zsh +++ /dev/null @@ -1,74 +0,0 @@ -# -# Configures Ruby local gem installation, loads version managers, and defines -# aliases. -# -# Authors: Sorin Ionescu -# - -# Load RVM into the shell session. -if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then - # Unset AUTO_NAME_DIRS since auto adding variable-stored paths to ~ list - # conflicts with RVM. - unsetopt AUTO_NAME_DIRS - - # Source RVM. - source "$HOME/.rvm/scripts/rvm" - -# Load manually installed rbenv into the shell session. -elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then - path=("$HOME/.rbenv/bin" $path) - eval "$(rbenv init - --no-rehash zsh)" - -# Load package manager installed rbenv into the shell session. -elif (( $+commands[rbenv] )); then - eval "$(rbenv init - --no-rehash zsh)" - -# Load package manager installed chruby into the shell session. -elif (( $+commands[chruby-exec] )); then - if (( ! $+functions[chruby] )); then - source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh" - fi - - if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then - if (( ! $+functions[chruby_auto] )); then - source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh" - fi - - # If a default Ruby is set, switch to it. - chruby_auto - fi - -# Prepend local gems bin directories to PATH. -else - path=($HOME/.gem/ruby/*/bin(N) $path) -fi - -# Return if requirements are not found. -if (( ! $+commands[ruby] && ! ( $+commands[rvm] || $+commands[rbenv] ) )); then - return 1 -fi - -# -# Aliases -# - -# General -alias rb='ruby' - -# Bundler -if (( $+commands[bundle] )); then - alias rbb='bundle' - alias rbbc='bundle clean' - alias rbbe='bundle exec' - alias rbbi='bundle install --path vendor/bundle' - alias rbbl='bundle list' - alias rbbo='bundle open' - alias rbbp='bundle package' - alias rbbu='bundle update' - alias rbbI='rbbi \ - && bundle package \ - && print .bundle >>! .gitignore \ - && print vendor/assets >>! .gitignore \ - && print vendor/bundle >>! .gitignore \ - && print vendor/cache >>! .gitignore' -fi diff --git a/.zprezto/modules/screen/README.md b/.zprezto/modules/screen/README.md deleted file mode 100644 index 0a9ff07..0000000 --- a/.zprezto/modules/screen/README.md +++ /dev/null @@ -1,44 +0,0 @@ -GNU Screen -========== - -Defines [GNU Screen][1] aliases and provides for auto launching it at start-up. - -Settings --------- - -### Auto-Start - -Starts a GNU Screen session automatically when Zsh is launched. - -To enable this feature when launching Zsh in a local terminal, add the -following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:screen:auto-start' local 'yes' -``` - -To enable this feature when launching Zsh in a SSH connection, add the -following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:screen:auto-start' remote 'yes' -``` - -Aliases -------- - - - `scr` is short for `screen`. - - `scrl` lists sessions/socket directory. - - `scrn` starts a new session. - - `scrr` attaches to a session if one exists or start a new one. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Georges Discry](https://github.com/gdiscry) - -[1]: http://www.gnu.org/software/screen/ -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/screen/init.zsh b/.zprezto/modules/screen/init.zsh deleted file mode 100644 index 0dee1c9..0000000 --- a/.zprezto/modules/screen/init.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# -# Defines GNU Screen aliases and provides for auto launching it at start-up. -# -# Authors: -# Sorin Ionescu -# Georges Discry -# - -# Return if requirements are not found. -if (( ! $+commands[screen] )); then - return 1 -fi - -# -# Auto Start -# - -if [[ -z "$STY" && -z "$EMACS" && -z "$VIM" ]] && ( \ - ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' remote ) || - ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' local ) \ -); then - session="$( - screen -list 2> /dev/null \ - | sed '1d;$d' \ - | awk '{print $1}' \ - | head -1)" - - if [[ -n "$session" ]]; then - exec screen -x "$session" - else - exec screen -a -A -U -D -R -m "$SHELL" -l - fi -fi - -# -# Aliases -# - -alias scr='screen' -alias scrl='screen -list' -alias scrn='screen -U -S' -alias scrr='screen -a -A -U -D -R' diff --git a/.zprezto/modules/spectrum/README.md b/.zprezto/modules/spectrum/README.md deleted file mode 100644 index 66abcb2..0000000 --- a/.zprezto/modules/spectrum/README.md +++ /dev/null @@ -1,91 +0,0 @@ -Spectrum -======== - -Provides for easier use of 256 colors and effects. - -To learn more about text formatting, read [A Guide to 256 Color Codes][1]. - -Variables ---------- - - - `BG` provides background colors. - - `FG` provides foreground colors. - - `FX` provides effects. - -### Background and Foreground - -Terminals support 8, 16, 88, and 256 colors. Check if a terminal supports 256 -colors with `tput colors` before use. - -The following colors are supported. - -- 0 to 255 -- black -- red -- green -- yellow -- blue -- magenta -- cyan -- white - -### Effects - -Though there are many effects, most terminals support at least bold formatting. - -**Not all effects work on all terminals; use them sparingly.** - -| Enable | Disable | -| ------------------------- | ---------------------------- | -| | none | -| | normal | -| bold | no-bold | -| faint | no-faint | -| standout | no-standout | -| underline | no-underline | -| blink | no-blink | -| fast-blink | no-fast-blink | -| reverse | no-reverse | -| conceal | no-conceal | -| strikethrough | no-strikethrough | -| gothic | no-gothic | -| double-underline | no-double-underline | -| proportional | no-proportional | -| overline | no-overline | -| | | -| | no-border | -| border-rectangle | no-border-rectangle | -| border-circle | no-border-circle | -| | | -| | no-ideogram-marking | -| underline-or-right | no-underline-or-right | -| double-underline-or-right | no-double-underline-or-right | -| overline-or-left | no-overline-or-left | -| double-overline-or-left | no-double-overline-or-left | -| stress | no-stress | -| | | -| | font-default | -| font-first | no-font-first | -| font-second | no-font-second | -| font-third | no-font-third | -| font-fourth | no-font-fourth | -| font-fifth | no-font-fifth | -| font-sixth | no-font-sixth | -| font-seventh | no-font-seventh | -| font-eigth | no-font-eigth | -| font-ninth | no-font-ninth | - -### Plain Text - -Use `$BG[none]`, `$FG[none]`, or `$FX[none]` to turn off formatting. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [P.C. Shyamshankar](https://github.com/sykora) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://lucentbeing.com/writing/archives/a-guide-to-256-color-codes/ -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/spectrum/init.zsh b/.zprezto/modules/spectrum/init.zsh deleted file mode 100644 index 61e2262..0000000 --- a/.zprezto/modules/spectrum/init.zsh +++ /dev/null @@ -1,69 +0,0 @@ -# -# Provides for easier use of 256 colors and effects. -# -# Authors: -# P.C. Shyamshankar -# Sorin Ionescu -# - -# Return if requirements are not found. -if [[ "$TERM" == 'dumb' ]]; then - return 1 -fi - -typeset -gA FX FG BG - -FX=( - none "\e[00m" - normal "\e[22m" - bold "\e[01m" no-bold "\e[22m" - faint "\e[02m" no-faint "\e[22m" - standout "\e[03m" no-standout "\e[23m" - underline "\e[04m" no-underline "\e[24m" - blink "\e[05m" no-blink "\e[25m" - fast-blink "\e[06m" no-fast-blink "\e[25m" - reverse "\e[07m" no-reverse "\e[27m" - conceal "\e[08m" no-conceal "\e[28m" - strikethrough "\e[09m" no-strikethrough "\e[29m" - gothic "\e[20m" no-gothic "\e[22m" - double-underline "\e[21m" no-double-underline "\e[22m" - proportional "\e[26m" no-proportional "\e[50m" - overline "\e[53m" no-overline "\e[55m" - - no-border "\e[54m" - border-rectangle "\e[51m" no-border-rectangle "\e[54m" - border-circle "\e[52m" no-border-circle "\e[54m" - - no-ideogram-marking "\e[65m" - underline-or-right "\e[60m" no-underline-or-right "\e[65m" - double-underline-or-right "\e[61m" no-double-underline-or-right "\e[65m" - overline-or-left "\e[62m" no-overline-or-left "\e[65m" - double-overline-or-left "\e[63m" no-double-overline-or-left "\e[65m" - stress "\e[64m" no-stress "\e[65m" - - font-default "\e[10m" - font-first "\e[11m" no-font-first "\e[10m" - font-second "\e[12m" no-font-second "\e[10m" - font-third "\e[13m" no-font-third "\e[10m" - font-fourth "\e[14m" no-font-fourth "\e[10m" - font-fifth "\e[15m" no-font-fifth "\e[10m" - font-sixth "\e[16m" no-font-sixth "\e[10m" - font-seventh "\e[17m" no-font-seventh "\e[10m" - font-eigth "\e[18m" no-font-eigth "\e[10m" - font-ninth "\e[19m" no-font-ninth "\e[10m" -) - -FG[none]="$FX[none]" -BG[none]="$FX[none]" -colors=(black red green yellow blue magenta cyan white) -for color in {0..255}; do - if (( $color >= 0 )) && (( $color < $#colors )); then - index=$(( $color + 1 )) - FG[$colors[$index]]="\e[38;5;${color}m" - BG[$colors[$index]]="\e[48;5;${color}m" - fi - - FG[$color]="\e[38;5;${color}m" - BG[$color]="\e[48;5;${color}m" -done -unset color{s,} index diff --git a/.zprezto/modules/ssh/README.md b/.zprezto/modules/ssh/README.md deleted file mode 100644 index a1727b9..0000000 --- a/.zprezto/modules/ssh/README.md +++ /dev/null @@ -1,26 +0,0 @@ -SSH -=== - -Provides for an easier use of [SSH][1] by setting up [ssh-agent][2]. - -Settings --------- - -### Identities - -To load multiple identities, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_dsa' 'id_github' -``` - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.openssh.com -[2]: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-agent&sektion=1 -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/ssh/init.zsh b/.zprezto/modules/ssh/init.zsh deleted file mode 100644 index 08edce5..0000000 --- a/.zprezto/modules/ssh/init.zsh +++ /dev/null @@ -1,60 +0,0 @@ -# -# Provides for an easier use of SSH by setting up ssh-agent. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[ssh-agent] )); then - return 1 -fi - -# Set the path to the SSH directory. -_ssh_dir="$HOME/.ssh" - -# Set the path to the environment file if not set by another module. -_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env.$UID}" - -# Set the path to the persistent authentication socket. -_ssh_agent_sock="${TMPDIR:-/tmp}/ssh-agent.sock.$UID" - -# Start ssh-agent if not started. -if [[ ! -S "$SSH_AUTH_SOCK" ]]; then - # Export environment variables. - source "$_ssh_agent_env" 2> /dev/null - - # Start ssh-agent if not started. - if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then - eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")" - fi -fi - -# Create a persistent SSH authentication socket. -if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then - ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock" - export SSH_AUTH_SOCK="$_ssh_agent_sock" -fi - -# Load identities. -if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then - zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities' - # ssh-add has strange requirements for running SSH_ASKPASS, so we duplicate - # them here. Essentially, if the other requirements are met, we redirect stdin - # from /dev/null in order to meet the final requirement. - # - # From ssh-add(1): - # If ssh-add needs a passphrase, it will read the passphrase from the current - # terminal if it was run from a terminal. If ssh-add does not have a terminal - # associated with it but DISPLAY and SSH_ASKPASS are set, it will execute the - # program specified by SSH_ASKPASS and open an X11 window to read the - # passphrase. - if [[ -n "$DISPLAY" && -x "$SSH_ASKPASS" ]]; then - ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} < /dev/null 2> /dev/null - else - ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} 2> /dev/null - fi -fi - -# Clean up. -unset _ssh_{dir,identities} _ssh_agent_{env,sock} diff --git a/.zprezto/modules/syntax-highlighting/README.md b/.zprezto/modules/syntax-highlighting/README.md deleted file mode 100644 index 7a28892..0000000 --- a/.zprezto/modules/syntax-highlighting/README.md +++ /dev/null @@ -1,71 +0,0 @@ -Syntax Highlighting -=================== - -Integrates [zsh-syntax-highlighting][1] into Prezto. - -This module should be loaded before the *prompt* module. - -Additionally, if this module is used in conjunction with the -*history-substring-search* module, this module must be loaded **before** the -*history-substring-search* module. - -Contributors ------------- - -New features and bug fixes should be submitted to the -[zsh-syntax-highlighting][1] project according to its rules and regulations. -This module will be synchronized against it. - -Settings --------- - -### Highlighting - -To enable highlighting for this module only, add the following line to -*zpreztorc*: - -```sh -zstyle ':prezto:module:syntax-highlighting' color 'yes' -``` - -### Highlighters - -Syntax highlighting is accomplished by pluggable [highlighters][2]. This module -only enables the *main* highlighter by default. - -To enable all highlighters, add the following to *zpreztorc*: - -```sh -zstyle ':prezto:module:syntax-highlighting' highlighters \ - 'main' \ - 'brackets' \ - 'pattern' \ - 'line' \ - 'cursor' \ - 'root' -``` - -### Highlighting Styles - -Each syntax highlighter defines styles used to highlight tokens. - -To highlight, for example, builtins, commands, and functions in blue instead of -green, add the following to *zpreztorc*: - -```sh -zstyle ':prezto:module:syntax-highlighting' styles \ - 'builtin' 'bg=blue' \ - 'command' 'bg=blue' \ - 'function' 'bg=blue' -``` - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][3].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/zsh-users/zsh-syntax-highlighting -[2]: https://github.com/zsh-users/zsh-syntax-highlighting/tree/master/highlighters -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/syntax-highlighting/external/.revision-hash b/.zprezto/modules/syntax-highlighting/external/.revision-hash deleted file mode 100644 index 6828f88..0000000 --- a/.zprezto/modules/syntax-highlighting/external/.revision-hash +++ /dev/null @@ -1 +0,0 @@ -$Format:%H$ diff --git a/.zprezto/modules/syntax-highlighting/external/.version b/.zprezto/modules/syntax-highlighting/external/.version deleted file mode 100644 index e1bde80..0000000 --- a/.zprezto/modules/syntax-highlighting/external/.version +++ /dev/null @@ -1 +0,0 @@ -0.7.0-dev diff --git a/.zprezto/modules/syntax-highlighting/external/COPYING.md b/.zprezto/modules/syntax-highlighting/external/COPYING.md deleted file mode 100644 index 22eea4f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/COPYING.md +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2010-2018 zsh-syntax-highlighting contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted -provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors - may be used to endorse or promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.zprezto/modules/syntax-highlighting/external/HACKING.md b/.zprezto/modules/syntax-highlighting/external/HACKING.md deleted file mode 100644 index 5266a33..0000000 --- a/.zprezto/modules/syntax-highlighting/external/HACKING.md +++ /dev/null @@ -1,75 +0,0 @@ -Hacking on zsh-syntax-highlighting itself -========================================= - -This document includes information for people working on z-sy-h itself: on the -core driver (`zsh-syntax-highlighting.zsh`), on the highlighters in the -distribution, and on the test suite. It does not target third-party -highlighter authors (although they may find it an interesting read). - -The `main` highlighter ----------------------- - -The following function `pz` is useful when working on the `main` highlighting: - - pq() { - (( $#argv )) || return 0 - print -r -l -- ${(qqqq)argv} - } - pz() { - local arg - for arg; do - pq ${(z)arg} - done - } - -It prints, for each argument, its token breakdown, similar to how the main -loop of the `main` highlighter sees it. - -Testing the `brackets` highlighter ----------------------------------- - -Since the test harness empties `ZSH_HIGHLIGHT_STYLES` and the `brackets` -highlighter interrogates `ZSH_HIGHLIGHT_STYLES` to determine how to highlight, -tests must set the `bracket-level-#` keys themselves. For example: - - ZSH_HIGHLIGHT_STYLES[bracket-level-1]= - ZSH_HIGHLIGHT_STYLES[bracket-level-2]= - - BUFFER='echo ({x})' - - expected_region_highlight=( - "6 6 bracket-level-1" # ( - "7 7 bracket-level-2" # { - "9 9 bracket-level-2" # } - "10 10 bracket-level-1" # ) - ) - -Testing the `pattern` and `regexp` highlighters ------------------------------------------------ - -Because the `pattern` and `regexp` highlighters modifies `region_highlight` -directly instead of using `_zsh_highlight_add_highlight`, the test harness -cannot get the `ZSH_HIGHLIGHT_STYLES` keys. Therefore, when writing tests, use -the style itself as third word (cf. the -[documentation for `expected_region_highlight`](docs/highlighters.md)). For example: - - ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') - - BUFFER='rm -rf /' - - expected_region_highlight=( - "1 8 fg=white,bold,bg=red" # rm -rf / - ) - -Miscellany ----------- - -If you work on the driver (`zsh-syntax-highlighting.zsh`), you may find the following zstyle useful: - - zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh - -IRC channel ------------ - -We're on #zsh-syntax-highlighting on freenode. - diff --git a/.zprezto/modules/syntax-highlighting/external/INSTALL.md b/.zprezto/modules/syntax-highlighting/external/INSTALL.md deleted file mode 100644 index 468e9bd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/INSTALL.md +++ /dev/null @@ -1,115 +0,0 @@ -How to install --------------- - -### Using packages - -* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package] -* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository]) -* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository]) -* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`textproc/zsh-syntax-highlighting`][freebsd-port]) -* Gentoo: [mv overlay][gentoo-overlay] -* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package] -* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository]) -* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository] -* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository] -* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package] - -[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting -[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git -[debian-package]: https://packages.debian.org/zsh-syntax-highlighting -[freebsd-port]: http://www.freshports.org/textproc/zsh-syntax-highlighting/ -[gentoo-overlay]: http://gpo.zugaina.org/app-shells/zsh-syntax-highlighting -[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-syntax-highlighting.rb -[ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting -[fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting -[fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting -[obs-repository]: https://software.opensuse.org//download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting -[void-package]: https://github.com/voidlinux/void-packages/tree/master/srcpkgs/zsh-syntax-highlighting - -See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions) - - -### In your ~/.zshrc - -Simply clone this repository and source the script: - - git clone https://github.com/zsh-users/zsh-syntax-highlighting.git - echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc - - Then, enable syntax highlighting in the current interactive shell: - - source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - - If `git` is not installed, download and extract a snapshot of the latest - development tree from: - - https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz - - Note the `source` command must be **at the end** of `~/.zshrc`. - - -### With a plugin manager - -Note that `zsh-syntax-highlighting` must be the last plugin sourced. - -The zsh-syntax-highlighting authors recommend manual installation over the use -of a framework or plugin manager. - -This list is incomplete as there are too many -[frameworks / plugin managers][framework-list] to list them all here. - -[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks - -#### [Antigen](https://github.com/zsh-users/antigen) - -Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in -your `.zshrc`. - -#### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) - -1. Clone this repository in oh-my-zsh's plugins directory: - - git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - -2. Activate the plugin in `~/.zshrc`: - - plugins=( [plugins...] zsh-syntax-highlighting) - -3. Source `~/.zshrc` to take changes into account: - - source ~/.zshrc - -#### [Prezto](https://github.com/sorin-ionescu/prezto) - -Zsh-syntax-highlighting is included with Prezto. See the -[Prezto documentation][prezto-docs] to enable and configure highlighters. - -[prezto-docs]: https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting - -#### [zgen](https://github.com/tarjoilija/zgen) - -Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`. - -#### [zplug](https://github.com/zplug/zplug) - -Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`. - -#### [zplugin](https://github.com/psprint/zplugin) - -Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your -`.zshrc`. - - -### System-wide installation - -Any of the above methods is suitable for a single-user installation, -which requires no special privileges. If, however, you desire to install -zsh-syntax-highlighting system-wide, you may do so by running - - make install - -and directing your users to add - - source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - -to their `.zshrc`s. diff --git a/.zprezto/modules/syntax-highlighting/external/Makefile b/.zprezto/modules/syntax-highlighting/external/Makefile deleted file mode 100644 index 6cc2648..0000000 --- a/.zprezto/modules/syntax-highlighting/external/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -NAME=zsh-syntax-highlighting - -INSTALL?=install -c -PREFIX?=/usr/local -SHARE_DIR?=$(DESTDIR)$(PREFIX)/share/$(NAME) -DOC_DIR?=$(DESTDIR)$(PREFIX)/share/doc/$(NAME) -ZSH?=zsh # zsh binary to run tests with - -all: - cd docs && \ - cp highlighters.md all.md && \ - printf '\n\nIndividual highlighters documentation\n=====================================' >> all.md && \ - for doc in highlighters/*.md; do printf '\n\n'; cat "$$doc"; done >> all.md - -install: all - $(INSTALL) -d $(SHARE_DIR) - $(INSTALL) -d $(DOC_DIR) - cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR) - cp COPYING.md README.md changelog.md $(DOC_DIR) - sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md - if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \ - git rev-parse HEAD; \ - else \ - cat .revision-hash; \ - fi > $(SHARE_DIR)/.revision-hash - : -# The [ -e ] check below is to because sh evaluates this with (the moral -# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches. - for dirname in highlighters highlighters/*/ ; do \ - $(INSTALL) -d $(SHARE_DIR)/"$$dirname"; \ - for fname in "$$dirname"/*.zsh ; do [ -e "$$fname" ] && cp "$$fname" $(SHARE_DIR)"/$$dirname"; done; \ - done - cp -R docs/* $(DOC_DIR) - -clean: - rm -f docs/all.md - -test: - @$(ZSH) -fc 'echo ZSH_PATCHLEVEL=$$ZSH_PATCHLEVEL' - @result=0; \ - for test in highlighters/*; do \ - if [ -d $$test/test-data ]; then \ - echo "Running test $${test##*/}"; \ - $(ZSH) -f tests/test-highlighting.zsh "$${test##*/}"; \ - : $$(( result |= $$? )); \ - fi \ - done; \ - exit $$result - -quiet-test: - $(MAKE) test QUIET=y - -perf: - @result=0; \ - for test in highlighters/*; do \ - if [ -d $$test/test-data ]; then \ - echo "Running test $${test##*/}"; \ - $(ZSH) -f tests/test-perfs.zsh "$${test##*/}"; \ - : $$(( result |= $$? )); \ - fi \ - done; \ - exit $$result - -.PHONY: all install clean test perf diff --git a/.zprezto/modules/syntax-highlighting/external/README.md b/.zprezto/modules/syntax-highlighting/external/README.md deleted file mode 100644 index 08af2b6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/README.md +++ /dev/null @@ -1,80 +0,0 @@ -zsh-syntax-highlighting [![Build Status][build-status-image]][build-status-travis] -======================= - -**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].** - -*Requirements: zsh 4.3.11+.* - -[fish]: http://www.fishshell.com/ -[zsh]: http://www.zsh.org/ - -This package provides syntax highlighting for the shell zsh. It enables -highlighting of commands whilst they are typed at a zsh prompt into an -interactive terminal. This helps in reviewing commands before running -them, particularly in catching syntax errors. - -Some examples: - -Before: [![Screenshot #1.1](images/before1-smaller.png)](images/before1.png) -
-After:  [![Screenshot #1.2](images/after1-smaller.png)](images/after1.png) - -Before: [![Screenshot #2.1](images/before2-smaller.png)](images/before2.png) -
-After:  [![Screenshot #2.2](images/after2-smaller.png)](images/after2.png) - -Before: [![Screenshot #3.1](images/before3-smaller.png)](images/before3.png) -
-After:  [![Screenshot #3.2](images/after3-smaller.png)](images/after3.png) - - -How to install --------------- - -See [INSTALL.md](INSTALL.md). - - -FAQ ---- - -### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file? - -`zsh-syntax-highlighting.zsh` wraps ZLE widgets. It must be sourced after all -custom widgets have been created (i.e., after all `zle -N` calls and after -running `compinit`). Widgets created later will work, but will not update the -syntax highlighting. - -### Does syntax highlighting work during incremental history search? - -Highlighting the command line during an incremental history search (by default bound to -to Ctrl+R in zsh's emacs keymap) requires zsh 5.4 or newer. - -Under zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting] -of the matched portion of the buffer remains available, but zsh-syntax-highlighting's -additional highlighting is unavailable. (Those versions of zsh do not provide -enough information to allow computing the highlighting correctly.) - -See issues [#288][i288] and [#415][i415] for details. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting -[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288 -[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415 - -### How are new releases announced? - -There is currently no "push" announcements channel. However, the following -alternatives exist: - -- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom -- An anitya entry: https://release-monitoring.org/project/7552/ - - -How to tweak ------------- - -Syntax highlighting is done by pluggable highlighter scripts. See the -[documentation on highlighters](docs/highlighters.md) for details and -configuration settings. - -[build-status-image]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting.svg?branch=master -[build-status-travis]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/changelog.md b/.zprezto/modules/syntax-highlighting/external/changelog.md deleted file mode 100644 index f20e69d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/changelog.md +++ /dev/null @@ -1,558 +0,0 @@ -# Changes in version 0.6.0 - -This is a stable release, featuring bugfixes and minor improvements. - - -## Performance improvements: - -(none) - - -## Added highlighting of: - -- The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting]. - (79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support) - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting - -- Possible history expansions in double-quoted strings. - (76ea9e1df316) - -- Mismatched `if`/`then`/`elif`/`else`/`fi`. - (73cb83270262) - - -## Fixed highlighting of: - -- A comment line followed by a non-comment line. - (#385, 9396ad5c5f9c) - -- An unquoted `$*` (expands to the positional parameters). - (237f89ad629f) - -- history-incremental-pattern-search-backward under zsh 5.3.1. - (#407, #415, 462779629a0c) - - -## API changes (for highlighter authors): - -(none) - - -## Developer-visible changes: - -- tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility. - (9523d6d49cb3) - - -## Other changes: - -- docs: Added before/after screenshots. - (cd9ec14a65ec..b7e277106b49) - -- docs: Link Fedora package. - (3d74aa47e4a7, 5feed23962df) - -- docs: Link FreeBSD port. - (626c034c68d7) - -- docs: Link OpenSUSE Build Service packages - (#419, dea1fedc7358) - -- Prevent user-defined aliases from taking effect in z-sy-h's own code. - (#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954) - -- docs: Update zplug installation instructions. - (#399, 4f49c4a35f17) - -- Improve "unhandled ZLE widget 'foo'" error message. - (#409, be083d7f3710) - -- Fix printing of "failed loading highlighters" error message. - (#426, ad522a091429) - - -# Changes in version 0.5.0 - - -## Performance improvements: - -We thank Sebastian Gniazdowski and "m0viefreak" for significant contributions -in this area. - -- Optimize string operations in the `main` (default) highlighter. - (#372/3cb58fd7d7b9, 02229ebd6328, ef4bfe5bcc14, #372/c6b6513ac0d6, #374/15461e7d21c3) - -- Command word highlighting: Use the `zsh/parameter` module to avoid forks. - Memoize (cache) the results. - (#298, 3ce01076b521, 2f18ba64e397, 12b879caf7a6; #320, 3b67e656bff5) - -- Avoid forks in the driver and in the `root` highlighter. - (b9112aec798a, 38c8fbea2dd2) - - -## Added highlighting of: - -- `pkexec` (a precommand). - (#248, 4f3910cbbaa5) - -- Aliases that cannot be defined normally nor invoked normally (highlighted as an error). - (#263 (in part), 28932316cca6) - -- Path separators (`/`) — the default behaviour remains to highlight path separators - and path components the same way. - (#136, #260, 6cd39e7c70d3, 9a934d291e7c, f3d3aaa00cc4) - -- Assignments to individual positional arguments (`42=foo` to assign to `$42`). - (f4036a09cee3) - -- Linewise region (the `visual-line-mode` widget, bound to `V` in zsh's `vi` keymap). - (#267, a7a7f8b42280, ee07588cfd9b) - -- Command-lines recalled by `isearch` mode; requires zsh≥5.3. - (#261 (in part); #257; 4ad311ec0a68) - -- Command-lines whilst the `IGNORE_BRACES` or `IGNORE_CLOSE_BRACES` option is in effect. - (a8a6384356af, 02807f1826a5) - -- Mismatched parentheses and braces (in the `main` highlighter). - (51b9d79c3bb6, 2fabf7ca64b7, a4196eda5e6f, and others) - -- Mismatched `do`/`done` keywords. - (b2733a64da93) - -- Mismatched `foreach`/`end` keywords. - (#96, 2bb8f0703d8f) - -- In Bourne-style function definitions, when the `MULTI_FUNC_DEF` option is set - (which is the default), highlight the first word in the function body as - a command word: `f() { g "$@" }`. - (6f91850a01e1) - -- `always` blocks. - (#335, e5782e4ddfb6) - -- Command substitutions inside double quotes, `"$(echo foo)"`. - (#139 (in part), c3913e0d8ead) - -- Non-alphabetic parameters inside double quotes (`"$$"`, `"$#"`, `"$*"`, `"$@"`, `"$?"`, `"$-"`). - (4afe670f7a1b, 44ef6e38e5a7) - -- Command words from future versions of zsh (forward compatibly). - This also adds an `arg0` style that all other command word styles fall back to. - (b4537a972eed, bccc3dc26943) - -- Escaped history expansions inside double quotes: `: "\!"` - (28d7056a7a06, et seq) - - -## Fixed highlighting of: - -- Command separator tokens in syntactically-invalid positions. - (09c4114eb980) - -- Redirections with a file descriptor number at command word. - (#238 (in part), 73ee7c1f6c4a) - -- The `select` prompt, `$PS3`. - (#268, 451665cb2a8b) - -- Values of variables in `vared`. - (e500ca246286) - -- `!` as an argument (neither a history expansion nor a reserved word). - (4c23a2fd1b90) - -- "division by zero" error under the `brackets` highlighter when `$ZSH_HIGHLIGHT_STYLES` is empty. - (f73f3d53d3a6) - -- Process substitutions, `<(pwd)` and `>(wc -l)`. - (#302, 6889ff6bd2ad, bfabffbf975c, fc9c892a3f15) - -- The non-`SHORT_LOOPS` form of `repeat` loops: `repeat 42; do true; done`. - (#290, 4832f18c50a5, ef68f50c048f, 6362c757b6f7) - -- Broken symlinks (are now highlighted as files). - (#342, 95f7206a9373, 53083da8215e) - -- Lines accepted from `isearch` mode. - (#284; #257, #259, #288; 5bae6219008b, a8fe22d42251) - -- Work around upstream bug that triggered when the command word was a relative - path, that when interpreted relative to a $PATH directory denoted a command; - the effect of that upstream bug was that the relative path was cached as - a "valid external command name". - (#354, #355, 51614ca2c994, fdaeec45146b, 7d38d07255e4; - upstream fix slated to be released in 5.3 (workers/39104)) - -- After accepting a line with the cursor on a bracket, the matching bracket - of the bracket under the cursor no longer remains highlighted (with the - `brackets` highlighter). - (4c4baede519a) - -- The first word on a new line within an array assignment or initialization is no - longer considered a command position. - (8bf423d16d46) - -- Subshells that end at command position, `(A=42)`, `(true;)`. - (#231, 7fb6f9979121; #344, 4fc35362ee5a) - -- Command word after array assignment, `a=(lorem ipsum) pwd`. - (#330, 7fb6f9979121) - - -## API changes (for highlighter authors): - -- New interface `_zsh_highlight_add_highlight`. - (341a3ae1f015, c346f6eb6fb6) - -- tests: Specify the style key, not its value, in test expectations. - (a830613467af, fd061b5730bf, eaa4335c3441, among others) - -- Module author documentation improvements. - (#306 (in part), 217669270418, 0ff354b44b6e, 80148f6c8402, 364f206a547f, and others) - -- The driver no longer defines a `_zsh_highlight_${highlighter}_highlighter_cache` - variable, which is in the highlighters' namespace. - (3e59ab41b6b8, 80148f6c8402, f91a7b885e7d) - -- Rename highlighter entry points. The old names remain supported for - backwards compatibility. - (a3d5dfcbdae9, c793e0dceab1) - -- tests: Add the "NONE" expectation. - (4da9889d1545, 13018f3dd735, d37c55c788cd) - -- tests: consider a test that writes to stderr to have failed. - (#291, 1082067f9315) - - -## Developer-visible changes: - -- Add `make quiet-test`. - (9b64ad750f35) - -- test harness: Better quote replaceables in error messages. - (30d8f92df225) - -- test harness: Fix exit code for XPASS. - (bb8d325c0cbd) - -- Create [HACKING.md](HACKING.md). - (cef49752fd0e) - -- tests: Emit a description for PASS test points. - (6aa57d60aa64, f0bae44b76dd) - -- tests: Create a script that generates a test file. - (8013dc3b8db6, et seq; `tests/generate.zsh`) - - -## Other changes: - -- Under zsh≤5.2, widgets whose names start with a `_` are no longer excluded - from highlighting. - (ed33d2cb1388; reverts part of 186d80054a40 which was for #65) - -- Under zsh≤5.2, widgets implemented by a function named after the widget are - no longer excluded from highlighting. - (487b122c480d; reverts part of 776453cb5b69) - -- Under zsh≤5.2, shell-unsafe widget names can now be wrapped. - (#278, 6a634fac9fb9, et seq) - -- Correct some test expectations. - (78290e043bc5) - -- `zsh-syntax-highlighting.plugin.zsh`: Convert from symlink to plain file - for msys2 compatibility. - (#292, d4f8edc9f3ad) - -- Document installation under some plugin managers. - (e635f766bef9, 9cab566f539b) - -- Don't leak the `PATH_DIRS` option. - (7b82b88a7166) - -- Don't require the `FUNCTION_ARGZERO` option to be set. - (#338, 750aebc553f2) - -- Under zsh≤5.2, support binding incomplete/nonexistent widgets. - (9e569bb0fe04, part of #288) - -- Make the driver reentrant, fixing possibility of infinite recursion - under zsh≤5.2 under interaction with theoretical third-party code. - (#305, d711563fe1bf, 295d62ec888d, f3242cbd6aba) - -- Fix warnings when `WARN_CREATE_GLOBAL` is set prior to sourcing zsh-syntax-highlighting. - (z-sy-h already sets `WARN_CREATE_GLOBAL` internally.) - (da60234fb236) - -- Warn only once, rather than once per keypress, when a highlighter is unavailable. - (0a9b347483ae) - - -# Changes in version 0.4.1 - -## Fixes: - -- Arguments to widgets were not properly dash-escaped. Only matters for widgets - that take arguments (i.e., that are invoked as `zle ${widget} -- ${args}`). - (282c7134e8ac, reverts c808d2187a73) - - -# Changes in version 0.4.0 - - -## Added highlighting of: - -- incomplete sudo commands - (a3047a912100, 2f05620b19ae) - - sudo; - sudo -u; - -- command words following reserved words - (#207, #222, b397b12ac139 et seq, 6fbd2aa9579b et seq, 8b4adbd991b0) - - if ls; then ls; else ls; fi - repeat 10 do ls; done - - (The `ls` are now highlighted as a command.) - -- comments (when `INTERACTIVE_COMMENTS` is set) - (#163, #167, 693de99a9030) - - echo Hello # comment - -- closing brackets of arithmetic expansion, subshells, and blocks - (#226, a59f442d2d34, et seq) - - (( foo )) - ( foo ) - { foo } - -- command names enabled by the `PATH_DIRS` option - (#228, 96ee5116b182) - - # When ~/bin/foo/bar exists, is executable, ~/bin is in $PATH, - # and 'setopt PATH_DIRS' is in effect - foo/bar - -- parameter expansions with braces inside double quotes - (#186, 6e3720f39d84) - - echo "${foo}" - -- parameter expansions in command word - (#101, 4fcfb15913a2) - - x=/bin/ls - $x -l - -- the command separators '|&', '&!', '&|' - - view file.pdf &! ls - - -## Fixed highlighting of: - -- precommand modifiers at non-command-word position - (#209, 2c9f8c8c95fa) - - ls command foo - -- sudo commands with infix redirections - (#221, be006aded590, 86e924970911) - - sudo -u >/tmp/foo.out user ls - -- subshells; anonymous functions - (#166, #194, 0d1bfbcbfa67, 9e178f9f3948) - - (true) - () { true } - -- parameter assignment statements with no command - (#205, 01d7eeb3c713) - - A=1; - - (The semicolon used to be highlighted as a mistake) - -- cursor highlighter: Remove the cursor highlighting when accepting a line. - (#109, 4f0c293fdef0) - - -## Removed features: - -- Removed highlighting of approximate paths (`path_approx`). - (#187, 98aee7f8b9a3) - - -## Other changes: - -- main highlighter refactored to use states rather than booleans. - (2080a441ac49, et seq) - -- Fix initialization when sourcing `zsh-syntax-highlighting.zsh` via a symlink - (083c47b00707) - -- docs: Add screenshot. - (57624bb9f64b) - -- widgets wrapping: Don't add '--' when invoking widgets. - (c808d2187a73) [_reverted in 0.4.1_] - -- Refresh highlighting upon `accept-*` widgets (`accept-line` et al). - (59fbdda64c21) - -- Stop leaking match/mbegin/mend to global scope (thanks to upstream - `WARN_CREATE_GLOBAL` improvements). - (d3deffbf46a4) - -- 'make install': Permit setting `$(SHARE_DIR)` from the environment. - (e1078a8b4cf1) - -- driver: Tolerate KSH_ARRAYS being set in the calling context. - (#162, 8f19af6b319d) - -- 'make install': Install documentation fully and properly. - (#219, b1619c001390, et seq) - -- docs: Improve 'main' highlighter's documentation. - (00de155063f5, 7d4252f5f596) - -- docs: Moved to a new docs/ tree; assorted minor updates - (c575f8f37567, 5b34c23cfad5, et seq) - -- docs: Split README.md into INSTALL.md - (0b3183f6cb9a) - -- driver: Report `$ZSH_HIGHLIGHT_REVISION` when running from git - (84734ba95026) - - -## Developer-visible changes: - -- Test harness converted to [TAP](http://testanything.org/tap-specification.html) format - (d99aa58aaaef, et seq) - -- Run each test in a separate subprocess, isolating them from each other - (d99aa58aaaef, et seq) - -- Fix test failure with nonexisting $HOME - (#216, b2ac98b98150) - -- Test output is now colorized. - (4d3da30f8b72, 6fe07c096109) - -- Document `make install` - (a18a7427fd2c) - -- tests: Allow specifying the zsh binary to use. - (557bb7e0c6a0) - -- tests: Add 'make perf' target - (4513eaea71d7) - -- tests: Run each test in a sandbox directory - (c01533920245) - - -# Changes in version 0.3.0 - - -## Added highlighting of: - -- suffix aliases (requires zsh 5.1.1 or newer): - - alias -s png=display - foo.png - -- prefix redirections: - - foo.txt - -- arithmetic evaluations: - - (( 42 )) - -- $'' strings, including \x/\octal/\u/\U escapes - - : $'foo\u0040bar' - -- multiline strings: - - % echo "line 1 - line 2" - -- string literals that haven't been finished: - - % echo "Hello, world - -- command words that involve tilde expansion: - - % ~/bin/foo - - -## Fixed highlighting of: - -- quoted command words: - - % \ls - -- backslash escapes in "" strings: - - % echo "\x41" - -- noglob after command separator: - - % :; noglob echo * - -- glob after command separator, when the first command starts with 'noglob': - - % noglob true; echo * - -- the region (vi visual mode / set-mark-command) (issue #165) - -- redirection and command separators that would be highlighted as `path_approx` - - % echo foo;‸ - % echo <‸ - - (where `‸` represents the cursor location) - -- escaped globbing (outside quotes) - - % echo \* - - -## Other changes: - -- implemented compatibility with zsh's paste highlighting (issue #175) - -- `$?` propagated correctly to wrapped widgets - -- don't leak $REPLY into global scope - - -## Developer-visible changes: - -- added makefile with `install` and `test` targets - -- set `warn_create_global` internally - -- document release process - - - - -# Version 0.2.1 - -(Start of changelog.) - diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters.md deleted file mode 100644 index 642d2bd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters.md +++ /dev/null @@ -1,105 +0,0 @@ -zsh-syntax-highlighting / highlighters -====================================== - -Syntax highlighting is done by pluggable highlighters: - -* `main` - the base highlighter, and the only one [active by default][1]. -* `brackets` - [matches brackets][2] and parenthesis. -* `pattern` - matches [user-defined patterns][3]. -* `cursor` - matches [the cursor position][4]. -* `root` - highlights the whole command line [if the current user is root][5]. -* `line` - applied to [the whole command line][6]. - -[1]: highlighters/main.md -[2]: highlighters/brackets.md -[3]: highlighters/pattern.md -[4]: highlighters/cursor.md -[5]: highlighters/root.md -[6]: highlighters/line.md - - -How to activate highlighters ----------------------------- - -To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in -`~/.zshrc`, for example: - - ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) - -By default, `$ZSH_HIGHLIGHT_HIGHLIGHTERS` is unset and only the `main` -highlighter is active. - - -How to tweak highlighters -------------------------- - -Highlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` associative array. -Navigate into the [individual highlighters' documentation](highlighters/) to -see what styles (keys) each highlighter defines; the syntax for values is the -same as the syntax of "types of highlighting" of the zsh builtin -`$zle_highlight` array, which is documented in [the `zshzle(1)` manual -page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting - -Some highlighters support additional configuration parameters; see each -highlighter's documentation for details and examples. - - -How to implement a new highlighter ----------------------------------- - -To create your own `acme` highlighter: - -* Create your script at - `highlighters/acme/acme-highlighter.zsh`. - -* Implement the `_zsh_highlight_highlighter_acme_predicate` function. - This function must return 0 when the highlighter needs to be called and - non-zero otherwise, for example: - - _zsh_highlight_highlighter_acme_predicate() { - # Call this highlighter in SVN working copies - [[ -d .svn ]] - } - -* Implement the `_zsh_highlight_highlighter_acme_paint` function. - This function does the actual syntax highlighting, by calling - `_zsh_highlight_add_highlight` with the start and end of the region to - be highlighted and the `ZSH_HIGHLIGHT_STYLES` key to use. Define the default - style for that key in the highlighter script outside of any function with - `: ${ZSH_HIGHLIGHT_STYLES[key]:=value}`, being sure to prefix - the key with your highlighter name and a colon. For example: - - : ${ZSH_HIGHLIGHT_STYLES[acme:aurora]:=fg=green} - - _zsh_highlight_highlighter_acme_paint() { - # Colorize the whole buffer with the 'aurora' style - _zsh_highlight_add_highlight 0 $#BUFFER acme:aurora - } - - If you need to test which options the user has set, test `zsyh_user_options` - with a sensible default if the option is not present in supported zsh - versions. For example: - - [[ ${zsyh_user_options[ignoreclosebraces]:-off} == on ]] - - The option name must be all lowercase with no underscores and not an alias. - -* Name your own functions and global variables `_zsh_highlight_acme_*`. - - - In zsh-syntax-highlighting 0.4.0 and earlier, the entrypoints - `_zsh_highlight_highlighter_acme_predicate` and - `_zsh_highlight_highlighter_acme_paint` - were named - `_zsh_highlight_acme_highlighter_predicate` and - `_zsh_highlight_highlighter_acme_paint` respectively. - - These names are still supported for backwards compatibility; - however, support for them will be removed in a a future major or minor release (v0.x.0 or v1.0.0). - -* Activate your highlighter in `~/.zshrc`: - - ZSH_HIGHLIGHT_HIGHLIGHTERS+=(acme) - -* [Write tests](../tests/README.md). diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/brackets.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/brackets.md deleted file mode 100644 index 9001074..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/brackets.md +++ /dev/null @@ -1,29 +0,0 @@ -zsh-syntax-highlighting / highlighters / brackets -------------------------------------------------- - -This is the `brackets` highlighter, that highlights brackets and parentheses, and -matches them. - - -### How to tweak it - -This highlighter defines the following styles: - -* `bracket-error` - unmatched brackets -* `bracket-level-N` - brackets with nest level N -* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket - -To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, -for example in `~/.zshrc`: - - # To define styles for nested brackets up to level 4 - ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold' - ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold' - ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold' - ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold' - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/cursor.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/cursor.md deleted file mode 100644 index 7295fd1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/cursor.md +++ /dev/null @@ -1,22 +0,0 @@ -zsh-syntax-highlighting / highlighters / cursor ------------------------------------------------ - -This is the `cursor` highlighter, that highlights the cursor. - - -### How to tweak it - -This highlighter defines the following styles: - -* `cursor` - the style for the current cursor position - -To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, -for example in `~/.zshrc`: - - ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue' - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/line.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/line.md deleted file mode 100644 index 4ba14e9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/line.md +++ /dev/null @@ -1,22 +0,0 @@ -zsh-syntax-highlighting / highlighters / line ---------------------------------------------- - -This is the `line` highlighter, that highlights the whole line. - - -### How to tweak it - -This highlighter defines the following styles: - -* `line` - the style for the whole line - -To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, -for example in `~/.zshrc`: - - ZSH_HIGHLIGHT_STYLES[line]='bold' - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/main.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/main.md deleted file mode 100644 index 005fc4d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/main.md +++ /dev/null @@ -1,113 +0,0 @@ -zsh-syntax-highlighting / highlighters / main ---------------------------------------------- - -This is the `main` highlighter, that highlights: - -* Commands -* Options -* Arguments -* Paths -* Strings - -This highlighter is active by default. - - -### How to tweak it - -This highlighter defines the following styles: - -* `unknown-token` - unknown tokens / errors -* `reserved-word` - shell reserved words (`if`, `for`) -* `alias` - aliases -* `suffix-alias` - suffix aliases (requires zsh 5.1.1 or newer) -* `builtin` - shell builtin commands (`shift`, `pwd`, `zstyle`) -* `function` - function names -* `command` - command names -* `precommand` - precommand modifiers (e.g., `noglob`, `builtin`) -* `commandseparator` - command separation tokens (`;`, `&&`) -* `hashed-command` - hashed commands -* `path` - existing filenames -* `path_pathseparator` - path separators in filenames (`/`); if unset, `path` is used (default) -* `path_prefix` - prefixes of existing filenames -* `path_prefix_pathseparator` - path separators in prefixes of existing filenames (`/`); if unset, `path_prefix` is used (default) -* `globbing` - globbing expressions (`*.txt`) -* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`) -* `command-substitution` - command substitutions (`$(echo foo)`) -* `command-substitution-unquoted` - an unquoted command substitution (`$(echo foo)`) -* `command-substitution-quoted` - a quoted command substitution (`"$(echo foo)"`) -* `command-substitution-delimiter` - command substitution delimiters (`$(` and `)`) -* `command-substitution-delimiter-unquoted` - an unquoted command substitution delimiters (`$(` and `)`) -* `command-substitution-delimiter-quoted` - a quoted command substitution delimiters (`"$(` and `)"`) -* `process-substitution` - process substitutions (`<(echo foo)`) -* `process-substitution-delimiter` - process substitution delimiters (`<(` and `)`) -* `single-hyphen-option` - single-hyphen options (`-o`) -* `double-hyphen-option` - double-hyphen options (`--option`) -* `back-quoted-argument` - backtick command substitution (`` `foo` ``) -* `back-quoted-argument-unclosed` - unclosed backtick command substitution (`` `foo ``) -* `back-quoted-argument-delimiter` - backtick command substitution delimiters (`` ` ``) -* `single-quoted-argument` - single-quoted arguments (`` 'foo' ``) -* `single-quoted-argument-unclosed` - unclosed single-quoted arguments (`` 'foo ``) -* `double-quoted-argument` - double-quoted arguments (`` "foo" ``) -* `double-quoted-argument-unclosed` - unclosed double-quoted arguments (`` "foo ``) -* `dollar-quoted-argument` - dollar-quoted arguments (`` $'foo' ``) -* `dollar-quoted-argument-unclosed` - unclosed dollar-quoted arguments (`` $'foo ``) -* `rc-quote` - two single quotes inside single quotes when the `RC_QUOTES` option is set (`` 'foo''bar' ``) -* `dollar-double-quoted-argument` - parameter expansion inside double quotes (`$foo` inside `""`) -* `back-double-quoted-argument` - backslash escape sequences inside double-quoted arguments (`\"` in `"foo\"bar"`) -* `back-dollar-quoted-argument` - backslash escape sequences inside dollar-quoted arguments (`\x` in `$'\x48'`) -* `assign` - parameter assignments (`x=foo` and `x=( )`) -* `redirection` - redirection operators (`<`, `>`, etc) -* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`) -* `named-fd` - named file descriptor (`echo foo {fd}>&2`) -* `arg0` - a command word other than one of those enumerated above (other than a command, precommand, alias, function, or shell builtin command). -* `default` - everything else - -To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, -for example in `~/.zshrc`: - - # Declare the variable - typeset -A ZSH_HIGHLIGHT_STYLES - - # To differentiate aliases from other command types - ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold' - - # To have paths colored instead of underlined - ZSH_HIGHLIGHT_STYLES[path]='fg=cyan' - - # To disable highlighting of globbing expressions - ZSH_HIGHLIGHT_STYLES[globbing]='none' - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -#### Parameters - -To avoid partial path lookups on a path, add the path to the `X_ZSH_HIGHLIGHT_DIRS_BLACKLIST` array. -This interface is still experimental. - - X_ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share) - -### Useless trivia - -#### Forward compatibility. - -zsh-syntax-highlighting attempts to be forward-compatible with zsh. -Specifically, we attempt to facilitate highlighting _command word_ types that -had not yet been invented when this version of zsh-syntax-highlighting was -released. - -A _command word_ is something like a function name, external command name, et -cetera. (See -[Simple Commands & Pipelines in `zshmisc(1)`][zshmisc-Simple-Commands-And-Pipelines] -for a formal definition.) - -If a new _kind_ of command word is ever added to zsh — something conceptually -different than "function" and "alias" and "external command" — then command words -of that (new) kind will be highlighted by the style `arg0_$kind`, -where `$kind` is the output of `type -w` on the new kind of command word. If that -style is not defined, then the style `arg0` will be used instead. - -[zshmisc-Simple-Commands-And-Pipelines]: http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/pattern.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/pattern.md deleted file mode 100644 index 3ad5f24..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/pattern.md +++ /dev/null @@ -1,19 +0,0 @@ -zsh-syntax-highlighting / highlighters / pattern ------------------------------------------------- - -This is the `pattern` highlighter, that highlights user-defined patterns. - - -### How to tweak it - -To use this highlighter, associate patterns with styles in the -`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`: - - # To have commands starting with `rm -rf` in red: - ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/regexp.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/regexp.md deleted file mode 100644 index 25f1b6c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/regexp.md +++ /dev/null @@ -1,27 +0,0 @@ -zsh-syntax-highlighting / highlighters / regexp ------------------------------------------------- - -This is the `regexp` highlighter, that highlights user-defined regular -expressions. It's similar to the `pattern` highlighter, but allows more complex -patterns. - -### How to tweak it - -To use this highlighter, associate regular expressions with styles in the -`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`: - - ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold) - -This will highlight "sudo" only as a complete word, i.e., "sudo cmd", but not -"sudoedit" - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -See also: [regular expressions tutorial][perlretut], zsh regexp operator `=~` -in [the `zshmisc(1)` manual page][zshmisc-Conditional-Expressions] - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting -[perlretut]: http://perldoc.perl.org/perlretut.html -[zshmisc-Conditional-Expressions]: http://zsh.sourceforge.net/Doc/Release/Conditional-Expressions.html#Conditional-Expressions diff --git a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/root.md b/.zprezto/modules/syntax-highlighting/external/docs/highlighters/root.md deleted file mode 100644 index 0b0d41f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/docs/highlighters/root.md +++ /dev/null @@ -1,23 +0,0 @@ -zsh-syntax-highlighting / highlighters / root ---------------------------------------------- - -This is the `root` highlighter, that highlights the whole line if the current -user is root. - - -### How to tweak it - -This highlighter defines the following styles: - -* `root` - the style for the whole line if the current user is root. - -To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, -for example in `~/.zshrc`: - - ZSH_HIGHLIGHT_STYLES[root]='bg=red' - -The syntax for values is the same as the syntax of "types of highlighting" of -the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. - -[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/README.md deleted file mode 100644 index 8490ddf..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/README.md +++ /dev/null @@ -1,8 +0,0 @@ -zsh-syntax-highlighting / highlighters -====================================== - -Navigate into the individual highlighters' documentation to see -what styles (`$ZSH_HIGHLIGHT_STYLES` keys) each highlighter defines. - -Refer to the [documentation on highlighters](../docs/highlighters.md) for further -information. diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/README.md deleted file mode 120000 index 6997bd6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/brackets.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/brackets-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/brackets-highlighter.zsh deleted file mode 100644 index fc71f2a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/brackets-highlighter.zsh +++ /dev/null @@ -1,106 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Define default styles. -: ${ZSH_HIGHLIGHT_STYLES[bracket-error]:=fg=red,bold} -: ${ZSH_HIGHLIGHT_STYLES[bracket-level-1]:=fg=blue,bold} -: ${ZSH_HIGHLIGHT_STYLES[bracket-level-2]:=fg=green,bold} -: ${ZSH_HIGHLIGHT_STYLES[bracket-level-3]:=fg=magenta,bold} -: ${ZSH_HIGHLIGHT_STYLES[bracket-level-4]:=fg=yellow,bold} -: ${ZSH_HIGHLIGHT_STYLES[bracket-level-5]:=fg=cyan,bold} -: ${ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]:=standout} - -# Whether the brackets highlighter should be called or not. -_zsh_highlight_highlighter_brackets_predicate() -{ - [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved || _zsh_highlight_buffer_modified -} - -# Brackets highlighting function. -_zsh_highlight_highlighter_brackets_paint() -{ - local char style - local -i bracket_color_size=${#ZSH_HIGHLIGHT_STYLES[(I)bracket-level-*]} buflen=${#BUFFER} level=0 matchingpos pos - local -A levelpos lastoflevel matching - - # Find all brackets and remember which one is matching - for (( pos = 1; pos <= buflen; pos++ )) ; do - char=$BUFFER[pos] - case $char in - ["([{"]) - levelpos[$pos]=$((++level)) - lastoflevel[$level]=$pos - ;; - [")]}"]) - if (( level > 0 )); then - matchingpos=$lastoflevel[$level] - levelpos[$pos]=$((level--)) - if _zsh_highlight_brackets_match $matchingpos $pos; then - matching[$matchingpos]=$pos - matching[$pos]=$matchingpos - fi - else - levelpos[$pos]=-1 - fi - ;; - esac - done - - # Now highlight all found brackets - for pos in ${(k)levelpos}; do - if (( $+matching[$pos] )); then - if (( bracket_color_size )); then - _zsh_highlight_add_highlight $((pos - 1)) $pos bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 )) - fi - else - _zsh_highlight_add_highlight $((pos - 1)) $pos bracket-error - fi - done - - # If cursor is on a bracket, then highlight corresponding bracket, if any. - if [[ $WIDGET != zle-line-finish ]]; then - pos=$((CURSOR + 1)) - if (( $+levelpos[$pos] )) && (( $+matching[$pos] )); then - local -i otherpos=$matching[$pos] - _zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket - fi - fi -} - -# Helper function to differentiate type -_zsh_highlight_brackets_match() -{ - case $BUFFER[$1] in - \() [[ $BUFFER[$2] == \) ]];; - \[) [[ $BUFFER[$2] == \] ]];; - \{) [[ $BUFFER[$2] == \} ]];; - *) false;; - esac -} diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket-line-finish.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket-line-finish.zsh deleted file mode 100644 index b2acd31..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket-line-finish.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -WIDGET=zle-line-finish - -BUFFER=': $foo[bar]' -CURSOR=6 # cursor is zero-based - -expected_region_highlight=( -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket.zsh deleted file mode 100644 index e05b4e9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/cursor-matchingbracket.zsh +++ /dev/null @@ -1,47 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= -ZSH_HIGHLIGHT_STYLES[bracket-level-3]= - -BUFFER=': ((( )))' -CURSOR=2 # cursor is zero-based - -expected_region_highlight=( - "3 3 bracket-level-1" - "4 4 bracket-level-2" - "5 5 bracket-level-3" - "7 7 bracket-level-3" - "8 8 bracket-level-2" - "9 9 bracket-level-1" - "9 9 cursor-matchingbracket" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/empty-styles.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/empty-styles.zsh deleted file mode 100644 index e60657b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/empty-styles.zsh +++ /dev/null @@ -1,33 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': (x)' - -expected_region_highlight=( -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/loop-styles.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/loop-styles.zsh deleted file mode 100644 index e5cfcdf..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/loop-styles.zsh +++ /dev/null @@ -1,53 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= -ZSH_HIGHLIGHT_STYLES[bracket-level-3]= - -BUFFER=': ({[({[(x)]})]})' - -expected_region_highlight=( - "3 3 bracket-level-1" - "4 4 bracket-level-2" - "5 5 bracket-level-3" - "6 6 bracket-level-1" - "7 7 bracket-level-2" - "8 8 bracket-level-3" - "9 9 bracket-level-1" - "11 11 bracket-level-1" - "12 12 bracket-level-3" - "13 13 bracket-level-2" - "14 14 bracket-level-1" - "15 15 bracket-level-3" - "16 16 bracket-level-2" - "17 17 bracket-level-1" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/mismatch-patentheses.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/mismatch-patentheses.zsh deleted file mode 100644 index 5cc588f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/mismatch-patentheses.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= - -BUFFER='echo ({x}]' - -expected_region_highlight=( - "6 6 bracket-error" # ( - "7 7 bracket-level-2" # { - "9 9 bracket-level-2" # } - "10 10 bracket-error" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/near-quotes.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/near-quotes.zsh deleted file mode 100644 index 49f002b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/near-quotes.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= - -BUFFER=': {"{x}"}' - -expected_region_highlight=( - "3 3 bracket-level-1" - "5 5 bracket-level-2" - "7 7 bracket-level-2" - "9 9 bracket-level-1" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/nested-parentheses.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/nested-parentheses.zsh deleted file mode 100644 index 21a20fb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/nested-parentheses.zsh +++ /dev/null @@ -1,45 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= -ZSH_HIGHLIGHT_STYLES[bracket-level-3]= - -BUFFER='echo $(echo ${(z)array})' - -expected_region_highlight=( - "7 7 bracket-level-1" # ( - "14 14 bracket-level-2" # { - "15 15 bracket-level-3" # ( - "17 17 bracket-level-3" # ) - "23 23 bracket-level-2" # } - "24 24 bracket-level-1" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/only-error.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/only-error.zsh deleted file mode 100644 index 00fe557..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/only-error.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': x)' - -expected_region_highlight=( - "4 4 bracket-error" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/quoted-patentheses.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/quoted-patentheses.zsh deleted file mode 100644 index 81ee04f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/quoted-patentheses.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo "foo ( bar"' - -expected_region_highlight=( -"11 11 bracket-error" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/simple-parentheses.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/simple-parentheses.zsh deleted file mode 100644 index 2ccfbab..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/simple-parentheses.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= - -BUFFER='echo ({x})' - -expected_region_highlight=( - "6 6 bracket-level-1" # ( - "7 7 bracket-level-2" # { - "9 9 bracket-level-2" # } - "10 10 bracket-level-1" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses.zsh deleted file mode 100644 index d3f6560..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= -ZSH_HIGHLIGHT_STYLES[bracket-level-2]= - -BUFFER='echo ({x}' - -expected_region_highlight=( - "6 6 bracket-error" # ( - "7 7 bracket-level-2" # { - "9 9 bracket-level-2" # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses2.zsh deleted file mode 100644 index 2c489c3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/brackets/test-data/unclosed-patentheses2.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsorted=1 - -ZSH_HIGHLIGHT_STYLES[bracket-level-1]= - -BUFFER='echo {x})' - -expected_region_highlight=( - "6 6 bracket-level-1" # { - "8 8 bracket-level-1" # } - "9 9 bracket-error" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/README.md deleted file mode 120000 index 70e0c8c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/cursor.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/cursor-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/cursor-highlighter.zsh deleted file mode 100644 index 81633a3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/cursor/cursor-highlighter.zsh +++ /dev/null @@ -1,47 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Define default styles. -: ${ZSH_HIGHLIGHT_STYLES[cursor]:=standout} - -# Whether the cursor highlighter should be called or not. -_zsh_highlight_highlighter_cursor_predicate() -{ - # remove cursor highlighting when the line is finished - [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved -} - -# Cursor highlighting function. -_zsh_highlight_highlighter_cursor_paint() -{ - [[ $WIDGET == zle-line-finish ]] && return - - _zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor -} diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/line/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/line/README.md deleted file mode 120000 index 052fe20..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/line/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/line.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/line/line-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/line/line-highlighter.zsh deleted file mode 100644 index f922dc9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/line/line-highlighter.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Define default styles. -: ${ZSH_HIGHLIGHT_STYLES[line]:=} - -# Whether the root highlighter should be called or not. -_zsh_highlight_highlighter_line_predicate() -{ - _zsh_highlight_buffer_modified -} - -# root highlighting function. -_zsh_highlight_highlighter_line_paint() -{ - _zsh_highlight_add_highlight 0 $#BUFFER line -} diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/main/README.md deleted file mode 120000 index 0354731..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/main.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/main-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/main-highlighter.zsh deleted file mode 100644 index 06839ce..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/main-highlighter.zsh +++ /dev/null @@ -1,1386 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Define default styles. -: ${ZSH_HIGHLIGHT_STYLES[default]:=none} -: ${ZSH_HIGHLIGHT_STYLES[unknown-token]:=fg=red,bold} -: ${ZSH_HIGHLIGHT_STYLES[reserved-word]:=fg=yellow} -: ${ZSH_HIGHLIGHT_STYLES[suffix-alias]:=fg=green,underline} -: ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline} -: ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none} -: ${ZSH_HIGHLIGHT_STYLES[path]:=underline} -: ${ZSH_HIGHLIGHT_STYLES[path_pathseparator]:=} -: ${ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]:=} -: ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue} -: ${ZSH_HIGHLIGHT_STYLES[history-expansion]:=fg=blue} -: ${ZSH_HIGHLIGHT_STYLES[command-substitution]:=none} -: ${ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]:=fg=magenta} -: ${ZSH_HIGHLIGHT_STYLES[process-substitution]:=none} -: ${ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]:=fg=magenta} -: ${ZSH_HIGHLIGHT_STYLES[single-hyphen-option]:=none} -: ${ZSH_HIGHLIGHT_STYLES[double-hyphen-option]:=none} -: ${ZSH_HIGHLIGHT_STYLES[back-quoted-argument]:=none} -: ${ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]:=fg=magenta} -: ${ZSH_HIGHLIGHT_STYLES[single-quoted-argument]:=fg=yellow} -: ${ZSH_HIGHLIGHT_STYLES[double-quoted-argument]:=fg=yellow} -: ${ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]:=fg=yellow} -: ${ZSH_HIGHLIGHT_STYLES[rc-quote]:=fg=cyan} -: ${ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]:=fg=cyan} -: ${ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]:=fg=cyan} -: ${ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]:=fg=cyan} -: ${ZSH_HIGHLIGHT_STYLES[assign]:=none} -: ${ZSH_HIGHLIGHT_STYLES[redirection]:=none} -: ${ZSH_HIGHLIGHT_STYLES[comment]:=fg=black,bold} -: ${ZSH_HIGHLIGHT_STYLES[named-fd]:=none} -: ${ZSH_HIGHLIGHT_STYLES[arg0]:=fg=green} - -# Whether the highlighter should be called or not. -_zsh_highlight_highlighter_main_predicate() -{ - # may need to remove path_prefix highlighting when the line ends - [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_buffer_modified -} - -# Helper to deal with tokens crossing line boundaries. -_zsh_highlight_main_add_region_highlight() { - integer start=$1 end=$2 - shift 2 - - (( highlighted_alias )) && return - (( in_alias )) && highlighted_alias=1 - - # The calculation was relative to $buf but region_highlight is relative to $BUFFER. - (( start += buf_offset )) - (( end += buf_offset )) - - list_highlights+=($start $end $1) -} - -_zsh_highlight_main_add_many_region_highlights() { - for 1 2 3; do - _zsh_highlight_main_add_region_highlight $1 $2 $3 - done -} - -_zsh_highlight_main_calculate_fallback() { - local -A fallback_of; fallback_of=( - alias arg0 - suffix-alias arg0 - builtin arg0 - function arg0 - command arg0 - precommand arg0 - hashed-command arg0 - arg0_\* arg0 - - path_prefix path - # The path separator fallback won't ever be used, due to the optimisation - # in _zsh_highlight_main_highlighter_highlight_path_separators(). - path_pathseparator path - path_prefix_pathseparator path_prefix - - single-quoted-argument{-unclosed,} - double-quoted-argument{-unclosed,} - dollar-quoted-argument{-unclosed,} - back-quoted-argument{-unclosed,} - - command-substitution{-quoted,,-unquoted,} - command-substitution-delimiter{-quoted,,-unquoted,} - - command-substitution{-delimiter,} - process-substitution{-delimiter,} - back-quoted-argument{-delimiter,} - ) - local needle=$1 value - reply=($1) - while [[ -n ${value::=$fallback_of[(k)$needle]} ]]; do - unset "fallback_of[$needle]" # paranoia against infinite loops - reply+=($value) - needle=$value - done -} - -# Get the type of a command. -# -# Uses the zsh/parameter module if available to avoid forks, and a -# wrapper around 'type -w' as fallback. -# -# If $2 is 0, do not consider aliases. -# -# The result will be stored in REPLY. -_zsh_highlight_main__type() { - integer -r aliases_allowed=${2-1} - # We won't cache replies of anything that exists as an alias at all, to - # ensure the cached value is correct regardless of $aliases_allowed. - # - # ### We probably _should_ cache them in a cache that's keyed on the value of - # ### $aliases_allowed, on the assumption that aliases are the common case. - integer may_cache=1 - - # Cache lookup - if (( $+_zsh_highlight_main__command_type_cache )); then - REPLY=$_zsh_highlight_main__command_type_cache[(e)$1] - if [[ -n "$REPLY" ]]; then - return - fi - fi - - # Main logic - if (( $#options_to_set )); then - setopt localoptions $options_to_set; - fi - unset REPLY - if zmodload -e zsh/parameter; then - if (( $+aliases[(e)$1] )); then - may_cache=0 - fi - if (( $+aliases[(e)$1] )) && (( aliases_allowed )); then - REPLY=alias - elif [[ $1 == *.* && -n ${1%.*} ]] && (( $+saliases[(e)${1##*.}] )); then - REPLY='suffix alias' - elif (( $reswords[(Ie)$1] )); then - REPLY=reserved - elif (( $+functions[(e)$1] )); then - REPLY=function - elif (( $+builtins[(e)$1] )); then - REPLY=builtin - elif (( $+commands[(e)$1] )); then - REPLY=command - # zsh 5.2 and older have a bug whereby running 'type -w ./sudo' implicitly - # runs 'hash ./sudo=/usr/local/bin/./sudo' (assuming /usr/local/bin/sudo - # exists and is in $PATH). Avoid triggering the bug, at the expense of - # falling through to the $() below, incurring a fork. (Issue #354.) - # - # The first disjunct mimics the isrelative() C call from the zsh bug. - elif { [[ $1 != */* ]] || is-at-least 5.3 } && - ! builtin type -w -- $1 >/dev/null 2>&1; then - REPLY=none - fi - fi - if ! (( $+REPLY )); then - # Note that 'type -w' will run 'rehash' implicitly. - # - # We 'unalias' in a subshell, so the parent shell is not affected. - # - # The colon command is there just to avoid a command substitution that - # starts with an arithmetic expression [«((…))» as the first thing inside - # «$(…)»], which is area that has had some parsing bugs before 5.6 - # (approximately). - REPLY="${$(:; (( aliases_allowed )) || unalias -- $1 2>/dev/null; LC_ALL=C builtin type -w -- $1 2>/dev/null)##*: }" - if [[ $REPLY == 'alias' ]]; then - may_cache=0 - fi - fi - - # Cache population - if (( may_cache )) && (( $+_zsh_highlight_main__command_type_cache )); then - _zsh_highlight_main__command_type_cache[(e)$1]=$REPLY - fi - [[ -n $REPLY ]] - return $? -} - -# Checks whether $1 is something that can be run. -# -# Return 0 if runnable, 1 if not runnable, 2 if trouble. -_zsh_highlight_main__is_runnable() { - if _zsh_highlight_main__type "$1"; then - [[ $REPLY != none ]] - else - return 2 - fi -} - -# Check whether the first argument is a redirection operator token. -# Report result via the exit code. -_zsh_highlight_main__is_redirection() { - # A redirection operator token: - # - starts with an optional single-digit number; - # - then, has a '<' or '>' character; - # - is not a process substitution [<(...) or >(...)]. - # - is not a numeric glob <-> - [[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]] && [[ $1 != *'<'*'-'*'>'* ]] -} - -# Resolve alias. -# -# Takes a single argument. -# -# The result will be stored in REPLY. -_zsh_highlight_main__resolve_alias() { - if zmodload -e zsh/parameter; then - REPLY=${aliases[$arg]} - else - REPLY="${"$(alias -- $arg)"#*=}" - fi -} - -# Check that the top of $braces_stack has the expected value. If it does, set -# the style according to $2; otherwise, set style=unknown-token. -# -# $1: character expected to be at the top of $braces_stack -# $2: optional assignment to style it if matches -# return value is 0 if there is a match else 1 -_zsh_highlight_main__stack_pop() { - if [[ $braces_stack[1] == $1 ]]; then - braces_stack=${braces_stack:1} - if (( $+2 )); then - style=$2 - fi - return 0 - else - style=unknown-token - return 1 - fi -} - -# Main syntax highlighting function. -_zsh_highlight_highlighter_main_paint() -{ - setopt localoptions extendedglob - - # At the PS3 prompt and in vared, highlight nothing. - # - # (We can't check this in _zsh_highlight_highlighter_main_predicate because - # if the predicate returns false, the previous value of region_highlight - # would be reused.) - if [[ $CONTEXT == (select|vared) ]]; then - return - fi - - typeset -a ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR - typeset -a ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW - local -a options_to_set reply # used in callees - local REPLY - - # $flags_with_argument is a set of letters, corresponding to the option letters - # that would be followed by a colon in a getopts specification. - local flags_with_argument - # $flags_sans_argument is a set of letters, corresponding to the option letters - # that wouldn't be followed by a colon in a getopts specification. - local flags_sans_argument - # $precommand_options maps precommand name to values of $flags_with_argument and - # $flags_sans_argument for that precommand, joined by a colon. - # - # Currently, setting $flags_sans_argument is only important for commands that - # have a non-empty $flags_with_argument; see test-data/precommand4.zsh. - local -A precommand_options - precommand_options=( - # Precommand modifiers as of zsh 5.6.2 cf. zshmisc(1). - '-' '' - 'builtin' '' - 'command' :pvV - 'exec' a:cl - 'nocorrect' '' - 'noglob' '' - - 'doas' aCu:Lns # as of OpenBSD's doas(1) dated September 4, 2016 - 'nice' n: # as of current POSIX spec - 'pkexec' '' # doesn't take short options; immune to #121 because it's usually not passed --option flags - 'sudo' Cgprtu:AEHKPSVbhiklnsv # as of sudo 1.8.21p2 - ) - - if [[ $zsyh_user_options[ignorebraces] == on || ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]; then - local right_brace_is_recognised_everywhere=false - else - local right_brace_is_recognised_everywhere=true - fi - - if [[ $zsyh_user_options[pathdirs] == on ]]; then - options_to_set+=( PATH_DIRS ) - fi - - ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR=( - '|' '||' ';' '&' '&&' - '|&' - '&!' '&|' - # ### 'case' syntax, but followed by a pattern, not by a command - # ';;' ';&' ';|' - ) - - # Tokens that, at (naively-determined) "command position", are followed by - # a de jure command position. All of these are reserved words. - ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW=( - $'\x7b' # block - $'\x28' # subshell - '()' # anonymous function - 'while' - 'until' - 'if' - 'then' - 'elif' - 'else' - 'do' - 'time' - 'coproc' - '!' # reserved word; unrelated to $histchars[1] - ) - - _zsh_highlight_main_highlighter_highlight_list -$#PREBUFFER '' 1 "$PREBUFFER$BUFFER" - - # end is a reserved word - local start end_ style - for start end_ style in $reply; do - (( start >= end_ )) && { print -r -- >&2 "zsh-syntax-highlighting: BUG: _zsh_highlight_highlighter_main_paint: start($start) >= end($end_)"; return } - (( end_ <= 0 )) && continue - (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings - _zsh_highlight_main_calculate_fallback $style - _zsh_highlight_add_highlight $start $end_ $reply - done -} - -# $1 is the offset of $4 from the parent buffer. Added to the returned highlights. -# $2 is the initial braces_stack (for a closing paren). -# $3 is 1 if $4 contains the end of $BUFFER, else 0. -# $4 is the buffer to highlight. -# Returns: -# $REPLY: $buf[REPLY] is the last character parsed. -# $reply is an array of region_highlight additions. -# exit code is 0 if the braces_stack is empty, 1 otherwise. -_zsh_highlight_main_highlighter_highlight_list() -{ - integer start_pos end_pos=0 buf_offset=$1 has_end=$3 - # last_alias is the last alias arg (lhs) expanded (if in an alias). - # This allows for expanding alias ls='ls -l' while avoiding loops. - local arg buf=$4 highlight_glob=true last_alias style - local in_array_assignment=false # true between 'a=(' and the matching ')' - # highlighted_alias is 1 when the alias arg has been highlighted with a non-alias style. - # E.g. alias x=ls; x has been highlighted as alias AND command. - # in_alias is equal to the number of shifts needed until arg=args[1] pops an - # arg from BUFFER and not added by an alias. - integer highlighted_alias=0 in_alias=0 len=$#buf - local -a match mbegin mend list_highlights - # seen_alias is a map of aliases already seen to avoid loops like alias a=b b=a - local -A seen_alias - # Pattern for parameter names - readonly parameter_name_pattern='([A-Za-z_][A-Za-z0-9_]*|[0-9]+)' - list_highlights=() - - # "R" for round - # "Q" for square - # "Y" for curly - # "T" for [[ ]] - # "S" for $( ) - # "D" for do/done - # "$" for 'end' (matches 'foreach' always; also used with cshjunkiequotes in repeat/while) - # "?" for 'if'/'fi'; also checked by 'elif'/'else' - # ":" for 'then' - local braces_stack=$2 - - # State machine - # - # The states are: - # - :start: Command word - # - :start_of_pipeline: Start of a 'pipeline' as defined in zshmisc(1). - # Only valid when :start: is present - # - :sudo_opt: A leading-dash option to a precommand, whether it takes an - # argument or not. (Example: sudo's "-u" or "-i".) - # - :sudo_arg: The argument to a precommand's leading-dash option, - # when given as a separate word; i.e., "foo" in "-u foo" (two - # words) but not in "-ufoo" (one word). - # - :regular: "Not a command word", and command delimiters are permitted. - # Mainly used to detect premature termination of commands. - # - :always: The word 'always' in the «{ foo } always { bar }» syntax. - # - # When the kind of a word is not yet known, $this_word / $next_word may contain - # multiple states. For example, after "sudo -i", the next word may be either - # another --flag or a command name, hence the state would include both :start: - # and :sudo_opt:. - # - # The tokens are always added with both leading and trailing colons to serve as - # word delimiters (an improvised array); [[ $x == *:foo:* ]] and x=${x//:foo:/} - # will DTRT regardless of how many elements or repetitions $x has.. - # - # Handling of redirections: upon seeing a redirection token, we must stall - # the current state --- that is, the value of $this_word --- for two iterations - # (one for the redirection operator, one for the word following it representing - # the redirection target). Therefore, we set $in_redirection to 2 upon seeing a - # redirection operator, decrement it each iteration, and stall the current state - # when it is non-zero. Thus, upon reaching the next word (the one that follows - # the redirection operator and target), $this_word will still contain values - # appropriate for the word immediately following the word that preceded the - # redirection operator. - # - # The "the previous word was a redirection operator" state is not communicated - # to the next iteration via $next_word/$this_word as usual, but via - # $in_redirection. The value of $next_word from the iteration that processed - # the operator is discarded. - # - local this_word next_word=':start::start_of_pipeline:' - integer in_redirection - # Processing buffer - local proc_buf="$buf" - local -a args - if [[ $zsyh_user_options[interactivecomments] == on ]]; then - args=(${(zZ+c+)buf}) - else - args=(${(z)buf}) - fi - while (( $#args )); do - arg=$args[1] - shift args - if (( in_alias )); then - (( in_alias-- )) - (( in_alias == 0 )) && highlighted_alias=0 last_alias= seen_alias=() - fi - - # Initialize this_word and next_word. - if (( in_redirection == 0 )); then - this_word=$next_word - next_word=':regular:' - else - # Stall $next_word. - (( --in_redirection )) - fi - - # Initialize per-"simple command" [zshmisc(1)] variables: - # - # $style how to highlight $arg - # $in_array_assignment boolean flag for "between '(' and ')' of array assignment" - # $highlight_glob boolean flag for "'noglob' is in effect" - # - style=unknown-token - if [[ $this_word == *':start:'* ]]; then - in_array_assignment=false - if [[ $arg == 'noglob' ]]; then - highlight_glob=false - fi - fi - - if (( in_alias == 0 )); then - # Compute the new $start_pos and $end_pos, skipping over whitespace in $buf. - [[ "$proc_buf" = (#b)(#s)(([ $'\t']|\\$'\n')#)* ]] - # The first, outer parenthesis - integer offset="${#match[1]}" - (( start_pos = end_pos + offset )) - (( end_pos = start_pos + $#arg )) - - # Compute the new $proc_buf. We advance it - # (chop off characters from the beginning) - # beyond what end_pos points to, by skipping - # as many characters as end_pos was advanced. - # - # end_pos was advanced by $offset (via start_pos) - # and by $#arg. Note the `start_pos=$end_pos` - # below. - # - # As for the [,len]. We could use [,len-start_pos+offset] - # here, but to make it easier on eyes, we use len and - # rely on the fact that Zsh simply handles that. The - # length of proc_buf is len-start_pos+offset because - # we're chopping it to match current start_pos, so its - # length matches the previous value of start_pos. - # - # Why [,-1] is slower than [,length] isn't clear. - proc_buf="${proc_buf[offset + $#arg + 1,len]}" - fi - - # Handle the INTERACTIVE_COMMENTS option. - # - # We use the (Z+c+) flag so the entire comment is presented as one token in $arg. - if [[ $zsyh_user_options[interactivecomments] == on && $arg[1] == $histchars[3] ]]; then - if [[ $this_word == *(':regular:'|':start:')* ]]; then - style=comment - else - style=unknown-token # prematurely terminated - fi - _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style - # Stall this arg - in_redirection=1 - continue - fi - - if [[ $this_word == *:start:* ]] && ! (( in_redirection )); then - # Expand aliases. - _zsh_highlight_main__type "$arg" - local res="$REPLY" - if [[ $res == "alias" ]] && [[ $last_alias != $arg ]]; then - # Avoid looping forever on alias a=b b=c c=b, but allow alias foo='foo bar' - # Also mark insane aliases as unknown-token (cf. #263). - if (( $+seen_alias[$arg] )) || [[ $arg == ?*=* ]]; then - _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token - continue - fi - seen_alias[$arg]=1 - last_alias=$arg - _zsh_highlight_main__resolve_alias $arg - local -a alias_args - # Elision is desired in case alias x='' - alias_args=( ${interactive_comments-${(z)REPLY}} - ${interactive_comments+${(zZ+c+)REPLY}} ) - args=( $alias_args $args ) - if (( in_alias == 0 )); then - _zsh_highlight_main_add_region_highlight $start_pos $end_pos alias - # Add one because we will in_alias-- on the next loop iteration so - # this iteration should be considered in in_alias as well - (( in_alias += $#alias_args + 1 )) - else - # This arg is already included in the count, so no need to + 1. - (( in_alias += $#alias_args )) - fi - (( in_redirection++ )) # Stall this arg - continue - else - _zsh_highlight_main_highlighter_expand_path $arg - arg=$REPLY - _zsh_highlight_main__type "$arg" 0 - res="$REPLY" - fi - fi - - # Analyse the current word. - if _zsh_highlight_main__is_redirection $arg ; then - if (( in_redirection == 1 )); then - # The condition excludes the case that BUFFER='{foo}>&2' and we're on the '>&'. - _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token - else - in_redirection=2 - _zsh_highlight_main_add_region_highlight $start_pos $end_pos redirection - fi - continue - elif [[ $arg == '{'${~parameter_name_pattern}'}' ]] && _zsh_highlight_main__is_redirection $args[1]; then - # named file descriptor: {foo}>&2 - in_redirection=3 - _zsh_highlight_main_add_region_highlight $start_pos $end_pos named-fd - continue - fi - - # Expand parameters. - # - # ### For now, expand just '$foo' or '${foo}', possibly with braces, but with - # ### no other features of the parameter expansion syntax. (No ${(x)foo}, - # ### no ${foo[x]}, no ${foo:-x}.) - () { - # That's not entirely correct --- if the parameter's value happens to be a reserved - # word, the parameter expansion will be highlighted as a reserved word --- but that - # incorrectness is outweighed by the usability improvement of permitting the use of - # parameters that refer to commands, functions, and builtins. - local -a match mbegin mend - local MATCH; integer MBEGIN MEND - local parameter_name - if [[ $arg[1] == '$' ]] && [[ ${arg[2]} == '{' ]] && [[ ${arg[-1]} == '}' ]]; then - parameter_name=${${arg:2}%?} - elif [[ $arg[1] == '$' ]]; then - parameter_name=${arg:1} - fi - if [[ $res == none ]] && zmodload -e zsh/parameter && - [[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] && - (( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]] - then - # Set $arg. - case ${(tP)MATCH} in - (*array*|*assoc*) - local -a words; words=( ${(P)MATCH} ) - arg=${words[1]} - ;; - (*) - # scalar, presumably - arg=${(P)MATCH} - ;; - esac - _zsh_highlight_main__type "$arg" 0 - res=$REPLY - fi - } - - # Parse the sudo command line - if (( ! in_redirection )); then - if [[ $this_word == *':sudo_opt:'* ]]; then - if [[ -n $flags_with_argument ]] && - { [[ -n $flags_sans_argument ]] && [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]] || - [[ $arg == '-'[$flags_with_argument] ]] }; then - # Flag that requires an argument - this_word=${this_word//:start:/} - next_word=':sudo_arg:' - elif [[ -n $flags_with_argument ]] && - { [[ -n $flags_sans_argument ]] && [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument]* ]] || - [[ $arg == '-'[$flags_with_argument]* ]] }; then - # Argument attached in the same word - this_word=${this_word//:start:/} - next_word+=':start:' - next_word+=':sudo_opt:' - elif [[ -n $flags_sans_argument ]] && - [[ $arg == '-'[$flags_sans_argument]# ]]; then - # Flag that requires no argument - this_word=:sudo_opt: - next_word+=':start:' - next_word+=':sudo_opt:' - elif [[ $arg == '-'* ]]; then - # Unknown flag - this_word=:sudo_opt: - next_word+=':start:' - next_word+=':sudo_opt:' - _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token - continue - else - # Not an option flag; nothing to do. (If the command line is - # syntactically valid, ${this_word//:sudo_opt:/} should be - # non-empty now.) - this_word=${this_word//:sudo_opt:/} - fi - elif [[ $this_word == *':sudo_arg:'* ]]; then - next_word+=':sudo_opt:' - next_word+=':start:' - fi - fi - - # The Great Fork: is this a command word? Is this a non-command word? - if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then - if _zsh_highlight_main__stack_pop T || _zsh_highlight_main__stack_pop Q; then - # Missing closing square bracket(s) - style=unknown-token - elif [[ $this_word == *':regular:'* ]]; then - # This highlights empty commands (semicolon follows nothing) as an error. - # Zsh accepts them, though. - style=commandseparator - else - style=unknown-token - fi - if [[ $arg == ';' ]] && $in_array_assignment; then - # literal newline inside an array assignment - next_word=':regular:' - else - next_word=':start:' - highlight_glob=true - if [[ $arg != '|' && $arg != '|&' ]]; then - next_word+=':start_of_pipeline:' - fi - fi - elif ! (( in_redirection)) && [[ $this_word == *':always:'* && $arg == 'always' ]]; then - # try-always construct - style=reserved-word # de facto a reserved word, although not de jure - next_word=':start:' # only left brace is allowed, apparently - elif ! (( in_redirection)) && [[ $this_word == *':start:'* ]]; then # $arg is the command word - if (( ${+precommand_options[$arg]} )) && _zsh_highlight_main__is_runnable $arg; then - style=precommand - flags_with_argument=${precommand_options[$arg]%:*} - flags_sans_argument=${precommand_options[$arg]#*:} - next_word=${next_word//:regular:/} - next_word+=':sudo_opt:' - next_word+=':start:' - else - case $res in - reserved) # reserved word - style=reserved-word - # Match braces and handle special cases. - case $arg in - ($'\x7b') - braces_stack='Y'"$braces_stack" - ;; - ($'\x7d') - # We're at command word, so no need to check $right_brace_is_recognised_everywhere - _zsh_highlight_main__stack_pop 'Y' reserved-word - if [[ $style == reserved-word ]]; then - next_word+=':always:' - fi - ;; - ($'\x5b\x5b') - braces_stack='T'"$braces_stack" - ;; - ('do') - braces_stack='D'"$braces_stack" - ;; - ('done') - _zsh_highlight_main__stack_pop 'D' reserved-word - ;; - ('if') - braces_stack=':?'"$braces_stack" - ;; - ('then') - _zsh_highlight_main__stack_pop ':' reserved-word - ;; - ('elif') - if [[ ${braces_stack[1]} == '?' ]]; then - braces_stack=':'"$braces_stack" - else - style=unknown-token - fi - ;; - ('else') - if [[ ${braces_stack[1]} == '?' ]]; then - : - else - style=unknown-token - fi - ;; - ('fi') - _zsh_highlight_main__stack_pop '?' - ;; - ('foreach') - braces_stack='$'"$braces_stack" - ;; - ('end') - _zsh_highlight_main__stack_pop '$' reserved-word - ;; - ('repeat') - # skip the repeat-count word - in_redirection=2 - # The redirection mechanism assumes $this_word describes the word - # following the redirection. Make it so. - # - # That word can be a command word with shortloops (`repeat 2 ls`) - # or a command separator (`repeat 2; ls` or `repeat 2; do ls; done`). - # - # The repeat-count word will be handled like a redirection target. - this_word=':start::regular:' - ;; - ('!') - if [[ $this_word != *':start_of_pipeline:'* ]]; then - style=unknown-token - else - # '!' reserved word at start of pipeline; style already set above - fi - ;; - esac - ;; - 'suffix alias') style=suffix-alias;; - alias) :;; - builtin) style=builtin - [[ $arg == $'\x5b' ]] && braces_stack='Q'"$braces_stack" - ;; - function) style=function;; - command) style=command;; - hashed) style=hashed-command;; - none) if _zsh_highlight_main_highlighter_check_assign; then - _zsh_highlight_main_add_region_highlight $start_pos $end_pos assign - local i=$(( arg[(i)=] + 1 )) - if [[ $arg[i] == '(' ]]; then - in_array_assignment=true - else - # assignment to a scalar parameter. - # (For array assignments, the command doesn't start until the ")" token.) - # - # Discard :start_of_pipeline:, if present, as '!' is not valid - # after assignments. - next_word+=':start:' - if (( start_pos + i <= end_pos )); then - () { - local highlight_glob=false - [[ $zsyh_user_options[globassign] == on ]] && highlight_glob=true - _zsh_highlight_main_highlighter_highlight_argument $i - } - fi - fi - continue - elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then - style=history-expansion - elif [[ $arg[0,1] == $histchars[2,2] ]]; then - style=history-expansion - elif [[ $arg[1,2] == '((' ]]; then - # Arithmetic evaluation. - # - # Note: prior to zsh-5.1.1-52-g4bed2cf (workers/36669), the ${(z)...} - # splitter would only output the '((' token if the matching '))' had - # been typed. Therefore, under those versions of zsh, BUFFER="(( 42" - # would be highlighted as an error until the matching "))" are typed. - # - # We highlight just the opening parentheses, as a reserved word; this - # is how [[ ... ]] is highlighted, too. - _zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) reserved-word - if [[ $arg[-2,-1] == '))' ]]; then - _zsh_highlight_main_add_region_highlight $((end_pos - 2)) $end_pos reserved-word - fi - continue - elif [[ $arg == '()' ]]; then - # anonymous function - style=reserved-word - elif [[ $arg == $'\x28' ]]; then - # subshell - style=reserved-word - braces_stack='R'"$braces_stack" - elif [[ $arg == $'\x29' ]]; then - # end of subshell or command substitution - if _zsh_highlight_main__stack_pop 'S'; then - REPLY=$start_pos - reply=($list_highlights) - return 0 - fi - _zsh_highlight_main__stack_pop 'R' reserved-word - else - if _zsh_highlight_main_highlighter_check_path $arg; then - style=$REPLY - else - style=unknown-token - fi - fi - ;; - *) _zsh_highlight_main_add_region_highlight $start_pos $end_pos arg0_$res - continue - ;; - esac - fi - if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW:#"$arg"} ]]; then - next_word=':start::start_of_pipeline:' - fi - else # $arg is a non-command word - case $arg in - $'\x29') # subshell or end of array assignment - if $in_array_assignment; then - style=assign - in_array_assignment=false - next_word+=':start:' - elif (( in_redirection )); then - style=unknown-token - else - if _zsh_highlight_main__stack_pop 'S'; then - REPLY=$start_pos - reply=($list_highlights) - return 0 - fi - _zsh_highlight_main__stack_pop 'R' reserved-word - fi;; - $'\x28\x29') # possibly a function definition - if (( in_redirection )) || $in_array_assignment; then - style=unknown-token - else - if [[ $zsyh_user_options[multifuncdef] == on ]] || false # TODO: or if the previous word was a command word - then - next_word+=':start::start_of_pipeline:' - fi - style=reserved-word - fi - ;; - *) if false; then - elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then - # Parsing rule: { - # - # Additionally, `tt(})' is recognized in any position if neither the - # tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set. - if (( in_redirection )) || $in_array_assignment; then - style=unknown-token - else - _zsh_highlight_main__stack_pop 'Y' reserved-word - if [[ $style == reserved-word ]]; then - next_word+=':always:' - fi - fi - elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then - style=history-expansion - elif [[ $arg == $'\x5d\x5d' ]] && _zsh_highlight_main__stack_pop 'T' reserved-word; then - : - elif [[ $arg == $'\x5d' ]] && _zsh_highlight_main__stack_pop 'Q' builtin; then - : - else - _zsh_highlight_main_highlighter_highlight_argument 1 $(( 1 != in_redirection )) - continue - fi - ;; - esac - fi - _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style - done - [[ "$proc_buf" = (#b)(#s)(([[:space:]]|\\$'\n')#) ]] - REPLY=$(( end_pos + ${#match[1]} - 1 )) - reply=($list_highlights) - return $(( $#braces_stack > 0 )) -} - -# Check if $arg is variable assignment -_zsh_highlight_main_highlighter_check_assign() -{ - setopt localoptions extended_glob - [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] || - [[ $arg == [0-9]##(|[+])=* ]] -} - -_zsh_highlight_main_highlighter_highlight_path_separators() -{ - local pos style_pathsep - style_pathsep=$1_pathseparator - reply=() - [[ -z "$ZSH_HIGHLIGHT_STYLES[$style_pathsep]" || "$ZSH_HIGHLIGHT_STYLES[$1]" == "$ZSH_HIGHLIGHT_STYLES[$style_pathsep]" ]] && return 0 - for (( pos = start_pos; $pos <= end_pos; pos++ )) ; do - if [[ $BUFFER[pos] == / ]]; then - reply+=($((pos - 1)) $pos $style_pathsep) - fi - done -} - -# Check if $1 is a path. -# If yes, return 0 and in $REPLY the style to use. -# Else, return non-zero (and the contents of $REPLY is undefined). -_zsh_highlight_main_highlighter_check_path() -{ - _zsh_highlight_main_highlighter_expand_path "$1" - local expanded_path="$REPLY" tmp_path - - REPLY=path - - [[ -z $expanded_path ]] && return 1 - - # Check if this is a blacklisted path - if [[ $expanded_path[1] == / ]]; then - tmp_path=$expanded_path - else - tmp_path=$PWD/$expanded_path - fi - tmp_path=$tmp_path:a - - while [[ $tmp_path != / ]]; do - [[ -n ${(M)X_ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1 - tmp_path=$tmp_path:h - done - - [[ -L $expanded_path ]] && return 0 - [[ -e $expanded_path ]] && return 0 - - # Search the path in CDPATH - local cdpath_dir - for cdpath_dir in $cdpath ; do - [[ -e "$cdpath_dir/$expanded_path" ]] && return 0 - done - - # If dirname($1) doesn't exist, neither does $1. - [[ ! -d ${expanded_path:h} ]] && return 1 - - # If this word ends the buffer, check if it's the prefix of a valid path. - if (( has_end && (len == end_pos) )) && - [[ $WIDGET != zle-line-finish ]]; then - local -a tmp - tmp=( ${expanded_path}*(N) ) - (( $#tmp > 0 )) && REPLY=path_prefix && return 0 - fi - - # It's not a path. - return 1 -} - -# Highlight an argument and possibly special chars in quotes starting at $1 in $arg -# This command will at least highlight $1 to end_pos with the default style -# If $2 is set to 0, the argument cannot be highlighted as an option. -_zsh_highlight_main_highlighter_highlight_argument() -{ - local base_style=default i=$1 option_eligible=${2:-1} path_eligible=1 ret start style - local -a highlights - - local -a match mbegin mend - local MATCH; integer MBEGIN MEND - - case "$arg[i]" in - '-') - if (( option_eligible )); then - if [[ $arg[i+1] == - ]]; then - base_style=double-hyphen-option - else - base_style=single-hyphen-option - fi - path_eligible=0 - fi - ;; - '=') - if [[ $arg[i+1] == $'\x28' ]]; then - (( i += 2 )) - _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos] - ret=$? - (( i += REPLY )) - highlights+=( - $(( start_pos + $1 - 1 )) $(( start_pos + i )) process-substitution - $(( start_pos + $1 - 1 )) $(( start_pos + $1 + 1 )) process-substitution-delimiter - $reply - ) - if (( ret == 0 )); then - highlights+=($(( start_pos + i - 1 )) $(( start_pos + i )) process-substitution-delimiter) - fi - fi - esac - - for (( ; i <= end_pos - start_pos ; i += 1 )); do - case "$arg[$i]" in - "\\") (( i += 1 )); continue;; - "'") - _zsh_highlight_main_highlighter_highlight_single_quote $i - (( i = REPLY )) - highlights+=($reply) - ;; - '"') - _zsh_highlight_main_highlighter_highlight_double_quote $i - (( i = REPLY )) - highlights+=($reply) - ;; - '`') - _zsh_highlight_main_highlighter_highlight_backtick $i - (( i = REPLY )) - highlights+=($reply) - ;; - '$') - path_eligible=0 - if [[ $arg[i+1] == "'" ]]; then - path_eligible=1 - _zsh_highlight_main_highlighter_highlight_dollar_quote $i - (( i = REPLY )) - highlights+=($reply) - continue - elif [[ $arg[i+1] == $'\x28' ]]; then - start=$i - (( i += 2 )) - _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos] - ret=$? - (( i += REPLY )) - highlights+=( - $(( start_pos + start - 1)) $(( start_pos + i )) command-substitution-unquoted - $(( start_pos + start - 1)) $(( start_pos + start + 1)) command-substitution-delimiter-unquoted - $reply - ) - if (( ret == 0 )); then - highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) command-substitution-delimiter-unquoted) - fi - continue - fi - while [[ $arg[i+1] == [\^=~#+] ]]; do - (( i += 1 )) - done - if [[ $arg[i+1] == [*@#?$!-] ]]; then - (( i += 1 )) - fi;; - [\<\>]) - if [[ $arg[i+1] == $'\x28' ]]; then # \x28 = open paren - start=$i - (( i += 2 )) - _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos] - ret=$? - (( i += REPLY )) - highlights+=( - $(( start_pos + start - 1)) $(( start_pos + i )) process-substitution - $(( start_pos + start - 1)) $(( start_pos + start + 1 )) process-substitution-delimiter - $reply - ) - if (( ret == 0 )); then - highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) process-substitution-delimiter) - fi - continue - fi - ;| - *) - if $highlight_glob && [[ ${arg[$i]} =~ ^[*?] || ${arg:$i-1} =~ ^\<[0-9]*-[0-9]*\> ]]; then - highlights+=($(( start_pos + i - 1 )) $(( start_pos + i + $#MATCH - 1)) globbing) - (( i += $#MATCH - 1 )) - path_eligible=0 - else - continue - fi - ;; - esac - done - - if (( path_eligible )) && _zsh_highlight_main_highlighter_check_path $arg[$1,end_pos]; then - base_style=$REPLY - _zsh_highlight_main_highlighter_highlight_path_separators $base_style - highlights+=($reply) - fi - - highlights=($(( start_pos + $1 - 1 )) $end_pos $base_style $highlights) - _zsh_highlight_main_add_many_region_highlights $highlights -} - -# Quote Helper Functions -# -# $arg is expected to be set to the current argument -# $start_pos is expected to be set to the start of $arg in $BUFFER -# $1 is the index in $arg which starts the quote -# $REPLY is returned as the end of quote index in $arg -# $reply is returned as an array of region_highlight additions - -# Highlight single-quoted strings -_zsh_highlight_main_highlighter_highlight_single_quote() -{ - local arg1=$1 i q=\' style - i=$arg[(ib:arg1+1:)$q] - reply=() - - if [[ $zsyh_user_options[rcquotes] == on ]]; then - while [[ $arg[i+1] == "'" ]]; do - reply+=($(( start_pos + i - 1 )) $(( start_pos + i + 1 )) rc-quote) - (( i++ )) - i=$arg[(ib:i+1:)$q] - done - fi - - if [[ $arg[i] == "'" ]]; then - style=single-quoted-argument - else - # If unclosed, i points past the end - (( i-- )) - style=single-quoted-argument-unclosed - fi - reply=($(( start_pos + arg1 - 1 )) $(( start_pos + i )) $style $reply) - REPLY=$i -} - -# Highlight special chars inside double-quoted strings -_zsh_highlight_main_highlighter_highlight_double_quote() -{ - local -a breaks match mbegin mend saved_reply - local MATCH; integer last_break=$(( start_pos + $1 - 1 )) MBEGIN MEND - local i j k ret style - reply=() - - for (( i = $1 + 1 ; i <= end_pos - start_pos ; i += 1 )) ; do - (( j = i + start_pos - 1 )) - (( k = j + 1 )) - case "$arg[$i]" in - '"') break;; - '`') saved_reply=($reply) - _zsh_highlight_main_highlighter_highlight_backtick $i - (( i = REPLY )) - reply=($saved_reply $reply) - continue - ;; - '$' ) style=dollar-double-quoted-argument - # Look for an alphanumeric parameter name. - if [[ ${arg:$i} =~ ^([A-Za-z_][A-Za-z0-9_]*|[0-9]+) ]] ; then - (( k += $#MATCH )) # highlight the parameter name - (( i += $#MATCH )) # skip past it - elif [[ ${arg:$i} =~ ^[{]([A-Za-z_][A-Za-z0-9_]*|[0-9]+)[}] ]] ; then - (( k += $#MATCH )) # highlight the parameter name and braces - (( i += $#MATCH )) # skip past it - elif [[ $arg[i+1] == '$' ]]; then - # $$ - pid - (( k += 1 )) # highlight both dollar signs - (( i += 1 )) # don't consider the second one as introducing another parameter expansion - elif [[ $arg[i+1] == [-#*@?] ]]; then - # $#, $*, $@, $?, $- - like $$ above - (( k += 1 )) # highlight both dollar signs - (( i += 1 )) # don't consider the second one as introducing another parameter expansion - elif [[ $arg[i+1] == $'\x28' ]]; then - breaks+=( $last_break $(( start_pos + i - 1 )) ) - (( i += 2 )) - saved_reply=($reply) - _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos] - ret=$? - (( i += REPLY )) - last_break=$(( start_pos + i )) - reply=( - $saved_reply - $j $(( start_pos + i )) command-substitution-quoted - $j $(( j + 2 )) command-substitution-delimiter-quoted - $reply - ) - if (( ret == 0 )); then - reply+=($(( start_pos + i - 1 )) $(( start_pos + i )) command-substitution-delimiter-quoted) - fi - continue - else - continue - fi - ;; - "\\") style=back-double-quoted-argument - if [[ \\\`\"\$${histchars[1]} == *$arg[$i+1]* ]]; then - (( k += 1 )) # Color following char too. - (( i += 1 )) # Skip parsing the escaped char. - else - continue - fi - ;; - ($histchars[1]) # ! - may be a history expansion - if [[ $arg[i+1] != ('='|$'\x28'|$'\x7b'|[[:blank:]]) ]]; then - style=history-expansion - else - continue - fi - ;; - *) continue ;; - - esac - reply+=($j $k $style) - done - - if [[ $arg[i] == '"' ]]; then - style=double-quoted-argument - else - # If unclosed, i points past the end - (( i-- )) - style=double-quoted-argument-unclosed - fi - (( last_break != start_pos + i )) && breaks+=( $last_break $(( start_pos + i )) ) - saved_reply=($reply) - reply=() - for 1 2 in $breaks; do - reply+=($1 $2 $style) - done - reply+=($saved_reply) - REPLY=$i -} - -# Highlight special chars inside dollar-quoted strings -_zsh_highlight_main_highlighter_highlight_dollar_quote() -{ - local -a match mbegin mend - local MATCH; integer MBEGIN MEND - local i j k style - local AA - integer c - reply=() - - for (( i = $1 + 2 ; i <= end_pos - start_pos ; i += 1 )) ; do - (( j = i + start_pos - 1 )) - (( k = j + 1 )) - case "$arg[$i]" in - "'") break;; - "\\") style=back-dollar-quoted-argument - for (( c = i + 1 ; c <= end_pos - start_pos ; c += 1 )); do - [[ "$arg[$c]" != ([0-9xXuUa-fA-F]) ]] && break - done - AA=$arg[$i+1,$c-1] - # Matching for HEX and OCT values like \0xA6, \xA6 or \012 - if [[ "$AA" =~ "^(x|X)[0-9a-fA-F]{1,2}" - || "$AA" =~ "^[0-7]{1,3}" - || "$AA" =~ "^u[0-9a-fA-F]{1,4}" - || "$AA" =~ "^U[0-9a-fA-F]{1,8}" - ]]; then - (( k += $#MATCH )) - (( i += $#MATCH )) - else - if (( $#arg > $i+1 )) && [[ $arg[$i+1] == [xXuU] ]]; then - # \x not followed by hex digits is probably an error - style=unknown-token - fi - (( k += 1 )) # Color following char too. - (( i += 1 )) # Skip parsing the escaped char. - fi - ;; - *) continue ;; - - esac - reply+=($j $k $style) - done - - if [[ $arg[i] == "'" ]]; then - style=dollar-quoted-argument - else - # If unclosed, i points past the end - (( i-- )) - style=dollar-quoted-argument-unclosed - fi - reply=($(( start_pos + $1 - 1 )) $(( start_pos + i )) $style $reply) - REPLY=$i -} - -# Highlight backtick substitutions -_zsh_highlight_main_highlighter_highlight_backtick() -{ - # buf is the contents of the backticks with a layer of backslashes removed. - # last is the index of arg for the start of the string to be copied into buf. - # It is either one past the beginning backtick or one past the last backslash. - # offset is a count of consumed \ (the delta between buf and arg). - # offsets is an array indexed by buf offset of when the delta between buf and arg changes. - # It is sparse, so search backwards to the last value - local buf highlight style=back-quoted-argument-unclosed style_end - local -i arg1=$1 end_ i=$1 last offset=0 start subshell_has_end=0 - local -a highlight_zone highlights offsets - reply=() - - last=$(( arg1 + 1 )) - # Remove one layer of backslashes and find the end - while i=$arg[(ib:i+1:)[\\\\\`]]; do # find the next \ or ` - if (( i > end_pos - start_pos )); then - buf=$buf$arg[last,i] - offsets[i-arg1-offset]='' # So we never index past the end - (( i-- )) - subshell_has_end=$(( has_end && (start_pos + i == len) )) - break - fi - - if [[ $arg[i] == '\' ]]; then - (( i++ )) - # POSIX XCU 2.6.3 - if [[ $arg[i] == ('$'|'`'|'\') ]]; then - buf=$buf$arg[last,i-2] - (( offset++ )) - # offsets is relative to buf, so adjust by -arg1 - offsets[i-arg1-offset]=$offset - else - buf=$buf$arg[last,i-1] - fi - else # it's an unquoted ` and this is the end - style=back-quoted-argument - style_end=back-quoted-argument-delimiter - buf=$buf$arg[last,i-1] - offsets[i-arg1-offset]='' # So we never index past the end - break - fi - last=$i - done - - _zsh_highlight_main_highlighter_highlight_list 0 '' $subshell_has_end $buf - - # Munge the reply to account for removed backslashes - for start end_ highlight in $reply; do - start=$(( start_pos + arg1 + start + offsets[(Rb:start:)?*] )) - end_=$(( start_pos + arg1 + end_ + offsets[(Rb:end_:)?*] )) - highlights+=($start $end_ $highlight) - if [[ $highlight == back-quoted-argument-unclosed && $style == back-quoted-argument ]]; then - # An inner backtick command substitution is unclosed, but this level is closed - style_end=unknown-token - fi - done - - reply=( - $(( start_pos + arg1 - 1 )) $(( start_pos + i )) $style - $(( start_pos + arg1 - 1 )) $(( start_pos + arg1 )) back-quoted-argument-delimiter - $highlights - ) - if (( $#style_end )); then - reply+=($(( start_pos + i - 1)) $(( start_pos + i )) $style_end) - fi - REPLY=$i -} - -# Called with a single positional argument. -# Perform filename expansion (tilde expansion) on the argument and set $REPLY to the expanded value. -# -# Does not perform filename generation (globbing). -_zsh_highlight_main_highlighter_expand_path() -{ - (( $# == 1 )) || print -r -- >&2 "zsh-syntax-highlighting: BUG: _zsh_highlight_main_highlighter_expand_path: called without argument" - - # The $~1 syntax normally performs filename generation, but not when it's on the right-hand side of ${x:=y}. - setopt localoptions nonomatch - unset REPLY - : ${REPLY:=${(Q)${~1}}} -} - -# ------------------------------------------------------------------------------------------------- -# Main highlighter initialization -# ------------------------------------------------------------------------------------------------- - -_zsh_highlight_main__precmd_hook() { - _zsh_highlight_main__command_type_cache=() -} - -autoload -Uz add-zsh-hook -if add-zsh-hook precmd _zsh_highlight_main__precmd_hook 2>/dev/null; then - # Initialize command type cache - typeset -gA _zsh_highlight_main__command_type_cache -else - print -r -- >&2 'zsh-syntax-highlighting: Failed to load add-zsh-hook. Some speed optimizations will not be used.' - # Make sure the cache is unset - unset _zsh_highlight_main__command_type_cache -fi -typeset -ga X_ZSH_HIGHLIGHT_DIRS_BLACKLIST diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-assignment1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-assignment1.zsh deleted file mode 100644 index 0c101c8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-assignment1.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Issue #263 (more-pathological case): aliases[x=y]=z works; the ${(z)} splitter considers -# that a single word; but it's not looked up as an alias. Hence, highlight it as an error. -aliases[x=y]='lorem ipsum dolor sit amet' -BUFFER='x=y ls' - -expected_region_highlight=( - "1 3 unknown-token" # x=y - "5 6 default" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment1.zsh deleted file mode 100644 index 0c449e1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment1.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# see alias-comment2.zsh -setopt interactivecomments -alias x=$'# foo\npwd' -BUFFER='x' - -expected_region_highlight=( - '1 1 alias' # x - '1 1 comment' # x (#) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment2.zsh deleted file mode 100644 index 8bdc5a8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-comment2.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# see alias-comment1.zsh -setopt NO_interactivecomments -alias x=$'# foo\npwd' -BUFFER='x' - -expected_region_highlight=( - '1 1 alias' # x - '1 1 unknown-token' # x (#) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-complex.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-complex.zsh deleted file mode 100644 index 7a9626e..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-complex.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias x='echo && ls; >' - -BUFFER='x file echo' - -expected_region_highlight=( - '1 1 alias' # x - '1 1 builtin' # x (echo) - '3 6 default' # file - '8 11 builtin' # echo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-empty.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-empty.zsh deleted file mode 100644 index 535fccc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-empty.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias x='' - -BUFFER='x echo foo' - -expected_region_highlight=( - '1 1 alias' # x - '3 6 builtin' # echo - '8 10 default' # foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-loop.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-loop.zsh deleted file mode 100644 index b36d1c9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-loop.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias a=b b=c c=b - -BUFFER='a foo; :' - -expected_region_highlight=( - '1 1 alias' # a - '1 1 unknown-token' # a (invalid alias loop) - '3 5 default' # foo - '6 6 commandseparator' # ; - '8 8 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested-precommand.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested-precommand.zsh deleted file mode 100644 index 7c2eeeb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested-precommand.zsh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias a=b b=sudo -sudo(){} - -BUFFER='a -u phy1729 echo; :' - -expected_region_highlight=( - '1 1 alias' # a - '1 1 precommand' # a (sudo) - '3 4 single-hyphen-option' # -u - '6 12 default' # phy1729 - '14 17 builtin' # echo - '18 18 commandseparator' # ; - '20 20 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested.zsh deleted file mode 100644 index 44ab22b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-nested.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias a=b b=: - -BUFFER='a foo; :' - -expected_region_highlight=( - '1 1 alias' # a - '1 1 builtin' # a (:) - '3 5 default' # foo - '6 6 commandseparator' # ; - '8 8 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument1.zsh deleted file mode 100644 index ad16962..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument1.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias sdu='sudo -u' -sudo(){} - -BUFFER='sdu phy1729 echo foo' - -expected_region_highlight=( - '1 3 alias' # sdu - '1 3 precommand' # sdu (sudo) - '5 11 default' # phy1729 - '13 16 commmand "issue #540"' # echo (not builtin) - '18 20 default' # foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument2.zsh deleted file mode 100644 index 2fceff8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-precommand-option-argument2.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias sde='sudo -e' -alias seu='sde -u' -sudo(){} - -BUFFER='seu phy1729 echo foo' - -expected_region_highlight=( - '1 3 alias' # seu - '1 3 precommand' # seu (sudo) - '5 11 default' # phy1729 - '13 16 commmand "issue #540"' # echo (not builtin) - '18 20 default' # foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-quoted.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-quoted.zsh deleted file mode 100644 index e42e2f0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-quoted.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) YYYY zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias a=: ls='ls -l' -BUFFER='"a" foo; \ls' - -expected_region_highlight=( - '1 3 unknown-token' # "a" - '5 7 default' # foo - '8 8 commandseparator' # ; - '10 12 command' # \ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-redirect.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-redirect.zsh deleted file mode 100644 index a6a0aab..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-redirect.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias x=\> -BUFFER='x foo echo bar' - -expected_region_highlight=( - '1 1 alias' # x - '1 1 redirection' # x (>) - '3 5 default' # foo - '7 10 builtin' # echo - '12 14 default' # bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-self.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-self.zsh deleted file mode 100644 index 88ed3c8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-self.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias echo='echo foo' - -BUFFER='echo bar' - -expected_region_highlight=( - '1 4 alias' # echo - '1 4 builtin' # echo - '6 8 default' # bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-to-dir.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-to-dir.zsh deleted file mode 100644 index 93aaa62..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias-to-dir.zsh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias x=/ -BUFFER=$'x' - -expected_region_highlight=( - '1 1 alias' # x - '1 1 unknown-token "issue #202"' # x (/) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias.zsh deleted file mode 100644 index 03ca0be..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/alias.zsh +++ /dev/null @@ -1,54 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias alias1="ls" -alias -s alias2="echo" -function alias1() {} # to check that it's highlighted as an alias, not as a function - -BUFFER='x.alias2; alias1; alias2' - -# Set expected_region_highlight as a function of zsh version. -# -# Highlight of suffix alias requires zsh-5.1.1 or newer; see issue #126, -# and commit 36403 to zsh itself. Therefore, check if the requisite zsh -# functionality is present, and skip verifying suffix-alias highlighting -# if it isn't. -expected_region_highlight=() -if zmodload -e zsh/parameter || [[ "$(type -w x.alias2)" == *suffix* ]]; then - expected_region_highlight+=( - "1 8 suffix-alias" # x.alias2 - ) -fi -expected_region_highlight+=( - "9 9 commandseparator" # ; - "11 16 alias" # alias1 - "11 16 command" # alias1 (ls) - "17 17 commandseparator" # ; - "19 24 unknown-token" # alias2 -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always1.zsh deleted file mode 100644 index ae40a72..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always1.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='{ ls } always { pwd }' - -expected_region_highlight=( - '1 1 reserved-word' # { - '3 4 command' # ls - '6 6 reserved-word' # } - '8 13 reserved-word' # always - '15 15 reserved-word' # { - '17 19 builtin' # pwd - '21 21 reserved-word' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always2.zsh deleted file mode 100644 index f5852c6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always2.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'{\nls\n} always { pwd }' - -expected_region_highlight=( - '1 1 reserved-word' # { - '2 2 unknown-token' # \n - '3 4 command' # ls - '5 5 commandseparator' # \n - '6 6 reserved-word' # } - '8 13 reserved-word' # always - '15 15 reserved-word' # { - '17 19 builtin' # pwd - '21 21 reserved-word' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always3.zsh deleted file mode 100644 index d41beeb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/always3.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -setopt ignorebraces -BUFFER='echo { foo } always { bar }' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 6 default' # { - '8 10 default' # foo - '12 12 default' # } - '14 19 default' # always - '21 21 default' # { - '23 25 default' # bar - '27 27 default' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/anonymous-function.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/anonymous-function.zsh deleted file mode 100644 index 9d67fb1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/anonymous-function.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='() echo hello; () { echo world } "argument"' - -expected_region_highlight=( - "1 2 reserved-word" # () - "4 7 builtin" # echo - "9 13 default" # hello - "14 14 commandseparator" # ; - "16 17 reserved-word" # () - "19 19 reserved-word" # { - "21 24 builtin" # echo - "26 30 default" # world - "32 32 reserved-word" # } - "34 43 default" # "argument" - "34 43 double-quoted-argument" # "argument" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arg0-colon.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arg0-colon.zsh deleted file mode 100644 index 8955bd2..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arg0-colon.zsh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=''\''x: /' - -expected_region_highlight=( - '1 5 unknown-token' # \'x: / -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arithmetic-evaluation.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arithmetic-evaluation.zsh deleted file mode 100644 index e0eb6e7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/arithmetic-evaluation.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Must be at command word, since the word following 'if' isn't currently considered -# a command word (issue #207). -# -# An opening '((' without matching '))' is highlighted correctly under zsh-5.1.1-52-g4bed2cf -# or newer, only (issue #188). -BUFFER='(( x == 42 ))' - -expected_region_highlight=( - "1 2 reserved-word" # (( - "12 13 reserved-word" # )) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-append.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-append.zsh deleted file mode 100644 index eb9fbbd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-append.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='a+=(lorem ipsum)' - -expected_region_highlight=( - "1 4 assign" # a+=( - "5 9 default" # lorem - "11 15 default" # ipsum - "16 16 assign" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-argv.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-argv.zsh deleted file mode 100644 index ec5acc2..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-argv.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -touch foo -BUFFER='42=foo 43+=bar' - -expected_region_highlight=( - "1 6 assign" # 42=foo - "4 6 path" # foo - "8 14 assign" # 43+=bar - "12 14 default" # bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array.zsh deleted file mode 100644 index 0624f9b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='(A=(hello world))' - -expected_region_highlight=( - "1 1 reserved-word" # ( - "2 4 assign" # A=( - "5 9 default" # hello - "11 15 default" # world - "16 16 assign" # ) - "17 17 reserved-word" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array2.zsh deleted file mode 100644 index cdc9e63..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array2.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='A=(hello world) ls' - -expected_region_highlight=( - "1 3 assign" # A=( - "4 8 default" # hello - "10 14 default" # world - "15 15 assign" # ) - "17 18 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array3.zsh deleted file mode 100644 index 986d71f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-array3.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='A=(hello world) b=42' - -expected_region_highlight=( - "1 3 assign" # A=( - "4 8 default" # hello - "10 14 default" # world - "15 15 assign" # ) - "17 20 assign" # b=42 - "19 20 default" # 42 -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array.zsh deleted file mode 100644 index 651ab80..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='a=foo( bar ) :' - -expected_region_highlight=( - '1 12 assign' # a=foo( bar ) - '3 12 default' # foo( bar ) - '14 14 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array2.zsh deleted file mode 100644 index dfda106..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-not-array2.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='a=foo\( :' - -expected_region_highlight=( - '1 7 assign' # a=foo\( - '3 7 default' # foo\( - '9 9 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-semicolon.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-semicolon.zsh deleted file mode 100644 index f748c94..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-semicolon.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='A=1; echo hello world' - -expected_region_highlight=( - "1 3 assign" # A=1 - "3 3 default" # 1 - "4 4 commandseparator" # ; - "6 9 builtin" # echo - "11 15 default" # hello - "17 21 default" # world -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-subshell.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-subshell.zsh deleted file mode 100644 index 2022889..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign-subshell.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='(A=1)' - -expected_region_highlight=( - "1 1 reserved-word" # ( - "2 4 assign" # A=1 - "4 4 default" # 1 - "5 5 reserved-word" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign.zsh deleted file mode 100644 index 6e797ac..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/assign.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='A=1 b=("foo" bar)' - -expected_region_highlight=( - "1 3 assign" # A=1 - "3 3 default" # 1 - "5 7 assign" # b=( - "8 12 default" # "foo" - "8 12 double-quoted-argument" # "foo" - "14 16 default" # bar - "17 17 assign" # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-argument.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-argument.zsh deleted file mode 100644 index d504a2c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-argument.zsh +++ /dev/null @@ -1,58 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo `echo \`42\`` "is `echo equal` to" `echo 6 times 9' - -expected_region_highlight=( - "1 4 builtin" # echo - "6 18 default" # `echo \`42\`` - "6 18 back-quoted-argument" # `echo \`42\`` - "6 6 back-quoted-argument-delimiter" # ` - "7 10 builtin" # echo - "12 17 default" # \`42\` - "12 17 back-quoted-argument" # \`42\` - "12 13 back-quoted-argument-delimiter" # \` - "14 15 unknown-token" # 42 - "16 17 back-quoted-argument-delimiter" # \` - "18 18 back-quoted-argument-delimiter" # ` - "20 39 default" # "is `echo equal` to" - "20 39 double-quoted-argument" # "is `echo equal` to" - "24 35 back-quoted-argument" # `echo equal` - "24 24 back-quoted-argument-delimiter" # ` - "25 28 builtin" # echo - "30 34 default" # equal - "35 35 back-quoted-argument-delimiter" # ` - "41 55 default" # `echo 6 times 9 - "41 55 back-quoted-argument-unclosed" # `echo 6 times 9 - "41 41 back-quoted-argument-delimiter" # ` - "42 45 builtin" # echo - "47 47 default" # 6 - "49 53 default" # times - "55 55 default" # 9 -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-open.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-open.zsh deleted file mode 100644 index f188d81..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/back-quoted-open.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -touch foo -BUFFER=$': `ls fo' - -expected_region_highlight=( - '1 1 builtin' # : - '3 8 default' # `ls fo - '3 8 back-quoted-argument-unclosed' # `ls fo - '3 3 back-quoted-argument-delimiter' # ` - '4 5 command' # ls - '7 8 path_prefix' # fo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-continuation.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-continuation.zsh deleted file mode 100644 index ebcf2e1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-continuation.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -PREBUFFER=$'echo \\\n' -BUFFER='noglob' - -expected_region_highlight=( - "1 6 default" # 'noglob' highlighted as a string, not as a precomand -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-space.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-space.zsh deleted file mode 100644 index 0d8a63c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/backslash-space.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'echo \\ \'foo\' ; ls' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 12 default' # \ \'foo\' - '8 12 single-quoted-argument' # 'foo' - '14 14 commandseparator' # ; - '16 17 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-array.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-array.zsh deleted file mode 100644 index 77b57e6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-array.zsh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'foo=(bar abaz) \! ls' - -expected_region_highlight=( - '1 5 assign' # foo=( - '6 8 default' # bar - '10 13 default' # abaz - '14 14 assign' # ) - '16 16 unknown-token' # \! - '18 19 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-scalar.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-scalar.zsh deleted file mode 100644 index e919050..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-assign-scalar.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'foo=bar \! ls' - -expected_region_highlight=( - '1 7 assign' # foo=bar - '5 7 default' # bar - '9 9 unknown-token' # \! - '11 12 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-pipeline.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-pipeline.zsh deleted file mode 100644 index fef25f1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/bang-pipeline.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'\! ls | \! ls' - -expected_region_highlight=( - '1 1 reserved-word' # \! - '3 4 command' # ls - '6 6 commandseparator' # | - '8 8 unknown-token' # \! - '10 11 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces1.zsh deleted file mode 100644 index 3c5b1f0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces1.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'() { echo }\n}' -# no special setopts - -expected_region_highlight=( - '1 2 reserved-word' # () - '4 4 reserved-word' # { - '6 9 builtin' # echo - '11 11 reserved-word' # } - '12 12 commandseparator' # \n - '13 13 unknown-token' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces2.zsh deleted file mode 100644 index a3ea7c9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/braces2.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'() { echo }\n}' -setopt ignorebraces - -expected_region_highlight=( - '1 2 reserved-word' # () - '4 4 reserved-word' # { - '6 9 builtin' # echo - '11 11 default' # } - '12 12 commandseparator' # \n - '13 13 reserved-word' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching1.zsh deleted file mode 100644 index 7cc6de5..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching1.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='[[ -n foo ]]' - -expected_region_highlight=( - '1 2 reserved-word' # [[ - '4 5 single-hyphen-option' # -n - '7 9 default' # foo - '11 12 reserved-word' # ]] -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching2.zsh deleted file mode 100644 index 19c7f0d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-matching2.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='[ -n foo ]' - -expected_region_highlight=( - '1 1 builtin' # [ - '3 4 single-hyphen-option' # -n - '6 8 default' # foo - '10 10 builtin' # ] -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch1.zsh deleted file mode 100644 index 5e6e80f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch1.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='() { echo foo )' - -expected_region_highlight=( - '1 2 reserved-word' # () - '4 4 reserved-word' # { - '6 9 builtin' # echo - '11 13 default' # foo - '15 15 unknown-token' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch10-if-negative.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch10-if-negative.zsh deleted file mode 100644 index 9d0b53c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch10-if-negative.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='elif true; then echo two; fi' - -expected_region_highlight=( - '1 4 unknown-token' # elif - '6 9 builtin' # true - '10 10 commandseparator' # ; - '12 15 unknown-token' # then - '17 20 builtin' # echo - '22 24 default' # two - '25 25 commandseparator' # ; - '27 28 unknown-token' # fi -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch2.zsh deleted file mode 100644 index 2d98ac2..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='() ( echo foo }' - -expected_region_highlight=( - '1 2 reserved-word' # () - '4 4 reserved-word' # ( - '6 9 builtin' # echo - '11 13 default' # foo - '15 15 unknown-token' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch3.zsh deleted file mode 100644 index e33040a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch3.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo )' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 6 unknown-token' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch4.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch4.zsh deleted file mode 100644 index a9b15dc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch4.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo }' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 6 unknown-token' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch5.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch5.zsh deleted file mode 100644 index 21e8bb2..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch5.zsh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo { }' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 6 default' # { - '8 8 unknown-token' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch6.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch6.zsh deleted file mode 100644 index 9df8388..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch6.zsh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='(repeat 1; do)' - -expected_region_highlight=( - '1 1 reserved-word' # ( - '2 7 reserved-word' # repeat - '9 9 default' # 1 - '10 10 commandseparator' # ; - '12 13 reserved-word' # do - '14 14 unknown-token' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch7.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch7.zsh deleted file mode 100644 index 1caa936..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch7.zsh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2012 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='for n in *; do echo $n; end' - -expected_region_highlight=( - '1 3 reserved-word' # for - '5 5 default' # n - '7 8 default' # in - '10 10 default' # * - '10 10 globbing' # * - '11 11 commandseparator' # ; - '13 14 reserved-word' # do - '16 19 builtin' # echo - '21 22 default' # $n - '23 23 commandseparator' # ; - '25 27 unknown-token' # end -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8-if-positive.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8-if-positive.zsh deleted file mode 100644 index d6838f0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8-if-positive.zsh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='if false; then echo one; elif true; then echo two; else echo three; fi' - -expected_region_highlight=( - '1 2 reserved-word' # if - '4 8 builtin' # false - '9 9 commandseparator' # ; - '11 14 reserved-word' # then - '16 19 builtin' # echo - '21 23 default' # one - '24 24 commandseparator' # ; - '26 29 reserved-word' # elif - '31 34 builtin' # true - '35 35 commandseparator' # ; - '37 40 reserved-word' # then - '42 45 builtin' # echo - '47 49 default' # two - '50 50 commandseparator' # ; - '52 55 reserved-word' # else - '57 60 builtin' # echo - '62 66 default' # three - '67 67 commandseparator' # ; - '69 70 reserved-word' # fi -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8.zsh deleted file mode 100644 index 07a42e3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch8.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='(ls&)' - -expected_region_highlight=( - '1 1 reserved-word' # ( - '2 3 command' # ls - '4 4 commandseparator' # & - '5 5 reserved-word' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch9-if-positive.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch9-if-positive.zsh deleted file mode 100644 index 87c1ba7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-mismatch9-if-positive.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='if false; then echo one; fi' - -expected_region_highlight=( - '1 2 reserved-word' # if - '4 8 builtin' # false - '9 9 commandseparator' # ; - '11 14 reserved-word' # then - '16 19 builtin' # echo - '21 23 default' # one - '24 24 commandseparator' # ; - '26 27 reserved-word' # fi -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-premature-termination.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-premature-termination.zsh deleted file mode 100644 index fa813da..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/brackets-premature-termination.zsh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='[[ -n foo; echo ]]' - -expected_region_highlight=( - '1 2 reserved-word' # [[ - '4 5 single-hyphen-option' # -n - '7 9 default' # foo - '10 10 unknown-token' # ; - '12 15 builtin' # echo - '17 18 default' # ]] -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-in-assignment.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-in-assignment.zsh deleted file mode 100644 index fafda49..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-in-assignment.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'foo=$(echo bar) :' - -expected_region_highlight=( - '1 15 assign' # foo=$(echo bar) - '5 15 default' # $(echo bar) - '5 15 command-substitution-unquoted' # $(echo bar) - '5 6 command-substitution-delimiter-unquoted' # $( - '7 10 builtin' # echo - '12 14 default' # bar - '15 15 command-substitution-delimiter-unquoted' # ) - '17 17 builtin' # : -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-unclosed.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-unclosed.zsh deleted file mode 100644 index 3229dfc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/command-substitution-unclosed.zsh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': foo$(echo bar' - -expected_region_highlight=( - '1 1 builtin' # : - '3 15 default' # foo$(echo bar - '6 15 command-substitution-unquoted' # $(echo bar - '6 7 command-substitution-delimiter-unquoted' # $( - '8 11 builtin' # echo - '13 15 default' # bar -) - -if [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug - expected_region_highlight[2]='3 16 default' # foo$(echo bar - expected_region_highlight[3]='6 16 command-substitution-unquoted' # $(echo bar -fi diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commandseparator.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commandseparator.zsh deleted file mode 100644 index f504847..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commandseparator.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=':; pwd &! ls' - -expected_region_highlight=( - "1 1 builtin" # : - "2 2 commandseparator" # ; - "4 6 builtin" # pwd - "8 9 commandseparator" # &! - "11 12 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-followed.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-followed.zsh deleted file mode 100644 index 8c7e42c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-followed.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -setopt interactivecomments -BUFFER=$'# foo\ntrue' - -expected_region_highlight=( - '1 5 comment' # # foo - '6 6 commandseparator "issue #501"' # \n - '7 10 builtin' # true -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-leading.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-leading.zsh deleted file mode 100644 index b4c9910..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-leading.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -setopt interactive_comments - -BUFFER='# echo foo' - -expected_region_highlight=( - "1 10 comment" # # echo foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-off.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-off.zsh deleted file mode 100644 index 0381bdb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comment-off.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -unsetopt interactive_comments - -BUFFER='# echo foo' - -expected_region_highlight=( - "1 1 unknown-token" # # - "3 6 default" # " echo foo" - "8 10 default" # " echo foo" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comments.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comments.zsh deleted file mode 100644 index f3cc57e..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/comments.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -setopt interactive_comments - -BUFFER='echo "foo #bar" #baz # quux' - -expected_region_highlight=( - "1 4 builtin" # echo - "6 15 default" # "foo #bar" - "6 15 double-quoted-argument" # "foo #bar" - "17 27 comment" # #baz # quux -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commmand-parameter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commmand-parameter.zsh deleted file mode 100644 index 48d20ba..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/commmand-parameter.zsh +++ /dev/null @@ -1,45 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -local x=/usr/bin/env -local y=sudo -local -a z; z=(zsh -f) -sudo(){} - -BUFFER='$x "argument"; $y; $z' - -expected_region_highlight=( - "1 2 command" # $x - "4 13 default" # "argument" - "4 13 double-quoted-argument" # "argument" - "14 14 commandseparator" # ; - "16 17 precommand" # $y (sudo) - "18 18 unknown-token" # ; - "20 21 command" # $z - 'zsh' being the command -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow.zsh deleted file mode 100644 index a610bdc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow.zsh +++ /dev/null @@ -1,57 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='while if echo Hello; then ls /; else ls; fi; do stat "x"; done; repeat 10 ls' - -expected_region_highlight+=( - "1 5 reserved-word" # while - "7 8 reserved-word" # if - "10 13 builtin" # echo - "15 19 default" # Hello - "20 20 commandseparator" # ; - "22 25 reserved-word" # then - "27 28 command" # ls - "30 30 path" # / - "31 31 commandseparator" # ; - "33 36 reserved-word" # else - "38 39 command" # ls - "40 40 commandseparator" # ; - "42 43 reserved-word" # fi - "44 44 commandseparator" # ; - "46 47 reserved-word" # do - "49 52 command" # stat - "54 56 default" # "x" - "54 56 double-quoted-argument" # "x" - "57 57 commandseparator" # ; - "59 62 reserved-word" # done - "63 63 commandseparator" # ; - "65 70 reserved-word" # repeat - "72 73 default" # 10 - "75 76 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow2.zsh deleted file mode 100644 index acf99e1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow2.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='repeat 42; do ls; done' - -expected_region_highlight+=( - "1 6 reserved-word" # repeat - "8 9 default" # 42 - "10 10 commandseparator" # ; - "12 13 reserved-word" # do - "15 16 command" # ls - "17 17 commandseparator" # ; - "19 22 reserved-word" # done -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow3.zsh deleted file mode 100644 index 58f507f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/control-flow3.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='repeat 42; ls; pwd' - -expected_region_highlight+=( - "1 6 reserved-word" # repeat - "8 9 default" # 42 - "10 10 commandseparator" # ; - "12 13 command" # ls - "14 14 commandseparator" # ; - "16 18 builtin" # pwd -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/cthulhu.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/cthulhu.zsh deleted file mode 100644 index c8119a8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/cthulhu.zsh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# 0000000 0 01111111111222222 222233333 3 333344 4 4 444444555555555 5 6 6666 6 6 6667777777777888 8 8 88888999 9 9999 9 9 00 00 0000001111 -# 1234567 8 90123456789012345 678901234 5 678901 2 3 456789012345678 9 0 1234 5 6 7890123456789012 3 4 56789012 3 4567 8 9 01 23 4567890123 -BUFFER=$'echo Ph\\\'ng`echo lui "mg"\\`echo lw\\\'nafh \\\\\\`echo Cthu"lhu\\\\\\` R\\\\\'ly$(echo eh wag\\\\\\`echo h\\\'nag\\\\\\`\'l\' fht)agn`' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 113 default' # Ph\'ng`echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn` - '12 113 back-quoted-argument' # `echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn` - '12 12 back-quoted-argument-delimiter' # ` - '13 16 builtin' # echo - '18 20 default' # lui - '22 112 default' # "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn - '22 25 double-quoted-argument' # "mg" - '26 112 back-quoted-argument-unclosed' # \`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn - '26 27 back-quoted-argument-delimiter' # \` - '28 31 builtin' # echo - '33 40 default' # lw\'nafh - '42 62 default' # \\\`echo Cthu"lhu\\\` - '42 62 back-quoted-argument' # \\\`echo Cthu"lhu\\\` - '42 45 back-quoted-argument-delimiter' # \\\` - '46 49 builtin' # echo - '51 58 default' # Cthu"lhu - '55 58 double-quoted-argument-unclosed' # "lhu - '59 62 back-quoted-argument-delimiter' # \\\` - '64 112 default' # R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn - '70 109 command-substitution-unquoted' # $(echo eh wag\\\`echo h\'nag\\\`'l' fht) - '70 71 command-substitution-delimiter-unquoted' # $( - '72 75 builtin' # echo - '77 78 default' # eh - '80 104 default' # wag\\\`echo h\'nag\\\`'l' - '83 101 back-quoted-argument' # \\\`echo h\'nag\\\` - '83 86 back-quoted-argument-delimiter' # \\\` - '87 90 builtin' # echo - '92 97 default' # h\'nag - '98 101 back-quoted-argument-delimiter' # \\\` - '102 104 single-quoted-argument' # 'l' - '106 108 default' # fht - '109 109 command-substitution-delimiter-unquoted' # ) - '113 113 unknown-token' # ` -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dirs_blacklist.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dirs_blacklist.zsh deleted file mode 100644 index 8cf04be..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dirs_blacklist.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -mkdir foo -touch foo/bar -BUFFER=": foo/bar $PWD/foo foo/b" -X_ZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo $PWD/bar) - -expected_region_highlight=( - '1 1 builtin' # : - '3 9 default' # foo/bar - "11 $(( 14 + $#PWD )) default" # $PWD/foo - "$(( 16 + $#PWD )) $(( 20 + $#PWD )) default" # foo/b -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-dollar.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-dollar.zsh deleted file mode 100644 index e3f387c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-dollar.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "$$ $$foo"' - -expected_region_highlight=( - '1 1 builtin' # : - '3 12 default' # "$$ $$foo" - '3 12 double-quoted-argument' # "$$ $$foo" - '4 5 dollar-double-quoted-argument' # $$ - '7 8 dollar-double-quoted-argument' # $$ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-noise.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-noise.zsh deleted file mode 100644 index 9bb11bd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-noise.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "$- $# $* $@ $?"' - -expected_region_highlight=( - '1 1 builtin' # : - '3 18 default' # "$- $# $* $@ $?" - '3 18 double-quoted-argument' # "$- $# $* $@ $?" - '4 5 dollar-double-quoted-argument' # $- - '7 8 dollar-double-quoted-argument' # $# - '10 11 dollar-double-quoted-argument' # $* - '13 14 dollar-double-quoted-argument' # $@ - '16 17 dollar-double-quoted-argument' # $? -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-paren.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-paren.zsh deleted file mode 100644 index 2bbcef1..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-paren.zsh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "$(:)" "foo$(:)bar' - -expected_region_highlight=( - '1 1 builtin' # : - '3 8 default' # "$(:)" - '3 3 double-quoted-argument' # "$(:)" - '8 8 double-quoted-argument' # "$(:)" - '4 7 command-substitution-quoted' # $(:) - '4 5 command-substitution-delimiter-quoted' # $( - '6 6 builtin' # : - '7 7 command-substitution-delimiter-quoted' # ) - '10 20 default' # "foo$(:)bar - '10 13 double-quoted-argument-unclosed' # "foo - '18 20 double-quoted-argument-unclosed' # bar - '14 17 command-substitution-quoted' # $(:) - '14 15 command-substitution-delimiter-quoted' # $( - '16 16 builtin' # : - '17 17 command-substitution-delimiter-quoted' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted.zsh deleted file mode 100644 index 081a365..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=": \$'*' 'foo'" - -expected_region_highlight=( - "1 1 builtin" # : - "3 6 default" # $'*' - "3 6 dollar-quoted-argument" # $'*' - not a glob - "8 12 default" # 'foo' - "8 12 single-quoted-argument" # 'foo' -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted2.zsh deleted file mode 100644 index ed7428b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'" - -expected_region_highlight=( - "1 1 builtin" # : - "3 29 default" # $'foo\xbar\udeadbeef\uzzzz' - "3 29 dollar-quoted-argument" # $'foo\xbar\udeadbeef\uzzzz' - "8 11 back-dollar-quoted-argument" # \xba - "13 18 back-dollar-quoted-argument" # \dead - "23 24 unknown-token" # \u -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted3.zsh deleted file mode 100644 index 365f351..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/dollar-quoted3.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Similar to double-quoted2.zsh -# This test checks that the '1' gets highlighted correctly. Do not append to the BUFFER. -BUFFER=": \$'\xa1" - -expected_region_highlight=( - "1 1 builtin" # : - "3 8 default" # $'\xa1 - "3 8 dollar-quoted-argument-unclosed" # $'\xa1 - "5 8 back-dollar-quoted-argument" # \xa1 -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-hyphen-option.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-hyphen-option.zsh deleted file mode 100644 index e5cacd3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-hyphen-option.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='hello --world' - -expected_region_highlight=( - "1 5 unknown-token" # hello - "7 13 double-hyphen-option" # --world -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted.zsh deleted file mode 100644 index 0a4336c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "foo$bar:\`:\":\$:' -BUFFER+=\\\\:\" - -expected_region_highlight=( - "1 1 builtin" # : - "3 24 default" # "foo$bar:\`:\":\$:\\:" - "3 24 double-quoted-argument" # "foo$bar:\`:\":\$:\\:" - "7 10 dollar-double-quoted-argument" # $bar - "12 13 back-double-quoted-argument" # \` - "15 16 back-double-quoted-argument" # \$ - "18 19 back-double-quoted-argument" # \" - "21 22 back-double-quoted-argument" # \\ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted2.zsh deleted file mode 100644 index c400e54..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Similar to dollar-quoted3.zsh -# This test checks that the 'r' gets highlighted correctly. Do not append to the BUFFER. -BUFFER=': "foo$bar' - -expected_region_highlight=( - "1 1 builtin" # : - "3 10 default" # "foo$bar - "3 10 double-quoted-argument-unclosed" # "foo$bar - "7 10 dollar-double-quoted-argument" # $bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted3.zsh deleted file mode 100644 index 86e3ced..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted3.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "$" "$42foo"' -BUFFER+=\ \"\\\'\\x\" - -expected_region_highlight=( - "1 1 builtin" # : - "3 5 default" # "$" - "3 5 double-quoted-argument" # "$" - "7 14 default" # "$42foo" - "7 14 double-quoted-argument" # "$42foo" - "8 10 dollar-double-quoted-argument" # $42 - "16 21 default" # "\'\x" - "16 21 double-quoted-argument" # "\'\x" - \' and \x are not escape sequences -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted4.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted4.zsh deleted file mode 100644 index c59d5d8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/double-quoted4.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': "${foo}bar"' - -expected_region_highlight=( - "1 1 builtin" # : - "3 13 default" # "${foo}bar" - "3 13 double-quoted-argument" # "${foo}bar" - "4 9 dollar-double-quoted-argument" # ${foo} -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command.zsh deleted file mode 100644 index 5831464..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo; ;' - -expected_region_highlight=( - "1 4 builtin" # echo - "5 5 commandseparator" # ; - "7 7 unknown-token" # ; -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command2.zsh deleted file mode 100644 index dcb4e6f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-command2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Same test data and expectations as empty-command.zsh; the only difference is: -touch ';' - -BUFFER='echo; ;' - -expected_region_highlight=( - "1 4 builtin" # echo - "5 5 commandseparator" # ; - "7 7 unknown-token" # ; -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-line.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-line.zsh deleted file mode 100644 index a4d6685..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/empty-line.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'\\\n; ls' - -expected_region_highlight=( - '3 3 unknown-token' # ; - '5 6 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/escaped-single-quote.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/escaped-single-quote.zsh deleted file mode 100644 index 4b2fe4b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/escaped-single-quote.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': \'foo\'\\\'\'bar\'' # <<<: 'foo'\''bar'>>> - -expected_region_highlight=( - '1 1 builtin' # : - '3 14 default' # 'foo'\''bar' - '3 7 single-quoted-argument' # 'foo' - '10 14 single-quoted-argument' # 'bar' -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/exec-redirection1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/exec-redirection1.zsh deleted file mode 100644 index 78a0c62..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/exec-redirection1.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='exec {foo}>&/tmp ls' - -expected_region_highlight=( - "1 4 precommand" # exec - "6 10 named-fd" # {foo} - "11 12 redirection" # >& - "13 16 path" # /tmp - "18 19 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-altsyntax.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-altsyntax.zsh deleted file mode 100644 index 0f9a833..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-altsyntax.zsh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Define named and anonymous function using the alternative syntax -BUFFER=$'function f { pwd }; function { pwd }' - -expected_region_highlight=( - '1 8 reserved-word' # function - '10 10 default' # f - '12 12 reserved-word "issue #237"' # { - '14 16 command "issue #237"' # pwd - '18 18 reserved-word "issue #237"' # } - '19 19 commandseparator' # ; - '21 28 reserved-word' # function - '30 30 reserved-word "issue #237"' # { - '32 34 command "issue #237"' # pwd - '36 36 reserved-word "issue #237"' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named1.zsh deleted file mode 100644 index c962ddb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named1.zsh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='f() pwd; f() { balanced braces }' - -expected_region_highlight=( - '1 1 TBD "issue #223"' # f - '2 3 reserved-word' # () - '5 7 builtin' # pwd - '8 8 commandseparator' # ; - '10 10 TBD "issue #223"' # f - '11 12 reserved-word' # () - '14 14 reserved-word' # { - '16 23 unknown-token' # balanced - '25 30 default' # braces - '32 32 reserved-word' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named2.zsh deleted file mode 100644 index e12fce6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function-named2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='f g h () pwd' - -expected_region_highlight=( - '1 1 TBD "issue #223"' # f - '3 3 TBD "issue #223"' # g - '5 5 TBD "issue #223"' # h - '7 8 reserved-word' # () - '10 12 builtin' # pwd -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function.zsh deleted file mode 100644 index b1be853..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/function.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -cd() { - builtin cd "$@" -} -ls() { - command ls "$@" -} -BUFFER='cd;ls' - -expected_region_highlight=( - "1 2 function" # cd - "3 3 commandseparator" # ; - "4 5 function" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/glob.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/glob.zsh deleted file mode 100644 index 2ff1022..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/glob.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': foo* bar? *baz qux\?' - -expected_region_highlight=( - "1 1 builtin" # : - "3 6 default" # foo* - "6 6 globbing" # * - "8 11 default" # bar? - "11 11 globbing" # ? - "13 16 default" # *baz - "13 13 globbing" # * - "18 22 default" # qux\? -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/globs-with-quoting.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/globs-with-quoting.zsh deleted file mode 100644 index d7d74bc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/globs-with-quoting.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': "foo"*\'bar\'?"baz?"<17-29>"qu*ux"' - -expected_region_highlight=( - '1 1 builtin' # : - '3 34 default' # "foo"*'bar'?"baz?"<17-29>"qu*ux" - '3 7 double-quoted-argument' # "foo" - '8 8 globbing' # * - '9 13 single-quoted-argument' # 'bar' - '14 14 globbing' # ? - '15 20 double-quoted-argument' # "baz?" - '21 27 globbing' # <17-29> - '28 34 double-quoted-argument' # "qu*ux" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/hashed-command.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/hashed-command.zsh deleted file mode 100644 index 2983ef8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/hashed-command.zsh +++ /dev/null @@ -1,35 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -hash zsh_syntax_highlighting_hash=/doesnotexist -BUFFER='zsh_syntax_highlighting_hash' - -expected_region_highlight=( - "1 28 hashed-command 'zsh/parameter cannot distinguish between hashed and command'" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-escaped.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-escaped.zsh deleted file mode 100644 index 7807cc0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-escaped.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo "Hello\!"' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 14 default' # "Hello\!" - '6 14 double-quoted-argument' # "Hello\!" - '12 13 back-double-quoted-argument' # \! -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-no.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-no.zsh deleted file mode 100644 index e082dbc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-no.zsh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo "foo != bar !{baz}"' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 24 default' # "foo != bar !{baz}" - '6 24 double-quoted-argument' # "foo != bar !{baz}" - no history expansions -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-unescaped.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-unescaped.zsh deleted file mode 100644 index cfe6a11..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-unescaped.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo "Hello!"' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 13 default' # "Hello!" - '6 13 double-quoted-argument' # "Hello!" - '12 12 history-expansion' # ! -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-yes.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-yes.zsh deleted file mode 100644 index e963c3b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-double-quoted-yes.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='echo "foo !bar"' - -expected_region_highlight=( - '1 4 builtin' # echo - '6 15 default' # "foo !bar" - '6 15 double-quoted-argument' # "foo !bar" - '11 11 history-expansion' # ! -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion.zsh deleted file mode 100644 index 05e20fc..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='!foo bar !baz ! ; !' - -expected_region_highlight=( - "1 4 history-expansion" # !foo - "6 8 default" # bar - "10 13 history-expansion" # !baz - "15 15 default" # ! - "17 17 commandseparator" # ; - "19 19 reserved-word" # ! -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion2.zsh deleted file mode 100644 index 386d0df..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/history-expansion2.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='^foo^bar' - -expected_region_highlight=( - "1 8 history-expansion" # ^foo^bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/inheritance.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/inheritance.zsh deleted file mode 100644 index e851ca3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/inheritance.zsh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -_zsh_highlight_add_highlight() -{ - region_highlight+=("$1 $2 ${(j.,.)argv[3,-1]}") -} - -BUFFER='type' - -expected_region_highlight=( - '1 4 builtin,arg0' # type -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-array-assignment1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-array-assignment1.zsh deleted file mode 100644 index 3734c7a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-array-assignment1.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'foo=(\nbar) env' - -expected_region_highlight=( - '1 5 assign' # foo=( - '6 6 commandseparator' # \n - '7 9 default' # bar - '10 10 assign' # ) - '12 14 command' # env -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string.zsh deleted file mode 100644 index 0127b4b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -PREBUFFER=$'echo "foo1\n' -BUFFER='foo2" ./' - -expected_region_highlight=( - "1 5 default" # 'foo2"' - "1 5 double-quoted-argument" # 'foo2"' - "7 8 path" # './' -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string2.zsh deleted file mode 100644 index 3a90dce..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiline-string2.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'echo \'foo1\n' - -expected_region_highlight=( - "1 4 builtin" # echo - "6 11 default" # 'foo1\n - "6 11 single-quoted-argument-unclosed" # 'foo1\n -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-quotes.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-quotes.zsh deleted file mode 100644 index dabf70c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-quotes.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': \'foo\'bar"baz$quux/foo\\\\bar"baz$\'quux\\nfoo\\001bar\'baz' - -expected_region_highlight=( - "1 1 builtin" # : - "3 54 default" # 'foo'bar"baz$quux/foo\\bar"baz$'quux\nfoo\001'baz - "3 7 single-quoted-argument" # 'foo' - "11 29 double-quoted-argument" #"baz - "15 19 dollar-double-quoted-argument" # $quux - "24 25 back-double-quoted-argument" # \\ - "33 51 dollar-quoted-argument" # $'quux\nfoo\001bar' - "39 40 back-dollar-quoted-argument" # \n - "44 47 back-dollar-quoted-argument" # \001 -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-redirections.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-redirections.zsh deleted file mode 100644 index 778e712..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/multiple-redirections.zsh +++ /dev/null @@ -1,46 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='ps aux | grep java | sort | uniq | tail | head' - -expected_region_highlight=( - "1 2 command" # ps - "4 6 default" # aux - "8 8 commandseparator" # | - "10 13 command" # grep - "15 18 default" # java - "20 20 commandseparator" # | - "22 25 command" # sort - "27 27 commandseparator" # | - "29 32 command" # uniq - "34 34 commandseparator" # | - "36 39 command" # tail - "41 41 commandseparator" # | - "43 46 command" # head -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-alias.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-alias.zsh deleted file mode 100644 index 5676b5a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-alias.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias x=command -BUFFER='x ls' - -expected_region_highlight=( - "1 1 alias" # x - "1 1 precommand" # x (command) - "3 4 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-always.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-always.zsh deleted file mode 100644 index 481722f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob-always.zsh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'{ noglob echo * } always { echo * }' - -expected_region_highlight=( - '1 1 reserved-word' # { - '3 8 precommand' # noglob - '10 13 builtin' # echo - '15 15 default' # * - '17 17 reserved-word' # } - '19 24 reserved-word' # always - '26 26 reserved-word' # { - '28 31 builtin' # echo - '33 33 globbing "issue #577"' # * - '35 35 reserved-word' # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob1.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob1.zsh deleted file mode 100644 index 1857db0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob1.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=':; noglob echo *' - -expected_region_highlight=( - "1 1 builtin" # : - "2 2 commandseparator" # ; - "4 9 precommand" # noglob - "11 14 builtin" # echo - "16 16 default" # * -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob2.zsh deleted file mode 100644 index 3b4fcd7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob2.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='noglob echo *; echo *' - -expected_region_highlight=( - "1 6 precommand" # noglob - "8 11 builtin" # echo - "13 13 default" # * - "14 14 commandseparator" # ; - "16 19 builtin" # echo - "21 21 default" # * - "21 21 globbing" # * -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob3.zsh deleted file mode 100644 index c404aaa..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob3.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -touch \* - -BUFFER='noglob echo *' - -expected_region_highlight=( - "1 6 precommand" # noglob - "8 11 builtin" # echo - "13 13 path" # * -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob4.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob4.zsh deleted file mode 100644 index cc7065f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/noglob4.zsh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$'noglob cat <(print -r -- *)' - -expected_region_highlight=( - '1 6 precommand' # noglob - '8 10 command' # cat - '12 27 default' # <(print -r -- *) - '12 27 process-substitution' # <(print -r -- *) - '12 13 process-substitution-delimiter' # <( - '14 18 builtin' # print - '20 21 single-hyphen-option' # -r - '23 24 double-hyphen-option' # -- - '26 26 default' # * - '26 26 globbing' # * - '27 27 process-substitution-delimiter' # ) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/number_range-glob.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/number_range-glob.zsh deleted file mode 100644 index c840951..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/number_range-glob.zsh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='print <-> x<->y ' - -expected_region_highlight=( - '1 5 builtin' # print - '7 9 default' # <-> - '7 9 globbing' # <-> - '11 15 default' # x<->y - '12 14 globbing' # <-> - '17 17 redirection' # < - '18 23 default' # foo2-3 (the filename) - '24 24 redirection' # > -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/off-by-one.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/off-by-one.zsh deleted file mode 100644 index 7d6961a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/off-by-one.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -alias a=: -f() {} - -BUFFER='a;f;' - -expected_region_highlight=( - "1 1 alias" # a - "1 1 builtin" # a (:) - "2 2 commandseparator" # ; - "3 3 function" # f - "4 4 commandseparator" # ; -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-path_dirs.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-path_dirs.zsh deleted file mode 100644 index 0300c7e..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-path_dirs.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -if [[ $OSTYPE == msys ]]; then - skip_test='Cannot chmod +x in msys2' -else - setopt PATH_DIRS - mkdir -p foo/bar - touch foo/bar/testing-issue-228 - chmod +x foo/bar/testing-issue-228 - path+=( "$PWD"/foo ) - - BUFFER='bar/testing-issue-228' - - expected_region_highlight=( - "1 21 command" # bar/testing-issue-228 - ) -fi diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-with-quotes.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-with-quotes.zsh deleted file mode 100644 index 6286f03..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/option-with-quotes.zsh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': --user="phy1729"' - -expected_region_highlight=( - '1 1 builtin' # : - '3 18 double-hyphen-option' # --user="phy1729" - '10 18 double-quoted-argument' # "phy1729" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-after-dollar.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-after-dollar.zsh deleted file mode 100644 index 773c183..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-after-dollar.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -touch '$foo' -BUFFER=': $foo \$foo' - -expected_region_highlight=( - '1 1 builtin' # : - '3 6 default' # $foo - if we add a "unquoted parameter expansion" style then this expectation should change - '8 12 path' # \$foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-before-globbing.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-before-globbing.zsh deleted file mode 100644 index 8456b18..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/order-path-before-globbing.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -touch '*' -BUFFER=': * \*' - -expected_region_highlight=( - '1 1 builtin' # : - '3 3 default' # * - '3 3 globbing' # * - '5 6 path' # \* -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/parameter-star.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/parameter-star.zsh deleted file mode 100644 index 2311be0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/parameter-star.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='() { : $* }' - -# This tests that $* isn't highlighted as a glob. -# If we ever add a "unquoted parameter" style, the expectation may change. -expected_region_highlight=( - "1 2 reserved-word" # () - "4 4 reserved-word" # { - "6 6 builtin" # : - "8 9 default" # $* - "11 11 reserved-word" # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-broken-symlink.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-broken-symlink.zsh deleted file mode 100644 index baebee3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-broken-symlink.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -if [[ $OSTYPE == msys ]]; then - skip_test='Cannot create symlinks in msys2' -else - ln -s /nonexistent broken-symlink - BUFFER=': broken-symlink' - CURSOR=5 # to make path_prefix ineligible - - expected_region_highlight=( - "1 1 builtin" # : - "3 16 path" # broken-symlink - ) -fi diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word.zsh deleted file mode 100644 index 99055da..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word.zsh +++ /dev/null @@ -1,45 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -if [[ $OSTYPE == msys ]]; then - skip_test='Cannot chmod +x in msys2' # cargo culted from option-path_dirs.zsh -else - mkdir kappa - touch kappa.exe - chmod +x kappa.exe - cd kappa - - BUFFER='$PWD.exe; ${PWD}.exe' - - expected_region_highlight=( - "1 8 unknown-token" # $PWD.exe - not eval'd; issue #328 - "9 9 commandseparator" # ; - "11 20 unknown-token" # ${PWD}.exe - ) -fi diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word2.zsh deleted file mode 100644 index f404d5d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word2.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -local lambda="''" -touch \$lambda -BUFFER=': \$lambda' - -expected_region_highlight=( - "1 1 builtin" # : - "3 10 path" # \$lambda -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word3.zsh deleted file mode 100644 index 6921cba..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word3.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# «/usr» at this point would be highlighted as path_prefix; so should -# a parameter that expands to an equivalent string be highlighted. -# -# More complicated parameter substitutions aren't eval'd; issue #328. -BUFFER='$PWD; ${PWD}' - -expected_region_highlight=( - "1 4 path" # $PWD - "5 5 commandseparator" # ; - "7 12 path" # ${PWD} -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word4.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word4.zsh deleted file mode 100644 index e29182c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-dollared-word4.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# This tests for a regression during development of issue #328: an interim version -# of that branch failed that test with "Bail out! output on stderr". -BUFFER='${' - -expected_region_highlight=( - "1 2 unknown-token" # ${ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators.zsh deleted file mode 100644 index 52749b7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators.zsh +++ /dev/null @@ -1,53 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# ZSH_HIGHLIGHT_STYLES is empty in tests. The path-separator code however compares its values. -# Make sure the relevant ones are set to something. -ZSH_HIGHLIGHT_STYLES[path_pathseparator]=set -ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]=set - -mkdir A -touch A/mu -BUFFER='ls /bin/ / A/mu A/m' - -expected_region_highlight=( - "1 2 command" # ls - "4 8 path" # /bin/ - "4 4 path_pathseparator" # / - "8 8 path_pathseparator" # / - - "10 10 path" # / - "10 10 path_pathseparator" # / - - "12 15 path" # A/mu - "13 13 path_pathseparator" # / - - "17 19 path_prefix" # A/m - "18 18 path_prefix_pathseparator" # / -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators2.zsh deleted file mode 100644 index bc885a0..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-separators2.zsh +++ /dev/null @@ -1,40 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# ZSH_HIGHLIGHT_STYLES is empty in tests. The path-separator code however compares its values. -# For this test, make sure both these styles are set and identical: -ZSH_HIGHLIGHT_STYLES[path]=value -ZSH_HIGHLIGHT_STYLES[path_pathseparator]=value - -BUFFER='ls /bin/' - -expected_region_highlight=( - "1 2 command" # ls - "4 8 path" # /bin/ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-space.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-space.zsh deleted file mode 100644 index 87cc22f..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-space.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -mkdir A -touch "A/mu with spaces" -BUFFER='ls A/mu\ with\ spaces' - -expected_region_highlight=( - "1 2 command" # ls - "4 21 path" # A/mu\ with\ spaces -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home.zsh deleted file mode 100644 index 8b1c680..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -HOME="." -BUFFER='ls ~' - -expected_region_highlight=( - "1 2 command" # ls - "4 4 path" # ~ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home2.zsh deleted file mode 100644 index 3f7b820..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home2.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -HOME="/nonexistent" -BUFFER='ls ~' - -expected_region_highlight=( - "1 2 command" # ls - "4 4 default" # ~ -) - diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home3.zsh deleted file mode 100644 index 5c076e8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-home3.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -HOME="." -BUFFER='ls \~' - -expected_region_highlight=( - "1 2 command" # ls - "4 5 default" # \~ -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-named.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-named.zsh deleted file mode 100644 index 335b3fd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path-tilde-named.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -mkdir mydir -touch mydir/path-tilde-named.test -hash -d D=mydir - -BUFFER='ls ~D/path-tilde-named.test' - -expected_region_highlight=( - "1 2 command" # ls - "4 27 path" # ~D/path-tilde-named.test -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path.zsh deleted file mode 100644 index d387eff..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -mkdir A -touch A/mu -BUFFER='ls A/mu' - -expected_region_highlight=( - "1 2 command" # ls - "4 7 path" # A/mu -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix.zsh deleted file mode 100644 index 3303bfb..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Assumes that '/bin/sh' exists and '/bin/s' does not exist. -# Related to path_prefix2.zsh - -BUFFER='ls /bin/s' - -expected_region_highlight=( - "1 2 command" # ls - "4 9 path_prefix" # /bin/s -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix2.zsh deleted file mode 100644 index 4f40f7e..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix2.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Assumes that '/bin/sh' exists and '/bin/s' does not exist. -# Related to path_prefix.zsh - -BUFFER='ls /bin/s' -WIDGET=zle-line-finish - -expected_region_highlight=( - "1 2 command" # ls - "4 9 default" # /bin/s -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix3.zsh deleted file mode 100644 index f4a0189..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/path_prefix3.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# Assumes that '/bin/sh' exists and '/bin/s' does not exist. -# Related to path_prefix.zsh - -PREBUFFER='ls \' -BUFFER='/bin/s' - -expected_region_highlight=( - '1 6 path_prefix' # /bin/s -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand-unknown-option.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand-unknown-option.zsh deleted file mode 100644 index 1fba1b9..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand-unknown-option.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -BUFFER='sudo -ux ls; sudo -x ls' - -expected_region_highlight=( - '1 4 precommand' # sudo - '6 8 single-hyphen-option' # -ux - '10 11 command' # ls - '12 12 commandseparator' # ; - '14 17 precommand' # sudo - '19 20 unknown-token' # -x - '22 23 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand.zsh deleted file mode 100644 index a03b331..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': command zzzzzz' - -expected_region_highlight=( - "1 1 builtin" # : - "3 9 default" # not precommand - "11 16 default" # not unknown-token (since 'zzzzzz' is not a command) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand2.zsh deleted file mode 100644 index 75dceab..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand2.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='command -v ls' - -expected_region_highlight=( - "1 7 precommand" # command - "9 10 single-hyphen-option" # -v - "12 13 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand3.zsh deleted file mode 100644 index f8b0c78..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand3.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='nice -n10 ls; nice -n 10 ls' - -expected_region_highlight=( - "1 4 precommand" # nice - "6 9 single-hyphen-option" # -n10 - "11 12 command" # ls - "13 13 commandseparator" # ; - "15 18 precommand" # nice - "20 21 single-hyphen-option" # -n - "23 24 default" # 10 - "26 27 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand4.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand4.zsh deleted file mode 100644 index b9e6119..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/precommand4.zsh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -doas(){} -BUFFER=$'doas -nu phy1729 ls' - -expected_region_highlight=( - '1 4 precommand' # doas - '6 8 single-hyphen-option' # -nu - '10 16 default' # phy1729 - '18 19 command' # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/prefix-redirection.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/prefix-redirection.zsh deleted file mode 100644 index a0f0ed5..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/prefix-redirection.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='>/tmp >/tmp command echo >/tmp foo' - -expected_region_highlight=( - "1 1 redirection" # > - "2 5 path" # /tmp - "7 7 redirection" # > - "8 11 path" # /tmp - "13 19 precommand" # command - "21 24 builtin" # echo - "26 26 redirection" # > - "27 30 path" # /tmp - "32 34 default" # foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh deleted file mode 100644 index f8dbd6b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=$': =(>&! - "17 19 default" # bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection2.zsh deleted file mode 100644 index d44c8e7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection2.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='ls >(wc) | nl' - -expected_region_highlight=( - "1 2 command" # ls - "4 8 default" # >(wc) - "4 8 process-substitution" # >(wc) - "4 5 process-substitution-delimiter" # >( - "6 7 command" # wc - "8 8 process-substitution-delimiter" # ) - "10 10 commandseparator" # | - "12 13 command" # nl -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection3.zsh deleted file mode 100644 index bf062cf..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/redirection3.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER=': >>>; : <>\<<<> - "5 5 unknown-token" # > - "6 6 commandseparator" # ; - "8 8 builtin" # : - "10 11 redirection" # <> - "12 13 default" # \< - "14 16 redirection" # <<< - "17 19 default" # EOF -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/reserved-word.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/reserved-word.zsh deleted file mode 100644 index aca3796..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/reserved-word.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='repeat "1" do done' - -expected_region_highlight=( - "1 6 reserved-word" # repeat - "8 10 default" # "1" - "8 10 double-quoted-argument" # "1" - "12 13 reserved-word" # do - "15 18 reserved-word" # done -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-command.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-command.zsh deleted file mode 100644 index 8bb41fd..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-command.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='ls' - -expected_region_highlight=( - "1 2 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-redirection.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-redirection.zsh deleted file mode 100644 index e8c25e5..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/simple-redirection.zsh +++ /dev/null @@ -1,38 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='ps aux | grep java' - -expected_region_highlight=( - "1 2 command" # ps - "4 6 default" # aux - "8 8 commandseparator" # | - "10 13 command" # grep - "15 18 default" # java -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/subshell.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/subshell.zsh deleted file mode 100644 index c068013..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/subshell.zsh +++ /dev/null @@ -1,51 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }' - -expected_region_highlight=( - "1 3 command" # tar - "5 6 default" # cf - "8 8 single-hyphen-option" # - - "10 10 default" # * - "10 10 globbing" # * - "12 12 commandseparator" # | - "14 14 reserved-word" # ( - "15 16 builtin" # cd - "18 24 default" # /target - "25 25 commandseparator" # ; - "27 29 command" # tar - "31 33 default" # xfp - "35 35 single-hyphen-option" # - - "36 36 reserved-word" # ) - "38 38 commandseparator" # | - "40 40 reserved-word" # { - "42 44 command" # cat - "46 46 reserved-word" # } -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-command.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-command.zsh deleted file mode 100644 index 941349a..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-command.zsh +++ /dev/null @@ -1,54 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -# Tests three codepaths: -# * -i (no argument) -# * -C3 (pasted argument) -# * -u otheruser (non-pasted argument) -BUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ; sudo notacommand' - -expected_region_highlight=( - "1 4 precommand" # sudo - "6 8 single-hyphen-option" # -C3 - "10 11 single-hyphen-option" # -u - "13 21 default" # otheruser - "23 24 single-hyphen-option" # -i - "26 27 command" # ls - "29 29 path" # / - "30 30 commandseparator" # ; - "32 35 precommand" # sudo - "37 37 unknown-token" # ;, error because empty command - "39 42 precommand" # sudo - "44 45 single-hyphen-option" # -u - "47 47 unknown-token" # ;, error because incomplete command - "49 52 precommand" # sudo - "54 64 unknown-token" # notacommand - doesn't falls back to "not a command word" codepath -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-comment.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-comment.zsh deleted file mode 100644 index 74cd905..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-comment.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -setopt interactive_comments -BUFFER='sudo -u # comment' - -expected_region_highlight=( - "1 4 precommand" # sudo - "6 7 single-hyphen-option" # -u - "9 17 unknown-token" # "# comment" - error because argument missed -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection.zsh deleted file mode 100644 index c675d7d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection.zsh +++ /dev/null @@ -1,48 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -BUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls' - -expected_region_highlight=( - "1 4 precommand" # sudo - "6 7 single-hyphen-option" # -u - "9 9 redirection" # > - "10 13 path" # /tmp - "15 23 default" # otheruser - "25 26 command" # ls - "27 27 commandseparator" # ; - "29 32 precommand" # sudo - "34 35 command" # ls - "36 36 commandseparator" # ; - "38 41 precommand" # sudo - "43 44 single-hyphen-option" # -i - "46 47 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection2.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection2.zsh deleted file mode 100644 index 23ada53..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection2.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -BUFFER='sudo >/tmp -u otheruser ls' - -expected_region_highlight=( - "1 4 precommand" # sudo - "6 6 redirection" # > - "7 10 path" # /tmp - "12 13 single-hyphen-option" # -u - "15 23 default" # otheruser - "25 26 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection3.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection3.zsh deleted file mode 100644 index 80e55b5..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/sudo-redirection3.zsh +++ /dev/null @@ -1,41 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -sudo(){} - -BUFFER='sudo 2>./. -u otheruser ls' - -expected_region_highlight=( - "1 4 precommand" # sudo - "6 7 redirection" # 2> - "8 10 path" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh - "12 13 single-hyphen-option" # -u - "15 23 default" # otheruser - "25 26 command" # ls -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/tilde-command-word.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/tilde-command-word.zsh deleted file mode 100644 index 67c996c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/tilde-command-word.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -hash -d D=/usr/bin - -BUFFER='~D/env foo' - -expected_region_highlight=( - "1 6 command" # ~D/env [= /usr/bin/env - "8 10 default" # foo -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unbackslash.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unbackslash.zsh deleted file mode 100644 index c8dfbd4..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unbackslash.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='\sh' - -expected_region_highlight=( - "1 3 command" # \sh (runs 'sh', bypassing aliases) -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unknown-command.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unknown-command.zsh deleted file mode 100644 index e71faec..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/unknown-command.zsh +++ /dev/null @@ -1,34 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='azertyuiop' - -expected_region_highlight=( - "1 10 unknown-token" # azertyuiop -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vanilla-newline.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vanilla-newline.zsh deleted file mode 100644 index bd60ad4..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vanilla-newline.zsh +++ /dev/null @@ -1,39 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -PREBUFFER=$'echo foo; echo bar\n\n\n' -BUFFER=' echo baz; echo qux' - -expected_region_highlight=( - "2 5 builtin" # echo - "7 9 default" # baz - "10 10 commandseparator" # semicolon - "12 15 builtin" # echo - "17 19 default" # qux -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vi-linewise-mode.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vi-linewise-mode.zsh deleted file mode 100644 index 7003c49..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/main/test-data/vi-linewise-mode.zsh +++ /dev/null @@ -1,43 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# See issue #267 for the magic numbers -BUFFER=$'foo foo\nbar bar' -REGION_ACTIVE=2 -CURSOR=4 -MARK=12 - -expected_region_highlight=( - "1 3 unknown-token" # foo - "5 7 default" # foo - "8 8 commandseparator" # \n - "9 11 unknown-token" # bar - "13 15 default" # bar - "1 15 standout" # foo foo\nbar bar -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/README.md deleted file mode 120000 index 5ff00e6..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/pattern.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/pattern-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/pattern-highlighter.zsh deleted file mode 100644 index 054eff7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/pattern-highlighter.zsh +++ /dev/null @@ -1,60 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# List of keyword and color pairs. -typeset -gA ZSH_HIGHLIGHT_PATTERNS - -# Whether the pattern highlighter should be called or not. -_zsh_highlight_highlighter_pattern_predicate() -{ - _zsh_highlight_buffer_modified -} - -# Pattern syntax highlighting function. -_zsh_highlight_highlighter_pattern_paint() -{ - setopt localoptions extendedglob - local pattern - for pattern in ${(k)ZSH_HIGHLIGHT_PATTERNS}; do - _zsh_highlight_pattern_highlighter_loop "$BUFFER" "$pattern" - done -} - -_zsh_highlight_pattern_highlighter_loop() -{ - # This does *not* do its job syntactically, sorry. - local buf="$1" pat="$2" - local -a match mbegin mend - local MATCH; integer MBEGIN MEND - if [[ "$buf" == (#b)(*)(${~pat})* ]]; then - region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_PATTERNS[$pat]") - "$0" "$match[1]" "$pat"; return $? - fi -} diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/test-data/rm-rf.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/test-data/rm-rf.zsh deleted file mode 100644 index 2f76929..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/pattern/test-data/rm-rf.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') - -BUFFER='rm -rf /' - -expected_region_highlight=( - "1 8 fg=white,bold,bg=red" # rm -rf / -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/README.md deleted file mode 120000 index 9f2522d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/regexp.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/regexp-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/regexp-highlighter.zsh deleted file mode 100644 index 26f9da3..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/regexp-highlighter.zsh +++ /dev/null @@ -1,62 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# List of keyword and color pairs. -typeset -gA ZSH_HIGHLIGHT_REGEXP - -# Whether the pattern highlighter should be called or not. -_zsh_highlight_highlighter_regexp_predicate() -{ - _zsh_highlight_buffer_modified -} - -# Pattern syntax highlighting function. -_zsh_highlight_highlighter_regexp_paint() -{ - setopt localoptions extendedglob - local pattern - for pattern in ${(k)ZSH_HIGHLIGHT_REGEXP}; do - _zsh_highlight_regexp_highlighter_loop "$BUFFER" "$pattern" - done -} - -_zsh_highlight_regexp_highlighter_loop() -{ - local buf="$1" pat="$2" - integer OFFSET=0 - local MATCH; integer MBEGIN MEND - local -a match mbegin mend - while true; do - [[ "$buf" =~ "$pat" ]] || return; - region_highlight+=("$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat]") - buf="$buf[$(($MEND+1)),-1]" - OFFSET=$((MEND+OFFSET)); - done -} diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/complex.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/complex.zsh deleted file mode 100644 index 4e0089b..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/complex.zsh +++ /dev/null @@ -1,37 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -ZSH_HIGHLIGHT_REGEXP+=('[0-9\+\-]+' 'fg=white,bold,bg=red') - -BUFFER='echo 1+9-3 7+2' - -expected_region_highlight=( - "6 10 fg=white,bold,bg=red" - "12 14 fg=white,bold,bg=red" -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/subexpression.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/subexpression.zsh deleted file mode 100644 index 308cb41..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/subexpression.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2018 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -BUFFER='ls foo' -ZSH_HIGHLIGHT_REGEXP=('(^| )(ls|cd)($| )' 'fg=green') - -expected_region_highlight=( - '1 3 fg=green' # "ls " -) diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/word-boundary.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/word-boundary.zsh deleted file mode 100644 index 1f4f666..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/regexp/test-data/word-boundary.zsh +++ /dev/null @@ -1,42 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -if zmodload zsh/pcre 2>/dev/null; then - setopt RE_MATCH_PCRE - - ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' 'fg=white,bold,bg=red') - - BUFFER='sudo ls' - - expected_region_highlight=( - "1 4 fg=white,bold,bg=red" - ) -else - skip_test='Test requires zsh/pcre' -fi diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/root/README.md b/.zprezto/modules/syntax-highlighting/external/highlighters/root/README.md deleted file mode 120000 index ca6799d..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/root/README.md +++ /dev/null @@ -1 +0,0 @@ -../../docs/highlighters/root.md \ No newline at end of file diff --git a/.zprezto/modules/syntax-highlighting/external/highlighters/root/root-highlighter.zsh b/.zprezto/modules/syntax-highlighting/external/highlighters/root/root-highlighter.zsh deleted file mode 100644 index 3718c44..0000000 --- a/.zprezto/modules/syntax-highlighting/external/highlighters/root/root-highlighter.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Define default styles. -: ${ZSH_HIGHLIGHT_STYLES[root]:=standout} - -# Whether the root highlighter should be called or not. -_zsh_highlight_highlighter_root_predicate() -{ - _zsh_highlight_buffer_modified -} - -# root highlighting function. -_zsh_highlight_highlighter_root_paint() -{ - if (( EUID == 0 )) { _zsh_highlight_add_highlight 0 $#BUFFER root } -} diff --git a/.zprezto/modules/syntax-highlighting/external/images/after1-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/after1-smaller.png deleted file mode 100644 index 768294c..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after1-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/after1.png b/.zprezto/modules/syntax-highlighting/external/images/after1.png deleted file mode 100644 index ea378d3..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after1.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/after2-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/after2-smaller.png deleted file mode 100644 index 8b5b1f8..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after2-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/after2.png b/.zprezto/modules/syntax-highlighting/external/images/after2.png deleted file mode 100644 index ddcbfad..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after2.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/after3-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/after3-smaller.png deleted file mode 100644 index d6aaa7b..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after3-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/after3.png b/.zprezto/modules/syntax-highlighting/external/images/after3.png deleted file mode 100644 index 7a0af88..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/after3.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before1-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/before1-smaller.png deleted file mode 100644 index b29551e..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before1-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before1.png b/.zprezto/modules/syntax-highlighting/external/images/before1.png deleted file mode 100644 index 80c6f54..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before1.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before2-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/before2-smaller.png deleted file mode 100644 index 991a716..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before2-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before2.png b/.zprezto/modules/syntax-highlighting/external/images/before2.png deleted file mode 100644 index 48cfc32..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before2.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before3-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/before3-smaller.png deleted file mode 100644 index e525c6d..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before3-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/before3.png b/.zprezto/modules/syntax-highlighting/external/images/before3.png deleted file mode 100644 index 40c3601..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/before3.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/preview-smaller.png b/.zprezto/modules/syntax-highlighting/external/images/preview-smaller.png deleted file mode 100644 index 6fb84d1..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/preview-smaller.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/images/preview.png b/.zprezto/modules/syntax-highlighting/external/images/preview.png deleted file mode 100644 index 545cc51..0000000 Binary files a/.zprezto/modules/syntax-highlighting/external/images/preview.png and /dev/null differ diff --git a/.zprezto/modules/syntax-highlighting/external/release.md b/.zprezto/modules/syntax-highlighting/external/release.md deleted file mode 100644 index 55a70f5..0000000 --- a/.zprezto/modules/syntax-highlighting/external/release.md +++ /dev/null @@ -1,18 +0,0 @@ -# Release procedure (for developers): - -- For minor (A.B.0) releases: - - Check whether the release uses any not-yet-released zsh features -- Check open issues and outstanding pull requests -- Confirm `make test` passes - - check with multiple zsh versions -- Update changelog.md - `tig --abbrev=12 --abbrev-commit 0.4.1..upstream/master` -- Remove `-dev` suffix from `./.version`; - Commit that using `git commit -m "Tag version $(<.version)." .version`; - Tag it using `git tag -m "Tag version $(<.version)"`; - Increment `./.version` and restore the `-dev` suffix; - Commit that using `git commit -C b5c30ae52638e81a38fe5329081c5613d7bd6ca5 .version`. -- Push with `git push && git push --tags` -- Notify downstreams (OS packages) - - anitya should autodetect the tag -- Update /topic on IRC diff --git a/.zprezto/modules/syntax-highlighting/external/tests/README.md b/.zprezto/modules/syntax-highlighting/external/tests/README.md deleted file mode 100644 index 8487b3c..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/README.md +++ /dev/null @@ -1,93 +0,0 @@ -zsh-syntax-highlighting / tests -=============================== - -Utility scripts for testing zsh-syntax-highlighting highlighters. - -The tests harness expects the highlighter directory to contain a `test-data` -directory with test data files. -See the [main highlighter](../highlighters/main/test-data) for examples. - -Each test should define the string `$BUFFER` that is to be highlighted and the -array parameter `$expected_region_highlight`. -The value of that parameter is a list of strings of the form `"$i $j $style"`. -or `"$i $j $style $todo"`. -Each string specifies the highlighting that `$BUFFER[$i,$j]` should have; -that is, `$i` and `$j` specify a range, 1-indexed, inclusive of both endpoints. -`$style` is a key of `$ZSH_HIGHLIGHT_STYLES`. -If `$todo` exists, the test point is marked as TODO (the failure of that test -point will not fail the test), and `$todo` is used as the explanation. -If a test sets `$skip_test` to a non-empty string, the test will be skipped -with the provided string as the reason. -If a test sets `unsorted=1` the order of highlights in `$expected_region_highlight` -need not match the order in `$region_highlight`. - -**Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but -interprets the indexes differently. - -**Note**: Tests are run with `setopt NOUNSET WARN_CREATE_GLOBAL`, so any -variables the test creates must be declared local. - -**Isolation**: Each test is run in a separate subshell, so any variables, -aliases, functions, etc., it defines will be visible to the tested code (that -computes `$region_highlight`), but will not affect subsequent tests. The -current working directory of tests is set to a newly-created empty directory, -which is automatically cleaned up after the test exits. For example: - - setopt PATH_DIRS - mkdir -p foo/bar - touch foo/bar/testing-issue-228 - chmod +x foo/bar/testing-issue-228 - path+=( "$PWD"/foo ) - - BUFFER='bar/testing-issue-228' - - expected_region_highlight=( - "1 21 command" # bar/testing-issue-228 - ) - - -Writing new tests ------------------ - -An experimental tool is available to generate test files: - - zsh -f tests/generate.zsh 'ls -x' acme newfile - -This generates a `highlighters/acme/test-data/newfile.zsh` test file based on -the current highlighting of the given `$BUFFER` (in this case, `ls -x`). - -_This tool is experimental._ Its interface may change. In particular it may -grow ways to set `$PREBUFFER` to inject free-form code into the generated file. - - -Highlighting test ------------------ - -[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of -the highlighting. Usage: - - zsh test-highlighting.zsh - -All tests may be run with - - make test - -which will run all highlighting tests and report results in [TAP format][TAP]. -By default, the results of all tests will be printed; to show only "interesting" -results (tests that failed but were expected to succeed, or vice-versa), run -`make quiet-test` (or `make test QUIET=y`). - -[TAP]: http://testanything.org/ - - -Performance test ----------------- - -[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the -highlighting. Usage: - - zsh test-perfs.zsh - -All tests may be run with - - make perf diff --git a/.zprezto/modules/syntax-highlighting/external/tests/generate.zsh b/.zprezto/modules/syntax-highlighting/external/tests/generate.zsh deleted file mode 100755 index 64a1ede..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/generate.zsh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -emulate -LR zsh -setopt localoptions extendedglob - -# Argument parsing. -if (( $# != 3 )) || [[ $1 == -* ]]; then - print -r -- >&2 "$0: usage: $0 BUFFER HIGHLIGHTER BASENAME" - print -r -- >&2 "" - print -r -- >&2 "Generate highlighters/HIGHLIGHTER/test-data/BASENAME.zsh based on the" - print -r -- >&2 "current highlighting of BUFFER." - exit 1 -fi -buffer=$1 -ZSH_HIGHLIGHT_HIGHLIGHTERS=( $2 ) -fname=${0:A:h:h}/highlighters/$2/test-data/${3%.zsh}.zsh - -# Load the main script. -. ${0:A:h:h}/zsh-syntax-highlighting.zsh - -# Overwrite _zsh_highlight_add_highlight so we get the key itself instead of the style -_zsh_highlight_add_highlight() -{ - region_highlight+=("$1 $2 $3") -} - - -# Copyright block -year="`LC_ALL=C date +%Y`" -if ! read -q "?Set copyright year to $year? "; then - year="YYYY" -fi -exec >$fname -<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/" -# Assumes stdout is line-buffered -git add -- $fname - -# Buffer -print -n 'BUFFER=' -if [[ $buffer != (#s)[$'\t -~']#(#e) ]]; then - print -r -- ${(qqqq)buffer} -else - print -r -- ${(qq)buffer} -fi -echo "" - -# Expectations -print 'expected_region_highlight=(' -() { - local i - local PREBUFFER - local BUFFER - - PREBUFFER="" - BUFFER="$buffer" - region_highlight=() - # TODO: use run_test() from tests/test-highlighting.zsh (to get a tempdir) - _zsh_highlight - - for ((i=1; i<=${#region_highlight}; i++)); do - local -a highlight_zone; highlight_zone=( ${(z)region_highlight[$i]} ) - integer start=$highlight_zone[1] end=$highlight_zone[2] - if (( start < end )) # region_highlight ranges are half-open - then - (( --end )) # convert to closed range, like expected_region_highlight - (( ++start, ++end )) # region_highlight is 0-indexed; expected_region_highlight is 1-indexed - fi - printf " %s # %s\n" ${(qq):-"$start $end $highlight_zone[3]"} ${${(qqqq)BUFFER[start,end]}[3,-2]} - done -} -print ')' diff --git a/.zprezto/modules/syntax-highlighting/external/tests/tap-colorizer.zsh b/.zprezto/modules/syntax-highlighting/external/tests/tap-colorizer.zsh deleted file mode 100755 index f3dc84e..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/tap-colorizer.zsh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015, 2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# This is a stdin-to-stdout filter that takes TAP output (such as 'make test') -# on stdin and passes it, colorized, to stdout. - -emulate -LR zsh - -if [[ ! -t 1 ]] ; then - exec cat -fi - -while read -r line; -do - case $line in - # comment (filename header) or plan - (#* | <->..<->) - print -nP %F{blue} - ;; - # SKIP - (*# SKIP*) - print -nP %F{yellow} - ;; - # XPASS - (ok*# TODO*) - print -nP %F{red} - ;; - # XFAIL - (not ok*# TODO*) - print -nP %F{yellow} - ;; - # FAIL - (not ok*) - print -nP %F{red} - ;; - # PASS - (ok*) - print -nP %F{green} - ;; - esac - print -nr - "$line" - print -nP %f - echo "" # newline -done diff --git a/.zprezto/modules/syntax-highlighting/external/tests/tap-filter b/.zprezto/modules/syntax-highlighting/external/tests/tap-filter deleted file mode 100755 index 6587808..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/tap-filter +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env perl -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# vim: ft=perl sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# This is a stdin-to-stdout filter that takes TAP output (such as 'make test') -# on stdin and deletes lines pertaining to expected results. -# -# More specifically, if any of the test points in a test file either failed but -# was expected to pass, or passed but was expected to fail, then emit that test -# file's output; else, elide that test file's output. - -use v5.10.0; -use warnings; -use strict; - -undef $/; # slurp mode -print for - grep { /^ok.*# TODO/m or /^not ok(?!.*# TODO)/m } - split /^(?=#)/m, - ; diff --git a/.zprezto/modules/syntax-highlighting/external/tests/test-highlighting.zsh b/.zprezto/modules/syntax-highlighting/external/tests/test-highlighting.zsh deleted file mode 100755 index 812b1a7..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/test-highlighting.zsh +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -setopt NO_UNSET WARN_CREATE_GLOBAL - -# Check an highlighter was given as argument. -[[ -n "$1" ]] || { - echo >&2 "Bail out! You must provide the name of a valid highlighter as argument." - exit 2 -} - -# Check the highlighter is valid. -[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || { - echo >&2 "Bail out! Could not find highlighter ${(qq)1}." - exit 2 -} - -# Check the highlighter has test data. -[[ -d ${0:h:h}/highlighters/$1/test-data ]] || { - echo >&2 "Bail out! Highlighter ${(qq)1} has no test data." - exit 2 -} - -# Set up results_filter -local results_filter -if [[ ${QUIET-} == y ]]; then - if type -w perl >/dev/null; then - results_filter=${0:A:h}/tap-filter - else - echo >&2 "Bail out! quiet mode not supported: perl not found"; exit 2 - fi -else - results_filter=cat -fi -[[ -n $results_filter ]] || { echo >&2 "Bail out! BUG setting \$results_filter"; exit 2 } - -# Load the main script. -# While here, test that it doesn't eat aliases. -print > >($results_filter | ${0:A:h}/tap-colorizer.zsh) -r -- "# global (driver) tests" -print > >($results_filter | ${0:A:h}/tap-colorizer.zsh) -r -- "1..1" -alias -- +plus=plus -alias -- _other=other -original_alias_dash_L_output="$(alias -L)" -. ${0:h:h}/zsh-syntax-highlighting.zsh -if [[ $original_alias_dash_L_output == $(alias -L) ]]; then - print -r -- "ok 1 # 'alias -- +foo=bar' is preserved" -else - print -r -- "not ok 1 # 'alias -- +foo=bar' is preserved" - exit 1 -fi > >($results_filter | ${0:A:h}/tap-colorizer.zsh) - -# Overwrite _zsh_highlight_add_highlight so we get the key itself instead of the style -_zsh_highlight_add_highlight() -{ - region_highlight+=("$1 $2 $3") -} - -# Activate the highlighter. -ZSH_HIGHLIGHT_HIGHLIGHTERS=($1) - -# Runs a highlighting test -# $1: data file -run_test_internal() { - - local tests_tempdir="$1"; shift - local srcdir="$PWD" - builtin cd -q -- "$tests_tempdir" || { echo >&2 "Bail out! On ${(qq)1}: cd failed: $?"; return 1 } - - echo "# ${1:t:r}" - - # Load the data and prepare checking it. - local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET skip_test unsorted=0 - local -a expected_region_highlight region_highlight - . "$srcdir"/"$1" - - (( $#skip_test )) && { print -r -- "1..0 # SKIP $skip_test"; return; } - - # Check the data declares $PREBUFFER or $BUFFER. - [[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)1}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return 1; } - # Check the data declares $expected_region_highlight. - (( $+expected_region_highlight == 0 )) && { echo >&2 "Bail out! On ${(qq)1}: 'expected_region_highlight' is not declared."; return 1; } - - # Set sane defaults for ZLE variables - : ${CURSOR=$#BUFFER} ${PENDING=0} ${WIDGET=z-sy-h-test-harness-test-widget} - - # Process the data. - _zsh_highlight - - if (( unsorted )); then - region_highlight=("${(@n)region_highlight}") - expected_region_highlight=("${(@n)expected_region_highlight}") - fi - - echo "1..$(( $#expected_region_highlight + 1))" - local i - for ((i=1; i<=$#expected_region_highlight; i++)); do - local -a expected_highlight_zone; expected_highlight_zone=( ${(z)expected_region_highlight[i]} ) - integer exp_start=$expected_highlight_zone[1] exp_end=$expected_highlight_zone[2] - local todo= - (( $+expected_highlight_zone[4] )) && todo="# TODO $expected_highlight_zone[4]" - if ! (( $+region_highlight[i] )); then - print -r -- "not ok $i - unmatched expectation ($exp_start $exp_end $expected_highlight_zone[3])" - continue - fi - local -a highlight_zone; highlight_zone=( ${(z)region_highlight[i]} ) - integer start=$(( highlight_zone[1] + 1 )) end=$highlight_zone[2] - # Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output - local desc="[$start,$end] «${${BUFFER[$start,$end]//'#'/♯}//$'\n'/↵}»" - if - [[ $start != $exp_start ]] || - [[ $end != $exp_end ]] || - [[ $highlight_zone[3] != $expected_highlight_zone[3] ]] - then - print -r -- "not ok $i - $desc - expected ($exp_start $exp_end ${(qqq)expected_highlight_zone[3]}), observed ($start $end ${(qqq)highlight_zone[3]}). $todo" - else - print -r -- "ok $i - $desc${todo:+ - }$todo" - fi - unset expected_highlight_zone - unset exp_start exp_end - unset todo - unset highlight_zone - unset start end - unset desc - done - - if (( $#expected_region_highlight == $#region_highlight )); then - print -r -- "ok $i - cardinality check" - else - print -r -- "not ok $i - have $#expected_region_highlight expectations and $#region_highlight region_highlight entries" - fi -} - -# Run a single test file. The exit status is 1 if the test harness had -# an error and 0 otherwise. The exit status does not depend on whether -# test points succeeded or failed. -run_test() { - # Do not combine the declaration and initialization: «local x="$(false)"» does not set $?. - local __tests_tempdir - __tests_tempdir="$(mktemp -d)" && [[ -d $__tests_tempdir ]] || { - echo >&2 "Bail out! mktemp failed"; return 1 - } - typeset -r __tests_tempdir # don't allow tests to override the variable that we will 'rm -rf' later on - - { - # Use a subshell to isolate tests from each other. - # (So tests can alter global shell state using 'cd', 'hash', etc) - { - # These braces are so multios don't come into play. - { (run_test_internal "$__tests_tempdir" "$@") 3>&1 >&2 2>&3 } | grep \^ - local ret=$pipestatus[1] stderr=$pipestatus[2] - if (( ! stderr )); then - # stdout will become stderr - echo "Bail out! On ${(qq)1}: output on stderr"; return 1 - else - return $ret - fi - } 3>&1 >&2 2>&3 - } always { - rm -rf -- "$__tests_tempdir" - } -} - -# Process each test data file in test data directory. -integer something_failed=0 -ZSH_HIGHLIGHT_STYLES=() -for data_file in ${0:h:h}/highlighters/$1/test-data/*.zsh; do - run_test "$data_file" | tee >($results_filter | ${0:A:h}/tap-colorizer.zsh) | grep -v '^not ok.*# TODO' | grep -Eq '^not ok|^ok.*# TODO' && (( something_failed=1 )) - (( $pipestatus[1] )) && exit 2 -done - -exit $something_failed diff --git a/.zprezto/modules/syntax-highlighting/external/tests/test-perfs.zsh b/.zprezto/modules/syntax-highlighting/external/tests/test-perfs.zsh deleted file mode 100755 index 3411754..0000000 --- a/.zprezto/modules/syntax-highlighting/external/tests/test-perfs.zsh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env zsh -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2015 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - - -# Check an highlighter was given as argument. -[[ -n "$1" ]] || { - echo >&2 "Bail out! You must provide the name of a valid highlighter as argument." - exit 2 -} - -# Check the highlighter is valid. -[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || { - echo >&2 "Bail out! Could not find highlighter ${(qq)1}." - exit 2 -} - -# Check the highlighter has test data. -[[ -d ${0:h:h}/highlighters/$1/test-data ]] || { - echo >&2 "Bail out! Highlighter ${(qq)1} has no test data." - exit 2 -} - -# Load the main script. -. ${0:h:h}/zsh-syntax-highlighting.zsh - -# Activate the highlighter. -ZSH_HIGHLIGHT_HIGHLIGHTERS=($1) - -# Runs a highlighting test -# $1: data file -run_test_internal() { - local -a highlight_zone - - local tests_tempdir="$1"; shift - local srcdir="$PWD" - builtin cd -q -- "$tests_tempdir" || { echo >&2 "Bail out! cd failed: $?"; return 1 } - - echo -n "# ${1:t:r}: " - - # Load the data and prepare checking it. - PREBUFFER= BUFFER= ; - . "$srcdir"/"$1" - - # Check the data declares $PREBUFFER or $BUFFER. - [[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return 1; } - - # Measure the time taken by _zsh_highlight. - TIMEFMT="%*Es" - time (BUFFER="$BUFFER" && _zsh_highlight) -} - -run_test() { - # Do not combine the declaration and initialization: «local x="$(false)"» does not set $?. - local __tests_tempdir - __tests_tempdir="$(mktemp -d)" && [[ -d $__tests_tempdir ]] || { - echo >&2 "Bail out! mktemp failed"; return 1 - } - typeset -r __tests_tempdir # don't allow tests to override the variable that we will 'rm -rf' later on - - { - (run_test_internal "$__tests_tempdir" "$@") - } always { - rm -rf -- "$__tests_tempdir" - } -} - -# Process each test data file in test data directory. -for data_file in ${0:h:h}/highlighters/$1/test-data/*.zsh; do - run_test "$data_file" - (( $pipestatus[1] )) && exit 2 -done - -exit 0 diff --git a/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.plugin.zsh b/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.plugin.zsh deleted file mode 100644 index f2456ae..0000000 --- a/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -0=${(%):-%N} -source ${0:A:h}/zsh-syntax-highlighting.zsh diff --git a/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh b/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh deleted file mode 100644 index 4caf3a8..0000000 --- a/.zprezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh +++ /dev/null @@ -1,440 +0,0 @@ -# ------------------------------------------------------------------------------------------------- -# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted -# provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this list of conditions -# and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, this list of -# conditions and the following disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors -# may be used to endorse or promote products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ------------------------------------------------------------------------------------------------- -# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- -# vim: ft=zsh sw=2 ts=2 et -# ------------------------------------------------------------------------------------------------- - -# First of all, ensure predictable parsing. -zsh_highlight__aliases=`builtin alias -Lm '[^+]*'` -# In zsh <= 5.2, `alias -L` emits aliases that begin with a plus sign ('alias -- +foo=42') -# them without a '--' guard, so they don't round trip. -# -# Hence, we exclude them from unaliasing: -builtin unalias -m '[^+]*' - -# Set $0 to the expected value, regardless of functionargzero. -0=${(%):-%N} -if true; then - # $0 is reliable - typeset -g ZSH_HIGHLIGHT_VERSION=$(<"${0:A:h}"/.version) - typeset -g ZSH_HIGHLIGHT_REVISION=$(<"${0:A:h}"/.revision-hash) - if [[ $ZSH_HIGHLIGHT_REVISION == \$Format:* ]]; then - # When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION - # would be set to '$Format:%H$' literally. That's an invalid value, and obtaining - # the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so: - ZSH_HIGHLIGHT_REVISION=HEAD - fi -fi - -# ------------------------------------------------------------------------------------------------- -# Core highlighting update system -# ------------------------------------------------------------------------------------------------- - -# Use workaround for bug in ZSH? -# zsh-users/zsh@48cadf4 http://www.zsh.org/mla/workers//2017/msg00034.html -autoload -Uz is-at-least -if is-at-least 5.4; then - zsh_highlight__pat_static_bug=false -else - zsh_highlight__pat_static_bug=true -fi - -# Array declaring active highlighters names. -typeset -ga ZSH_HIGHLIGHT_HIGHLIGHTERS - -# Update ZLE buffer syntax highlighting. -# -# Invokes each highlighter that needs updating. -# This function is supposed to be called whenever the ZLE state changes. -_zsh_highlight() -{ - # Store the previous command return code to restore it whatever happens. - local ret=$? - - # Remove all highlighting in isearch, so that only the underlining done by zsh itself remains. - # For details see FAQ entry 'Why does syntax highlighting not work while searching history?'. - # This disables highlighting during isearch (for reasons explained in README.md) unless zsh is new enough - # and doesn't have the pattern matching bug - if [[ $WIDGET == zle-isearch-update ]] && { $zsh_highlight__pat_static_bug || ! (( $+ISEARCHMATCH_ACTIVE )) }; then - region_highlight=() - return $ret - fi - - # Before we 'emulate -L', save the user's options - local -A zsyh_user_options - if zmodload -e zsh/parameter; then - zsyh_user_options=("${(@kv)options}") - else - local canonical_options onoff option raw_options - raw_options=(${(f)"$(emulate -R zsh; set -o)"}) - canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *}) - for option in $canonical_options; do - [[ -o $option ]] - # This variable cannot be eliminated c.f. workers/42101. - onoff=${${=:-off on}[2-$?]} - zsyh_user_options+=($option $onoff) - done - fi - typeset -r zsyh_user_options - - emulate -L zsh - setopt localoptions warncreateglobal - local REPLY # don't leak $REPLY into global scope - - # Do not highlight if there are more than 300 chars in the buffer. It's most - # likely a pasted command or a huge list of files in that case.. - [[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret - - # Do not highlight if there are pending inputs (copy/paste). - [[ $PENDING -gt 0 ]] && return $ret - - # Reset region highlight to build it from scratch - typeset -ga region_highlight - region_highlight=(); - - { - local cache_place - local -a region_highlight_copy - - # Select which highlighters in ZSH_HIGHLIGHT_HIGHLIGHTERS need to be invoked. - local highlighter; for highlighter in $ZSH_HIGHLIGHT_HIGHLIGHTERS; do - - # eval cache place for current highlighter and prepare it - cache_place="_zsh_highlight__highlighter_${highlighter}_cache" - typeset -ga ${cache_place} - - # If highlighter needs to be invoked - if ! type "_zsh_highlight_highlighter_${highlighter}_predicate" >&/dev/null; then - echo "zsh-syntax-highlighting: warning: disabling the ${(qq)highlighter} highlighter as it has not been loaded" >&2 - # TODO: use ${(b)} rather than ${(q)} if supported - ZSH_HIGHLIGHT_HIGHLIGHTERS=( ${ZSH_HIGHLIGHT_HIGHLIGHTERS:#${highlighter}} ) - elif "_zsh_highlight_highlighter_${highlighter}_predicate"; then - - # save a copy, and cleanup region_highlight - region_highlight_copy=("${region_highlight[@]}") - region_highlight=() - - # Execute highlighter and save result - { - "_zsh_highlight_highlighter_${highlighter}_paint" - } always { - : ${(AP)cache_place::="${region_highlight[@]}"} - } - - # Restore saved region_highlight - region_highlight=("${region_highlight_copy[@]}") - - fi - - # Use value form cache if any cached - region_highlight+=("${(@P)cache_place}") - - done - - # Re-apply zle_highlight settings - - # region - if (( REGION_ACTIVE == 1 )); then - _zsh_highlight_apply_zle_highlight region standout "$MARK" "$CURSOR" - elif (( REGION_ACTIVE == 2 )); then - () { - local needle=$'\n' - integer min max - if (( MARK > CURSOR )) ; then - min=$CURSOR max=$MARK - else - min=$MARK max=$CURSOR - fi - # CURSOR and MARK are 0 indexed between letters like region_highlight - # Do not include the newline in the highlight - (( min = ${BUFFER[(Ib:min:)$needle]} )) - (( max = ${BUFFER[(ib:max:)$needle]} - 1 )) - _zsh_highlight_apply_zle_highlight region standout "$min" "$max" - } - fi - - # yank / paste (zsh-5.1.1 and newer) - (( $+YANK_ACTIVE )) && (( YANK_ACTIVE )) && _zsh_highlight_apply_zle_highlight paste standout "$YANK_START" "$YANK_END" - - # isearch - (( $+ISEARCHMATCH_ACTIVE )) && (( ISEARCHMATCH_ACTIVE )) && _zsh_highlight_apply_zle_highlight isearch underline "$ISEARCHMATCH_START" "$ISEARCHMATCH_END" - - # suffix - (( $+SUFFIX_ACTIVE )) && (( SUFFIX_ACTIVE )) && _zsh_highlight_apply_zle_highlight suffix bold "$SUFFIX_START" "$SUFFIX_END" - - - return $ret - - - } always { - typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER="$BUFFER" - typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR=$CURSOR - } -} - -# Apply highlighting based on entries in the zle_highlight array. -# This function takes four arguments: -# 1. The exact entry (no patterns) in the zle_highlight array: -# region, paste, isearch, or suffix -# 2. The default highlighting that should be applied if the entry is unset -# 3. and 4. Two integer values describing the beginning and end of the -# range. The order does not matter. -_zsh_highlight_apply_zle_highlight() { - local entry="$1" default="$2" - integer first="$3" second="$4" - - # read the relevant entry from zle_highlight - # - # ### In zsh≥5.0.8 we'd use ${(b)entry}, but we support older zsh's, so we don't - # ### add (b). The only effect is on the failure mode for callers that violate - # ### the precondition. - local region="${zle_highlight[(r)${entry}:*]-}" - - if [[ -z "$region" ]]; then - # entry not specified at all, use default value - region=$default - else - # strip prefix - region="${region#${entry}:}" - - # no highlighting when set to the empty string or to 'none' - if [[ -z "$region" ]] || [[ "$region" == none ]]; then - return - fi - fi - - integer start end - if (( first < second )); then - start=$first end=$second - else - start=$second end=$first - fi - region_highlight+=("$start $end $region") -} - - -# ------------------------------------------------------------------------------------------------- -# API/utility functions for highlighters -# ------------------------------------------------------------------------------------------------- - -# Array used by highlighters to declare user overridable styles. -typeset -gA ZSH_HIGHLIGHT_STYLES - -# Whether the command line buffer has been modified or not. -# -# Returns 0 if the buffer has changed since _zsh_highlight was last called. -_zsh_highlight_buffer_modified() -{ - [[ "${_ZSH_HIGHLIGHT_PRIOR_BUFFER:-}" != "$BUFFER" ]] -} - -# Whether the cursor has moved or not. -# -# Returns 0 if the cursor has moved since _zsh_highlight was last called. -_zsh_highlight_cursor_moved() -{ - [[ -n $CURSOR ]] && [[ -n ${_ZSH_HIGHLIGHT_PRIOR_CURSOR-} ]] && (($_ZSH_HIGHLIGHT_PRIOR_CURSOR != $CURSOR)) -} - -# Add a highlight defined by ZSH_HIGHLIGHT_STYLES. -# -# Should be used by all highlighters aside from 'pattern' (cf. ZSH_HIGHLIGHT_PATTERN). -# Overwritten in tests/test-highlighting.zsh when testing. -_zsh_highlight_add_highlight() -{ - local -i start end - local highlight - start=$1 - end=$2 - shift 2 - for highlight; do - if (( $+ZSH_HIGHLIGHT_STYLES[$highlight] )); then - region_highlight+=("$start $end $ZSH_HIGHLIGHT_STYLES[$highlight]") - break - fi - done -} - -# ------------------------------------------------------------------------------------------------- -# Setup functions -# ------------------------------------------------------------------------------------------------- - -# Helper for _zsh_highlight_bind_widgets -# $1 is name of widget to call -_zsh_highlight_call_widget() -{ - builtin zle "$@" && - _zsh_highlight -} - -# Rebind all ZLE widgets to make them invoke _zsh_highlights. -_zsh_highlight_bind_widgets() -{ - setopt localoptions noksharrays - typeset -F SECONDS - local prefix=orig-s$SECONDS-r$RANDOM # unique each time, in case we're sourced more than once - - # Load ZSH module zsh/zleparameter, needed to override user defined widgets. - zmodload zsh/zleparameter 2>/dev/null || { - print -r -- >&2 'zsh-syntax-highlighting: failed loading zsh/zleparameter.' - return 1 - } - - # Override ZLE widgets to make them invoke _zsh_highlight. - local -U widgets_to_bind - widgets_to_bind=(${${(k)widgets}:#(.*|run-help|which-command|beep|set-local-history|yank|yank-pop)}) - - # Always wrap special zle-line-finish widget. This is needed to decide if the - # current line ends and special highlighting logic needs to be applied. - # E.g. remove cursor imprint, don't highlight partial paths, ... - widgets_to_bind+=(zle-line-finish) - - # Always wrap special zle-isearch-update widget to be notified of updates in isearch. - # This is needed because we need to disable highlighting in that case. - widgets_to_bind+=(zle-isearch-update) - - local cur_widget - for cur_widget in $widgets_to_bind; do - case ${widgets[$cur_widget]:-""} in - - # Already rebound event: do nothing. - user:_zsh_highlight_widget_*);; - - # The "eval"'s are required to make $cur_widget a closure: the value of the parameter at function - # definition time is used. - # - # We can't use ${0/_zsh_highlight_widget_} because these widgets are always invoked with - # NO_function_argzero, regardless of the option's setting here. - - # User defined widget: override and rebind old one with prefix "orig-". - user:*) zle -N $prefix-$cur_widget ${widgets[$cur_widget]#*:} - eval "_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget ${(q)prefix}-${(q)cur_widget} -- \"\$@\" }" - zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;; - - # Completion widget: override and rebind old one with prefix "orig-". - completion:*) zle -C $prefix-$cur_widget ${${(s.:.)widgets[$cur_widget]}[2,3]} - eval "_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget ${(q)prefix}-${(q)cur_widget} -- \"\$@\" }" - zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;; - - # Builtin widget: override and make it call the builtin ".widget". - builtin) eval "_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget .${(q)cur_widget} -- \"\$@\" }" - zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;; - - # Incomplete or nonexistent widget: Bind to z-sy-h directly. - *) - if [[ $cur_widget == zle-* ]] && (( ! ${+widgets[$cur_widget]} )); then - _zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight } - zle -N $cur_widget _zsh_highlight_widget_$cur_widget - else - # Default: unhandled case. - print -r -- >&2 "zsh-syntax-highlighting: unhandled ZLE widget ${(qq)cur_widget}" - print -r -- >&2 "zsh-syntax-highlighting: (This is sometimes caused by doing \`bindkey ${(q-)cur_widget}\` without creating the ${(qq)cur_widget} widget with \`zle -N\` or \`zle -C\`.)" - fi - esac - done -} - -# Load highlighters from directory. -# -# Arguments: -# 1) Path to the highlighters directory. -_zsh_highlight_load_highlighters() -{ - setopt localoptions noksharrays bareglobqual - - # Check the directory exists. - [[ -d "$1" ]] || { - print -r -- >&2 "zsh-syntax-highlighting: highlighters directory ${(qq)1} not found." - return 1 - } - - # Load highlighters from highlighters directory and check they define required functions. - local highlighter highlighter_dir - for highlighter_dir ($1/*/(/)); do - highlighter="${highlighter_dir:t}" - [[ -f "$highlighter_dir${highlighter}-highlighter.zsh" ]] && - . "$highlighter_dir${highlighter}-highlighter.zsh" - if type "_zsh_highlight_highlighter_${highlighter}_paint" &> /dev/null && - type "_zsh_highlight_highlighter_${highlighter}_predicate" &> /dev/null; - then - # New (0.5.0) function names - elif type "_zsh_highlight_${highlighter}_highlighter" &> /dev/null && - type "_zsh_highlight_${highlighter}_highlighter_predicate" &> /dev/null; - then - # Old (0.4.x) function names - if false; then - # TODO: only show this warning for plugin authors/maintainers, not for end users - print -r -- >&2 "zsh-syntax-highlighting: warning: ${(qq)highlighter} highlighter uses deprecated entry point names; please ask its maintainer to update it: https://github.com/zsh-users/zsh-syntax-highlighting/issues/329" - fi - # Make it work. - eval "_zsh_highlight_highlighter_${(q)highlighter}_paint() { _zsh_highlight_${(q)highlighter}_highlighter \"\$@\" }" - eval "_zsh_highlight_highlighter_${(q)highlighter}_predicate() { _zsh_highlight_${(q)highlighter}_highlighter_predicate \"\$@\" }" - else - print -r -- >&2 "zsh-syntax-highlighting: ${(qq)highlighter} highlighter should define both required functions '_zsh_highlight_highlighter_${highlighter}_paint' and '_zsh_highlight_highlighter_${highlighter}_predicate' in ${(qq):-"$highlighter_dir${highlighter}-highlighter.zsh"}." - fi - done -} - - -# ------------------------------------------------------------------------------------------------- -# Setup -# ------------------------------------------------------------------------------------------------- - -# Try binding widgets. -_zsh_highlight_bind_widgets || { - print -r -- >&2 'zsh-syntax-highlighting: failed binding ZLE widgets, exiting.' - return 1 -} - -# Resolve highlighters directory location. -_zsh_highlight_load_highlighters "${ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR:-${${0:A}:h}/highlighters}" || { - print -r -- >&2 'zsh-syntax-highlighting: failed loading highlighters, exiting.' - return 1 -} - -# Reset scratch variables when commandline is done. -_zsh_highlight_preexec_hook() -{ - typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER= - typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR= -} -autoload -Uz add-zsh-hook -add-zsh-hook preexec _zsh_highlight_preexec_hook 2>/dev/null || { - print -r -- >&2 'zsh-syntax-highlighting: failed loading add-zsh-hook.' - } - -# Load zsh/parameter module if available -zmodload zsh/parameter 2>/dev/null || true - -# Initialize the array of active highlighters if needed. -[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) - -# Restore the aliases we unned -eval "$zsh_highlight__aliases" -builtin unset zsh_highlight__aliases - -# Set $?. -true diff --git a/.zprezto/modules/syntax-highlighting/init.zsh b/.zprezto/modules/syntax-highlighting/init.zsh deleted file mode 100644 index 52cc0c3..0000000 --- a/.zprezto/modules/syntax-highlighting/init.zsh +++ /dev/null @@ -1,36 +0,0 @@ -# -# Integrates zsh-syntax-highlighting into Prezto. -# -# Authors: -# Sorin Ionescu -# - -# Return if requirements are not found. -if ! zstyle -t ':prezto:module:syntax-highlighting' color; then - return 1 -fi - -# Source module files. -source "${0:h}/external/zsh-syntax-highlighting.zsh" || return 1 - -# Set highlighters. -zstyle -a ':prezto:module:syntax-highlighting' highlighters 'ZSH_HIGHLIGHT_HIGHLIGHTERS' -if (( ${#ZSH_HIGHLIGHT_HIGHLIGHTERS[@]} == 0 )); then - ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) -fi - -# Set highlighting styles. -typeset -A syntax_highlighting_styles -zstyle -a ':prezto:module:syntax-highlighting' styles 'syntax_highlighting_styles' -for syntax_highlighting_style in "${(k)syntax_highlighting_styles[@]}"; do - ZSH_HIGHLIGHT_STYLES[$syntax_highlighting_style]="$syntax_highlighting_styles[$syntax_highlighting_style]" -done -unset syntax_highlighting_style{s,} - -# Set pattern highlighting styles. -typeset -A syntax_pattern_styles -zstyle -a ':prezto:module:syntax-highlighting' pattern 'syntax_pattern_styles' -for syntax_pattern_style in "${(k)syntax_pattern_styles[@]}"; do - ZSH_HIGHLIGHT_PATTERNS[$syntax_pattern_style]="$syntax_pattern_styles[$syntax_pattern_style]" -done -unset syntax_pattern_style{s,} diff --git a/.zprezto/modules/terminal/README.md b/.zprezto/modules/terminal/README.md deleted file mode 100644 index 41a0885..0000000 --- a/.zprezto/modules/terminal/README.md +++ /dev/null @@ -1,57 +0,0 @@ -Terminal -======== - -Sets terminal window and tab titles. - -Settings --------- - -### Auto-Title - -To auto set the terminal window and tab titles with the current command or -directory, add the following to *zpreztorc*: - -```sh -zstyle ':prezto:module:terminal' auto-title 'yes' -``` - -Auto titling is disabled inside terminal multiplexers (except inside dvtm) -since it interferes with window names defined in configuration files and -profile managers. This can be overridden by setting it to `always`. - -```sh -zstyle ':prezto:module:terminal' auto-title 'always' -``` - -### Title formats - -To format terminal window and tab titles, add the following to *zpreztorc*: - -```sh -zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' -zstyle ':prezto:module:terminal:tab-title' format '%m: %s' -zstyle ':prezto:module:terminal:multiplexer-title' format '%s' -``` - -`%s` will be replaced with the current working directory path or the currently -executing program name. - -For a list of sequences, see [Expansion of Prompt Sequences][1]. - -Functions ---------- - -- `set-tab-title` sets the terminal tab title. -- `set-window-title` sets the terminal window title. -- `set-multiplexer-title` sets the terminal multiplexer title. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Olaf Conradi](https://github.com/oohlaf) - -[1]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Expansion-of-Prompt-Sequences -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/terminal/init.zsh b/.zprezto/modules/terminal/init.zsh deleted file mode 100644 index 2a5b9be..0000000 --- a/.zprezto/modules/terminal/init.zsh +++ /dev/null @@ -1,129 +0,0 @@ -# -# Sets terminal window and tab titles. -# -# Authors: -# Sorin Ionescu -# Olaf Conradi -# - -# Return if requirements are not found. -if [[ "$TERM" == (dumb|linux|*bsd*|eterm*) ]]; then - return 1 -fi - -# Sets the terminal window title. -function set-window-title { - local title_format{,ted} - zstyle -s ':prezto:module:terminal:window-title' format 'title_format' || title_format="%s" - zformat -f title_formatted "$title_format" "s:$argv" - printf '\e]2;%s\a' "${(V%)title_formatted}" -} - -# Sets the terminal tab title. -function set-tab-title { - local title_format{,ted} - zstyle -s ':prezto:module:terminal:tab-title' format 'title_format' || title_format="%s" - zformat -f title_formatted "$title_format" "s:$argv" - printf '\e]1;%s\a' "${(V%)title_formatted}" -} - -# Sets the terminal multiplexer tab title. -function set-multiplexer-title { - local title_format{,ted} - zstyle -s ':prezto:module:terminal:multiplexer-title' format 'title_format' || title_format="%s" - zformat -f title_formatted "$title_format" "s:$argv" - printf '\ek%s\e\\' "${(V%)title_formatted}" -} - -# Sets the tab and window titles with a given command. -function _terminal-set-titles-with-command { - emulate -L zsh - setopt EXTENDED_GLOB - - # Get the command name that is under job control. - if [[ "${2[(w)1]}" == (fg|%*)(\;|) ]]; then - # Get the job name, and, if missing, set it to the default %+. - local job_name="${${2[(wr)%*(\;|)]}:-%+}" - - # Make a local copy for use in the subshell. - local -A jobtexts_from_parent_shell - jobtexts_from_parent_shell=(${(kv)jobtexts}) - - jobs "$job_name" 2> /dev/null > >( - read index discarded - # The index is already surrounded by brackets: [1]. - _terminal-set-titles-with-command "${(e):-\$jobtexts_from_parent_shell$index}" - ) - else - # Set the command name, or in the case of sudo or ssh, the next command. - local cmd="${${2[(wr)^(*=*|sudo|ssh|-*)]}:t}" - local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}" - unset MATCH - - if [[ "$TERM" == screen* ]]; then - set-multiplexer-title "$truncated_cmd" - fi - set-tab-title "$truncated_cmd" - set-window-title "$cmd" - fi -} - -# Sets the tab and window titles with a given path. -function _terminal-set-titles-with-path { - emulate -L zsh - setopt EXTENDED_GLOB - - local absolute_path="${${1:a}:-$PWD}" - local abbreviated_path="${absolute_path/#$HOME/~}" - local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" - unset MATCH - - if [[ "$TERM" == screen* ]]; then - set-multiplexer-title "$truncated_path" - fi - set-tab-title "$truncated_path" - set-window-title "$abbreviated_path" -} - -# Do not override precmd/preexec; append to the hook array. -autoload -Uz add-zsh-hook - -# Set up the Apple Terminal. -if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] \ - && ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] ) -then - # Sets the Terminal.app current working directory before the prompt is - # displayed. - function _terminal-set-terminal-app-proxy-icon { - printf '\e]7;%s\a' "file://${HOST}${PWD// /%20}" - } - add-zsh-hook precmd _terminal-set-terminal-app-proxy-icon - - # Unsets the Terminal.app current working directory when a terminal - # multiplexer or remote connection is started since it can no longer be - # updated, and it becomes confusing when the directory displayed in the title - # bar is no longer synchronized with real current working directory. - function _terminal-unset-terminal-app-proxy-icon { - if [[ "${2[(w)1]:t}" == (screen|tmux|dvtm|ssh|mosh) ]]; then - print '\e]7;\a' - fi - } - add-zsh-hook preexec _terminal-unset-terminal-app-proxy-icon - - # Do not set the tab and window titles in Terminal.app since it sets the tab - # title to the currently running process by default and the current working - # directory is set separately. - return -fi - -# Set up non-Apple terminals. -if zstyle -t ':prezto:module:terminal' auto-title 'always' \ - || (zstyle -t ':prezto:module:terminal' auto-title \ - && ( ! [[ -n "$STY" || -n "$TMUX" ]] )) -then - # Sets titles before the prompt is displayed. - add-zsh-hook precmd _terminal-set-titles-with-path - - # Sets titles before command execution. - add-zsh-hook preexec _terminal-set-titles-with-command -fi diff --git a/.zprezto/modules/tmux/README.md b/.zprezto/modules/tmux/README.md deleted file mode 100644 index 0738d7c..0000000 --- a/.zprezto/modules/tmux/README.md +++ /dev/null @@ -1,93 +0,0 @@ -Tmux -==== - -Defines [tmux][1] aliases and provides for auto launching it at start-up. - -Settings --------- - -### Auto-Start - -Starts a tmux session automatically when Zsh is launched. - -To enable this feature when launching Zsh in a local terminal, add the -following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:tmux:auto-start' local 'yes' -``` - -To enable this feature when launching Zsh in a SSH connection, add the -following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:tmux:auto-start' remote 'yes' -``` - -In both cases, it will create a background session named _prezto_ if the tmux -server is not started. - -You can change the default session name with: - -```sh -zstyle ':prezto:module:tmux:session' name '' -``` - -With `auto-start` enabled, you may want to control how multiple sessions are -managed. The `destroy-unattached` option of tmux controls if the unattached -sessions must be kept alive, making sessions available for later use, configured -in *tmux.conf*: - -```conf -set-option -g destroy-unattached [on | off] -``` - -#### iTerm2 Integration - -[iTerm2][6] offers significant integration with tmux. This can be enabled by -adding the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:tmux:iterm' integrate 'yes' -``` - -Read [iTerm2 and tmux Integration][7] for more information. - -Aliases -------- - - - `tmuxa` attaches or switches to a tmux session. - - `tmuxl` lists sessions managed by the tmux server. - -Caveats -------- - -On macOS, launching tmux can cause the error **launch_msg(...): Socket is not -connected** to be displayed, which can be fixed by installing -[reattach-to-user-namespace][3], available in [Homebrew][4], and adding the -following to *tmux.conf*: - -```conf -set-option -g default-command "reattach-to-user-namespace -l $SHELL -l" -``` - -Furthermore, tmux is known to cause **kernel panics** on macOS. A discussion -about this and Prezto has already been [opened][2]. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][5].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - - [Colin Hebert](https://github.com/ColinHebert) - - [Georges Discry](https://github.com/gdiscry) - - [Xavier Cambar](https://github.com/xcambar) - -[1]: http://tmux.sourceforge.net -[2]: https://github.com/sorin-ionescu/prezto/issues/62 -[3]: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard -[4]: https://github.com/mxcl/homebrew -[5]: https://github.com/sorin-ionescu/prezto/issues -[6]: http://iterm2.com -[7]: https://gitlab.com/gnachman/iterm2/wikis/TmuxIntegration diff --git a/.zprezto/modules/tmux/init.zsh b/.zprezto/modules/tmux/init.zsh deleted file mode 100644 index fb56d07..0000000 --- a/.zprezto/modules/tmux/init.zsh +++ /dev/null @@ -1,49 +0,0 @@ -# -# Defines tmux aliases and provides for auto launching it at start-up. -# -# Authors: -# Sorin Ionescu -# Colin Hebert -# Georges Discry -# Xavier Cambar -# - -# Return if requirements are not found. -if (( ! $+commands[tmux] )); then - return 1 -fi - -# -# Auto Start -# - -if ([[ "$TERM_PROGRAM" = 'iTerm.app' ]] && \ - zstyle -t ':prezto:module:tmux:iterm' integrate \ -); then - _tmux_iterm_integration='-CC' -fi - -if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_PID" ]] && ( \ - ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || - ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ -); then - tmux start-server - - # Create a 'prezto' session if no session has been defined in tmux.conf. - if ! tmux has-session 2> /dev/null; then - zstyle -s ':prezto:module:tmux:session' name tmux_session || tmux_session='prezto' - tmux \ - new-session -d -s "$tmux_session" \; \ - set-option -t "$tmux_session" destroy-unattached off &> /dev/null - fi - - # Attach to the 'prezto' session or to the last session used. (detach first) - exec tmux $_tmux_iterm_integration attach-session -d -fi - -# -# Aliases -# - -alias tmuxa="tmux $_tmux_iterm_integration new-session -A" -alias tmuxl='tmux list-sessions' diff --git a/.zprezto/modules/utility/README.md b/.zprezto/modules/utility/README.md deleted file mode 100644 index 3b25b3a..0000000 --- a/.zprezto/modules/utility/README.md +++ /dev/null @@ -1,185 +0,0 @@ -Utility -======= - -Defines general aliases and functions. - -Settings --------- - -### Highlighting - -If you have enabled color globally in *zpreztorc*, you may disable it for -certain commands. - -To disable `ls` color, add the following line to *zpreztorc*; when coloring is -disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries. - -```sh -zstyle ':prezto:module:utility:ls' color 'no' -``` - -To disable GNU coreutils `ls` to list directories grouped first, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:utility:ls' dirs-first 'no' -``` - -To disable `diff` highlighting, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:utility:diff' color 'no' -``` - -To disable `wdiff` highlighting, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:utility:wdiff' color 'no' -``` - -To disable `make` highlighting, add the following line to *zpreztorc*: - -```sh -zstyle ':prezto:module:utility:make' color 'no' -``` - -Aliases -------- - -### Disabled Spelling Correction - - - `ack` - - `cd` - - `cp` - - `ebuild` - - `gcc` - - `gist` - - `grep` - - `heroku` - - `ln` - - `man` - - `mkdir` - - `mv` - - `mysql` - - `rm` - -### Disabled File Globbing - - - `bower` - - `fc` - - `find` - - `ftp` - - `history` - - `locate` - - `rake` - - `rsync` (selectively enabled for local files) - - `scp` (selectively enabled for local files) - - `sftp` - -### General - - - `_` executes a command as another user (`sudo`). - - `b` opens the default web browser. - - `diffu` shorthand for `diff --unified` - - `e` opens the default editor. - - `mkdir` creates directories, including intermediary directories. - - `p` opens the default pager. - - `po` removes a directory from the stack and changes to it (`popd`). - - `pu` changes the directory and pushes the old directory onto the stack - (`pushd`). - - `sa` search aliases for a word. - - `type` displays all the attribute values of a shell parameter. - -### Files and Directories - - - `ls` lists with directories grouped first (GNU only). - - `l` lists in one column, hidden files. - - `ll` lists human readable sizes. - - `lr` lists human readable sizes, recursively. - - `la` lists human readable sizes, hidden files. - - `lm` lists human readable sizes, hidden files through pager. - - `lx` lists sorted by extension (GNU only). - - `lk` lists sorted by size, largest last. - - `lt` lists sorted by date, most recent last. - - `lc` lists sorted by date, most recent last, shows change time. - - `lu` lists sorted by date, most recent last, shows access time. - - `sl` lists directory contents (`ls`). - -### macOS Everywhere - - - `o` opens files and directories (`open` or `xdg-open`). - - `get` downloads files (`curl` or `wget`). - - `pbcopy` copies to the pasteboard (`pbcopy`, `xclip` or `xsel`). - - `pbpaste` pastes from the pasteboard (`pbcopy`, `xclip` or `xsel`). - - `pbc` copies to the pasteboard (`pbcopy`). - - `pbp` pastes from the pasteboard (`pbpaste`). - -### Resource Usage - - - `df` displays free disk space using human readable units (aliases to `pydf`, - if installed). - - `du` displays disk usage using human readable units. - - `top` displays information about processes. - - `topc` displays information about processes sorted by CPU usage. - - `topm` displays information about processes sorted by RAM usage. - -### Safe ops - -By default, `cp`,`ln`, `mv` and `rm` are aliased to their interactive variants. -If this is not desired, it can be disabled by adding the following line to -*zpreztorc*: - - zstyle ':prezto:module:utility' safe-ops 'no'. - -In addition, the following aliases have been added: - - - `cpi` copies files and directories interactively. - - `lni` links files and directories interactively. - - `mvi` moves files and directories interactively. - - `rmi` removes files and directories interactively. - -### Miscellaneous - - - `http-serve` serves a directory via HTTP. - -Functions ---------- - -### General - - - `slit` prints columns *1, 2, 3 ... n*. - -### Files and Directories - - - `cdls` changes to a directory and lists its contents. - - `dut` displays the grand total disk usage using human readable units. - - `find-exec` finds files and executes a command on them. - - `mkdcd` makes a directory and changes to it. - - `popdls` pops an entry off the directory stack and lists its contents. - - `pushdls` pushes an entry onto the directory stack and lists its contents. - - `noremoteglob` enable local path globbing but disable remote path globbing. - -### Developer - - - `diff` highlights diff output (requires `colordiff`). - - `make` highlights make output (requires `colormake`). - - `wdiff` highlights wdiff output (requires `wdiff `or `Git`). - -### Resource usage - - - `psu` displays user owned processes status. - -### Search and Replace - - - `prep` provides a grep-like pattern search. - - `psub` provides a sed-like pattern substitution. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][1].* - - - [Robby Russell](https://github.com/robbyrussell) - - [Suraj N. Kurapati](https://github.com/sunaku) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/utility/functions/_cdls_popdls_pushdls b/.zprezto/modules/utility/functions/_cdls_popdls_pushdls deleted file mode 100644 index 5f0fe60..0000000 --- a/.zprezto/modules/utility/functions/_cdls_popdls_pushdls +++ /dev/null @@ -1,11 +0,0 @@ -#compdef cdls popdls pushdls -#autoload - -# -# Completes cdls, popdls, and pushdls. -# -# Authors: -# Sorin Ionescu -# - -_cd diff --git a/.zprezto/modules/utility/functions/_dut b/.zprezto/modules/utility/functions/_dut deleted file mode 100644 index 180dde7..0000000 --- a/.zprezto/modules/utility/functions/_dut +++ /dev/null @@ -1,11 +0,0 @@ -#compdef dut -#autoload - -# -# Completes dut. -# -# Authors: -# Sorin Ionescu -# - -_du diff --git a/.zprezto/modules/utility/functions/_mkdcd b/.zprezto/modules/utility/functions/_mkdcd deleted file mode 100644 index 5273651..0000000 --- a/.zprezto/modules/utility/functions/_mkdcd +++ /dev/null @@ -1,13 +0,0 @@ -#compdef mkdcd -#autoload - -# -# Completes mkdcd. -# -# Authors: -# Sorin Ionescu -# - -local expl - -_wanted directories expl 'directory' _path_files -/ || _message 'directory' diff --git a/.zprezto/modules/utility/functions/_noremoteglob b/.zprezto/modules/utility/functions/_noremoteglob deleted file mode 100644 index de5290e..0000000 --- a/.zprezto/modules/utility/functions/_noremoteglob +++ /dev/null @@ -1,11 +0,0 @@ -#compdef noremoteglob -#autoload - -# -# Completes noremoteglob. -# -# Authors: -# Indrajit Raychaudhuri -# - -_precommand diff --git a/.zprezto/modules/utility/functions/_prep b/.zprezto/modules/utility/functions/_prep deleted file mode 100644 index c9d6eda..0000000 --- a/.zprezto/modules/utility/functions/_prep +++ /dev/null @@ -1,18 +0,0 @@ -#compdef prep -#autoload - -# -# Completes prep. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '-i[ignore case]' \ - '-m[^ and $ match the start and the end of a line]' \ - '-s[. matches newline]' \ - '-v[invert match]' \ - '-x[ignore whitespace and comments]' \ - '1::pattern:' \ - '2::files:_files' && return 0 diff --git a/.zprezto/modules/utility/functions/_psub b/.zprezto/modules/utility/functions/_psub deleted file mode 100644 index c79899e..0000000 --- a/.zprezto/modules/utility/functions/_psub +++ /dev/null @@ -1,19 +0,0 @@ -#compdef psub -#autoload - -# -# Completes psub. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '-g[match globally]' \ - '-i[ignore case]' \ - '-m[^ and $ match the start and the end of a line]' \ - '-s[. matches newline]' \ - '-x[ignore whitespace and comments]' \ - '1::pattern:' \ - '2::replacement:' \ - '3::files:_files' && return 0 diff --git a/.zprezto/modules/utility/functions/diff b/.zprezto/modules/utility/functions/diff deleted file mode 100644 index d614b28..0000000 --- a/.zprezto/modules/utility/functions/diff +++ /dev/null @@ -1,17 +0,0 @@ -# -# Highlights diff output. -# -# Authors: -# Sorin Ionescu -# - -function diff { - if zstyle -t ':prezto:module:utility:diff' color \ - && (( $+commands[colordiff] )); then - command colordiff "$@" - else - command diff "$@" - fi -} - -diff "$@" diff --git a/.zprezto/modules/utility/functions/dut b/.zprezto/modules/utility/functions/dut deleted file mode 100644 index 6592280..0000000 --- a/.zprezto/modules/utility/functions/dut +++ /dev/null @@ -1,27 +0,0 @@ -# -# Displays the grand total disk usage using human readable units. -# -# Authors: -# Suraj N. Kurapati -# Sorin Ionescu -# - -function dut { - (( $# == 0 )) && set -- * - - if grep -q -i 'GNU' < <(du --version 2>&1); then - du -khsc "$@" | sort -h -r - else - local line size name - local -a record - - while IFS=$'\n' read line; do - record=(${(z)line}) - size="$(($record[1] / 1024.0))" - name="$record[2,-1]" - printf "%9.1LfM %s\n" "$size" "$name" - done < <(du -kcs "$@") | sort -n -r - fi -} - -dut "$@" diff --git a/.zprezto/modules/utility/functions/make b/.zprezto/modules/utility/functions/make deleted file mode 100644 index 5ebab05..0000000 --- a/.zprezto/modules/utility/functions/make +++ /dev/null @@ -1,20 +0,0 @@ -# -# Highlights make output. -# -# Authors: -# Sorin Ionescu -# - -function make { - if zstyle -t ':prezto:module:utility:make' color; then - if (( $+commands[colormake] )); then - colormake "$@" - else - command make "$@" - fi - else - command make "$@" - fi -} - -make "$@" diff --git a/.zprezto/modules/utility/functions/prep b/.zprezto/modules/utility/functions/prep deleted file mode 100644 index d6448ae..0000000 --- a/.zprezto/modules/utility/functions/prep +++ /dev/null @@ -1,56 +0,0 @@ -# -# Provides a grep-like pattern search. -# -# Authors: -# Sorin Ionescu -# - -# function prep { - -local usage pattern modifiers invert - -usage="$( -cat <&2 - print "$usage" >&2 - return 1 - ;; - ([?]) - print "$0: unknown option: $OPTARG" >&2 - print "$usage" >&2 - return 1 - ;; - esac -done -shift $(( $OPTIND - 1 )) - -if (( $# < 1 )); then - print "$usage" >&2 - return 1 -fi - -pattern="$1" -shift - -perl -n -l -e "print if ${invert:+not} m/${pattern//\//\\/}/${modifiers}" "$@" - -# } diff --git a/.zprezto/modules/utility/functions/psub b/.zprezto/modules/utility/functions/psub deleted file mode 100644 index af191fd..0000000 --- a/.zprezto/modules/utility/functions/psub +++ /dev/null @@ -1,57 +0,0 @@ -# -# Provides a sed-like pattern substitution. -# -# Authors: -# Sorin Ionescu -# - -# function psub { - -local usage pattern replacement modifiers - -usage="$( -cat <&2 - print "$usage" >&2 - return 1 - ;; - ([?]) - print "$0: unknown option: $OPTARG" >&2 - print "$usage" >&2 - return 1 - ;; - esac -done -shift $(( $OPTIND - 1 )) - -if (( $# < 2 )); then - print "$usage" >&2 - return 1 -fi - -pattern="$1" -replacement="$2" -repeat 2 shift - -perl -i'.orig' -n -l -e "s/${pattern//\//\\/}/${replacement//\//\\/}/${modifiers}; print" "$@" - -# } diff --git a/.zprezto/modules/utility/functions/wdiff b/.zprezto/modules/utility/functions/wdiff deleted file mode 100644 index ebfad0b..0000000 --- a/.zprezto/modules/utility/functions/wdiff +++ /dev/null @@ -1,29 +0,0 @@ -# -# Highlights wdiff output. -# -# Authors: -# Sorin Ionescu -# - -function wdiff { - if zstyle -t ':prezto:module:utility:wdiff' color; then - if (( $+commands[wdiff] )); then - command wdiff \ - --avoid-wraps \ - --start-delete="$(print -n $FG[red])" \ - --end-delete="$(print -n $FG[none])" \ - --start-insert="$(print -n $FG[green])" \ - --end-insert="$(print -n $FG[none])" \ - "$@" \ - | sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g' - elif (( $+commands[git] )); then - command git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@" - else - command wdiff "$@" - fi - else - command wdiff "$@" - fi -} - -wdiff "$@" diff --git a/.zprezto/modules/utility/functions/zsh-help b/.zprezto/modules/utility/functions/zsh-help deleted file mode 100644 index f6605ea..0000000 --- a/.zprezto/modules/utility/functions/zsh-help +++ /dev/null @@ -1,102 +0,0 @@ -# -# Provides a much easier way to search and access ZSH's manual. First checks for -# terms at the start of the manual, then checks if it's at start of a line allowing -# whitespace. -# -# Authors: -# Samantha McVey -# - -# function zsh-help { - -local usage="$( -cat <&2; fi - if man --pager='' ${i} | grep -E ${case} "${pattern}" > /dev/null; then - printf "%s" "${i}"; return 0; - fi - done - return 1 - } - # By default search only things at start of line - local first_prefix='^' - local prefix='^\s*' - if [[ ${1} == '--zsh-help-debug' ]]; then - shift; debug=1 - fi - if [[ ${1} == "--all" ]]; then - shift; first_prefix='' # We're searching everything, so remove the prefix - fi - if [[ $# < 1 || $1 == "--help" ]]; then - printf "%s\n" "${usage}" - unfunction _zsh-help-join; unfunction _zsh-help-try-query; # unfunction so it's not in the global scope - return 1 - fi - if [[ ${1} == "test" && $# == 1 ]]; then - case='' - pattern='^CONDITIONAL EXPRESSIONS$' - elif [[ ($1 == "-eq" || $1 == "-ne" || $1 == "-lt" || $1 == "-gt" || $1 == "-le" || $1 == "-ge") && $# == 1 ]]; then - case='' - pattern="${prefix}exp1\s+${1}\s+exp2" - elif [[ $1 == 'zstyle' ]]; then - pattern=$(_zsh-help-join '\s+' "$@") - section=ZSHMODULES - fi - # If it wasn't one of the special-cased things, check ZSHBUILTINS first. If - # not found there, we will search ZSHALL - if [[ ${pattern} == "" ]]; then - pattern="$(_zsh-help-join '\s+' "$@")" - # search for sections at the start of the man page first - section=$(_zsh-help-try-query "${case}" "${first_prefix}${pattern}") - # If it exists there, keep ZSHBUILTINS as the section - if (( $? == 0 )); then - pattern="${first_prefix}${pattern}" - elif [[ "${prefix}" ]]; then - # if not found, search for the term preceeded by whitetext - section=$(_zsh-help-try-query "${case}" "${prefix}${pattern}") - if (( $? == 0 )); then - pattern="${prefix}${pattern}" - else - pattern="" - fi - fi - if [[ ! ${pattern} ]]; then # Otherwise we use zshall - printf "Can't find term\n" 2>&1 - unfunction _zsh-help-join; unfunction _zsh-help-try-query; # unfunction so it's not in the global scope - return 1; - fi - fi - local command="man --pager=\"less ${case} -p '${pattern}'\" \"${section}\"" - if [[ ${debug} ]]; then - printf "\nFinal search term is:\n"; printf "%s\n" "${command}"; - else - eval $command - fi - local rtrn=$? - unfunction _zsh-help-join; unfunction _zsh-help-try-query; # unfunction so it's not in the global scope - return $? -#} diff --git a/.zprezto/modules/utility/init.zsh b/.zprezto/modules/utility/init.zsh deleted file mode 100644 index 6b07bf0..0000000 --- a/.zprezto/modules/utility/init.zsh +++ /dev/null @@ -1,245 +0,0 @@ -# -# Defines general aliases and functions. -# -# Authors: -# Robby Russell -# Suraj N. Kurapati -# Sorin Ionescu -# - -# Load dependencies. -pmodload 'helper' 'spectrum' - -# Correct commands. -setopt CORRECT - -# -# Aliases -# - -# Disable correction. -alias ack='nocorrect ack' -alias cd='nocorrect cd' -alias cp='nocorrect cp' -alias ebuild='nocorrect ebuild' -alias gcc='nocorrect gcc' -alias gist='nocorrect gist' -alias grep='nocorrect grep' -alias heroku='nocorrect heroku' -alias ln='nocorrect ln' -alias man='nocorrect man' -alias mkdir='nocorrect mkdir' -alias mv='nocorrect mv' -alias mysql='nocorrect mysql' -alias rm='nocorrect rm' - -# Disable globbing. -alias bower='noglob bower' -alias fc='noglob fc' -alias find='noglob find' -alias ftp='noglob ftp' -alias history='noglob history' -alias locate='noglob locate' -alias rake='noglob rake' -alias rsync='noglob rsync' -alias scp='noglob scp' -alias sftp='noglob sftp' - -# Define general aliases. -alias _='sudo' -alias b='${(z)BROWSER}' - -alias diffu="diff --unified" -alias e='${(z)VISUAL:-${(z)EDITOR}}' -alias mkdir="${aliases[mkdir]:-mkdir} -p" -alias p='${(z)PAGER}' -alias po='popd' -alias pu='pushd' -alias sa='alias | grep -i' -alias type='type -a' - -# Safe ops. Ask the user before doing anything destructive. -alias rmi="${aliases[rm]:-rm} -i" -alias mvi="${aliases[mv]:-mv} -i" -alias cpi="${aliases[cp]:-cp} -i" -alias lni="${aliases[ln]:-ln} -i" -if zstyle -T ':prezto:module:utility' safe-ops; then - alias rm='rmi' - alias mv='mvi' - alias cp='cpi' - alias ln='lni' -fi - -# ls -if is-callable 'dircolors'; then - # GNU Core Utilities - - if zstyle -T ':prezto:module:utility:ls' dirs-first; then - alias ls="${aliases[ls]:-ls} --group-directories-first" - fi - - if zstyle -t ':prezto:module:utility:ls' color; then - # Call dircolors to define colors if they're missing - if [[ -z "$LS_COLORS" ]]; then - if [[ -s "$HOME/.dir_colors" ]]; then - eval "$(dircolors --sh "$HOME/.dir_colors")" - else - eval "$(dircolors --sh)" - fi - fi - - alias ls="${aliases[ls]:-ls} --color=auto" - else - alias ls="${aliases[ls]:-ls} -F" - fi -else - # BSD Core Utilities - if zstyle -t ':prezto:module:utility:ls' color; then - # Define colors for BSD ls if they're not already defined - if [[ -z "$LSCOLORS" ]]; then - export LSCOLORS='exfxcxdxbxGxDxabagacad' - fi - - # Define colors for the completion system if they're not already defined - if [[ -z "$LS_COLORS" ]]; then - export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:' - fi - - alias ls="${aliases[ls]:-ls} -G" - else - alias ls="${aliases[ls]:-ls} -F" - fi -fi - -alias l='ls -1A' # Lists in one column, hidden files. -alias ll='ls -lh' # Lists human readable sizes. -alias lr='ll -R' # Lists human readable sizes, recursively. -alias la='ll -A' # Lists human readable sizes, hidden files. -alias lm='la | "$PAGER"' # Lists human readable sizes, hidden files through pager. -alias lx='ll -XB' # Lists sorted by extension (GNU only). -alias lk='ll -Sr' # Lists sorted by size, largest last. -alias lt='ll -tr' # Lists sorted by date, most recent last. -alias lc='lt -c' # Lists sorted by date, most recent last, shows change time. -alias lu='lt -u' # Lists sorted by date, most recent last, shows access time. -alias sl='ls' # I often screw this up. - -# Grep -if zstyle -t ':prezto:module:utility:grep' color; then - export GREP_COLOR='37;45' # BSD. - export GREP_COLORS="mt=$GREP_COLOR" # GNU. - - alias grep="${aliases[grep]:-grep} --color=auto" -fi - -# macOS Everywhere -if [[ "$OSTYPE" == darwin* ]]; then - alias o='open' -elif [[ "$OSTYPE" == cygwin* ]]; then - alias o='cygstart' - alias pbcopy='tee > /dev/clipboard' - alias pbpaste='cat /dev/clipboard' -else - alias o='xdg-open' - - if (( $+commands[xclip] )); then - alias pbcopy='xclip -selection clipboard -in' - alias pbpaste='xclip -selection clipboard -out' - elif (( $+commands[xsel] )); then - alias pbcopy='xsel --clipboard --input' - alias pbpaste='xsel --clipboard --output' - fi -fi - -alias pbc='pbcopy' -alias pbp='pbpaste' - -# File Download -if (( $+commands[curl] )); then - alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time' -elif (( $+commands[wget] )); then - alias get='wget --continue --progress=bar --timestamping' -fi - -# Resource Usage -alias df='df -kh' -alias du='du -kh' - -if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then - alias topc='top -o cpu' - alias topm='top -o vsize' -else - alias topc='top -o %CPU' - alias topm='top -o %MEM' -fi - -# Miscellaneous - -# Serves a directory via HTTP. -if (( $+commands[python3] )); then - alias http-serve='python3 -m http.server' -else - alias http-serve='python -m SimpleHTTPServer' -fi - -# -# Functions -# - -# Makes a directory and changes to it. -function mkdcd { - [[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1" -} - -# Changes to a directory and lists its contents. -function cdls { - builtin cd "$argv[-1]" && ls "${(@)argv[1,-2]}" -} - -# Pushes an entry onto the directory stack and lists its contents. -function pushdls { - builtin pushd "$argv[-1]" && ls "${(@)argv[1,-2]}" -} - -# Pops an entry off the directory stack and lists its contents. -function popdls { - builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}" -} - -# Prints columns 1 2 3 ... n. -function slit { - awk "{ print ${(j:,:):-\$${^@}} }" -} - -# Finds files and executes a command on them. -function find-exec { - find . -type f -iname "*${1:-}*" -exec "${2:-file}" '{}' \; -} - -# Displays user owned processes status. -function psu { - ps -U "${1:-$LOGNAME}" -o 'pid,%cpu,%mem,command' "${(@)argv[2,-1]}" -} - -# Enables globbing selectively on path arguments. -# Globbing is enabled on local paths (starting in '/' and './') and disabled -# on remote paths (containing ':' but not starting in '/' and './'). This is -# useful for programs that have their own globbing for remote paths. -# Currently, this is used by default for 'rsync' and 'scp'. -# Example: -# - Local: '*.txt', './foo:2017*.txt', '/var/*:log.txt' -# - Remote: user@localhost:foo/ -# -# NOTE: This function is buggy and is not used anywhere until we can make sure -# it's fixed. See https://github.com/sorin-ionescu/prezto/issues/1443 and -# https://github.com/sorin-ionescu/prezto/issues/1521 for more information. -function noremoteglob { - local -a argo - local cmd="$1" - for arg in ${argv:2}; do case $arg in - ( ./* ) argo+=( ${~arg} ) ;; # local relative, glob - ( /* ) argo+=( ${~arg} ) ;; # local absolute, glob - ( *:* ) argo+=( ${arg} ) ;; # remote, noglob - ( * ) argo+=( ${~arg} ) ;; # default, glob - esac; done - command $cmd "${(@)argo}" -} diff --git a/.zprezto/modules/wakeonlan/README.md b/.zprezto/modules/wakeonlan/README.md deleted file mode 100644 index dacfa52..0000000 --- a/.zprezto/modules/wakeonlan/README.md +++ /dev/null @@ -1,40 +0,0 @@ -Wake-on-LAN -=========== - -This module provides a wrapper around the [wakeonlan][1] tool. - -Usage ------ - -To use this wrapper, create the *~/.wakeonlan* directory, and place in it one -file for each device you would like to be able to wake. Give the file a name -that describes the device, such as its hostname. - -Each file should contain a line with the MAC address of the target device and -the network broadcast address. For instance, there might be a file -*~/.wakeonlan/leto* with the following contents: - -```conf -00:11:22:33:44:55:66 192.168.0.255 -``` - -To wake that device, use the following command: - -```sh -$ wake leto -``` - -For more information on the configuration file format, read the -[wakeonlan man page][2]. - -Authors -------- - -*The authors of this module should be contacted via [issue tracker][3].* - - - [Paul Dann](https://github.com/giddie) - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://gsd.di.uminho.pt/jpo/software/wakeonlan/ -[2]: http://man.cx/wakeonlan -[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/wakeonlan/functions/_wake b/.zprezto/modules/wakeonlan/functions/_wake deleted file mode 100644 index 87e1a36..0000000 --- a/.zprezto/modules/wakeonlan/functions/_wake +++ /dev/null @@ -1,12 +0,0 @@ -#compdef wake -#autoload - -# -# Completes wake. -# -# Authors: -# Paul Gideon Dann -# Sorin Ionescu -# - -_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 diff --git a/.zprezto/modules/wakeonlan/functions/wake b/.zprezto/modules/wakeonlan/functions/wake deleted file mode 100644 index 6f7d6c5..0000000 --- a/.zprezto/modules/wakeonlan/functions/wake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Wakes devices via wakeonlan. -# -# Authors: -# Paul Gideon Dann -# Sorin Ionescu -# - -# function wake { - -local config_file="$HOME/.wakeonlan/$1" -if [[ ! -s "$config_file" ]]; then - print "$0: invalid device file: $1" >&2 - return 1 -fi - -if (( ! $+commands[wakeonlan] )); then - print "$0: command not found: wakeonlan" >&2 - return 1 -fi - -wakeonlan -f "$config_file" - -# } diff --git a/.zprezto/modules/yum/README.md b/.zprezto/modules/yum/README.md deleted file mode 100644 index fa944da..0000000 --- a/.zprezto/modules/yum/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Yum -=== - -Defines [yum][1] aliases. - -Aliases -------- - - - `yumc` removes package(s) and leaves. - - `yumi` installs package(s). - - `yumh` displays history. - - `yuml` lists packages. - - `yumL` lists installed packages. - - `yumq` displays package information. - - `yumr` removes package(s). - - `yums` searches for a package. - - `yumu` updates packages. - - `yumU` upgrades packages. - -Authors -------- - -*The authors of this module should be contacted via the [issue tracker][2].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://yum.baseurl.org -[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/modules/yum/init.zsh b/.zprezto/modules/yum/init.zsh deleted file mode 100644 index 2f5427d..0000000 --- a/.zprezto/modules/yum/init.zsh +++ /dev/null @@ -1,27 +0,0 @@ -# -# Defines yum aliases. -# -# Authors: -# Simon -# Sorin Ionescu -# - -# Return if requirements are not found. -if (( ! $+commands[yum] )); then - return 1 -fi - -# -# Aliases -# - -alias yumc='sudo yum clean all' # Cleans the cache. -alias yumh='yum history' # Displays history. -alias yumi='sudo yum install' # Installs package(s). -alias yuml='yum list' # Lists packages. -alias yumL='yum list installed' # Lists installed packages. -alias yumq='yum info' # Displays package information. -alias yumr='sudo yum remove' # Removes package(s). -alias yums='yum search' # Searches for a package. -alias yumu='sudo yum update' # Updates packages. -alias yumU='sudo yum upgrade' # Upgrades packages. diff --git a/.zprezto/runcoms/README.md b/.zprezto/runcoms/README.md deleted file mode 100644 index 29d9f8a..0000000 --- a/.zprezto/runcoms/README.md +++ /dev/null @@ -1,79 +0,0 @@ -Configuration Files -=================== - -Zsh has several system-wide and user-local configuration files. - -Prezto has one user-local configuration file. - -System-wide configuration files are installation-dependent but are installed -in */etc* by default. - -User-local configuration files have the same name as their global counterparts -but are prefixed with a dot (hidden). Zsh looks for these files in the path -stored in the `$ZDOTDIR` environment variable. However, if said variable is -not defined, Zsh will use the user's home directory. - -File Descriptions ------------------ - -The configuration files are read in the following order: - - 01. /etc/zshenv - 02. ~/.zshenv - 03. /etc/zprofile - 04. ~/.zprofile - 05. /etc/zshrc - 06. ~/.zshrc - 07. ~/.zpreztorc - 08. /etc/zlogin - 09. ~/.zlogin - 10. ~/.zlogout - 11. /etc/zlogout - -### zshenv - -This file is sourced by all instances of Zsh, and thus, it should be kept as -small as possible and should only define environment variables. - -### zprofile - -This file is similar to zlogin, but it is sourced before zshrc. It was added -for [KornShell][1] fans. See the description of zlogin below for what it may -contain. - -zprofile and zlogin are not meant to be used concurrently but can be done so. - -### zshrc - -This file is sourced by interactive shells. It should define aliases, -functions, shell options, and key bindings. - -### zpreztorc - -This file configures Prezto. - -### zlogin - -This file is sourced by login shells after zshrc, and thus, it should contain -commands that need to execute at login. It is usually used for messages such as -[fortune][2], [msgs][3], or for the creation of files. - -This is not the file to define aliases, functions, shell options, and key -bindings. It should not change the shell environment. - -### zlogout - -This file is sourced by login shells during logout. It should be used for -displaying messages and the deletion of files. - -Authors -------- - -*The authors of these files should be contacted via the [issue tracker][4].* - - - [Sorin Ionescu](https://github.com/sorin-ionescu) - -[1]: http://www.kornshell.com -[2]: http://en.wikipedia.org/wiki/Fortune_(Unix) -[3]: http://www.manpagez.com/man/1/msgs -[4]: https://github.com/sorin-ionescu/prezto/issues diff --git a/.zprezto/runcoms/zlogin b/.zprezto/runcoms/zlogin deleted file mode 100644 index c914107..0000000 --- a/.zprezto/runcoms/zlogin +++ /dev/null @@ -1,15 +0,0 @@ -# -# Executes commands at login post-zshrc. -# -# Authors: -# Sorin Ionescu -# - -# Execute code that does not affect the current session in the background. -{ - # Compile the completion dump to increase startup speed. - zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" - if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then - zcompile "$zcompdump" - fi -} &! diff --git a/.zprezto/runcoms/zlogout b/.zprezto/runcoms/zlogout deleted file mode 100644 index 21616f8..0000000 --- a/.zprezto/runcoms/zlogout +++ /dev/null @@ -1,6 +0,0 @@ -# -# Executes commands at logout. -# -# Authors: -# Sorin Ionescu -# diff --git a/.zprezto/runcoms/zpreztorc b/.zprezto/runcoms/zpreztorc deleted file mode 100644 index 3d4b924..0000000 --- a/.zprezto/runcoms/zpreztorc +++ /dev/null @@ -1,230 +0,0 @@ -# -# Sets Prezto options. -# -# Authors: -# Sorin Ionescu -# - -# -# General -# - -# Set case-sensitivity for completion, history lookup, etc. -# zstyle ':prezto:*:*' case-sensitive 'yes' - -# Color output (auto set to 'no' on dumb terminals). -zstyle ':prezto:*:*' color 'yes' - -# Add additional directories to load prezto modules from -# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib - -# Set the Zsh modules to load (man zshmodules). -# zstyle ':prezto:load' zmodule 'attr' 'stat' - -# Set the Zsh functions to load (man zshcontrib). -# zstyle ':prezto:load' zfunction 'zargs' 'zmv' - -# Set the Prezto modules to load (browse modules). -# The order matters. -zstyle ':prezto:load' pmodule \ - 'environment' \ - 'terminal' \ - 'editor' \ - 'history' \ - 'directory' \ - 'spectrum' \ - 'utility' \ - 'completion' \ - 'prompt' \ - 'ssh' \ - 'homebrew' \ - 'osx' \ - 'git' \ - 'syntax-highlighting' \ - 'history-substring-search' - -# -# Autosuggestions -# - -# Set the query found color. -# zstyle ':prezto:module:autosuggestions:color' found '' - -# -# Completions -# - -# Set the entries to ignore in static */etc/hosts* for host completion. -# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \ -# '0.0.0.0' '127.0.0.1' - -# -# Editor -# - -# Set the key mapping style to 'emacs' or 'vi'. -zstyle ':prezto:module:editor' key-bindings 'emacs' - -# Auto convert .... to ../.. -# zstyle ':prezto:module:editor' dot-expansion 'yes' - -# Allow the zsh prompt context to be shown. -#zstyle ':prezto:module:editor' ps-context 'yes' - -# -# Git -# - -# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'. -# zstyle ':prezto:module:git:status:ignore' submodules 'all' - -# -# GNU Utility -# - -# Set the command prefix on non-GNU systems. -# zstyle ':prezto:module:gnu-utility' prefix 'g' - -# -# History Substring Search -# - -# Set the query found color. -# zstyle ':prezto:module:history-substring-search:color' found '' - -# Set the query not found color. -# zstyle ':prezto:module:history-substring-search:color' not-found '' - -# Set the search globbing flags. -# zstyle ':prezto:module:history-substring-search' globbing-flags '' - -# -# macOS -# - -# Set the keyword used by `mand` to open man pages in Dash.app -# zstyle ':prezto:module:osx:man' dash-keyword 'manpages' - -# -# Pacman -# - -# Set the Pacman frontend. -# zstyle ':prezto:module:pacman' frontend 'yaourt' - -# -# Prompt -# - -# Set the prompt theme to load. -# Setting it to 'random' loads a random theme. -# Auto set to 'off' on dumb terminals. -zstyle ':prezto:module:prompt' theme 'abra' - -# Set the working directory prompt display length. -# By default, it is set to 'short'. Set it to 'long' (without '~' expansion) -# for longer or 'full' (with '~' expansion) for even longer prompt display. -# zstyle ':prezto:module:prompt' pwd-length 'short' - -# Set the prompt to display the return code along with an indicator for non-zero -# return codes. This is not supported by all prompts. -# zstyle ':prezto:module:prompt' show-return-val 'yes' - -# -# Ruby -# - -# Auto switch the Ruby version on directory change. -# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' - -# -# Python -# - -# Auto switch the Python virtualenv on directory change. -# zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' - -# Automatically initialize virtualenvwrapper if pre-requisites are met. -# zstyle ':prezto:module:python:virtualenv' initialize 'yes' - -# -# Screen -# - -# Auto start a session when Zsh is launched in a local terminal. -# zstyle ':prezto:module:screen:auto-start' local 'yes' - -# Auto start a session when Zsh is launched in a SSH connection. -# zstyle ':prezto:module:screen:auto-start' remote 'yes' - -# -# SSH -# - -# Set the SSH identities to load into the agent. -# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' - -# -# Syntax Highlighting -# - -# Set syntax highlighters. -# By default, only the main highlighter is enabled. -# zstyle ':prezto:module:syntax-highlighting' highlighters \ -# 'main' \ -# 'brackets' \ -# 'pattern' \ -# 'line' \ -# 'cursor' \ -# 'root' -# -# Set syntax highlighting styles. -# zstyle ':prezto:module:syntax-highlighting' styles \ -# 'builtin' 'bg=blue' \ -# 'command' 'bg=blue' \ -# 'function' 'bg=blue' -# -# Set syntax pattern styles. -# zstyle ':prezto:module:syntax-highlighting' pattern \ -# 'rm*-rf*' 'fg=white,bold,bg=red' - -# -# Terminal -# - -# Auto set the tab and window titles. -# zstyle ':prezto:module:terminal' auto-title 'yes' - -# Set the window title format. -# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' - -# Set the tab title format. -# zstyle ':prezto:module:terminal:tab-title' format '%m: %s' - -# Set the terminal multiplexer title format. -# zstyle ':prezto:module:terminal:multiplexer-title' format '%s' - -# -# Tmux -# - -# Auto start a session when Zsh is launched in a local terminal. -# zstyle ':prezto:module:tmux:auto-start' local 'yes' - -# Auto start a session when Zsh is launched in a SSH connection. -# zstyle ':prezto:module:tmux:auto-start' remote 'yes' - -# Integrate with iTerm2. -zstyle ':prezto:module:tmux:iterm' integrate 'yes' - -# Set the default session name: -# zstyle ':prezto:module:tmux:session' name 'YOUR DEFAULT SESSION NAME' - -# -# Utility -# - -# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt -# before deleting or overwriting files. Set to 'no' to disable this safer -# behavior. -zstyle ':prezto:module:utility' safe-ops 'no' diff --git a/.zprezto/runcoms/zprofile b/.zprezto/runcoms/zprofile deleted file mode 100644 index 5a7ae33..0000000 --- a/.zprezto/runcoms/zprofile +++ /dev/null @@ -1,74 +0,0 @@ -# -# Executes commands at login pre-zshrc. -# -# Authors: -# Sorin Ionescu -# - -# -# Browser -# - -if [[ "$OSTYPE" == darwin* ]]; then - export BROWSER='open' -fi - -# -# Editors -# - -export EDITOR='vim' -export VISUAL='vim' -export PAGER='less' - -# -# Language -# - -if [[ -z "$LANG" ]]; then - export LANG='en_US.UTF-8' -fi - -# -# Paths -# - -# Ensure path arrays do not contain duplicates. -typeset -gU cdpath fpath mailpath path - -# Set the list of directories that cd searches. -# cdpath=( -# $cdpath -# ) - -# Set the list of directories that Zsh searches for programs. -#path=( -# /usr/local/{bin,sbin} -# $path -#) -path=( - "$HOME/bin" - "$HOME/.poetry/bin" - $path -) - -# -# Less -# - -# Set the default Less options. -# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). -# Remove -X and -F (exit if the content fits on one screen) to enable it. -export LESS='-F -g -i -M -R -S -w -X -z-4' - -# Set the Less input preprocessor. -# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. -if (( $#commands[(i)lesspipe(|.sh)] )); then - export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" -fi - -export PIPENV_VENV_IN_PROJECT=1 - -export LD_LIBRARY_PATH=$HOME/brew/lib:$LD_LIBRARY_PATH - -# export PATH="$HOME/.poetry/bin:$PATH" diff --git a/.zprezto/runcoms/zshenv b/.zprezto/runcoms/zshenv deleted file mode 100644 index 2dbf12a..0000000 --- a/.zprezto/runcoms/zshenv +++ /dev/null @@ -1,11 +0,0 @@ -# -# Defines environment variables. -# -# Authors: -# Sorin Ionescu -# - -# Ensure that a non-login, non-interactive shell has a defined environment. -if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then - source "${ZDOTDIR:-$HOME}/.zprofile" -fi diff --git a/.zprezto/runcoms/zshrc b/.zprezto/runcoms/zshrc deleted file mode 100644 index 505dc30..0000000 --- a/.zprezto/runcoms/zshrc +++ /dev/null @@ -1,17 +0,0 @@ -# -# Executes commands at the start of an interactive session. -# -# Authors: -# Sorin Ionescu -# - -function zsource_if_exists { - if [[ -s "$1" ]]; then - source "$1" - fi -} - -# Source Prezto. -zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" - -zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/abra/main.zsh" diff --git a/.zpreztorc b/.zpreztorc deleted file mode 120000 index fb46b62..0000000 --- a/.zpreztorc +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zpreztorc \ No newline at end of file diff --git a/.zprofile b/.zprofile deleted file mode 120000 index b085555..0000000 --- a/.zprofile +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zprofile \ No newline at end of file diff --git a/.zshenv b/.zshenv deleted file mode 120000 index 2ffffef..0000000 --- a/.zshenv +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zshenv \ No newline at end of file diff --git a/.zshrc b/.zshrc deleted file mode 120000 index ff7ceae..0000000 --- a/.zshrc +++ /dev/null @@ -1 +0,0 @@ -.zprezto/runcoms/zshrc \ No newline at end of file diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..490ebd8 --- /dev/null +++ b/.zshrc @@ -0,0 +1,159 @@ +# Basic +export LANG=en_US.UTF-8 +export EDITOR=vim +export HISTFILE=~/.zhistory +export HISTSIZE=100000 +export SAVEHIST=100000 + +# History behavior +setopt INC_APPEND_HISTORY SHARE_HISTORY +setopt HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS +setopt HIST_VERIFY + +# General quality-of-life +setopt EXTENDED_GLOB +setopt INTERACTIVE_COMMENTS +setopt MULTIOS # pipe to multiple outputs +setopt AUTO_PUSHD # cd becomes pushd +setopt AUTO_NAME_DIRS # use named dirs when possible +setopt GLOB_COMPLETE # expand globs +setopt ZLE +setopt NO_FLOW_CONTROL # disable Ctrl-S +setopt CLOBBER # allow > to overwrite +setopt NO_CASE_GLOB # case insensitive globbing +setopt NUMERIC_GLOB_SORT +setopt RC_EXPAND_PARAM # better array expansion + +unsetopt AUTO_CD # don't run directories as commands +unsetopt CORRECT # no "did you mean?" +unsetopt BANG_HIST # no ! history expansion + +# modules +zmodload zsh/datetime +zmodload zsh/mathfunc + +# plugin manager +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git" +[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)" +[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" +source "${ZINIT_HOME}/zinit.zsh" + +zinit light zsh-users/zsh-autosuggestions +zinit light zsh-users/zsh-syntax-highlighting +zinit light zsh-users/zsh-completions + +# completions +autoload -Uz compinit +compinit + +# idk? +zstyle ':completion:*' menu select +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' +bindkey '^[[Z' reverse-menu-complete # shift-tab + +# search from prefix +zinit light zsh-users/zsh-history-substring-search +bindkey "${key[Up]}" history-substring-search-up +bindkey "${key[Down]}" history-substring-search-down + +# keybindings +bindkey -e # emacs mode +bindkey '\e[1~' beginning-of-line +bindkey '\e[4~' end-of-line +bindkey "\eOH" beginning-of-line +bindkey "\eOF" end-of-line +bindkey '^[[3~' delete-char # Delete key +bindkey '^[[1;5C' forward-word # Ctrl+Right +bindkey '^[[1;5D' backward-word # Ctrl+Left +bindkey '^[.' insert-last-word # Alt+. or Esc,. (last arg of prev cmd) +bindkey '^[b' backward-word # Alt+B +bindkey '^[f' forward-word # Alt+F +bindkey '^[^?' backward-kill-word # Alt+Backspace +bindkey '^Q' push-line # Ctrl+Q (stash line, type another, comes back) +autoload -Uz edit-command-line && zle -N edit-command-line +bindkey '^X^E' edit-command-line # Ctrl+X,E → edit in $EDITOR + +# starship config (inline) +export STARSHIP_CONFIG=~/.config/starship.toml +mkdir -p ~/.config +cat > $STARSHIP_CONFIG << 'EOF' +add_newline = true +format = """$git_branch$git_status$character""" +right_format = """$username[@](red)$hostname $cmd_duration$time $directory""" + +[git_branch] +format = "[$branch]($style) " + +[git_status] +format = '[$all_status$ahead_behind]($style)' + +[username] +show_always = true +format = "[$user]($style)" +style_user = "blue bold" + +[hostname] +ssh_only = false +format = "[$hostname]($style)" +style = "blue bold" + +[directory] +truncation_length = 5 +truncate_to_repo = false +style = "cyan bold" + +[cmd_duration] +min_time = 5_000 +show_milliseconds = true +format = '[$duration]($style) ' + +[time] +disabled = false +format = "[$time]($style)" +style = "green" + +[character] +success_symbol = "[➤](green)" +error_symbol = "[➤](red)" +EOF + +# starship prompt +zinit ice as"command" from"gh-r" \ + atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ + atpull"%atclone" src"init.zsh" +zinit light starship/starship + +# paths +typeset -U path +path=( + $HOME/.local/bin + $HOME/.cargo/bin + $path +) + +# aliases: git +alias g="git" +alias a="git add --all :/" +alias b="git branch" +alias c="git commit -am" +alias ch="git checkout" +alias pull="git pull" +alias rb="git reset HEAD --hard" +alias s="git status" +alias st="git stash" +alias dc="a && c 'wip'" + +# aliases: dotfiles (bare repo) +alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME' +alias .gs='.g status -uno' +alias .gp='.g commit -am "auto" && .g push' + +# aliases: tmux +alias tmuxr="tmux new-session -A -s auto" +alias tmuxn="tmux new-session -A -s auto \; new-window" +alias tmuxa="tmux new-session -A -s" + +# aliases: misc +alias zshreload="exec zsh" +alias -g LATEST='*(om[1])' # glob: most recently modified +alias FUNCTION_PRELUDE="setopt LOCAL_OPTIONS PIPE_FAIL XTRACE ERR_RETURN"