At AELOGICA, we mostly use Ruby on Rails for developing websites, if not other Ruby related frameworks. One of the many reasons why Rails is so popular is that it has created some useful conventions that we can readily utilize. Thus, the phrase Convention over Configuration was popularized.
These conventions are perhaps borne out of the developer’s need to decrease the amount of decisions they are required to make without necessarily losing flexibility. For example, we don’t want to waste time setting up RESTful routes for a photos controller by mapping a bunch of URIs for each controller action. Instead, we just say
By using conventions, we are entrusting some decisions to others who have contemplated the same problem or question more deeply, especially if the number of choices are potentially endless. The paradigm of using conventions in software development can be seen not just in the frameworks or languages we use, but also in the tools we rely on as well. Recently, instead of using our own custom (oftentimes bloated) dotfiles for each machine and dealing with each of their idiosyncrasies, we have come to use a common Ruby development dotfile setup that most of us in the company now use.
From the YADR repo, YADR is an opinionated dotfile repo that will make your heart sing. Two of the bullet points that struck me are:
- OSX is the best OS. MacVim is the best editor. Zsh is the best shell. Pry is the best irb. Solarized is the best color scheme.
- Apple-style philosophy: make everything Just Work and Look Good. Don’t worry about too many options.
This is exactly what we want. To install, simply read starting from this part of the repository.
Additional Steps (or When Things Go Wrong):
However, as of posting time, there are still rough edges that needed fixes or extra steps. Note that we were running Mac OSX Lion (10.7.4) on our machines when YADR was set up.
For example, YADR doesn’t start right away when you restart terminal. In fact, when you check which shell script is used:
> echo $SHELL /bin/bash
Terminal says it’s still using bash. When you open MacVim from the command line via mvim, notice that the key mapping or even the Solarized theme doesn’t work right away. To fix that, here are the commands that will help you:
> chsh -s /bin/zsh # change shell to zsh permanently > ln -s ~/.yadr/vimrc ~/.vimrc # symlink your .vimrc to yadr's vimrc
As of posting time, the skwp.zsh-theme for YADR is not yet included into the original oh-my-zsh repo. So if you’ve also used the original oh-my-zsh, include the zsh theme file into
Also, If you would like to give your terminal (or iTerm) and other text editors (Sublime Text 2, in case your pair partner doesn’t know any vim yet) the same color scheme as mvim’s solarized theme, you will have to download their theme files separately. For most cases, they can be downloaded here. Installation can be as simple as a double-click.
Lastly, at least in my case, some symlinks were gone, for example, to reenable Sublime Text 2 via subl command, type:
> ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
After all these steps, congratulate yourself! You’ve set up one of the best set of dotfiles and plugins we’ve found across the web for Ruby development . :)