1 00:00:00,729 --> 00:00:04,500 Welcome to emacs rocks, episode four. 2 00:00:04,500 --> 00:00:07,600 Today I'll go all controversial on you - 3 00:00:07,600 --> 00:00:11,033 and rebind some emacs keys. 4 00:00:11,033 --> 00:00:13,259 That's what emacs is all about isn't it? 5 00:00:13,259 --> 00:00:15,867 Sharpening that knife. 6 00:00:15,867 --> 00:00:19,659 But first, a cool set of keystrokes. 7 00:00:20,341 --> 00:00:24,567 I'm switching to buster.js for my javascript tests these days 8 00:00:24,567 --> 00:00:28,133 and the syntax is slightly different 9 00:00:28,133 --> 00:00:33,533 watch how quickly I can go from one to the other 10 00:00:33,933 --> 00:00:36,459 done! hah 11 00:00:37,967 --> 00:00:41,267 did you see the first keystroke? 12 00:00:41,267 --> 00:00:43,932 ctrl-s is excellent for navigating 13 00:00:43,932 --> 00:00:46,533 but for short distances, it's suboptimal 14 00:00:46,533 --> 00:00:49,033 watch this 15 00:00:49,033 --> 00:00:56,703 I have to press enter to exit from the search, to start typing 16 00:00:56,703 --> 00:01:00,633 so let vim show the way with its excellent F-command 17 00:01:00,633 --> 00:01:03,800 move to char 18 00:01:03,800 --> 00:01:09,033 there's an extension called iy-go-to-char that does much the same 19 00:01:09,033 --> 00:01:13,167 I mapped it to meta-m, as in move 20 00:01:13,167 --> 00:01:16,900 yes, that keystroke is usually back to indentation 21 00:01:16,900 --> 00:01:21,100 but I find a much better mnemonic for that is meta-i 22 00:01:21,100 --> 00:01:26,110 so ... meta-m t, and I can press period right away 23 00:01:26,110 --> 00:01:29,400 meta-l for lower case, 24 00:01:29,400 --> 00:01:32,033 which conveniently moves my cursor to the end of the word 25 00:01:32,033 --> 00:01:34,900 forward, and transpose-word 26 00:01:34,900 --> 00:01:39,933 we had transpose-line and transpose-char in a previous episode 27 00:01:39,933 --> 00:01:44,400 so this is transpose-word ... nice, huh? 28 00:01:44,400 --> 00:01:48,767 so, iy-go-to-char - you can just google it 29 00:01:48,767 --> 00:01:50,759 it's really nice 30 00:01:50,759 --> 00:01:55,033 you don't have to bind it to the same key as me if you find that controversial 31 00:01:55,033 --> 00:02:01,208 I see that the suggested keystroke is ctrl-c f 32 00:02:01,208 --> 00:02:04,273 since it's supposed to be a short command for quick navigation, 33 00:02:04,273 --> 00:02:06,900 I want to have it on one keystroke 34 00:02:06,900 --> 00:02:10,519 let's take a look at another example 35 00:02:10,519 --> 00:02:14,000 here's a misspelled word - and another 36 00:02:14,000 --> 00:02:17,267 to quickly fix those I press: 37 00:02:17,267 --> 00:02:20,133 meta-m p e 38 00:02:20,133 --> 00:02:22,900 meta-m o, and o again, t 39 00:02:23,577 --> 00:02:26,295 very nice 40 00:02:26,787 --> 00:02:28,054 that was episode four 41 00:02:28,054 --> 00:02:29,646 hope you enjoyed it 42 00:02:29,646 --> 00:02:31,369 see you next time