Live data from Hacker News

Oh My Zsh adds bloat

rushter.com

161–170 of 304 posts

Re: Oh My Zsh adds bloat

#161

https://grml.org/zsh/ Simple, sensible defaults. Ships with the Arch Linux installation ISO.

I moved from oh-my-zsh to grml ~10 years ago, and I've enjoyed it - it's got good defaults, is extensible (I've added custom stuff to handle how I manage directories for work things) and the single-file nature of the defaults makes it super straightforward to put it onto a new machine (ie a server) without then necessarily needing to do any extra tweaking

Re: Oh My Zsh adds bloat

#162
post #96

Earlier quoted context omitted.

Try https://starship.rs then. Starship gives you the same "drop in and go" experience but without the 200ms+ prompt lag. One curl -> one line in your rc file, works on zsh/bash/fish/whatever. Configuration is straightforward and easy imo: https://starship.rs/config/ Give it a spin, I think you won't regret it.

I'm so glad I switched to fish, I'd rather have genuinely good settings out of the box rather than endless configuration, and honestly it's much better out of the box than any configuration I've ever had. Only drawback is that it's not POSIX, no issue for me, but maybe for people who have a lot of muscle memory with bash.

After 10 years on zsh I finally switched 6 months ago and I haven't looked back. If I need POSIX, I'll just run scripts with the right shebang or pipe it to sh.

Re: Oh My Zsh adds bloat

#163
I have these plugins: git, zsh-autosuggestions

    /usr/bin/time -f "%e seconds" zsh -i -c exit
    0.06 seconds
This is acceptable, maybe the zsh-autocomplete is the problem for author or something else?

I originally switched to ZSH + Oh My Shell because it opens so fast. Ideally plugins would initialize asynchronously but it's not very easy with shell scripts I think.

Re: Oh My Zsh adds bloat

#164
post #4

I use oh my zsh for exactly one reason: I can get a good shell experience out of the box and immediately start working on stuff productively, whether it's a new machine, a new remote host or a container. I could spend hours figuring out all those things, bit I'd rather use that time for something more important.

Try https://starship.rs then. Starship gives you the same "drop in and go" experience but without the 200ms+ prompt lag. One curl -> one line in your rc file, works on zsh/bash/fish/whatever. Configuration is straightforward and easy imo: https://starship.rs/config/ Give it a spin, I think you won't regret it.

From what I can tell, this doesn't nearly fill the gap that OMZ occupies

Nice history, command auto complete, and similar beyond just the looks, out of the box

Re: Oh My Zsh adds bloat

#165
post #25

Like many other people, I use oh-my-zsh for default setup and that's it. I literally use a single plugin for git and very actively autoload my custom functions to avoid startup delay. With my 384 line config and oh-my-zsh on, here are the results: $ hyperfine -N "zsh -lc 'exit 0'" "zsh -c 'exit 0'" Benchmark 1: zsh -lc 'exit 0' Time (mean ± σ): 54.5 ms ± 6.3 ms [User: 10.2 ms, System: 14.3 ms] Range (min … max): 38.1…

For anyone who cares about zsh startup performance, `zsh4humans` by `romkatv` (author of powerlevel10k) is worth a look: https://github.com/romkatv/zsh4humans

It achieves instant startup by rendering the prompt before the full shell initializes. Since adopting it, I am done fiddling with my shell config and the fact that `zsh4humans` is in maintenance-mode is actually an advantage as it keeps me from wasting time refactoring `zshrc`.

Re: Oh My Zsh adds bloat

#166
post #159

Earlier quoted context omitted.

Try https://starship.rs then. Starship gives you the same "drop in and go" experience but without the 200ms+ prompt lag. One curl -> one line in your rc file, works on zsh/bash/fish/whatever. Configuration is straightforward and easy imo: https://starship.rs/config/ Give it a spin, I think you won't regret it.

I tried using Starship, and it’s clearly faster than Oh My Zsh, but my issue was that I relied on some useful Oh My Zsh features that I didn’t know how to replicate in Starship. One of these is history filtering - for example, when I type source and press the up arrow, I only see previously run source commands, which makes it easy to find what I’m looking for. I tried to get this working in Starship, but had no luck.

I have never used Oh My Zsh, but I use Atuin to do this and it works excellently at that. You can even make it filter by what folder you're in and whether you want to search only this session or host (you can sync shell history across hosts). It never occurred to me that this is something I'd want from a shell prompt, which is what Starship is.

Re: Oh My Zsh adds bloat

#167

> The main problem with Oh My Zsh is that it adds a lot of unnecessary bloat that affects shell startup time. Wowsers! That +0.5 seconds delay will kill cats everywhere. We must microoptimise the startup time of shells!!! Or ... we could simply use bash and KDE konsole with, say, 10 tabs. That setup works for me since ages; admittedly I use bash just as a wrapper for simple actions as well as calling a gazillion of a…

For terminal-centric workflows, one ends up needing to open dozens of shells throughout the day.

Starting one command, realizing you need info from a previous command, often the fastest way to get that info is to open another terminal and start typing and the copy-pasting the relevant piece of cmd. Or needing the output from another command that's scrolled up in a window. In general you end up with a mosaic of tiles each of which is holding key information. So you inevitably open a new tab to make use of the information in the other 3 or 4 windows.

Shell startup is mainly not about waiting for a few terminals in abstraction, but about the way each shell is just a small piece of a longer live workflow and waiting a second for a shell so that you can fill in a piece of a command feels terrible. I think nushell will help cut down on this unpiped inefficiency, but it's usually much simpler to manually glue bash commands together than to parse text output and pipe.

Re: Oh My Zsh adds bloat

#168

I have these plugins: git, zsh-autosuggestions /usr/bin/time -f "%e seconds" zsh -i -c exit 0.06 seconds This is acceptable, maybe the zsh-autocomplete is the problem for author or something else? I originally switched to ZSH + Oh My Shell because it opens so fast. Ideally plugins would initialize asynchronously but it's not very easy with shell scripts I think.

FWIW, that’s not a great way to benchmark zsh.

Check out zsh-bench⁽¹⁾ for a more authoritative approach, including first prompt lag, first command lag, input lag and exit lag.

⁽¹⁾ https://github.com/romkatv/zsh-bench

Re: Oh My Zsh adds bloat

#169
post #96

Earlier quoted context omitted.

Try https://starship.rs then. Starship gives you the same "drop in and go" experience but without the 200ms+ prompt lag. One curl -> one line in your rc file, works on zsh/bash/fish/whatever. Configuration is straightforward and easy imo: https://starship.rs/config/ Give it a spin, I think you won't regret it.

I'm so glad I switched to fish, I'd rather have genuinely good settings out of the box rather than endless configuration, and honestly it's much better out of the box than any configuration I've ever had. Only drawback is that it's not POSIX, no issue for me, but maybe for people who have a lot of muscle memory with bash.

For POSIX: I leave Bash as the system shell and then shim into Fish only for interactive terminals. This works surprisingly well, and any POSIX env initialisation will be inherited. I very rarely need to do something complicated enough in the REPL of the terminal and can start a subshell if needed.

Fish is nicer to script in by far, and you can keep those isolated with shebang lines and still run Bash scripts (with a proper shebang line). The only thing that’s tricky is `source` and equivalents, but I don’t think I’ve ever needed this in my main shell and not a throw-away sub shell.

Re: Oh My Zsh adds bloat

#170
post #24

Earlier quoted context omitted.

Yeah but you can use something like zim that is better than omz but still easy. The shell starts so fast with zim and it is a breeze to set up

Exactly. The popular culture has bad picks. We can be low effort without necessarily being 100% unselective! No taste is not mandatory! Just the littlest bit of trying & listening to our peers can make a better world. There's so many better non-shite alternatives. Just one: Zim aka zimfw is one. It's just so sad that there's such a negative creep energy towards "I tried nothing and did nothing and this is where I am"…

People should be encouraged to play and explore. I landed on Zim eventually, but it's far from universally installed on my machines.
Post reply on HN