Live data from Hacker News

Oh My Zsh adds bloat

rushter.com

81–90 of 304 posts

Re: Oh My Zsh adds bloat

#81

> I'm using starship which is a fast and minimal prompt packed into a single binary. cargo install starship --locked downloads 336 packages. So much for "minimal". cargo is the new npm

Right. A lot of people when they say "minimal" mean "simple looking at first glance", and it rarely is.

Re: Oh My Zsh adds bloat

#82

Earlier quoted context omitted.

> I could spend hours figuring out all those things, This post is explaining how to set up those things. Less than five minutes to read.

That misses the point. I don’t even want to think about any of that stuff. It’s a single command to install oh-my-zsh. I can fire it off, check Slack, and come back in 5 minutes. If I have to take 5 minutes to setup it up, I’m just not going to do it.

[flagged]

Re: Oh My Zsh adds bloat

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

I think `zsh -l` start a login shell, which does not load zshrc so oh-my-zsh don't get initialized. Try `zsh -ic exit` and it should load zshrc before executing exit.

That said, the time of `zsh -ic exit` isn't really meaningful metric for measuring the performance of an interactive shell. See https://github.com/romkatv/zsh-bench#how-not-to-benchmark for details.

Re: Oh My Zsh adds bloat

#86

> I'm using starship which is a fast and minimal prompt packed into a single binary. cargo install starship --locked downloads 336 packages. So much for "minimal". cargo is the new npm

Some of those are the equivalent of a single C source file.

We wouldn't celebrate a C project for specifically holding down to say, 10 source files max. We'd celebrate it separating concerns well instead.

Re: Oh My Zsh adds bloat

#87
This is the .zshrc file I have in my dotfiles.

It auto installs everything if you don't have it. Starts effectively instantly.

External dependencies (or remove their line at the bottom)

- [Mise](https://mise.jdx.dev/) fast asdf, runner, and direnv replacement

- [oxide](https://github.com/ajeetdsouza/zoxide) smart and fast cd replacement

-[atuin](https://atuin.sh/) ctrl + r and shell history finder

- [fzf](https://github.com/junegunn/fzf) fuzzy finder

``` # Plugin Manager

declare -A ZINIT ZINIT[NO_ALIASES]=1 ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" [ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)" [ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" source "${ZINIT_HOME}/zinit.zsh"

autoload -Uz compinit; compinit

# Plugins zinit light Aloxaf/fzf-tab zstyle ':fzf-tab:' use-fzf-default-opts yes zinit light zdharma-continuum/fast-syntax-highlighting zinit light zsh-users/zsh-autosuggestions

# Starship zinit ice as"command" from"gh-r" \ atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ atpull"%atclone" src"init.zsh" zinit light starship/starship

zstyle ':fzf-tab:complete:' fzf-bindings 'shift-tab:toggle' zstyle ':fzf-tab:' switch-group ',' '.' zstyle ':fzf-tab:' continuous-trigger '`'

source eval "$(mise activate zsh)" eval "$(zoxide init zsh)" eval "$(atuin init zsh --disable-up-arrow)" ```

Re: Oh My Zsh adds bloat

#88
post #10

Earlier quoted context omitted.

Show me an environment where I can interact with my system programmatically, where I can compose together arbitrary tools, and which will never, ever, ever break on me, and I'll switch! My experience with graphical environments has been that they rarely compose, often break, and constantly make arbitrary changes that break my workflow. So every time I try something else I end up coming back to the terminal. But I agr…

Nushell. Still a terminal experience. But not a POSIX one. https://www.nushell.sh/

Colorful outputs and elaborately decorated error messages are cool but maybe it shouldn't deviate that far from POSIX shells.

    $ trap '' chld
    $ nu -c test
    Error: nu::shell::io::uncategorized_error
    
      × I/O error
      ╰─▶   × failed to get exit code
    
       ╭─[source:1:1]
     1 │ test
       · ──┬─
       ·   ╰── Uncategorized error
       ╰────
    
    $

Re: Oh My Zsh adds bloat

#89
I have been using OMZ for the last 8 years but recently made the switch to plain zsh with : - starship for a better prompt - Claude ported plugins I was using from omz (extract, sudo) - custom written aliases that were muscle memory - zoxide for the a command

So far that has been a great move, my terminal tab feel snappy again. One thing I miss (but I’m sure I could find a way to replace it) is `cd ….´

Re: Oh My Zsh adds bloat

#90

I don't think 0.38s is a bad trade-off for convenience when the rest of the tools I need to do my job collectively are another 2s at shell startup. NVM alone adds 0.5-0.6s on my M4 Macbook Air. Bigger fish to fry if we're being practical.

I am seeing a phenomenon of people wanting to hyper optimise their workflows. It’s nonsensical when you consider the other stuff you need to do or how slow everything else is.
Post reply on HN