views:

172

answers:

3

Are there any mnemonics or patterns that make memorizing emacs key combos easier?

+6  A: 

Well, the main important ones are: `

  • C-k to "Kill" a line and C-y to "Yank" it back from the kill buffer (aka: clipboard).
  • C-s to "Search "
  • C-h for "Help"
  • C-t "Transpose" two characters.
  • C-p "Previous" line
  • C-n "Next" line
  • C-f "Forward" char
  • C-b "Backward" char
  • C-e "End" of line
  • C-a .... a is the beginning of the alphabet, so "A beginning" of line

Other than that I mostly use the arrow keys, the mouse, the menus, or a select group of actual commands. The few exceptions to this (eg: macro creation and use) I learned pretty much by muscle-memory.

T.E.D.
Another very useful one: a "block" in many languages is denoted by {}, M-} and M-{ move forward and backward by blocks.
Justin Smith
Thanks to Trey for adding the "<kbd>" tags, thus indirectly showing the trick to me.
T.E.D.
+2  A: 

Don't memorize it, just USE it.

Yin Zhu
Yes. Do, or do not. There is no try.
Brian Postow
@BrianPostow Thanks Yoda!
Trey Jackson
Not very helpful, he is.
T.E.D.
+4  A: 

Regarding patterns, yes, there are very obvious patterns that occur all over.

C-f forward-char
M-f forward-word
C-M-f forward-sentence/expression

C-b backward-char
M-b backward-word
C-M-b backward-sentence/expression

The pattern being C- applies to the smallest unit (char), M- applies to the next larger unit (word), and C-M- applies to the largest. For programs the units are chars, words, sexps.

Trey Jackson