Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation – share a useful trick with named directories. #390

Closed
wants to merge 75 commits into from

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Oct 1, 2022

Alias all plugins with ~plgname to point to their directory.

Description

Normally one issues zi cd fzf<tab>, however I'm starting to like ~labels, after coming up with them after last argue about that should be separate plugin / ~ZIABC labels for Zinit system dirs.

Motivation and Context

To type as low as possible.

Related Issue(s)

#381

Usage examples

% pushd ~fzf
/home/q/.local/share/zinit/plugins/junegunn---fzf ~
% ls
fzf

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@psprint
Copy link
Contributor Author

psprint commented Dec 27, 2022

What about merging this PR? It's only a documentation extension (README.md) and it shares an useful technique to quickly jump to plugin dirs.

psprint and others added 22 commits December 30, 2022 17:04
### 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`.
- Fixes failing markdown linting test

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
- test using the `--help` flag instead of the `version` command
…inuum#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).

zdharma-continuum#199 has the details...

Closes: zdharma-continuum#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>
- add `os-x` to darwin gh-r pattern
- add zunit test for tstack/lnav

Closes zdharma-continuum#367

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Recent changes to GitHub HTML structure broke `gh-r` & `bpick` ices method of parsing project release assets.

- `gh-r` utilizes official GitHub REST API to retrieve project releases data
- add `local` scope to `releases_url` variable

# closes zdharma-continuum#374 

Co-authored-by: Tyler Wardhaugh <tyler.wardhaugh@gmail.com>
The user can use them in 3 ways:

$ cd ZIBIN
$ cd $ZIBIN
$ cd ~ZIBIN
$ cd ZPFX
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
vladdoster and others added 24 commits December 30, 2022 17:04
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
# [3.9.0](zdharma-continuum/zinit@v3.8.0...v3.9.0) (2022-12-17)

### Bug Fixes

* remove broken gh-r zunit test for "warp" ([zdharma-continuum#430](zdharma-continuum#430)) ([64fa4ae](zdharma-continuum@64fa4ae))

### Features

* add `completions` ice ([zdharma-continuum#417](zdharma-continuum#417)) ([59975d7](zdharma-continuum@59975d7))
* display version via `version` sub command ([bfb01e6](zdharma-continuum@bfb01e6))

### Performance Improvements

* reduce scheduler task check to 10 second interval ([zdharma-continuum#429](zdharma-continuum#429)) ([1681ce4](zdharma-continuum@1681ce4))

### Reverts

* "perf: reduce scheduler task check to 10 second interval ([zdharma-continuum#429](zdharma-continuum#429))" ([zdharma-continuum#432](zdharma-continuum#432)) ([cfd3261](zdharma-continuum@cfd3261))
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This reverts commit b979847, reversing
changes made to da924a2.

I (@vladdoster) accidentally merged this into the wrong repository. Apologies for the lack of due diligence.
Alias all plugins with ~plgname to point to their directory.
…oader.

Also make $PATH/$path unique by setting the -U flag on them.
… etc.

There are many such symbol var-like symbols:

- %ID%          – id-as ice
- %USER%        – username (in user/plugin ID)
- %PLUGIN%      – plugin name (in user/plugin ID)
- %URL%         – snippet url
- %DIR%         – plugin directory path
- %ZPFX%        – value of $ZPFX
- %OS%          – `$OSTYPE`
- %MACH%        – `$MACHTYPE`
- %CPU%         – `$CPUTYPE`
- %VENDOR%      – `$VENDOR`
- %HOST%        – `$HOST`
- %UID%         – `$UID` (numerical user id)
- %GID%         – `$GID` (group #)

With this patch many has been fixed (like %ID%, %USER%, %PLUGIN% were
returning empty strings, possibly breaking packages, where this undocumented
feature is used) and support for load-time ices (like `atload''`, etc.) have
been added.

For example:

```zsh
zinit id-as'plugin-%UID%' atload'print Loaded from dir: %DIR%, plugin id: %ID%' for zdharma-continuum/null
```

output is:

```
Loaded from dir: /home/q/.local/share/zinit/plugins/plugin-500, plugin id: plugin-500
```
One will be able to obtain, e.g.:

zinit fzf<Alt>-<Shift>-A
    » zinit junegunn/fzf
zinit cd rip<Alt>-<Shift>-A
    » zinit cd BurntSushi/ripgrep

and so on. The <Alt>-<Shift>-A shortcut works with ALL commands,
regardless if it's zinit command or not.

Two autoloaded functions added, ziactioncomplete (the proper imple-
mentation of the main features) and ziprocessbuffer (a very useful
library function that takes care of $BUFFFER/$CURSOR processing).

Also Feature: Cycling and ice-completion (<Alt>-<Shift>-C).

Cycling will allow to choose a particular match, say for, e.g.:
zinit at<Alt>-<Shift>-C
    »   zinit atclone<Alt><Shift>-C
    » zinit atinit<Alt>-<Shift>-C
@vladdoster
Copy link
Member

@psprint,

The branch needs to be rebased.

@psprint
Copy link
Contributor Author

psprint commented Jan 17, 2023

I created a separate branch and pull request (#464).

@psprint psprint closed this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants