Giter Site home page Giter Site logo

nicholas85 / z-a-eval Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 7.0 52 KB

A Zsh-Zinit annex (i.e. an extension), which caches arbitrarily slow command output to speed up shell startup.

License: Other

Shell 100.00%
zsh zinit-annex zinit zsh-plugin terminal shell-script shell-plugin

z-a-eval's People

Contributors

nicholas85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

z-a-eval's Issues

Is it edge case?

I've used your plugin and I'm satisfied.
There is a possibility that I used it incorrectly, but I found the wrong case.

prev setting:

_tldr-setting() {
  tldr --update
  local comp="$(tldr 2>/dev/null --list)"
  echo "complete -W \"$comp\" tldr" > init.zsh
}

zinit ice wait"2" as"command" from"gh-r" lucid \
      mv"tldr* -> tldr" atclone"_tldr-setting" pick"init.zsh" \
      atpull"%atclone" atload"alias man=tldr"
zinit light dbrgn/tealdeer

init.zsh result: so long..
https://gist.github.com/black7375/48cc53f92b29c94629c6930d2b95c381

complete -W "2to3
7z
7za
7zr
R
...
zramctl
zsh
zstd
zsteg
zypper" 

> tldr

z-a-eval setting:

zinit ice wait"2" as"command" from"gh-r" lucid \
      mv"tldr* -> tldr" atclone"./tldr --update" atpull"%atclone" \
      eval"echo complete -W $(./tldr 2>/dev/null --list) tldr" atload"alias man=tldr"
zinit light dbrgn/tealdeer

evalcache.zsh result:

# echo\ complete\ -W\ \ tldr
# generated with z-a-eval annex
if (( ZINIT_Z_A_EVAL_SOURCED )) { return; }
typeset -i ZINIT_Z_A_EVAL_SOURCED=1
complete -W tldr

Additional context
https://github.com/zdharma/zinit/issues/487

Thank you again for your hard work.

Does this support local plugins?

❯ tree -L 1 gnubin zinit/plugins
gnubin
└── gnubin.sh
zinit/plugins
└── _local---gnubin -> ../../gnubin
$ cat gnubin.sh
GNUBIN=$(find -L /usr/local/opt -type d -name gnubin | paste -sd':' -)
GNUMAN=$(find -L /usr/local/opt -type d -name gnuman | paste -sd':' -)
[ ! -z "$GNUBIN" ] && echo "export PATH=\"$GNUBIN:\$PATH\""
[ ! -z "$GNUMAN" ] && echo "export MANPATH=\"$GNUMAN:\$PATH\""
$ cat .zshrc
# ...
zinit depth'3' light-mode for \
    NICHOLAS85/z-a-eval

zinit light eval'./gnubin.sh' _local/gnubin
# ...

Output:

Downloading eval./gnubin.sh/_local/gnubin…

Cloning into '/root/.dotfiles/zsh/zinit/plugins/eval.---gnubin.sh---_local---gnubin'...
remote: Not Found
fatal: repository 'https://github.com/eval./gnubin.sh/_local/gnubin/' not found

Clone failed (code: 128).

No files for compliation found

# before
zinit lucid wait has'pyenv-virtualenv-init' atclone'pyenv virtualenv-init - > pyenv-venv.zsh' atpull'%atclone' pick'pyenv-venv.zsh' nocompile'!' id-as'pyenv-venv2' for @zdharma-continuum/null

Downloading zdharma-continuum/null… (at label: pyenv-venv2…)
Cloning into '$HOME/.local/share/zinit/plugins/pyenv-venv2'...
==> Compiling pyenv-venv.zsh [OK]

# after 
zinit lucid wait has'pyenv-virtualenv-init' eval'pyenv virtualenv-init -' id-as'pyenv-venv1' for @zdharma-continuum/null

Downloading zdharma-continuum/null… (at label: pyenv-venv1…)
Cloning into '$HOME/.local/share/zinit/plugins/pyenv-venv1'...
==> No files for compilation found
Warning: ∞zinit-compile-plugin-hook hook returned with 1
[eval] Caching output of (`pyenv virtualenv-init -…')

I notice the "No files for compilation found" warning when using the eval ice. However, the zwc file does exist:

ls $HOME/.local/share/zinit/plugins/pyenv-venv1
LICENSE.md  evalcache.zsh  evalcache.zsh.zwc  readme.md

Is there a way to make sure zinit loaded the complied version? Is this error benign / can it be fixed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.