Live data from Hacker News

Speeding up my ZSH shell

scottspence.com

91–100 of 133 posts

Re: Speeding up my ZSH shell

#91

Earlier quoted context omitted.

I don't want to spend ages figuring out which knobs to turn to get a half decent shell. If there's an alternative to oh-my-zsh that looks halfway decent, has that nice fzf integrated, and the 'ghost text' history suggestions, then I welcome it!

If zsh has its completion fully configured by default, there will be no need for most people to turn knobs nor will it be a "half decent shell." It'll be the best shell, if it isn't already. I wonder why ghost text history suggestions are popular though, I'd rather not have it. Shell history search works better, and I don't want my shell always showing me or whoever else is looking at the screen random commands that…

I for one use and like using both fzf on the search history and the ghost text history. With history, I often end up writing a line that isn't shell so that it fuzzy-matches what I'm looking for. I like having the passive suggestions in addition to that. It doesn't get in my way and if I like what I read, I can accept it.

I'd rather have a good history search than autosuggestion, but having both is a net-positive in my day-to-day.

Re: Speeding up my ZSH shell

#92

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…

Pure zsh is alright, it's pretty much just bash with fantastic autocomplete that usually provides short form documentation right there along with the options. So no need to remember (or look up) what -X -d -f stands for. Get rid of oh-my-zsh and give the proper shell another chance.

I'm being downvoted because I equated zsh with oh-my-zsh (or actually, maybe because I hate MacOS?), but if you look through the rest of the comments you'll notice that most people are asking for a lighter weight omz or wishing that some omz alternative hasn't been discontinued.

But think about trying to onboard with a shell. Imagine the type of help you'll get online, and where that inevitably pushes you. Consider these two things: 1. The number of people using pure zsh config Vs plugin systems like OMZ. 2. The number of people using pure bash config Vs some plugin system (can't even name one)....

With bash, when you try to figure out how to do something, the internet will usually spit out a snippet of pure bash. The same search on zsh will generally tell you which plugin you need to add to OMZ.

Zsh would likely be easier to adopt, and overall better off, if it didn't have an extremely bloated plugin system almost synonymous with it. I'm sure if I started from scratch with zsh years ago I'd have a great zshrc. Or if I had the time and energy to devote to getting zsh working to my taste without plugins, I'd do that. But vanilla zsh wasn't to my liking and I took, what seemed like, the path of least resistance. For a short while it I stuck it out, trying to gradually tweak it into shape. But I couldn't figure out how to correct some "fucking weird" behaviour, and digging into a bunch of insanely complex plugins was just way harder that looking at a zshrc. I eventually dumped the whole lot for bash and never looked back.

Could I have dumped OMZ and started clean? Yep. But I was tired, and bash works.

Re: Speeding up my ZSH shell

#93
post #74

Earlier quoted context omitted.

I actually like bash's autocomplete better (maybe there's a way to configure how zsh does it, I haven't looked into it).

If you've only compared against zsh's out-of-the-box completion then you're comparing against the fully backward compatible with how things were in 1993 state. Turn on compinit, and a half-dozen styles to enable descriptions at the very least. The content of `StartupFiles/zshrc` from zsh sources is more than enough, no need for a bloated framework like oh-my-zsh.

Yeah I'm comparing bash-completion with compinit (at least I think so). I just didn't really like how it "picks" an option for you

Re: Speeding up my ZSH shell

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

Its been my experience too, they mainly want the eye candy of the prompt to compliment their macbook.

Re: Speeding up my ZSH shell

#96
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'

What does this do exactly?

Re: Speeding up my ZSH shell

#97
I don't have anything against ZSH or similar shells. I think they are great, but they are not my thing.

Latency is a deal-breaker for me, and this is where autocompletion engines generally introduce surprising user-interactive pauses. I've generally settled with using mksh (or OpenBSD's KSH depending on the environment) with little configuration outside of aliases, variables, and few local functions. I'm not left with this inkling feeling like accidentally running find(1) over an AutoFS file system backed by NFS that needs to authenticate, mount, and then run the operation.

When I need something more sophisticated, I lean on using Go or Elvish and potentially delegate some UI elements out to https://github.com/charmbracelet/gum.

I'd rather keep my shell simpler and delegate out any other complexity to these other programs. Autocompletion and these other features simply aren’t free.

Re: Speeding up my ZSH shell

#98

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…

Out of curiosity, what is wrong with oh-my-zsh? I use it and never had any issue. Am I missing out on something?

Yep, many are just throwing shades at it. I combined omz with Antidote, which now gives me a fully featured shell and blazingly fast.

Re: Speeding up my ZSH shell

#100

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…

No shell does, I am using computers since 1986 and I don't these "pimp my shell" kind of stuff with rainbows and virtual pets.

CLI is for stuff that GUIs and IDEs for whatever reason don't support, or REPL like interactions.

Post reply on HN