How zsh is more useful than bash
31–40 of 151 posts
Re: How zsh is more useful than bash
#32Re: How zsh is more useful than bash
#33 cd site1 site2
if you just add this line to your ~/.bashrc: function cd() { if [ $# -eq 2 ]; then builtin cd ${PWD/$1/$2}; else builtin cd $1; fi }Re: How zsh is more useful than bash
#34I love using zsh (in combination with oh-my-zsh) on OSX but the only thing I've noticed after using it a year is that it's becoming very very slow. As in, it usually takes me 5-10 seconds to login to a new session (locally) and be able to see the prompt and type something. Tab auto completion takes a second or two (even for files). Combined with the git plugin I have enabled (which does "git status" on every prompt i…
Re: How zsh is more useful than bash
#35 local green="$(tput setaf 2)"
local reset="$(tput sgr0)"
export PS1="\[$green\]>>\[$reset\] "
And a multiline prompt, let alone one with right-justified elements, is pretty gruesome to me.The first slides about availability on Macintoshes don't resonate, because I'm going to have MacPorts on any dev box and use that to install the latest. It's more likely I ssh to a server that has Bash 4 and no Zsh than anything else, so it also makes sense to know bash and have a good .bashrc ready to scp up there if I'm going to be doing a lot of work on the server.
zsh spellcheck is very annoying, thankfully it can be disabled. This is my preferred spellcheck solution ;^) https://github.com/mtoyoda/sl
All that being said, zsh is a really cool piece of software. It's one of those things I've always wanted to really stretch to its limits, but I've never been able to hang with it for more than a few months, which I doubt is enough time to really become accustomed to the workflows zsh allows (like the /u/b/... expansion example in the slides).
Re: How zsh is more useful than bash
#36Problem is zsh is not omnipresent like bash is. I'm sure that if you use zsh you also use Plan 9, code in D, write LuaTeX in Emacs and wear a monocle.
These days, I use Zsh on OpenBSD. I don't use Plan 9, code in D or write LuaTeX, but I do use Emacs and wear a monocle. The last two are not a coincidence as the first (arguably more adequate substitute for God), invariably leads to the latter, most excellent eye wear. And a note to my Mac friends : "Using csh is like trying to type with your feets[sic] (if you're used to zsh or ksh)." http://forums.bsdnexus.com/view…
Re: How zsh is more useful than bash
#37I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.
> It's better. What's "better" about it?
2) An effort to clean up and orthogonalize shell syntax. The potential portability means I usually still make bash scripts when I'm sharing for others, but for my own stuff it's great.
3) Suggested completions. I start typing a command and if it's one I've used before in that directory it appears in faint gray letters on my command line and I just have to press ctrl-f to bring it up that way.
4) Probably a consequence of (1), but it feels very fast to me compared to when I used zsh. The author also talks about using threads and minimizing disk access to speed it up, but I don't really know how it compares to zsh on that level.
Re: How zsh is more useful than bash
#38I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.
I was happy enough sticking to bash as it's the default shell everywhere, but since someone switched me to Zsh (using oh-my-zsh) I probably rely on the features too much to ever go back. I also hear https://github.com/sorin-ionescu/prezto is a nicer, cleaner fork of oh-my-zsh but I haven't so found the overwhelming desire to go through the switching pains.
Re: How zsh is more useful than bash
#39I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.
Re: How zsh is more useful than bash
#40For example:
setopt extglob
cd *(
~~ massive spam of possible glob qualifiers ~~
and it works for variable expansion modifiers as well: print ${(
~~ completion candidates for parameter flags ~~
print ${
~~ complete any currently set variable in the current env~~
Another thing I like is the array types for things like $PATH that are historically colon-separated, typically
lower-case versions of the var name for the interesting 'magic' ones. vared path
vs vared PATH
to see the difference. print -l $path # much easier to read