Live data from Hacker News

Speeding up my ZSH shell

scottspence.com

21–30 of 133 posts

Re: Speeding up my ZSH shell

#21
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.

Re: Speeding up my ZSH shell

#23
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.

>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

Re: Speeding up my ZSH shell

#26
post #10
post #2

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…

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

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.

Re: Speeding up my ZSH shell

#27
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.

>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…

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)

Re: Speeding up my ZSH shell

#30
post #2

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…

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...

Post reply on HN