You are on page 1of 1

Basic Emacs Keyboard Commands

(Note: C means “Ctrl” and M means “Meta” (or “Alt” on Windows, “Esc” on Macintosh))

1. Open a file from the command line: emacs <filename> (e.g., emacs foo.cpp).
*** NOTE: this will create the file if it doesn’t already exist.

2. Save: C-x, C-s

3. Quit: C-x, C-c

4. Cancel current command: C-g

5. Cursor Movement
a) single char, forward and backward: C-f and C-b
b) single word, forward and backward: M-f and M-b
c) beginning and end of line: C-a and C-e
d) single line, next (down) and previous (up): C-n and C-p
e) single screen, down and up: C-v and M-v

6. Delete
a) single char: C-d
b) single word: M-d
c) from cursor to end of line: C-k

7. Copy and Paste


a) set mark: C-spacebar (then move cursor to select region)
b) cut selected region: C-w
c) copy selected region: M-w
d) paste copied or cut region: C-y

8. Undo and Redo


a) undo: C-/
b) redo: use “cancel” then “undo” (e.g., C-g, C-/)

You might also like