Bracket Expansion

Bracket Expansion

Let’s say you want to update capybara and capybara-webkit. You’d normally type this:

gem update capybara capybara-webkit

But you’re busy, you don’t have time to type “capybara” twice. Let’s see what tab completion has for us:

gem update capybara{,-webkit}

The bracket expression expands to the same thing as above because the brackets expand to "capybara" + "" and "capybara" + "-webkit". If you’re in ZSH, you can press the TAB key (gem update capybara{,-webkit}[TAB]) and it will expand the expression for you inline. Bash users, this will still work for you, even without the neat TAB trick.

Hound reviews Ruby and CoffeeScript code for style violations and comments on your GitHub pull requests. Free for open source repos.