zstyle ':omz:plugins:nvm' lazy yeshttps://github.com/lukechilds/zsh-nvm?tab=readme-ov-file#laz...
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...
export LESS='-RX --quit-if-one-screen'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.
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.
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
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)
So half the users are using OMZ with a bloated slow config and the other half are reinventing new config managers every year because of how terrible OMZ has become. And constantly churning through them as they keep getting abandoned.
I've been happily using zsh4humans for years but will need to find a replacement at some point as it's now going unmaintained too.
I miss simple things like alias when I temporary want to assign long commands to a shorter alias.
If I could use fish without set, maybe I would
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.
Chances are, like in the article, you installed oh-my-zsh, a third party configuration framework.
$ tim 'bash -lic logout' 'zsh -lic logout'
55.3 +- 3.7 μs (AlreadySubtracted)Overhead
7454 +- 26 μs bash -lic logout
7934 +- 39 μs zsh -lic logout
(Using https://github.com/c-blake/bu/blob/main/doc/tim.md)About 20,000 entries in the Zsh history slowing it a little. All completion activated (but zcompile'd, along with a very large digraphs.zwc).
I think most would not be troubled by taking 1.06X longer, though, especially at this 8 ms scale and for interactive session initiation. Note this test upper bounds Time To First Prompt { a different "TTFP" from Time To First Plot ;-) }, since it also exits as part of the `-c`.
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.
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 to these frameworks.
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. Sometimes the string substitution differences come up too.
You can never completely automate the debugging step: it often requires human judgement to direct the investigation in ways that can't really be expressed in a script.
The friction of the shell comes up not in executing the ops, which we do in fact have heavy automation around, but in all the little pieces of debugging has to happen to tell you what ops need to be done.
(If you get paged and the solution is to skip the debugging step and run a script, then why didn't you automate the script so that you don't get paged in the first place?)
I think auto suggestions and syntax highlighting plugins can be installed separately from oh-my-zsh.
I use starship for a better prompt, and it works on more shells than just Zsh.
I also have Atuin installed to share history across machines, and as a benefit the history search is a lot more powerful.
https://github.com/zsh-users/zsh-autosuggestions
I am running my home on hdd, not ssd. But still do not see justification of this lag.
I configured daemon mode to workaround an ZFS+sqlite issue. I also have my sync_frequency set to 5m (default is 1h) in the config. Perhaps those are making my experience smoother.
Thank you
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've previously typed.
The curse of backward compatibility means that zsh does not break your setup or change things on you. And there are still developers left who bear the trauma from the one time that was tried back in the early-mid 90s in the 2.x version series. Sadly that means many new features remain inactive by default, especially anything written in shell-code like command-specific completions.
I'd rather have a good history search than autosuggestion, but having both is a net-positive in my day-to-day.
I tweak it occasionally, but for the most part I set it and forget it.
The `z-shell` github org has (or had) some ... bad vibes, I would personally not use any of their code.
- https://recurse.social/@dylnuge/112224580867240812
- https://www.reddit.com/r/commandline/comments/1c3r7ck/zshell...
- https://www.reddit.com/r/zsh/comments/1c3r5gn/zshellzi_users...
You could use `zsh-users/zsh-syntax-highlighting` as an alternative.
So probably not.
But I have yet to meet anyone in real life who knows what zimfw is.
I use it and never had any issue. Am I missing out on something?
Some of the autocompletion settings set by oh-my-zsh are useful. But apart from that, the majority of the code consists of gazillions of random aliases and functions that someone else needed. It pollutes the command namespace for no good reason except maybe making users more wary of typos. The last time I checked, sudo was aliased as "please", and I can't find a single reason why that'd be useful.
oh-my-zsh also introduces a lot of churn, which is why it has autoupdates. Autoupdates. The only time I needed to change my configuration in vanilla zsh because of a change in zsh was once or maybe twice over a span of 10+ years.
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
I always turn all of the languages plugins off in Starship for this reason.
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.
The repo hasn't seen new commits since more than a year, but new issues are still opened. Is it abandoned?
2. macOS switched from bash to zsh mainly because of GPLv3
CLI is for stuff that GUIs and IDEs for whatever reason don't support, or REPL like interactions.
I’ve used colored informative prompts since DOS and having production servers be brilliantly red and dev servers a different color is quite helpful.
Things like git branch name and virtual envs are handled by starship.
My custom config is less than 10 lines now:
export HISTSIZE=1000000000
export SAVEHIST=$HISTSIZE
setopt EXTENDED_HISTORY
setopt autocd
autoload -U compinit; compinit
source <(fzf --zsh)
eval "$(starship init zsh)"
set -o viYes zsh has a bunch of settings and dense documentation, and it can be hard to understand. The problem with something like oh-my-zsh is that now you have two things you don’t understand, and worse, when something doesn’t work you don’t know which one isn’t working or where to look.
But there's a huge list of different offerings. Looking at https://github.com/sindresorhus/pure?tab=readme-ov-file#inte... , there's also for example zim, zplug, zinit, zi. It's be so great to have see some deeper investigations or comparisons: is Pretzo really the best choice? Aside from seeming popularity, why?
At least found this neat gist with a cheat sheet for different zsh plugin systems (and how very many there are!) https://gist.github.com/olets/06009589d7887617e061481e22cf5a...
If you have the Python environment displayed in Starship, your largest gain in speed is to replace pyenv and pyenv-virtualenv by uv.
Or even better switch to starship, a compiled binary doing the prompt formatting?
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.
I get bewildered looks when i hit v and edit my commands in vim from the youth but whatever, they’ll learn someday :))
Anyway, I'm going to be revisiting my zsh config soon and I'll be looking for ways to make sure I'm only using plugins that I absolutely do need. My principle in the past with workflows in zsh and Neovim is that I only add crucial plugins and try to keep my config minimal. Maybe I've gotten away from that a bit and need to regroup, so I find threads like this one useful to keep up with what's current.
This is fixed by adding an explicit `touch ~/.zcompdump` in the branch that runs a full `compinit`.
srvmshr•6mo ago
[Not the best hackjob out there but here it is:
https://github.com/gradientwolf/leanzsh
If you want to update it just copy over the latest `plugin/` folder from OMZ repo. You can get rid of all the plugins you dont want, as well as the themes. It somehow works]
SamDc73•6mo ago
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
lompad•6mo ago
To me personally, oh-my-zsh and similar projects feel like a worse version of the stuff fish brings by default.
Jubijub•6mo ago
ewuhic•6mo ago
krab•6mo ago
MillironX•6mo ago
My own usage: https://code.millironx.com/millironx/nix-dotfiles/src/commit...