Speeding Up My ZSH Shell

63 saikatsg 28 7/20/2025, 3:51:44 PM scottspence.com ↗

Comments (28)

Sparkenstein · 19m ago
I moved to fish 3 years ago, haven't noticed a difference till date.
notnmeyer · 7m ago
you are wise and have good taste
srvmshr · 2h ago
I discovered this issue 2-3 years ago. On slightly older machines, there was a palpable startup time. My fix was going through OhMyZSH and stripping away all the parts that I felt unnecessary (I call this my "leanZSH" and its considerably lighter version of OMZ.) It doesn't track upstream, and I manually update the plugin directory once in a while. Surprisingly OhmyZSH is pretty modular and doesn't break easily.

[Not the best hackjob out there but here it is:

https://github.com/gradientwolf/leanzsh

If you want to update it just copy over the latest `plugin/` folder from OMZ repo. You can get rid of all the plugins you dont want, as well as the themes. It somehow works]

MillironX · 9m ago
You can use Antidote to selectively load the parts of OhMyZsh you need - https://github.com/getantidote/use-omz

My own usage: https://code.millironx.com/millironx/nix-dotfiles/src/commit...

SamDc73 · 1h ago
I think you're better off switching to https://starship.rs

I did try to do my whole zsh config/theme from scratch, but it did take some time and lot of small features here and there were no worth the effort (like python version, vevn, and such) so I just switched to starship which is very fast and easy to use

lompad · 37m ago
Why not just use fish at that point? It's been rewritten in Rust too.

To me personally, oh-my-zsh and similar projects feel like a worse version of the stuff fish brings by default.

WhyNotHugo · 2h ago
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...

bravesoul2 · 1h ago
What's with the emoji alias?
gjvc · 1m ago
[delayed]
mcc1ane · 2h ago
satvikpendem · 1h ago
Sadly it's essentially discontinued
trallnag · 1h ago
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
opk · 1h ago
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.
stouset · 1h ago
Fish shell with starship. You will never look back.
rtkaratekid · 14m ago
I started using fish on a dare from a coworker who thought it would be funny. Joke’s on them, it’s been five years and I still love it. Started using starship this year and agree with you.
marliechiller · 1h ago
Funnily enough, the startup delay of oh-my-zsh is exactly what prompted me to try out fish and eventually starship on top. I have not looked back as you say!
paulirish · 38m ago
Yup. This was me 7 years ago.

Fish gives you the best ohmyzsh features but, by default. And it's so fast.

ivanjermakov · 1h ago
Oh-my-zsh is very bloated. You might not need it, since its most used features can be implemented with zsh directly: https://ianyepan.github.io/posts/moving-away-from-ohmyzsh/
jasonjmcghee · 1h ago
Thanks - that pushed me to profile, and as others mentioned nvm was the biggest culprit, then powerline status, which i swapped to powerline-go. nice and snappy startup time now.
RGBCube · 1h ago
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.

slacktivism123 · 51m ago
>it seems like ZSH tries to update on every shell spawn

Learn your tools first, not bloated frameworks. There's a gulf of difference between vanilla zsh and this:

>Community-driven (with 2,400+ contributors) framework for managing your zsh configuration

>Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc)

>140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community

RGBCube · 31m ago
Sorry, I meant oh-my-zsh. I know that the core shell doesn't update.

I still think it's bad. You shouldn't rely on a million different package managers, just 1 is enough. (2 if you are feeling spicy: Flatpak)

c-hendricks · 1h ago
oh-my-zsh, not zsh
rezmason · 2h ago
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
Zizizizz · 1h ago
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
satvikpendem · 1h ago
Just use fnm, I like it much better
saikatsg · 2h ago
Cool! Also, there's a zsh wrapper for nvm:

https://github.com/lukechilds/zsh-nvm?tab=readme-ov-file#laz...

dcre · 1h ago
Same. I switched to fnm.
raffraffraff · 54m ago
As a long time Linux + bash user I switched to zsh three months ago when I was forced to use a Mac at a new job. In every previous job I was able to insist on Linux, but this one is very corporate. I decided not to fight it, except to install AltTab, Karabiner, Rectangle and a script that detects which screen my mouse is on so I can alt-tab through ALL the stuff on that screen (sane XFCE / KDE behaviour).

I can't get used to the atrocious keyboard shortcuts but I have gotten used to the "non-UK UK keyboard layout".

And zsh. I honestly don't know why I didn't just brew install bash right from the start. Without even realising I was doing it, I fought with this bloated bastard for 2 months before finally asking what the fuck I was doing.

I sped up my shell by switching back to bash.