From 0029ed672a55ad9a109c3ce32893affff35f9e90 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 6 Feb 2021 10:35:46 +0100 Subject: [PATCH] add a fake hashbang to all autoloadable functions and sourced scripts to get syntax highlighting --- fn/-z4h-autosuggest-fetch | 2 ++ fn/-z4h-brew-command-not-found | 2 ++ fn/-z4h-cd-rotate | 2 ++ fn/-z4h-chsh | 2 ++ fn/-z4h-cmd-bindkey | 2 ++ fn/-z4h-cmd-compile | 2 ++ fn/-z4h-cmd-help | 2 ++ fn/-z4h-cmd-ssh | 2 ++ fn/-z4h-cmd-sudo | 2 ++ fn/-z4h-cmd-update | 2 ++ fn/-z4h-comp-files | 2 ++ fn/-z4h-comp-insert-all | 2 ++ fn/-z4h-comp-words | 2 ++ fn/-z4h-compile | 2 ++ fn/-z4h-complete-cargo | 2 ++ fn/-z4h-complete-helm | 2 ++ fn/-z4h-complete-kitty | 2 ++ fn/-z4h-complete-kubectl | 2 ++ fn/-z4h-complete-oc | 2 ++ fn/-z4h-complete-rustup | 2 ++ fn/-z4h-enable-iterm2-integration | 2 ++ fn/-z4h-error-command | 2 ++ fn/-z4h-error-iterm2-integration | 2 ++ fn/-z4h-error-param-changed | 2 ++ fn/-z4h-find | 2 ++ fn/-z4h-fix-locale | 2 ++ fn/-z4h-flowing | 2 ++ fn/-z4h-fzf | 2 ++ fn/-z4h-gen-init-darwin-paths | 2 ++ fn/-z4h-get-cursor-pos | 2 ++ fn/-z4h-gnu-command-not-found | 2 ++ fn/-z4h-help-bindkey | 2 ++ fn/-z4h-help-compile | 2 ++ fn/-z4h-help-source | 2 ++ fn/-z4h-help-ssh | 2 ++ fn/-z4h-init | 2 ++ fn/-z4h-init-wsl | 2 ++ fn/-z4h-insert-all | 2 ++ fn/-z4h-install-many | 2 ++ fn/-z4h-install-one | 2 ++ fn/-z4h-main-complete | 2 ++ fn/-z4h-move-and-kill | 2 ++ fn/-z4h-mv | 2 ++ fn/-z4h-postinstall-fzf | 2 ++ fn/-z4h-postinstall-powerlevel10k | 2 ++ fn/-z4h-postinstall-systemd | 2 ++ fn/-z4h-postinstall-terminfo | 2 ++ fn/-z4h-postinstall-zsh-autosuggestions | 2 ++ fn/-z4h-postinstall-zsh-history-substring-search | 2 ++ fn/-z4h-postinstall-zsh-syntax-highlighting | 2 ++ fn/-z4h-present-files | 2 ++ fn/-z4h-prompt-length | 2 ++ fn/-z4h-redraw-buffer | 2 ++ fn/-z4h-redraw-prompt | 2 ++ fn/-z4h-restore-screen | 2 ++ fn/-z4h-run-process-tree | 2 ++ fn/-z4h-sanitize-word-prefix | 2 ++ fn/-z4h-save-screen | 2 ++ fn/-z4h-set-list-colors | 2 ++ fn/-z4h-set-term-title | 2 ++ fn/-z4h-show-dots | 2 ++ fn/-z4h-ssh-maybe-update | 2 ++ fn/-z4h-tmux-bypass | 2 ++ fn/-z4h-welcome | 2 ++ fn/-z4h-with-local-history | 2 ++ fn/-z4h-zle-line-finish | 2 ++ fn/-z4h-zle-line-init | 2 ++ fn/-z4h-zle-line-pre-redraw | 2 ++ fn/_z4h_err | 2 ++ fn/z4h-autosuggest-accept | 2 ++ fn/z4h-backward-word | 2 ++ fn/z4h-backward-zword | 2 ++ fn/z4h-cd-down | 2 ++ fn/z4h-clear-screen-hard-bottom | 2 ++ fn/z4h-clear-screen-hard-top | 2 ++ fn/z4h-clear-screen-soft-bottom | 2 ++ fn/z4h-clear-screen-soft-top | 2 ++ fn/z4h-forward-word | 2 ++ fn/z4h-forward-zword | 2 ++ fn/z4h-fzf-complete | 2 ++ fn/z4h-fzf-history | 2 ++ fn/z4h-stash-buffer | 2 ++ sc/exec-zsh-i | 2 ++ 83 files changed, 166 insertions(+) diff --git a/fn/-z4h-autosuggest-fetch b/fn/-z4h-autosuggest-fetch index 48abb19..06a1a6d 100644 --- a/fn/-z4h-autosuggest-fetch +++ b/fn/-z4h-autosuggest-fetch @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + if [[ -z $BUFFER || $CONTEXT != start ]]; then unset POSTDISPLAY _z4h_autosuggest_buffer _z4h_autosuggestion else diff --git a/fn/-z4h-brew-command-not-found b/fn/-z4h-brew-command-not-found index c671aa4..4b0bc17 100644 --- a/fn/-z4h-brew-command-not-found +++ b/fn/-z4h-brew-command-not-found @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" { diff --git a/fn/-z4h-cd-rotate b/fn/-z4h-cd-rotate index 6f19187..7b4d20c 100644 --- a/fn/-z4h-cd-rotate +++ b/fn/-z4h-cd-rotate @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + () { eval "$_z4h_opt" while (( $#dirstack )) && ! pushd -q $1 &>/dev/null; do diff --git a/fn/-z4h-chsh b/fn/-z4h-chsh index 95e4336..2d5b364 100644 --- a/fn/-z4h-chsh +++ b/fn/-z4h-chsh @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local user=${(%):-%n} diff --git a/fn/-z4h-cmd-bindkey b/fn/-z4h-cmd-bindkey index c0a31c3..7674f3d 100644 --- a/fn/-z4h-cmd-bindkey +++ b/fn/-z4h-cmd-bindkey @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" zparseopts -D -F -- || return '_z4h_err()' diff --git a/fn/-z4h-cmd-compile b/fn/-z4h-cmd-compile index 12329ab..849c782 100644 --- a/fn/-z4h-cmd-compile +++ b/fn/-z4h-cmd-compile @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local file zparseopts -D -F -- || return '_z4h_err()' emulate zsh -o extended_glob -c 'local files=(${^@}(N))' diff --git a/fn/-z4h-cmd-help b/fn/-z4h-cmd-help index c91113a..fc5365f 100644 --- a/fn/-z4h-cmd-help +++ b/fn/-z4h-cmd-help @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" if (( ARGC == 1 )); then diff --git a/fn/-z4h-cmd-ssh b/fn/-z4h-cmd-ssh index d72a0ab..2df0924 100644 --- a/fn/-z4h-cmd-ssh +++ b/fn/-z4h-cmd-ssh @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # TODO: write proper docs for these configuration options. # # zstyle ':z4h:ssh:my_host' enable 'yes' diff --git a/fn/-z4h-cmd-sudo b/fn/-z4h-cmd-sudo index 37562e3..c1aedf6 100644 --- a/fn/-z4h-cmd-sudo +++ b/fn/-z4h-cmd-sudo @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local term diff --git a/fn/-z4h-cmd-update b/fn/-z4h-cmd-update index f02ece8..390621d 100644 --- a/fn/-z4h-cmd-update +++ b/fn/-z4h-cmd-update @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" -z4h-check-core-params || return diff --git a/fn/-z4h-comp-files b/fn/-z4h-comp-files index d2523a7..927fa88 100644 --- a/fn/-z4h-comp-files +++ b/fn/-z4h-comp-files @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + () { eval "$_z4h_opt" diff --git a/fn/-z4h-comp-insert-all b/fn/-z4h-comp-insert-all index 02855f9..d2da1ea 100644 --- a/fn/-z4h-comp-insert-all +++ b/fn/-z4h-comp-insert-all @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + emulate -L zsh if (( $#_z4h_scaffolds == 1 )); then diff --git a/fn/-z4h-comp-words b/fn/-z4h-comp-words index 13f230b..2b751aa 100644 --- a/fn/-z4h-comp-words +++ b/fn/-z4h-comp-words @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + () { eval "$_z4h_opt" diff --git a/fn/-z4h-compile b/fn/-z4h-compile index faf97ae..64254f1 100644 --- a/fn/-z4h-compile +++ b/fn/-z4h-compile @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Runs with user options. # # Precondition: [[ -e $1 ]]. diff --git a/fn/-z4h-complete-cargo b/fn/-z4h-complete-cargo index 8879e3b..cd6dacb 100644 --- a/fn/-z4h-complete-cargo +++ b/fn/-z4h-complete-cargo @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + (( $+commands[rustup] && $+commands[rustc] )) || { unset '_comps[cargo]' _default "$@" diff --git a/fn/-z4h-complete-helm b/fn/-z4h-complete-helm index d879fe6..aedba7e 100644 --- a/fn/-z4h-complete-helm +++ b/fn/-z4h-complete-helm @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local helm="${commands[helm]-}" local orig_cmd="${_comps[helm]-}" local comp="$Z4H"/cache/helm-completion-$EUID.zsh diff --git a/fn/-z4h-complete-kitty b/fn/-z4h-complete-kitty index 56b444a..c910c09 100644 --- a/fn/-z4h-complete-kitty +++ b/fn/-z4h-complete-kitty @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local kitty="${commands[kitty]-}" local orig_cmd="${_comps[kitty]-}" local comp="$Z4H"/cache/kitty-completion-$EUID.zsh diff --git a/fn/-z4h-complete-kubectl b/fn/-z4h-complete-kubectl index 1649835..3d80139 100644 --- a/fn/-z4h-complete-kubectl +++ b/fn/-z4h-complete-kubectl @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local kubectl="${commands[kubectl]-}" local orig_cmd="${_comps[kubectl]-}" local comp="$Z4H"/cache/kubectl-completion-$EUID.zsh diff --git a/fn/-z4h-complete-oc b/fn/-z4h-complete-oc index 52ca94a..6eeaeba 100644 --- a/fn/-z4h-complete-oc +++ b/fn/-z4h-complete-oc @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local oc="${commands[oc]-}" local orig_cmd="${_comps[oc]-}" local comp="$Z4H"/cache/oc-completion-$EUID.zsh diff --git a/fn/-z4h-complete-rustup b/fn/-z4h-complete-rustup index b9b6d28..161fe91 100644 --- a/fn/-z4h-complete-rustup +++ b/fn/-z4h-complete-rustup @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + (( $+commands[rustup] )) || { unset '_comps[rustup]' _default "$@" diff --git a/fn/-z4h-enable-iterm2-integration b/fn/-z4h-enable-iterm2-integration index d12ec13..5db5215 100644 --- a/fn/-z4h-enable-iterm2-integration +++ b/fn/-z4h-enable-iterm2-integration @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + function iterm2_set_user_var() { (( ${+commands[base64]} )) || return local x diff --git a/fn/-z4h-error-command b/fn/-z4h-error-command index 7ddabdb..de3b516 100644 --- a/fn/-z4h-error-command +++ b/fn/-z4h-error-command @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local home=~ local zdotdir=${${${(q)ZDOTDIR}/#${(q)home}/'~'}//\%/%%} local z4h=${${${(q)Z4H}/#${(q)home}/'~'}//\%/%%} diff --git a/fn/-z4h-error-iterm2-integration b/fn/-z4h-error-iterm2-integration index 0793a37..8da4d68 100644 --- a/fn/-z4h-error-iterm2-integration +++ b/fn/-z4h-error-iterm2-integration @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local home=~ local zdotdir=${${${(q)ZDOTDIR}/#${(q)home}/'~'}//\%/%%} diff --git a/fn/-z4h-error-param-changed b/fn/-z4h-error-param-changed index 07090de..26f8849 100644 --- a/fn/-z4h-error-param-changed +++ b/fn/-z4h-error-param-changed @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" print -Pru2 -- "%F{3}z4h%f: core parameters have unexpectedly changed" diff --git a/fn/-z4h-find b/fn/-z4h-find index 7ad1a2c..6778cf6 100644 --- a/fn/-z4h-find +++ b/fn/-z4h-find @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local dot_glob=$1 local only_dirs=$2 local dirs=("${@:3}") diff --git a/fn/-z4h-fix-locale b/fn/-z4h-fix-locale index b60cb40..4feb08d 100644 --- a/fn/-z4h-fix-locale +++ b/fn/-z4h-fix-locale @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Try in order: C.UTF-8, en_US.UTF-8, the first UTF-8 locale in lexicographical order. (( $+commands[locale] )) || return local loc=(${(@M)$(locale -a):#*.(utf|UTF)(-|)8}) diff --git a/fn/-z4h-flowing b/fn/-z4h-flowing index a6a5d8a..aa7f700 100644 --- a/fn/-z4h-flowing +++ b/fn/-z4h-flowing @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local -a centered indentation diff --git a/fn/-z4h-fzf b/fn/-z4h-fzf index fb9de7c..8a58743 100644 --- a/fn/-z4h-fzf +++ b/fn/-z4h-fzf @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local widget=${WIDGET#z4h-} diff --git a/fn/-z4h-gen-init-darwin-paths b/fn/-z4h-gen-init-darwin-paths index 9da4615..862dd55 100644 --- a/fn/-z4h-gen-init-darwin-paths +++ b/fn/-z4h-gen-init-darwin-paths @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -a stat local files=(/usr/libexec/path_helper /etc/{,man}paths{,.d} /etc/paths.d/*(N) /etc/manpaths.d/*(N)) zstat -A stat +mtime -- $files 2>/dev/null || return diff --git a/fn/-z4h-get-cursor-pos b/fn/-z4h-get-cursor-pos index db7b618..0c8ba1c 100644 --- a/fn/-z4h-get-cursor-pos +++ b/fn/-z4h-get-cursor-pos @@ -1,2 +1,4 @@ +#!/usr/bin/env zsh + local esc IFS='[;' builtin read -s -d R esc\?$'\e[6n' cursor_y cursor_x <"$TTY" diff --git a/fn/-z4h-gnu-command-not-found b/fn/-z4h-gnu-command-not-found index fa67481..e2aa0ee 100644 --- a/fn/-z4h-gnu-command-not-found +++ b/fn/-z4h-gnu-command-not-found @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" function command_not_found_handler() { diff --git a/fn/-z4h-help-bindkey b/fn/-z4h-help-bindkey index fbf9dab..18bf24d 100644 --- a/fn/-z4h-help-bindkey +++ b/fn/-z4h-help-bindkey @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" print -Pr -- "$(<<\END diff --git a/fn/-z4h-help-compile b/fn/-z4h-help-compile index debddb1..73de296 100644 --- a/fn/-z4h-help-compile +++ b/fn/-z4h-help-compile @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" print -Pr -- "$(<<\END diff --git a/fn/-z4h-help-source b/fn/-z4h-help-source index 28f88c6..4bf7d0d 100644 --- a/fn/-z4h-help-source +++ b/fn/-z4h-help-source @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" print -Pr -- "$(<<\END diff --git a/fn/-z4h-help-ssh b/fn/-z4h-help-ssh index b91457f..0065fc3 100644 --- a/fn/-z4h-help-ssh +++ b/fn/-z4h-help-ssh @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + print -Pr -- "$(<<\END Usage: %F{2}z4h%f %Bssh%b [%Ussh-options%u]... [--] [%Uuser@%u]%Uhostname%u diff --git a/fn/-z4h-init b/fn/-z4h-init index b2bb7bc..d0c88d7 100644 --- a/fn/-z4h-init +++ b/fn/-z4h-init @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + if zstyle -t :z4h: iterm2-integration && [[ $TERM != (dumb|linux) && $ITERM_SHELL_INTEGRATION_INSTALLED != Yes ]]; then -z4h-enable-iterm2-integration diff --git a/fn/-z4h-init-wsl b/fn/-z4h-init-wsl index c494846..c5fec75 100644 --- a/fn/-z4h-init-wsl +++ b/fn/-z4h-init-wsl @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + [[ "$(&- diff --git a/fn/-z4h-redraw-prompt b/fn/-z4h-redraw-prompt index 4ead623..b4b0757 100644 --- a/fn/-z4h-redraw-prompt +++ b/fn/-z4h-redraw-prompt @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + { -z4h-cursor-hide local f diff --git a/fn/-z4h-restore-screen b/fn/-z4h-restore-screen index 8b2c811..51bb161 100644 --- a/fn/-z4h-restore-screen +++ b/fn/-z4h-restore-screen @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" [[ -w $TTY ]] || return diff --git a/fn/-z4h-run-process-tree b/fn/-z4h-run-process-tree index 22c4230..3922ab9 100644 --- a/fn/-z4h-run-process-tree +++ b/fn/-z4h-run-process-tree @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Copied from https://github.com/romkatv/run-process-tree. zmodload zsh/parameter || return diff --git a/fn/-z4h-sanitize-word-prefix b/fn/-z4h-sanitize-word-prefix index 9ff3a12..b63ac8d 100644 --- a/fn/-z4h-sanitize-word-prefix +++ b/fn/-z4h-sanitize-word-prefix @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + () { emulate -L zsh -o extended_glob [[ $_z4h_word_prefix != *('$'|'\') ]] || return diff --git a/fn/-z4h-save-screen b/fn/-z4h-save-screen index d9d0b64..58d1c0d 100644 --- a/fn/-z4h-save-screen +++ b/fn/-z4h-save-screen @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" if [[ -n $_Z4H_TMUX ]]; then diff --git a/fn/-z4h-set-list-colors b/fn/-z4h-set-list-colors index a646b46..68e5023 100644 --- a/fn/-z4h-set-list-colors +++ b/fn/-z4h-set-list-colors @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" setopt octalzeroes diff --git a/fn/-z4h-set-term-title b/fn/-z4h-set-term-title index 4027e77..c12d465 100644 --- a/fn/-z4h-set-term-title +++ b/fn/-z4h-set-term-title @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + emulate -L zsh -o no_prompt_bang -o prompt_subst -o prompt_percent local title=$1 diff --git a/fn/-z4h-show-dots b/fn/-z4h-show-dots index 60dc7e8..b4b1d5d 100644 --- a/fn/-z4h-show-dots +++ b/fn/-z4h-show-dots @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i cursor=CURSOR local postdisplay=$POSTDISPLAY local buffer=$BUFFER diff --git a/fn/-z4h-ssh-maybe-update b/fn/-z4h-ssh-maybe-update index 16da48d..724e5b5 100644 --- a/fn/-z4h-ssh-maybe-update +++ b/fn/-z4h-ssh-maybe-update @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # Requires: [[ $Z4H_SSH == <1->:* ]] eval "$_z4h_opt" diff --git a/fn/-z4h-tmux-bypass b/fn/-z4h-tmux-bypass index 317b54c..510e80f 100644 --- a/fn/-z4h-tmux-bypass +++ b/fn/-z4h-tmux-bypass @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local x builtin printf -v x "$@" diff --git a/fn/-z4h-welcome b/fn/-z4h-welcome index 859d358..6b7bab3 100644 --- a/fn/-z4h-welcome +++ b/fn/-z4h-welcome @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" add-zsh-hook -d -- precmd -z4h-welcome diff --git a/fn/-z4h-with-local-history b/fn/-z4h-with-local-history index 35697d5..6cff31c 100644 --- a/fn/-z4h-with-local-history +++ b/fn/-z4h-with-local-history @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local last=$LASTWIDGET diff --git a/fn/-z4h-zle-line-finish b/fn/-z4h-zle-line-finish index b27d204..328508a 100644 --- a/fn/-z4h-zle-line-finish +++ b/fn/-z4h-zle-line-finish @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i ret if [[ -v widgets[-z4h-orig-zle-line-finish] ]]; then diff --git a/fn/-z4h-zle-line-init b/fn/-z4h-zle-line-init index 29bc5a7..9dc561c 100644 --- a/fn/-z4h-zle-line-init +++ b/fn/-z4h-zle-line-init @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i ret if (( ${+widgets[-z4h-orig-zle-line-init]} )); then diff --git a/fn/-z4h-zle-line-pre-redraw b/fn/-z4h-zle-line-pre-redraw index dc93483..425c86b 100644 --- a/fn/-z4h-zle-line-pre-redraw +++ b/fn/-z4h-zle-line-pre-redraw @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i ret if (( ${+widgets[-z4h-orig-zle-line-pre-redraw]} )); then diff --git a/fn/_z4h_err b/fn/_z4h_err index c51966f..1514f2f 100644 --- a/fn/_z4h_err +++ b/fn/_z4h_err @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i ret=$? eval "$_z4h_opt" print -Pru2 -- '%F{3}--- stack trace (most recent call first) ---%f' diff --git a/fn/z4h-autosuggest-accept b/fn/z4h-autosuggest-accept index 78b8a8a..f81f9da 100644 --- a/fn/z4h-autosuggest-accept +++ b/fn/z4h-autosuggest-accept @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + local -i cursor=CURSOR { if [[ $KEYMAP == vicmd && -n $BUFFER ]]; then diff --git a/fn/z4h-backward-word b/fn/z4h-backward-word index a72433a..357f22e 100644 --- a/fn/z4h-backward-word +++ b/fn/z4h-backward-word @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + emulate -L zsh -o extended_glob local w=${WORDCHARS//[[:space:][:alnum:]]} local buf=${LBUFFER%%[[:space:]]#} diff --git a/fn/z4h-backward-zword b/fn/z4h-backward-zword index 2582f3c..75ab94c 100644 --- a/fn/z4h-backward-zword +++ b/fn/z4h-backward-zword @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local word buf=$BUFFER for word in '' ${(Z:n:)BUFFER}; do diff --git a/fn/z4h-cd-down b/fn/z4h-cd-down index 74c1f2f..e109e77 100644 --- a/fn/z4h-cd-down +++ b/fn/z4h-cd-down @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + [[ -w $TTY && -r $TTY ]] || return autoload +X -Uz -- -z4h-present-files -z4h-cursor-show -z4h-find -z4h-fzf diff --git a/fn/z4h-clear-screen-hard-bottom b/fn/z4h-clear-screen-hard-bottom index 982981f..13d9605 100644 --- a/fn/z4h-clear-screen-hard-bottom +++ b/fn/z4h-clear-screen-hard-bottom @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + builtin echoti civis >"$TTY" builtin print -rn -- $'\e[H\e[2J'"${(pl:$LINES::\n:)}" >"$TTY" builtin zle -I diff --git a/fn/z4h-clear-screen-hard-top b/fn/z4h-clear-screen-hard-top index 0a7f7a4..95330b9 100644 --- a/fn/z4h-clear-screen-hard-top +++ b/fn/z4h-clear-screen-hard-top @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + builtin echoti civis >"$TTY" builtin print -rn -- $'\e[H\e[2J' >"$TTY" builtin zle .reset-prompt diff --git a/fn/z4h-clear-screen-soft-bottom b/fn/z4h-clear-screen-soft-bottom index b6f0a9c..28460e4 100644 --- a/fn/z4h-clear-screen-soft-bottom +++ b/fn/z4h-clear-screen-soft-bottom @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + builtin echoti civis >"$TTY" local -i cursor_x cursor_y -z4h-get-cursor-pos diff --git a/fn/z4h-clear-screen-soft-top b/fn/z4h-clear-screen-soft-top index 3071f28..816a24b 100644 --- a/fn/z4h-clear-screen-soft-top +++ b/fn/z4h-clear-screen-soft-top @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + builtin echoti civis >"$TTY" local -i cursor_x cursor_y -z4h-get-cursor-pos diff --git a/fn/z4h-forward-word b/fn/z4h-forward-word index c65a8db..92c4b51 100644 --- a/fn/z4h-forward-word +++ b/fn/z4h-forward-word @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + emulate -L zsh -o extended_glob local w=${WORDCHARS//[[:space:][:alnum:]]} local buf=${RBUFFER##[[:space:]]#} diff --git a/fn/z4h-forward-zword b/fn/z4h-forward-zword index 3679c6d..801420b 100644 --- a/fn/z4h-forward-zword +++ b/fn/z4h-forward-zword @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" local word buf=$BUFFER for word in ${(Z:n:)BUFFER} ''; do diff --git a/fn/z4h-fzf-complete b/fn/z4h-fzf-complete index 79c692f..c48fba8 100644 --- a/fn/z4h-fzf-complete +++ b/fn/z4h-fzf-complete @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + [[ -w $TTY && -r $TTY ]] || return [[ -o auto_menu ]] && local -i auto_menu=1 || local -i auto_menu=0 diff --git a/fn/z4h-fzf-history b/fn/z4h-fzf-history index 03b527f..69f7102 100644 --- a/fn/z4h-fzf-history +++ b/fn/z4h-fzf-history @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + # fzf-history-widget with duplicate removal, preview and syntax highlighting (requires `bat`). # # Disable preview: diff --git a/fn/z4h-stash-buffer b/fn/z4h-stash-buffer index fb7f2e8..559b4bc 100644 --- a/fn/z4h-stash-buffer +++ b/fn/z4h-stash-buffer @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + eval "$_z4h_opt" [[ -z $BUFFER ]] && return fc -R =(print -r -- ${BUFFER//$'\n'/$'\\\n'}) diff --git a/sc/exec-zsh-i b/sc/exec-zsh-i index 7f991b9..841f6fe 100644 --- a/sc/exec-zsh-i +++ b/sc/exec-zsh-i @@ -1,3 +1,5 @@ +#!/bin/sh +# # This file gets sourced. Does not return on success. _z4h_try_exec_zsh_i() {