Return to Video

Emacs Rocks! Episode 04: A rebind controversy

  • 0:01 - 0:04
    Welcome to emacs rocks, episode four.
  • 0:04 - 0:08
    Today I'll go all controversial on you -
  • 0:08 - 0:11
    and rebind some emacs keys.
  • 0:11 - 0:13
    That's what emacs is all about isn't it?
  • 0:13 - 0:16
    Sharpening that knife.
  • 0:16 - 0:20
    But first, a cool set of keystrokes.
  • 0:20 - 0:25
    I'm switching to buster.js for my javascript tests these days
  • 0:25 - 0:28
    and the syntax is slightly different
  • 0:28 - 0:34
    watch how quickly I can go from one to the other
  • 0:34 - 0:36
    done! hah
  • 0:38 - 0:41
    did you see the first keystroke?
  • 0:41 - 0:44
    ctrl-s is excellent for navigating
  • 0:44 - 0:47
    but for short distances, it's suboptimal
  • 0:47 - 0:49
    watch this
  • 0:49 - 0:57
    I have to press enter to exit from the search, to start typing
  • 0:57 - 1:01
    so let vim show the way with its excellent F-command
  • 1:01 - 1:04
    move to char
  • 1:04 - 1:09
    there's an extension called iy-go-to-char that does much the same
  • 1:09 - 1:13
    I mapped it to meta-m, as in move
  • 1:13 - 1:17
    yes, that keystroke is usually back to indentation
  • 1:17 - 1:21
    but I find a much better mnemonic for that is meta-i
  • 1:21 - 1:26
    so ... meta-m t, and I can press period right away
  • 1:26 - 1:29
    meta-l for lower case,
  • 1:29 - 1:32
    which conveniently moves my cursor to the end of the word
  • 1:32 - 1:35
    forward, and transpose-word
  • 1:35 - 1:40
    we had transpose-line and transpose-char in a previous episode
  • 1:40 - 1:44
    so this is transpose-word ... nice, huh?
  • 1:44 - 1:49
    so, iy-go-to-char - you can just google it
  • 1:49 - 1:51
    it's really nice
  • 1:51 - 1:55
    you don't have to bind it to the same key as me if you find that controversial
  • 1:55 - 2:01
    I see that the suggested keystroke is ctrl-c f
  • 2:01 - 2:04
    since it's supposed to be a short command for quick navigation,
  • 2:04 - 2:07
    I want to have it on one keystroke
  • 2:07 - 2:11
    let's take a look at another example
  • 2:11 - 2:14
    here's a misspelled word - and another
  • 2:14 - 2:17
    to quickly fix those I press:
  • 2:17 - 2:20
    meta-m p e
  • 2:20 - 2:23
    meta-m o, and o again, t
  • 2:24 - 2:26
    very nice
  • 2:27 - 2:28
    that was episode four
  • 2:28 - 2:30
    hope you enjoyed it
  • 2:30 - 2:31
    see you next time
Title:
Emacs Rocks! Episode 04: A rebind controversy
Description:

http://emacsrocks.com - Rocking emacs tricks and tips screencast.

Follow me on twitter: @emacsrocks

more » « less
Video Language:
English
Duration:
02:32
magnarsveen added a translation

English subtitles

Revisions