Re:VimGolf.com - real Vim ninjas count every keystroke
by BrandonM on Tuesday December 28, 2010 @04:16PM
(#2046832)
To be fair, I borrowed from a couple others here, but that was generally the approach I had in mind.
Of course, we aren't genuinely doing what the author intended. The point was not to copy-paste the line, but actually to perform what would be rather typical edits. I also was rather lucky that the file happened to be structured such that "3j" put the cursor in the right place each time.
It's also not clear whether or not the three times SHIFT must be pressed ("JD" = push and hold SHIFT = one press) should be counted as additional keystrokes.
The contest would have been better with a "tee" file and a "hole" file, stipulating that edits should be performed on the former in order to produce the latter.
Of course, we aren't genuinely doing what the author intended. The point was not to copy-paste the line, but actually to perform what would be rather typical edits. I also was rather lucky that the file happened to be structured such that "3j" put the cursor in the right place each time.
It's also not clear whether or not the three times SHIFT must be pressed ("JD" = push and hold SHIFT = one press) should be counted as additional keystrokes.
The contest would have been better with a "tee" file and a "hole" file, stipulating that edits should be performed on the former in order to produce the latter.