Issues addressed:
1. Confusing and unintuitive command names
Currently, two commands `loaded` and `list` will list installed
plugins and a single command `ls` lists installed snippets. The namea
don't make much sense or give context to their behavior, nor does
having two commands with identical behavior.
This PR removes the three commands in favor of two new commands
`list-snippets` and `list-plugins`. The names align with the action they
perform.
2. Uninformative output
Current output is hard to grok.
This PR cleans up the output format and uses color to help convey
information.
3. Incorrect
Output does not account for various situations with the only way to
fix is to reload Zsh session which would not always fix it. See images
below for the aforementioned situations.
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
The useful %x prompt expansion can be used to get path to the executed script:
0=${(%):-%x}
It is always the correct, expected value, even for autoloaded functions. However,
it currently doesn't work with Zinit special fpath-pollution free autoload.
This patch fixes this.
This reverts commit b979847bd4, reversing
changes made to da924a21a1.
I (@vladdoster) accidentally merged this into the wrong repository. Apologies for the lack of due diligence.
This can be used to overwrite `as'null'`, which would otherwise not trigger
completion detection and installation.
It will override the `nocompletions` ice when both are specified (e.g., using
the default ice annex).
The scheduler is called in 10 seconds intervals when no tasks are present to lower CPU usage.
Co-authored-by: vladislav doster <10052309+vladdoster@users.noreply.github.com>
The key is already bound to push-line, however the zle widget
has also two other keys, ctrl-q and Alt-q, so no problem, as
IMO users who want that widget already use Alt-q, not Alt-Q.
Closes#386
* maint: Ignore .idea folder
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
* fix: Don't escape exclamation marks in hook keys
Exclamation marks (per default) get escaped in interactive mode,
but not in non-interactive modes. In this case it meant that zinit
would not find any hooks which implements the ices when running in
non-interactive mode (e.g. in a script). This in turn would NOT result
in errors but would just silently not execute any of the ices which
of course would be a bad thing(tm).
https://github.com/zdharma-continuum/zinit/issues/199 has the details...
Closes: #199
* fix: Ignore errors if cp cannot copy .zwc files
This would otherwise bubble up as a hook failure and further up as a zinit call failure
* fix: Add pick ice now that the compile hook is run
After the fix, the compile hook is now run and would fail without this information. IN addition, only files starting with _ are linked into the completion folder.
* fix: Fix docker-buildx gh-r test now that atclone ice is run
* maint: Add basic tests for cp/mv/atclone/make ices
zunit runs tests non-interactively and these tests fail without the fix in this branch.
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
### configure ice
The new `configure''` ice is a facade for the following code.
```zsh
atclone'./configure --prefix=$PWD'
atpull'%atclone'
```
### Example:
Without the `configure` ice:
```zsh
zi for \
as'null' \
atclone'autoreconf -iv && ./configure --prefix=$PWD' \
atpull'%atclone' \
lbin'!**/stow' \
make'PREFIX=$PWD install' \
nocompile \
@aspiers/stow
```
With the `configure` ice:
```zsh
zi for \
as'null' \
configure'#' \
lbin'!**/stow' \
make'PREFIX=$PWD install' \
nocompile \
@aspiers/stow
```
Additionally, passing `#` as the ice value will look for and run `autogen.sh` prior to running `./configure`.
# Evaluating the `extract' '` earlier solves multiple issues:
## 1.
```bash
atclone'./configure --prefix=$PWD'
```
## 2.
The `mv' '` ice is ran after archive extraction, so
```bash
mv''
```
ice is running sense as the extension is not required for unpacking, so one can
utilize mv'' ice for something after the unpacking, not before to rename
'tmux->tmux.tgz' or similar.
## 3.
The `gh-r''` and `pack''` ices default ziextract calling in gh-r and pack'' obey
the exclamation marks from extract'!…' to allow deciding whether `move` or
`move2` mode should be enabled (i.e., move extracted archive up 1 or 2 levels
up).
## Tested against Tmux:
```bash
zi for \
as'null' \
atclone'./configure --disable-utf8proc --prefix=$PWD' \
atpull'%atclone' \
extract'!' \
from'gh-r' \
id-as'tmux' \
sbin \
make'-j 4 install' \
ver'latest' \
@tmux/tmux
```
- It makes `a/b` strings be recognized as plugin ids (plus the previous way of
recognition via a test to the disk, for single-word id-as plugins).
- Correctly handle ices with values and spaces (i.e., `sbin'* -> foo'`)
- OhMyZsh short-hands (i.e., `OMZP::` or `OMZL`) are recognized as plugin ids.
- It colorizes numbers with `{num}` and time notions (e.g., `3s`) with a new
code `{time} (color 220 – gold)`
* Add link ice for local-only snippets that uses symlink instead of copying
* update docs
* fix README for link ice
* fix unit tests for link ice
- account for the host not having `realpath` >= 8.23 (the symlink will be
an absolute path instead of a relative path)
A user can now specify a program via the `$ZINIT[LIST_COMMAND]`
variable. Additionally, it will first check for `exa` and fallback to
tree if this variable is not set.
e.g., use exa or any `tree`-esque program in `zinit ls`.
Closes#170
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
- Fix to re-enable users to generate zshelldoc documentation without
docker.
- Update most asciidoctor blocks in Zinit source code to fix issue where
they would take up a line above the next function name
- Remove unnecessary steps from the documentation Github action workflow
- Misc. Makefile changes in clean and doc targets logic
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>