Hacker News new | ask | show | jobs
by Afal 5078 days ago
The problem I have with zsh is that I don't really notice any benefits from it after switching from bash or whatever. I guess my problem is that I'm still using it like bash, which probably isn't a bad thing but I'm probably missing out on the other features it has.

Thing is there's no real feature I've noticed that made me think "Wow! How did I live without this?". Yeah I see some nice things but they feel like party tricks rather than game changing features.

I dunno, maybe I'm not seeing the big picture here. Is there anything out there that'll show what amazing things that zsh can do? Like is there anything out there that could make me stop using it like bash?

3 comments

My favourite feature is shared command line history among all open shells. It was my "how I lived without that" feature, and one which I use a lot. Of course, it's only useful if you use the shell for extended periods.

The glob features are certainly quite useful too, for example, if there's a file nested deep inside some directory I can just enter

    vim **/filename 
and zsh will expand it for me.
works in bash too, enable it with shopt -s globstar.
should be there in bash 4
Besides the awesome TAB completion, here are a few features that I use daily:

- Keyboard navigation for TAB completion (using the arrows)

- Coloured TAB completion

- "for" one-liners: for f in /*.py; wc -l $f

- Named directories (cd ~named_dir)

(edit: formatting)

This is not an attempt to argue with your feature list. Bash clearly doesn't do some of those. But I just noticed the for one-liners you mentioned. I do that in bash alot actually. This is just fyi for anyone reading, not trying to argue with your feature list.

for f in *.py; do wc -l $f; done

also, you can do something like

for f in `find project_name`; do wc -l $f; done t work on the output of another command.

Cheers!

That for loop looks pretty neat, however I don't tend to write loops that often on the command line so it doesn't really benefit me that much.
Erm.. ok? If you don't mind me asking, why would I want to look at that? I can't really tell what it can do for me other than "make zsh more awesome". How? How does it make it more awesome?
The thing I liked about oh-my-zsh when I switched from another shell was that it provided a wide variety of pre-built "plugin" scripts for customizing the shell for various environments/tasks. It's worth a try to just get a tour of some features available in zsh, and have some examples to look at. I don't know enough about either bash or zsh to list out feature-by-feature differences, but if you want a practical, real-world tour of zsh, oh-my-zsh is a good place to start.