Emacs logo

Emacs is an extensible, programmable text editor. It helps you write and edit text efficiently, customize your workflow, automate tasks with Emacs Lisp, and manage everything from code to notes, email, and projects inside one environment.

Why use Emacs instead of other text editors?

  1. Extensibility

  2. Almost every part of Emacs can be customized or extended with Emacs Lisp. You can turn it into a code editor, note-taking system, email client, or even a window manager.

  3. Stability

  4. Emacs has been around since the 1970s, is actively maintained, and runs on almost any system. Many users stay with it for decades.

  5. Keyboard-driven workflow

  6. Once learned, the keybindings allow very fast, efficient editing without leaving the keyboard.

  7. Org-mode

  8. A unique and powerful system for notes, tasks, and literate programming unmatched in most other editors.

Installation

Emacs supports many systems, even if its not listed here there's probably a way to install it

Debian/Ubuntu:
sudo apt install emacs
macOS:
brew install emacs
Windows:

You can follow this link.

Basic workflow

Remember that "C" means control key and "M" means alt key.

Open a file
C-x C-f
Save changes
C-x C-s
Close a buffer
C-x k
Split windows

Vertical split:

C-x 2

Horizontal split:

C-x 3

Switch windows:

C-x o
Search & replace

Incremental search:

C-s

Replace:

M-%

Undo:

C-/

Redo:

C-g C-/

Miscellaneous

Play games

Vim doesn't have this feature!

M-x tetris # play tetris
M-x snake # play snake
M-x doctor # talk to a psychotherapist
M-x hanoi # play tower of hanoi
Browse the web

Personally I use this every now and then.

M-x eww

You can enter a link or you can use the default DuckDuckGo browser to search like you would normally.

Simple calculator

This comes in handy especially while studying.

M-x calc
Calendar

Might be useful to some people.

M-x calendar

Simple configuration

Your configuration file will take place at ~/.emacs.d/init.el, if you're on Windows it should be at C:/Users/yourname/AppData/Roaming/.emacs.d/init.el Another way you can find your config file is by executing this line:

M-: (find-file user-init-file)

To show line numbers you can add this line to your configuration file:

(global-display-line-numbers-mode 1)

You can add this line to highlight matching parentheses:

(show-paren-mode 1)

You can add this line to shorten yes/no prompts to y/n:

(fset 'yes-or-no-p 'y-or-n-p)

If you want to set a keybinding to execute something you can do this:

(global-set-key (kbd "C-.") 'eww)

That is a line from my personal configuration, it binds the C-; command to execute the eww browser.

To make the changes go into effect you can execute the

C-x C-c
command to close Emacs and then restart it.

Org-mode basics

Open a file ending with .org.

Start with "*" for headings.
* My Project
** TODO Write tutorial
** DONE Install Emacs
Todo items

Type TODO before a task.

Toggle between TODO/DONE with:

C-c C-t
Lists

Use - or 1. for lists:

- item one
- item two
Checklists
* Shopping
  - [ ] Apples
  - [X] Bread
Dates & scheduling

Insert a timestamp with:

C-c .
Export

Export to PDF, HTML, etc.:

C-c C-e

If there are any issues/mistakes you can mail me at vdozer [at] tuta [dot] com.

Monero donations: 45sETv3BbWqi8BeaCjUtycE1UG4shMFefLKdtkziTBwY8NJUHA4zZjadK8Y7912UsZ92tP1C3FeDD8hTdtNKQxTdMjHuUL1 | Here is the QR.