Common Emacs Keystrokes

Keystrokes are shortcuts for commands, in particular when using keystrokes we do not need to use the mouse. Many experienced programmers prefer using keystrokes because they can be faster once you know them.

Emacs uses unconventional notation for naming keystrokes. For example the keystroke C-x C-f means: hold down the ctrl key and press x, then lift the x key and press f. The ctrl key should be down when you press f. It does not matter whether you do or do not lift it in between.

The keystroke M-w means: hold down Alt and press w.

The GNU Emacs Quick Reference card gives many more keystrokes than those listed here. Most of them we won’t address explicitly in this course.

keystroke     meaning
C-x C-s save file
C-x C-c exit emacs
C-x k close file
C-x C-f open a file from within emacs
C-g abort partially typed or executing command
C-x u undo
C-a move curser to the front of the line
C-e move curser to the end of the line
C-k “kill” (delete) the rest of the line