As I discussed a few days ago, I’m always open to a better offer when it comes to tools. Yesterday, Dan Croak write a massive post describing how to set up OS X for Ruby on Rails development. In the post he points to dot files shared on GitHub by Joe Ferris, and mentions that the shell they use is zsh (an alternative to bash that’s based on ksh).
I started wondering about the allure of zsh — I’ve used bash for a long time, and when I started using it, it was the most powerful shell around. I figured that if people were leaving bash for zsh, there must be some compelling reason, and I decided to do some research.
If you’re looking for the zsh argument, Fried CPU outlines the advantages. Item number 4 on his list, “Share history across sessions” was enough to convince me to give it a shot.
After changing my shell with chsh
, it was time to start tweaking the shell configuration. I went back and looked at the .zshrc
mentioned in Joe Ferris’ post and then I started looking around elsewhere for more. There are a bunch of zsh configuration files at <a href=http://dotfiles.org/.zshrc”>dotfiles.org, and from among them I found _why’s particularly useful. (He has some code that updates the title bar in your Terminal window in a useful fashion that’s a must have.)
We tell ourselves that we live in a rational, scientific society, but Unix configuration files clearly indicate that’s not the case. Various snippets are passed around like bits of ancient lore, with most people who use them having no idea why they do what they do. Count me among the ignorant and possibly superstitious. (See also: sync; sync; halt.) You can find my current zshrc here, but don’t ask me how it works, yet.
The coolest trick I’ve seen zsh pull so far involves svn add
. zsh is smart enough to include only files that have not yet been added in the tab completion list when you hit tab after svn add
. So if you have a directory of 10 files and only one of them is new, zsh is smart enough to choose that file when you hit tab. I love little bits of brilliance like that.
The secret is that zsh provides a highly extensible system for customizing tab completion, so there are tab completion packages for many tools that handle the special cases. (zsh’s autocompletion library for the kill
command is somewhat famous.)
Playing with zsh is the best geeky distraction I’ve found in some time. I’d urge you to check it out.
Cynicism loses again
I’ve been reading less political news lately. I’m trying to focus on building stuff and learning new ways to build stuff, and that’s crowded most of the political feeds out of my reader. But I still do check in a little every day, and one thing I’m seeing a lot of is effusive praise for the defense budget reforms that President Obama and Secretary of Defense Robert Gates have proposed. Here’s where it’s important to remember that Gates was President Bush’s Secretary of Defense and that Barack Obama asked him to stay on.
Here’s Matthew Yglesias on Gates yesterday:
As Fred Kaplan reminded us yesterday, when Gates was nominated by President Bush in 2006, he recommended exactly the sorts of reforms that were announced this week. So now we can look back and consider the idea that President Obama offered Gates the opportunity to keep his job if he was willing to make those reforms.
Last November, few people seemed to think that Obama may keep Gates because they shared common goals. Here’s Katie Couric expressing a common view you saw in the media — that Obama kept Gates to manufacture credibility on national security issues. Plenty of liberals suspected that keeping Gates was a way for Obama to backpedal on his campaign promises on Iraq — or that Gates would influence Obama to break those promises. Given the shape of things that have happened since, none of those theories have turned out to be correct.
Operating under the assumption that President Obama doesn’t have a plan that serves his own goals rarely leads to solid analysis.