Commit graph

442 commits

Author SHA1 Message Date
Vladislav Doster 336ca85ade
fix: broken update command
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-19 12:20:09 -05:00
Vladislav Doster 6c82d6788d fix: cleanup style, naming, and completion
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-10 12:32:16 +00:00
Vladislav Doster a86590762a
feat: refactor ls, list, and loaded commands
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>
2023-04-09 21:45:15 -05:00
Vladislav Doster 9eee215e3f
feat: delete subcommand refactor
- `delete` subcommand can now take multiple arguments
- improved logic for `--all`, `--clean` flags
- improved log output
- now cleans up broken symlinks

```
zinit delete <Plugin> <Plugin> ...
```

Closes #57
Closes #239

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-02 04:38:38 -05:00
Ryoga c624ac0077
add an option to disable aliases (#452)
* feat: add option to disable aliases

* docs: add docs for `ZINIT[NO_ALIASES]`
2023-03-26 22:54:30 +02:00
vladislav doster b5338e0252
Merge pull request #460 from psprint/%x-prompt-expn
fix: assign to functions hash to enable `%x`
2023-02-12 20:41:39 -06:00
Vladislav Doster cadeb791b4 refactor: zinit confirmation messages
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-02-12 18:01:43 -06:00
Sebastian Gniazdowski bd65a01734 fix: assign to functions hash to make %x work
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.
2023-01-13 16:34:03 +00:59
Vladislav Doster 515688bc97 revert: "Merge branch 'refactor/zinit-function-names' into main"
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.
2022-12-17 21:11:41 -06:00
vladislav doster b979847bd4
Merge branch 'refactor/zinit-function-names' into main 2022-12-17 18:22:20 -06:00
Vladislav Doster bfb01e65d7 feat: display version via version sub command
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-17 06:14:46 -06:00
Vladislav Doster 2b460a74f2 fix: vim modelines & zsdoc pdf rendering
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 22:22:48 -06:00
Vladislav Doster 0e45493e36 fix: change prefix ~zi:: to __zi::
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-16 03:45:16 +00:00
Vladislav Doster 75bb73547e fix: file modelines
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-15 12:01:15 -06:00
Vladislav Doster c28580c3fc refactor: rename zinit functions
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-12-09 15:40:31 -06:00
Jan Katins 59975d70d7
feat: add completions ice (#417)
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).
2022-12-05 07:21:28 -06:00
vladislav doster cfd3261892
revert: "perf: reduce scheduler task check to 10 second interval (#429)" (#432)
This reverts commit 1681ce40eb.
2022-11-30 18:50:52 -06:00
Sebastian Gniazdowski 1681ce40eb
perf: reduce scheduler task check to 10 second interval (#429) 2022-11-30 14:55:38 -06:00
Vladislav Doster 0c1839a18b revert: "perf: decrease scheduler checks from every 1 second to 10 seconds (#409)"
This reverts commit 4938e84827.
2022-11-20 03:47:48 -06:00
Sebastian Gniazdowski 4938e84827
perf: decrease scheduler checks from every 1 second to 10 seconds (#409)
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>
2022-11-19 23:21:38 -06:00
Aaron Lichtman 33fa18af98
Revert "Copy doc/zinit.1 only if it exists. Fixes #418." 2022-11-18 04:57:33 -08:00
Sebastian Gniazdowski 4bfc7ecbe3 Copy doc/zinit.1 only if it exists. Fixes #418. 2022-11-08 10:01:39 +00:59
Vladislav Doster 62c07b7326 style: fix fold markers, typos, and comments
- Fix function typos in asciidoc comments
- Fix asciidoc fold markers
- Fix function args typos/style in asciidoc comments

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2022-10-30 07:58:58 -05:00
Jan Katins 0e55b2ea67
fix: Do not try to escape exclamation marks (#399) 2022-10-29 11:16:36 -05:00
vladislav doster 49926e075a
maint: consistent vim mode lines across all files (#393) 2022-10-05 09:59:15 -05:00
Sebastian Gniazdowski 7f6dc7da6c
fix: change ctags symbols browser key binding from ctrl-k to alt-Q (#387)
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
2022-10-03 05:09:54 -05:00
Aaron Lichtman 952f683753
Revert "Add a few global aliases and vars like ZIBIN, ZIPLUGS and others." 2022-09-29 13:09:54 -07:00
Aaron Lichtman 5be3b2a72e
Merge pull request #350 from psprint/zinit.1-manual 2022-09-28 06:50:50 -05:00
Sebastian Gniazdowski 9168d6c183 Add a few global aliases and vars like ZIBIN, ZIPLUGS and others.
The user can use them in 3 ways:

$ cd ZIBIN
$ cd $ZIBIN
$ cd ~ZIBIN
$ cd ZPFX
2022-09-28 10:01:05 +00:59
Sebastian Gniazdowski 061a85c4ff
Add support for multiple (cmake, scons, meson) build systems to the configure'' ice. (#351) 2022-09-27 19:54:11 -05:00
Sebastian Gniazdowski 2e783f02e2
Make variables created with param'name → value' be exported. Also (#376) 2022-09-27 19:51:53 -05:00
Sebastian Gniazdowski 17fd453dc1
A zsh language definition for Ctags wrapped in tags Make target (#332) 2022-09-19 04:42:20 -05:00
Jan Katins c3d1bb586c
fix: allow zinit to be run from non-interactive scripts (#227)
* 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>
2022-08-06 02:35:58 -04:00
Sebastian Gniazdowski cc724a4336 Copy zinit.1 to man1 directory 2022-07-19 21:05:40 +02:00
Sebastian Gniazdowski 40a46c6d22
feat: add configure"" ice (#334)
### 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`.
2022-07-16 22:56:25 -05:00
Sebastian Gniazdowski 68f8f1d3cb
maint: run extract'' before the atclone'', atpull'', mv'', and cp'' ices (#328)
# 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
```
2022-07-05 18:37:10 -05:00
Sebastian Gniazdowski f6e1d03e43
maint: extend auto formatter to support plugin ids, numbers, times, and ice values(#311)
- 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)`
2022-06-16 12:08:24 -05:00
Sebastian Gniazdowski 6bbe920330
[feat]: add {dbg} formatter to .zinit-message (#286)
Co-authored-by: vladislav doster <mvdoster@gmail.com>
2022-06-03 23:17:18 -05:00
vladislav doster 7cbb680a30
Merge branch 'main' into auto-formatter 2022-06-01 09:28:27 -05:00
Sebastian Gniazdowski 9b86424521 A new {auto}, smart formatter 2022-05-30 17:09:55 +02:00
Sebastian Gniazdowski bcedc9ff94
Propagate -o xtrace when needed and prepend builtin to emulate (#293) 2022-05-29 12:47:27 -05:00
Tommy Wang b6f286b2c7
Add a new ice named "link", enabling local snippets to be symlinked instead of copied into the cache. (#234)
* 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)
2022-05-07 18:06:46 -05:00
vladislav doster bad7af3ae2
feat: ability to set program for zinit ls to use (#221)
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>
2022-04-25 01:00:47 -05:00
vladislav doster d0e7f9d204
doc: improve zsd gen, pdf output, and gh workflow (#220)
- 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>
2022-04-24 20:42:44 -05:00
Aaron Lichtman 638d9b5f88
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:34:44 -06:00
Aaron Lichtman 8f66657e51
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:34:37 -06:00
Aaron Lichtman 69fa943651
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:34:32 -06:00
Aaron Lichtman 7c28d37590
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:34:26 -06:00
Aaron Lichtman 55596cd39c
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:32:22 -06:00
Aaron Lichtman c1850630df
Update zinit.zsh
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2021-12-06 06:32:14 -06:00