Live data from Hacker News

Use Zsh

fendrich.se

71–80 of 117 posts

Re: Use Zsh

#71
There's one of these "why you should convert from X to Y" posts every week or so. I understand that a person can be somewhat excited about finding a better application to replace their old stand-by and might feel the need to evangelize. I don't see anything wrong with wanting to introduce others to new software with a helpful attitude.

However, it seems like all of the bash-to-zsh posts boil down to better autocompletion and oh-my-zsh. I haven't really seen anything fresh in quite some time. This is something that I do not understand. Does the author think he is saying something that hasn't been said, or is the hope that if we keep saying the same thing over and over that we can get more people to try zsh? I really can't say.

Also, I recommend not using oh-my-zsh if you are a beginner. Rather, I recommend that you start with a blank slate and read the documentation. This is the only way to get the exact configuration you want. If you don't really care about your shell that much, then why are you switching in the first place? Alternatively, you might try using the "recommended" config offered on first run (I can confirm that the default config on Debian is a good start and will work for most people). Then go through that config while reading the Zsh User Guide[1] and tweak it to your liking. It is my opinion that oh-my-zsh ultimately stops people from reading documentation and offers an incentive (ease of use) for using code that may not be understood (when it probably should be). However, a lot of people seem to like it. Perhaps I am missing something.

My intent is not to discourage this author specifically, but rather to call into question the underlying motivation and behind and utility of all posts of this type.

1 - http://zsh.sourceforge.net/Guide/

Re: Use Zsh

#72

I've been using zsh for over ten years. Since one of my best friends (now a computational physicist) convinced me to try it in college. Over time I've temporarily switched to others just to make sure I wasn't being stuck in a rut, but I always have come back to zsh. It's a joy to use as a day to day command line interface. For writing shell scripts, i.e. actual software implemented in shell, I actually prefer bash. I…

If you really want your scripts to be portable, you should probably write them in POSIX sh. There might be a high probability that any given machine with a Unix-like operating system will have bash installed, but it is essentially guaranteed that it will have sh.

However, if a person really wants to run your scripts, he can probably install the interpreter for which they were written.

So choosing bash as some sort of middle-ground isn't really justifiable.

Re: Use Zsh

#73

I used to use zsh but switched back to bash a couple years ago simply because the benefit wasn't worth the trouble. When I first changed back I went to some difficulty to get my PS1 to have color in it. That slowly faded away and now I have a visceral, negative reaction to prompts with that much colorful whizzy fu. Maybe in a few more years I'll trim out the username/hostname/path and become content with just a %.

This is exactly what I've done for the past year. I realized that most of the time, I know which directory I'm in, I know which user I am, and I know which host I'm on. It's trivial to look up any of these (as well as other crazy things people embed in their PS1). Now my prompt is nothing but a green ">> " on a black background. I'm not deluding myself when I say that the reduced clutter improves my productivity.

To each their own. I'm logged in to at least 5 different hosts at any given time, often many more. Without user/hostname in the prompt and the term-title I'd be completely lost.

Re: Use Zsh

#74

There's one of these "why you should convert from X to Y" posts every week or so. I understand that a person can be somewhat excited about finding a better application to replace their old stand-by and might feel the need to evangelize. I don't see anything wrong with wanting to introduce others to new software with a helpful attitude. However, it seems like all of the bash-to-zsh posts boil down to better autocomple…

The underlying motivation is to write it specifically for a few people, whose current way of working I know, and who have asked me for some information on zsh. If it were not for them, I would not have written it, since I don't add anything new, just summarize in a different way.

Having written it, though, I thought I might share it. For most people, like me, the timing has to be right to try something new. You have to have the time and the motivation and everything else. By sharing it, I hope to hit some people with the right timing (and based on some comments, upvotes, etc, I know I did).

I must have seen 20 Haskell advocacy posts before I actually tried writing something in it. Same with you for some new technologies?

Re: Use Zsh

#75
post #70
post #38

Everything in the "Context based tab completion" paragraph is already done by bash_completion. * It knows which commands git takes? Yes. * which hosts are in my hosts file for ssh? Yes. * which users my system have when I write chmod? Yes. * available packages to apt-get? Yes. Plus everything in /etc/bash_completion, plus the hundreds of additional commands in /etc/bash_completion.d, plus many, many online resources…

