Live data from Hacker News

Speeding up my ZSH shell

scottspence.com

81–90 of 133 posts

Re: Speeding up my ZSH shell

#81

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

I am absolutely stealing this:

    export LESS='-RX --quit-if-one-screen'

Re: Speeding up my ZSH shell

#82

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated. zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock…

FWIW I only ever saw zsh at colleagues screen(share) with Oh-My-Zsh

1. Utterly slow and cluttered

2. Colleagues leverage a tenth of its power than what they could achieve with pure bare bones bash

Therefore, never bothered to even try (but had to fix some one liners so that they work on their fancy setup). Also, was surprised that macos switched to it as its default.

I guess I never jumped on the oh-my-it's-so-slow-zsh bandwagon. OTOH, fish+starship combo /that was also recommended here/ seems interesting

Re: Speeding up my ZSH shell

#83
post #82

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated. zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock…

FWIW I only ever saw zsh at colleagues screen(share) with Oh-My-Zsh 1. Utterly slow and cluttered 2. Colleagues leverage a tenth of its power than what they could achieve with pure bare bones bash Therefore, never bothered to even try (but had to fix some one liners so that they work on their fancy setup). Also, was surprised that macos switched to it as its default. I guess I never jumped on the oh-my-it's-so-slow-z…

Starship can also be really really slow with the defaults, although that is not starship itself beings slow but it appears to sometimes call out to slow tools when display toolchain info.

I always turn all of the languages plugins off in Starship for this reason.

Re: Speeding up my ZSH shell

#84
post #36
post #35

Earlier quoted context omitted.

Fish is awesome, but there are times you need POSIX/ bash-like shell syntax

Then you open bash and get POSIX and not bash-like, but bash.

In fact, sometimes I open bash even from zsh. When pasting from a script and debugging why something doesn't work as expected, I don't want bash-like. For ad-hoc loops, bash-like works well for me thanks to the familiarity of syntax.

Re: Speeding up my ZSH shell

#85

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.

same here, nvm was absolutely wrecking my startup time and I almost never use npm/nodejs.

Re: Speeding up my ZSH shell

#86
post #82

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated. zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock…

FWIW I only ever saw zsh at colleagues screen(share) with Oh-My-Zsh 1. Utterly slow and cluttered 2. Colleagues leverage a tenth of its power than what they could achieve with pure bare bones bash Therefore, never bothered to even try (but had to fix some one liners so that they work on their fancy setup). Also, was surprised that macos switched to it as its default. I guess I never jumped on the oh-my-it's-so-slow-z…

For Fish, I'd recommend https://github.com/IlanCosman/tide instead

Re: Speeding up my ZSH shell

#87
post #83
post #82

Earlier quoted context omitted.

FWIW I only ever saw zsh at colleagues screen(share) with Oh-My-Zsh 1. Utterly slow and cluttered 2. Colleagues leverage a tenth of its power than what they could achieve with pure bare bones bash Therefore, never bothered to even try (but had to fix some one liners so that they work on their fancy setup). Also, was surprised that macos switched to it as its default. I guess I never jumped on the oh-my-it's-so-slow-z…

Starship can also be really really slow with the defaults, although that is not starship itself beings slow but it appears to sometimes call out to slow tools when display toolchain info. I always turn all of the languages plugins off in Starship for this reason.

Honestly, I'm quite OK with bash+liquidprompt. It is probably an order of magnitude slower than these fancy new stuff.

Even with a huge monorepo and git stats displayed after every press of return it's OK (I win time at other places), but it's intriguing to have the same fast prompt display that I would otherwise have outside local git clone's directories.

What seems sexy about fish/starship is that there is built-in performance check / benchmark for slowdowns.

Re: Speeding up my ZSH shell

#88

Earlier quoted context omitted.

You should try fish shell. Great user experience out of the box, including history suggestions. https://fishshell.com

The incompatible syntax of fish makes it a no go for me. As an SRE, at my day job I often need to copy/paste commands that are generated from a playbook. Our playbooks use Bash, and in practice Zsh is compatible. But a co-worker using fish often has to manually modify commands before running, and I'm not about that life. The problem with fish is mostly the different syntax for setting variables and lack of heredocs.…

We have everything as scripts rather than one-liners so they work fine no matter which shell you're using.

Re: Speeding up my ZSH shell

#89
post #81

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

I am absolutely stealing this: export LESS='-RX --quit-if-one-screen'

This is my config:

https://pastebin.com/ATZeFJRk

I find that for persistent configuration like this, it helps to use the long option format and include the man page contents for those options. I don’t have these options memorised so it’s good to have a reference handy to remind me.

Re: Speeding up my ZSH shell

#90
post #58
post #41

Earlier quoted context omitted.

Fish is nice, but syntax difference is a no-go for me. I frequently log into different servers that usually use bash. I miss simple things like alias when I temporary want to assign long commands to a shorter alias.

I still script in bash and I still know bash. It’s just not that big an ordeal to code-switch between the two.

It turns out that it’s pretty annoying to have completely different fundamental syntax for something like variable assignment when so many things are the same. If I’m living in bash scripts half the time anyways, it’s just fundamentally annoying to accidentally type “foo=123” into fish and to get an error.

If I could use fish without set, maybe I would

Post reply on HN