Rails Development with VIM

As explained on My Development Environment, I no longer use VIM full-time for editing Rails sites. However, I was quite efficient with it, so I have preserved the outline of that workflow here. Further VIM tips are on my VIM page.

This guide assumes Linux.

I used WMII. It's a window manager that automatically manages windows, assigning their positions and sizes so that as close to every pixel of your screen is filled as possible, with no overlap. As executive summaries go, that's great, but visit their site, check out some screenshots, and try it for yourself to understand what it's really about.

WMII's workspaces are created dynamically and identified by tags. I set my development tag to "stack" mode (one window visible at a time), open two terminals, and Firefox. Each had a purpose. In order from top window to bottom:

Terminal 1
This hosted my VIM instance, and when I was ready to commit changes, I would close VIM (which would destroy its swap files) and use the same terminal to diff and commit.
Terminal 2
This hosted my test runs. It was either an instance of autotest or my poor man's autotest (while true; do (rake spec | less); read; done). It depended on my mood, and how many tests were failing.
Firefox
I viewed the site I was working on, the Rails documentation, the Ruby documentation, and any other relevant documentation in Firefox tabs.

VIM Tabbing Strategy

I discovered VIM's tabs, but never really liked them. I worked mostly in splits. Typically I'd split the window vertically with specs on one side and code on the other. When I was dealing with a model/controller combo which were very related, I'd have multiple rows of splits, each with the spec/code combo. I'd move around with hotkeys.


Comments

Click here to view the comments on this post.