Live data from Hacker News

Speeding up my ZSH shell

scottspence.com

11–20 of 133 posts

Re: Speeding up my ZSH shell

#13
post #9

From the post, it seems like ZSH tries to update on every shell spawn: DISABLE_AUTO_UPDATE="true" WTF? Even if we ignore the crime of non-critical software updating itself, the fact that it does it on every start instead of every day or week is insane. I do not want my shell sending network requests to odd servers without explicit action from me, thanks.

oh-my-zsh, not zsh

Re: Speeding up my ZSH shell

#15
I'd be rather skeptical about the "fix" of updating the completion cache once a day only. Enabling oh-my-zsh already runs `compinit` and it does so after changing the function path in `fpath`. By running it again with a different `fpath` you invalidate the previous cache - meaning it builds a fresh cache twice every time you start zsh. If you use a plugin framework that already runs compinit, simply don't run it again separately. And make sure that `compinit` is only run after the final plugin or whatever has finished changing `fpath`. If you get that right, you'll only ever need to regenerate the cache when something actually updates.

Re: Speeding up my ZSH shell

#18

Oh-my-zsh has a lot of cool and handy features, but it is a huge and complex beast. Personally, I only cared about 3–4 features, so I simply removed it and sought out how to enable those features alone. Additionally, a lot of functionality which I wanted wasn’t there in OMZ, so my setup had a lot of custom bits anyway. My zshrc, for reference: https://git.sr.ht/~whynothugo/dotfiles/tree/269248912920d25e...

What's with the emoji alias?

Re: Speeding up my ZSH shell

#19
post #4

https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#...

Sadly it's essentially discontinued

I'll continue using it until the core features like instant prompt and transient prompt start to break or I run into bugs that I can't live with

Re: Speeding up my ZSH shell

#20
post #3

Aha! Now I know that nvm was slowing my shell startup down. Now I've reconfigured .zshrc to lazy-load nvm, and everything's snappy: zstyle ':omz:plugins:nvm' lazy yes

You should try switching to mise. I tried fnm too which was an improvement but mise does the same as fast and supports essentially every language
Post reply on HN