I Have Cream But Could Use More Sugar
Posted October 27th, 2006 in ProgrammingTags: Editor, IDE, Programming, Ruby on Rails
I currently develop on a Windows machine. (You can cut the snickering.) Therefore, I don’t have the pleasure of using TextMate. I’m also avoiding IDEs as a matter of course when an editor and CLI often avoids the bloat and subsequently works faster. I first used Scite which shipped with InstantRails. I quickly moved over to jEdit when I switched to Rails on Cygwin. With the right set of plugins you can quickly and easily get a TextMate-like editor. I decided to give Vim/GVim a try when I saw it in action. As much as I liked the raw power, things just didn’t make sense to me. When you learn to use editors a certain way, it’s hard to break old habits. Enter Cream.
Cream makes Vim act like your standard, modern editor by cleverly mapping the UI from what you expect to what Vim expects. That said, you can also turn off Cream’s mapping temporarily or permanently and make it act more like Vim. Should you desire to use straight Vim or GVim, you can do that as well. Cream eases you into Vim better than GVim does. In fact, GVim is more a middleman between you and Vim whereas Cream acts more like a translator.
Vim 7 has built-in stuff like folds and diff mode. It ships with the vim-ruby scripts which enables things like autocomplete and syntax highlighting for Ruby. Cream adds tabbed documents (but I find them to be more cumbersome especially now that I can use Alt-W 1 thru 9). Cream is nice because you can use your mouse for selection and do cut and paste via Ctrl-X and Ctrl-V which one would expect. Then there’s the rails plugin that exposes many handy commands that hook into the fact you can call system commands so you can generate a model or run a rake task from within Vim.
For all the stuff you get out of the box, Cream has some annoyances. For example, choosing a color theme for your syntax highlighting is, for the most part, limited to the default ones provided by Cream. You can hack the scripts to add your own or you can load one via a configuration file, but that overrides the ability to use the color preferences. As for creating a custom color scheme, that is a programming task in and of itself. I do see the value of Vim’s all-keyboard methodology (a consequence of Vi being written before the mouse was invented). Once learned it’s very efficient. Though one thing that annoys the heck out of me is the choice for navigation keys, primarily for left and right. I can understand the point of maintaining the hand positions on the homebase keys, hence J being mapped to down, down being the most frequent navigation. However, coming from an arrow keys, numpad, and WSAD history, the key mappings for K, L, and H just aren’t that intuitive to me. It would’ve been nice for DF to be mapped to left-right and JK to down-up thereby giving each hand an axis to control, or maybe IJKL be mapped similar to WASD, but in either case, the one letter mnemonics for commands would be lost. Granted the arrow keys do function, but that removes a hand from the homebase keys which isn’t all that efficient and if you’re doing that then a mouse would be just as good to navigate. Yes, it’s possible to remap keys but then what happens when you move to another machine without your customizations?
Still despite it’s shortcomings, I think Cream will most likely replace jEdit as my editor of choice on Windows. The shortcomings are more than likely artificial due to my lack of experience and practice. There’s definitely a lot of features to go through and by far the worst annoyance is a lack of documentation showing proper workflow using Cream/Vim.
Update: I did find this Ruby on Rails, Vim, and rails.vim which is a remix of the RoR Creating a weblog in 15 minutes screencast.