1864 keystrokes
Somebody could probably write some code that produces a more optimal solution, but this beats the reference case for now. This is a damn mess, and I am ashamed I did it by hand.
First, we enter insert mode.
i
Then all this
That ]! That ]!
IDNlike that ]!
Do Y like$?
|;].
IDNlike$.
WPY LTB or tB?
IZ LTB or tB.
IZ LTanywB.
IDNlike$.
|;].
WPY LTin a h@?
WPY LT=a m@?
|in a h@.
|=a m@.
|B or tB.
|.
IDNlike$.
|;].
WPY ETin a box?
WPY ET=a fox?
Not_a box. Not =a fox.
Not_a h@. Not =a m@.
IZ ETB or tB.
IZ ETanywB.
IZ eat$.
|;].
WPY? CPY? In a car?
Eat them! Eat them! B they are.
IZ,X,_a car.
You may LT. You will see.
You may LTin a tree!
IZ,X_a tree.
Not_a car! You let me be.
|in a box.
|=a fox.
|in a h@.
|=a m@.
|B or tB.
|.
IDNlike$.
|;].
AQ! AQ! AQ! AQ!
CPY;wPY;on aQ?
Not_aQ! Not_a tree!
Not_a car! Sam! Let me be!
IZ,X,_a box.
IX,Z;=a fox.
:=a m@.
:in a h@.
:B or tB.
:anywB.
IDNlike$.
|;].
Say! In +? B_+!
WPY;cPY,_+?
IZ,X,_+.
WPY;cPY,_the rain?
IZ,X,_the rain.
Not_+. Not on aQ.
Not_a car. Not_a tree.
|;Sam;Y see.
Not_a h@. Not_a box.
Not =a m@. Not =a fox.
:B or tB.
|!
You do not like$?
|;].
CPY;wPY;=a g^?
IZ,X;=a g^!
WPY;cPY;on a b^?
IX,Z;on a b^.
IWN,WN;=a g^.
:in the rain.
:on aQ.
Not_+! Not_a tree!
Not_a car! You let me be!
|in a box.
|=a fox.
:in a h@.
|=a m@.
|B or tB.
|!
IDNlike$!
|;].
You do not LT. So Y say.
Try them! Try them! & Y may.
Try them and Y may;I say.
Sam! If Y will let me be,
I will try them. You will see.
Say! I like$!
I do! I LT;]!
& I wPETin a b^.
& I wPET=a g^.
!ETin the rain.
&_+. & on aQ.
&_a car. &_a tree.
They are so good;so good;Y see!
So I will ETin a box.
!ET=a fox.
!ETin a h@.
!ET=a m@.
!ETB and tB.
Say! I will ETanywB!
I do so like$!
Thank Y! Thank Y;]!
Hit escape to enter command mode. And unravel the compressed stuff. Order matters, as I've compressed some compressed text.
<Esc>
%s/|/|anywB/g
%s/:/IWNET/g
%s/|/IDNLT/g
%s/Z/ wPnot/g
%s/X/ cPnot/g
%s/&/And/g
%s/+/the dark/g
%s/@/ouse/g
%s/^/oat/g
%s/Y/you/g
%s/IDN/I do not /g
%s/LT/like them /g
%s/]/Sam-I-am/g
%s/ET/eat them /g
%s/WN/ will not/g
%s/$/ green eggs and ham/g
%s/P/ould /g
%s/!/And I will /g
%s/Q/ train/g
%s/B/here/g
%s/_/ in /g
%s/=/with /g
%s/;/, /g
If somebody wants to create the Emacs equivalent of this question, they can. I'm not familiar enough with Emacs to know if it would make for an interesting question at all. – Joe Z. – 2013-12-09T03:46:25.503
Also, "with all default settings" means that you aren't allowed to load settings from a
.vimrc
file. – Joe Z. – 2013-12-09T03:47:12.117Based on your "canonical" insert-entire-file answer, I take it the mode you leave the editor in after the insertion doesn't matter. Maybe this should be explicitly specified to clarify (i.e. you don't have to <Esc> out from insert-mode). – FireFly – 2013-12-09T15:26:06.470
Yeah, you don't have to
<Esc>
out from insert mode, but you do have to start in normal. – Joe Z. – 2013-12-09T19:48:19.800As I see it, this question is on the edge of being off-topic. It's not a codegolf, it's a vimgolf (there is a page for that, a good one. Anyone interested should take a look). I also find the text to be too long, making it very time consuming to golf. – shiona – 2013-12-09T20:41:07.750
You lied: it is 51 words. Now I have to start over. (kidding) – hildred – 2013-12-09T22:20:48.250
It's more than 51 if you count capitalizations as different words. – Joe Z. – 2013-12-09T22:45:10.720
Also, there is a small typo in there. I'm not sure if its meant as a test to see who used your reference text or not, so I won't point it out. – None – 2013-12-09T23:01:39.087
fixing the typo brings the unique word count to 50 – hildred – 2013-12-09T23:42:24.793
I didn't even notice the typo myself. Thanks for pointing it out, though - I found it and fixed it. – Joe Z. – 2013-12-10T00:12:30.287
Is invoking external commands using Vim keystrokes allowed, if the "Your keystrokes must not load any other files" rule is still followed? – Jordan – 2013-12-23T23:04:58.700
If those external commands are not available on a default Vim installation, then yes, it would violate the "loading any other files" rule. – Joe Z. – 2013-12-23T23:41:23.833