first commit

This commit is contained in:
Arctic 2025-07-04 11:48:40 -05:00
commit 0610f4aeab
130 changed files with 9897 additions and 0 deletions

41
fn/-z4h-help-source Normal file
View file

@ -0,0 +1,41 @@
#!/usr/bin/env zsh
eval "$_z4h_opt"
print -Pr -- "$(<<\END
Usage: %F{2}z4h%f %Bsource%b [-c|--compile] [--] [%Ufile%u]...
Source the specified Zsh files, skipping over inexisting ones.
If %B-c%b or %B--compile%b is specified, files are automatically
compiled with %F{2}zcompile%f to speed up subsequent sourcing. This
gives you faster Zsh startup.
Relative file names are resolved from %U$Z4H/%u. This is the
directory where %F{2}z4h%f %Binstall%b puts downloaded files.
%F{2}z4h%f %Binstall%b ohmyzsh/ohmyzsh
...
%F{2}z4h%f %Bsource%b ohmyzsh/ohmyzsh/lib/diagnostics.zsh
Exit code of %F{2}z4h%f %Bsource%b is that of the last sourced file.
Inexisting files do not affect exit code.
Compilation isn't enabled by default because it has one
negative side effect. Namely, aliases defined within a
sourced file are not expanded in that same file. For
example:
%% %F{2}cat%f %U~/config.zsh%u
%F{2}alias%f echo=%F{3}'echo hello'%f
%F{2}echo%f world
%% ( %F{2}z4h%f source %U~/config.zsh%u )
hello world
%% ( %F{2}z4h%f source -c %U~/config.zsh%u )
world
END
)"