zcomet
zcomet copied to clipboard
Feature request: "eval" function
Thanks for zcomet! It's easy to use and understand, and seems fast too.
Hopefully this idea is easy to understand.
Similar to zcomet snippet
, it would be nice to be able to cache the output of slow commands that are normally eval
'd. For example:
zcomet eval "$(/opt/homebrew/bin/brew shellenv)"
zcomet eval "$(pyenv init -)"
zcomet eval "$(pyenv virtualenv-init -)"
Open to other suggestions / alternatives, of course!
Thanks for the suggestion!
Have you tried using mroth/evalcache? I haven’t tried it myself, but it looks as if it should do what you need.
This is great! I was manually caching these kinds of things to files, like a chump :)
...
source "${HOME}/.local/share/zcomet/zcomet.zsh"
zcomet load mroth/evalcache
...
zcomet compinit
ZSH_EVALCACHE_DIR=${ZDOTDIR}/.zsh-evalcache
# hooks
_evalcache direnv hook zsh
_evalcache fasd --init auto
_evalcache pyenv init - --no-rehash zsh
_evalcache pyenv virtualenv-init - zsh
# completion
_evalcache pip completion --zsh
_evalcache register-python-argcomplete pytest pipx
...