Friday, December 10, 2010

Vim - telling it like it is

So, I've been working on the Bank Kata OCR lately.  Part of it requires you to read input from a file.  I've been doing my development in Eclipse, including creating some files that have test data in them.

One requirement is that your record will span three lines, followed by a "blank" line.  There can be many records in a single file.  Thus, a record technically consists of 4 lines, of which you only care about three.

My tests were failing and I was having trouble figuring out what the problem was.  After all, I had typed in my file correctly:



After some consternation, it finally dawned on me to open my file in Vim.  When what to my wondering eyes should appear:



But a file with only three lines in it!

Yeah, it's a small thing, a minor inconvenience, and it's not like I wasted days on this.  But still, the point remains:  Keep a trusted tool and old friend in your toolbox.