DEV Community

Cover image for ⚙️ ❮ Nickname a plugin or snippet ❯
❮ ZI ❯ for Z-Shell

Posted on

3 2

⚙️ ❮ Nickname a plugin or snippet ❯



Logo

https://z.digitalclouds.dev | GitHub | Twitter


ZI supports loading a plugin or snippet with a NICK-NAME. Set the nickname through the new id-as'' ice-mod.

For example, one could try to load docker/compose from GitHub binary releases:

zi ice as"program" from"gh-r" mv"docker-compose* -> docker-compose"
zi light "docker/compose"

This registers plugin under ID docker/compose. Now the user could want to load a completion from GitHub repository (not the binary release catalog) also called docker/compose. The two IDs, both being docker/compose, will collide. The user can however resolve the conflict via id-as'' ice-mod by loading the completion under a nick-name dc-completion:

zi ice as"completion" id-as"dc-completion"
zi load docker/compose

The completion is now seen under ID dc-completion. Issuing zi report dc-completion works, so as other ZI commands:

 ▲ ~ zi report dc-completion
Plugin report for dc-completion
-------------------------------

Completions:
_docker-compose [enabled]

This can be also used to nickname snippets. For example, you can use this to create handlers in place of long urls:

zi ice as"program" id-as"git-unique"
zi snippet https://github.com/Osse/git-scripts/blob/master/git-unique

zi delete git-unique will work, zi times will show git-unique instead of the URL, etc.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more