Live data from Hacker News

Oh My Zsh adds bloat

rushter.com

291–300 of 304 posts

Re: Oh My Zsh adds bloat

#291
post #148

Earlier quoted context omitted.

I've been using fish for nearly 10 years. First, there are some ways to make fish more compatible with bash. If you want to do some shell scripting in fish, or running other people's shell scripts (or commands) this may aid you since you wouldn't have to port them (or take less time to port them over). You can achieve this with a plugin system such as 'oh my fish' or 'fisher'. But, as always, it adds complexity (and…

./script.sh and script.sh just starts with #/bin/bash I'm simple

If I use fish, I want to make use of it, and that means I will want to convert scripts, or simply learn to write scripts compatible with fish.

Shell scripts from third parties stick with whatever shell they were written for (ie. /bin/sh or /usr/bin/env bash), and commands copy/pasted from the internet are either quickly executed with bash (one-off) or ported over. Because I like to have such in my history (fish is configured to use atuin), I want to keep using the same shell, so I try to stick with fish. If I cannot convert a command (usually a bunch of commands) to fish, it is PEBCAK and a learning curve/experience.

As for tmux, that is solid advice, because it also allows to stick with a shell which is known to work. I've come to like zellij with alacritty, with zellij the option is default_shell. But now that I use ghostty, I don't use a terminal multiplexer locally any more; only remotely. And there I still use tmux.

Re: Oh My Zsh adds bloat

#292
post #157

> For Vim users, I also suggest enabling Vim mode in Zsh. It makes editing commands much faster. I am also an avid Vim user but I disagree. The default readline is perfectly fine for single line commands (you do have to know your way around some basic commands though C-a/u/k/l/w...). To edit long commands in $EDITOR you can always do C-x C-e in bash/zsh (M-v in Fish). As a matter of fact everytime I pair program with…

I can't believe it, have been an zsh user for a long time and didn't know this trick until now

Re: Oh My Zsh adds bloat

#294
post #159

Earlier quoted context omitted.

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 haven't checked out starship yet, but if I understand what you are using, that is Zle functionality. It's part of OMZs configuration (here: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindi... ) but doesn't use other OMZ features. I don't know if starship is still using Zle. If so, this should be possible to configure without OMZ.

Oh thank you, I was looking for this. Will try it.

Re: Oh My Zsh adds bloat

#295
post #159

Earlier quoted context omitted.

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.

Control r. This is a zsh feature not a starship/oh my zsh feature

Oh my god! How did I not know about this! Thank you! Are there any other useful tips like this one?

Re: Oh My Zsh adds bloat

#296

Earlier quoted context omitted.

I think that's just a standard readline functionality. It's available on bash, out of the box.

Absolutely and in zsh too, out of the box. It kind of blows my mind that people think they need all this additional bloatware for things which have always just worked (at least as far back as like 96 or so which is when I started using Linux) but it wasn’t new then. Wait till people learn they can use rlwrap to get the benefit of readline even in things like commandline sql clients, which often lack this.

I think convenience inherently comes with bloat. This is true for many things in life. Most people use cars simply to drive to work and back, yet they don’t use 90% of the features sold to them by salespeople.

Re: Oh My Zsh adds bloat

#297
post #171
post #156

Earlier quoted context omitted.

Starship allows empty segments, I in this specific case it's just how the preset/theme works as it uses the Unicode character as separator and it needs to set the background and foreground colors depending on which modules is surrounded by

Every preset with powerlevel10k-style segments don't support hiding empty segments. Look at Pastel Powerline, Tokyo Night, Gruvbox Rainbow, Catppucin Powerline... https://starship.rs/presets/#pastel-powerline I tried making my own and the config TOML syntax isn't expressive enough to support hiding empty segments. You're right that it's the thing with the Unicode character as separator, which all the alternatives han…

Also oh-my-posh supports transient prompt and AFAIK starship.rs does not.

"Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate." https://ohmyposh.dev/docs/configuration/transient

Here is my config for oh-my-posh https://github.com/rofrol/dotfiles/blob/master/.config/oh-my...

Re: Oh My Zsh adds bloat

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

Also oh-my-posh supports transient prompt and AFAIK starship.rs does not.

"Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate." https://ohmyposh.dev/docs/configuration/transient

Here is my config for oh-my-posh https://github.com/rofrol/dotfiles/blob/master/.config/oh-my...

Re: Oh My Zsh adds bloat

#299
post #295

Earlier quoted context omitted.

Control r. This is a zsh feature not a starship/oh my zsh feature

Oh my god! How did I not know about this! Thank you! Are there any other useful tips like this one?

You are most welcome. Probably hundreds but I don't know what you don't know. It's worth learning some old-school command-line history fu as well because that is often useful. I've written up some things I have found helpful here[1]

One thing which is not in the writeup but should be (and I mention it in a sibling thread) is "rlwrap" which is a readline wrapper which imbues whatever program with readline editing and history niceness.

So say you have to use some crufty cli like a sql cli or something that doesn't have commandline editing or history. You run "rlwrap horrible_sql_cli" aaand now it does. Really helpful.

[1] https://www.uncarved.com/articles/unix/

Re: Oh My Zsh adds bloat

#300

Earlier quoted context omitted.

I'm using Asdf too. Have heard well about Mise, but I haven't figured out what the difference is, so I have stayed with Asdf

mise has more features - it is a super set of asdf. For example it can set your env vars when you cd into a directory (like direnv). It also has tasks (which I haven't used) - they appear to be similar to what a Makefile does. So you can potentially replace three tools (asdf, direnv, make) with one.

Thanks! Sounds interesting!
Post reply on HN