0:00:00.000,0:00:03.436 Hi! Welcome back to Emacs rocks! 0:00:03.436,0:00:08.125 It's episode 2 and today I have a real treat for you. Check it out! 0:00:08.125,0:00:10.562 It's VimGolf! Yay! 0:00:11.900,0:00:15.925 VimGolf is really cool, I really wish there was one for Emacs. 0:00:17.292,0:00:21.371 It's a competition and the goal is to transform 0:00:21.387,0:00:23.662 the starting file into the ending file 0:00:23.662,0:00:26.800 in as few keystrokes as possible. 0:00:29.508,0:00:33.244 So, this is challenge number 6 and 0:00:33.244,0:00:39.152 there is a one to ten in letters and a one to ten in numbers 0:00:39.152,0:00:43.923 and the goal is to get the one to ten lined up in two columns. 0:00:45.382,0:00:49.790 So the best score into Vim is 17, is the winning score. 0:00:51.052,0:00:54.233 So let's see if Emacs might do a little bit better. 0:01:12.833,0:01:17.005 Ok, I'll run through it one time without commentary 0:01:17.021,0:01:20.259 and then I'll run through it again and tell you what I'm doing. 0:01:20.259,0:01:22.789 So pay attention to the keystrokes. 0:01:46.000,0:01:49.825 Haha! Now wasn't that awesome. 0:01:50.008,0:01:53.167 Let's see it again in slow motion. 0:02:01.621,0:02:04.246 Ok, now we are back to the start. 0:02:04.938,0:02:09.282 This is the first episode where I use macros but it won't be the last! 0:02:09.282,0:02:12.413 Macros is a powerhorse in Emacs. 0:02:12.413,0:02:15.656 So I start by defining a macro pressing F3 0:02:15.656,0:02:21.887 then jump to the bottom and I delete all. 0:02:22.385,0:02:27.429 This puts it into the kill ring and I erase the space 0:02:27.429,0:02:30.136 and then I press Control-9 0:02:30.136,0:02:32.690 Control-9 doesn't do anything on it's own, 0:02:32.690,0:02:35.675 but it makes my next command repeat 9 times. 0:02:36.775,0:02:41.931 Which is command p for previous line, 9 lines up 0:02:42.498,0:02:48.579 Control-E, tab, yank, and my macro is finished. 0:02:48.579,0:02:52.175 So I press F4 to complete my macro and now 0:02:52.175,0:02:57.631 I can run that macro nine times, Control-9 F4. 0:02:58.467,0:03:00.105 Done. 0:03:00.105,0:03:03.008 And that was 12 keystrokes. 0:03:03.008,0:03:06.748 Let me remind tou, best in Vim, 17. 0:03:07.485,0:03:09.944 So, to reiterate 0:03:11.621,0:03:14.525 Emacs rocks!