z-shell / zi

✨ A Swiss Army Knife for Zsh - Unix Shell
https://wiki.zshell.dev
MIT License
735 stars 42 forks source link

[bug]: OMZP::aliases not functional #257

Closed aidan-gibson closed 1 year ago

aidan-gibson commented 1 year ago

Environment

Device: apple | darwin21.3.0 | arm64 Shell: /opt/homebrew/bin/zsh | -zsh | zsh-5.9-0-g73d3173 Zi: 572553b2c6326c3609cea593e48745a1da9112fe

Reproduction steps

1.In zshrc add `zi snippet OMZP::aliases`
2.Reload terminal
3.Run `acs`

❯ acs
/opt/homebrew/bin/python3: can't open file '/Users/aidangibson/.zi/snippets/OMZP::aliases/cheatsheet.py': [Errno 2] No such file or directory

### Expected behavior

```bash
After manually adding cheatsheet.py from [aliases repo](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/aliases/) to `~/.zi/snippets/OMZP//aliases`, command works and provides expected output as follows.

acs
[_default]
    airdrop = sh /usr/local/bin/airdropfix.sh
    brew86 = arch -x86_64 /usr/local/bin/brew
    bu = brew update && brew upgrade && ziu
    c = clear
    cat = bat
    conda = load_conda && conda
    diff = diff --color
    ext = cd '\''/Users/aidangibson/Library/Mobile Documents/iCloud~md~obsidian/Documents/Ext Brain'\
    fsh-alias = fast-theme
    intel = arch -x86_64 /bin/zsh
    karabiner = code /Users/aidangibson/.config/karabiner.edn
    ls = ls -G
    pi = python3 -i
    pinentry = pinentry-mac
    python = load_conda && python
    python3.7 = arch -x86_64 /Users/aidangibson/.pyenv/versions/3.7.14/bin/python3.7
    python3.9 = /opt/homebrew/bin/python3.9
    reload = source ~/.zshrc
    rip = rip --graveyard ~/.Trash
    run-help = man
    s = sudo pmset disablesleep 0 && sudo pmset sleepnow
    tree = ls --tree
    which-command = whence
    zshrc = code ~/.zshrc && code ~/.zaliases && code ~/.zshenv

[arch]
    pip3.7 = arch -x86_64 /Users/aidangibson/.pyenv/versions/3.7.14/bin/python3.7 -m pip
    pyenv86 = arch -x86_64 pyenv

[zi]
    zini = zi
    zinit = zi
    ziu = zi self-update && zi delete --yes --quiet --clean && zi update --all --parallel --quiet
    zplugin = zi

### Current behavior

```bash
Explained above

Code snippet

zi snippet OMZP::aliases

Additional information

If I'm not mistaken, it appears "snippets" are compiled to .zwc files. This presents a problem for OMZP::aliases, as I don't have the option to load it as a plugin, only a snippet.

Self-service

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

aidangibson310@gmail.com

ss-o commented 1 year ago

The OMZP::aliases is the OhMyZsh plugin (not Zsh plugin), and in some cases, it requires additional setup steps because of missing libraries or file order/amount/location.

One of the solutions would be:

zi for nocompile svn \
  multisrc'aliases.plugin.zsh' pick'/dev/null' \
    OMZP::aliases

Note

  • This snippet might be simplified, I just improvised here.

The reason is that you want a single directory in a repository, and subversion is one of the solutions to get it. I am working on more solutions such as GitHub codeload, etc.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] commented 1 year ago

Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.