Emacs
Part 1
24 January 2025
Outline
What is Emacs?
Pros/Cons
Install
Getting Started
.emacs
Miscellaneous Items
01
02
03
04
05
06
2
What is Emacs
Joke:
Emacs is a great operating system, lacking only a decent text editor.
What emacs REALLY is:
Emacs is an interactive environment for developing text editing programs.
Pros/Cons
Pros:
Cons:
Install
Windows:
Mac:
Linux:
Getting Started
Pick a few keyboard commands per week and practice using them. It takes time for the muscle memory to train:
Getting Started
Getting Started
Command | Description |
C-z | GUI: Minimize window Console: Put emacs in background |
C-x C-c | Quit emacs |
C-x C-f | Open file |
C-x C-s | Save file |
C-x C-w | Save file as |
C-g | Cancel current thing |
C-x u C-/ | Undo last action (can undo multiple times) |
Getting Started: Movement
Command | Description |
C-f, C-b | Move forward or backward one letter |
M-f, M-b | Move forward or backward one word |
C-n, C-p | Move to next or previous line |
C-a, C-e | Move to start or end of line |
C-v, M-v | Move down or up one screenful |
C-s, C-r | Search forward or backward |
C-l | Center the text vertically on “point” |
Getting Started: Copy/Paste
Command | Description |
Backspace, C-d | Delete previous or next char |
M-Backspace, M-d | Kill previous or next word |
C-k | Kill line from cursor to end-of-lline |
C-w, M-w | Delete or kill “region” (text between mark/point) |
C-y | Yank (paste last thing in the kill ring) |
M-y | Replace last yank with preceding item in kill ring |
C-Space | Set “mark” at “point” |
C-x C-x | Swap “mark” and “point” |
.emacs
Your dot emacs file (.emacs) is found in your home directory (~).
It is an elisp code file that is executed when emacs starts up.
Set variables, write code, load other code files here to configure your emacs.
Miscellaneous Items
Q&A
13