One important difference between how that completion works and zsh's is that zsh cycles between the available completions if you repeatedly type tab. E.g. if you have the files [less01.png, less02.png, less03.png] and type "eog less " in bash will show you the files. Press tab again and it will list the files again. In zsh, the second tab press would fill in "less01.png", then "less02.png" and so on. It's a matter of…

That is an inputrc configuration not a shell feature.

http://stackoverflow.com/questions/7179642/how-can-i-make-ba...

Yay Unix. Input collection is a pluggabls component.

Re: Use Zsh

#76
I used zsh for years. Loved it. I just don't do as much command line stuff anymore so vanilla bash works fine for me. I do miss the history stuff mentioned at the end of the article, though.

Re: Use Zsh

#77
post #75
post #70

Earlier quoted context omitted.

One important difference between how that completion works and zsh's is that zsh cycles between the available completions if you repeatedly type tab. E.g. if you have the files [less01.png, less02.png, less03.png] and type "eog less " in bash will show you the files. Press tab again and it will list the files again. In zsh, the second tab press would fill in "less01.png", then "less02.png" and so on. It's a matter of…

That is an inputrc configuration not a shell feature. http://stackoverflow.com/questions/7179642/how-can-i-make-ba... Yay Unix. Input collection is a pluggabls component.

Thank you! I knew it was an inputrc setting, but I couldn't find the right one.

Re: Use Zsh

#78
post #34

Earlier quoted context omitted.

I independently wrote pretty much the same post. http://www.apreche.net/dont-change-the-computer-change-yours...

Probably you used Linux at the time it wasn't very mature. I'm running Gentoo now and never had to reinstall to fix things. With modern computers compiling is very fast, most software compiles in less than a minute. I spend more time solving binary compatibility problems with CentOS (at work) than compiling stuff via portage. I recently bought a new video card (nvidia), plugged it and then booted linux. It just worke…

That's the huge advantage of distros without discrete upgrade paths. I have the same Gentoo install on my desktop since I built it in 2008. Meanwhile I tried Ubuntu on my laptop for a couple of years and every time a new version came out, I tried to upgrade only to find my system borked, hours wasted, and ultimately my giving up and doing a fresh reinstall.

And yes, so many more things work "out of the box" today than ever before (as long as it isn't ATI/AMD :P). The Linux ecosystem has grown and improved incredibly over the last few years. I wouldn't dare argue whether it's better than OSX or Windows, but I can comfortably say that it has advanced a much further distance in the last few years.

Re: Use Zsh

#79

I've been using zsh for over ten years. Since one of my best friends (now a computational physicist) convinced me to try it in college. Over time I've temporarily switched to others just to make sure I wasn't being stuck in a rut, but I always have come back to zsh. It's a joy to use as a day to day command line interface. For writing shell scripts, i.e. actual software implemented in shell, I actually prefer bash. I…

If you really want your scripts to be portable, you should probably write them in POSIX sh. There might be a high probability that any given machine with a Unix-like operating system will have bash installed, but it is essentially guaranteed that it will have sh. However, if a person really wants to run your scripts, he can probably install the interpreter for which they were written. So choosing bash as some sort of…

When it probably covers mostly all computers that will run your script, I don't see why it isn't a good compromise.

Re: Use Zsh

#80

I've been using zsh for over ten years. Since one of my best friends (now a computational physicist) convinced me to try it in college. Over time I've temporarily switched to others just to make sure I wasn't being stuck in a rut, but I always have come back to zsh. It's a joy to use as a day to day command line interface. For writing shell scripts, i.e. actual software implemented in shell, I actually prefer bash. I…

If you really want your scripts to be portable, you should probably write them in POSIX sh. There might be a high probability that any given machine with a Unix-like operating system will have bash installed, but it is essentially guaranteed that it will have sh. However, if a person really wants to run your scripts, he can probably install the interpreter for which they were written. So choosing bash as some sort of…

dawg, where isn't bash these days?
Post reply on HN