Aaron N. Tubbs bio photo

Aaron N. Tubbs

Dragon chaser.

Twitter Facebook Google+ LinkedIn Github

I’ve been resisting moving away from bash ever since I started using bash. I like bash, it works, and when I want to do fancy shell scripting … well, I just use perl instead. Everybody who uses zsh seems to like it, but I always say “no, I don’t need your fancy shell, it can’t be that great.” Today I read Ned’s post about zsh, and I became an instant convert. First struggle was making sure I knew how to do all of the stuff that worked in bash. Problem solved; it does everything I want and more.

New sexy things:

  • “< file” is like “$PAGER < file”
  • Super-awesome shell-globbing
  • All sorts of short-syntax modifiers like basename (:t), dirname (:h) and so forth.
  • Easy one-liner tab-completion of pids to kill. So obvious it’s beautiful. So simple nobody did it before.
  • vim **/freq_flier – finds this file recursively and edits it.
  • vim =freq_flier – finds this file in $PATH and edits it

Other notes:

  • One of the pains I had with bash was in mashing my TERM settings all of the time to get everything cooperating with a 256-color terminal. Magically, it just works with zsh. I can’t explain it, but I’m loving it. No more goofy conditional logic in my .bashrc to magically untangle the world. Now I just have a .zshrc with aliases and exports, like it should be. Well, and a whole bunch of stuff like “zstyle ‘:completion::approximate:’ max-errors ‘reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )’.” You can’t have everything, I guess.

I don’t see myself suddenly using zsh for shell scripting, or fancy automation, that’s still where perl fits in my book, but for one liners, I suspect I’ll pick up more of the scripting language/shortcuts. If all else fails, I’m pretty sure recursive globbing will become my new favorite friend.

Anyhow, realizing how cool zsh was after all of these, I decided to challenge another long-standing prejudice. I love vim; it’s simply the best editor ever. I’ve long since come to the opinion that emacs is a lovely text processing environment in need of a great editor. However, after seeing the magic of zsh, I decided to give emacs another go. Maybe after a few hours with my newfound friend, all would be swell in the world. Long story short, the world is not ending, emacs is still a load of horseshit, and my C-x M-x, oh shit, better hit C-g before lisp explodes … let’s just say I’m not changing editors anytime soon. Did I mention the emacs tutorial specifically talks about “how to recover a hung emacs?” A new user shouldn’t have to worry about their text editor hanging. On that note, vim has some of the most useful and helpful documentation and tutorials I’ve ever seen, emacs seems to just blabber on about editing in its tutorial and teaches you nothing.

I mean, seriously. M-x reply schangedaltered …. why not just do a :%s/foo/bar and be done with it? Regular expressions? No problem. I know the HCI guys HATE modal editors, but they’re so much faster for people that know how to type and know what they want to do.

And with that, we’re off to Belize to much relaxation and scuba. Upon our return I will with luck have my thoughts that I want to blog about straightened out a bit more, and will with luck have lovely photographs and wonderful memories.