Description

Emacs is a text editor that is hailed for its ability to be customized and many people use it for their agenda, RSS feeds, code editing, and more. By extending the base packages, vim keybindings could be enabled, LSPs can be configured, etc.

Quickstart

I started with Spacemacs which has 200+ packages already configured. This instantly adds lots of keybinds and functionality to emacs, and you’ll have to decide if it’s worth using.

Building a configuration from scratch (instead of using a distro like Spacemacs) is often recommended for beginners to better understand what’s happening under the hood.

Terms

  • Projects - Just a folder.
  • Layers - A set of configurations that can be enabled/disabled to bring packages together.
  • Modes - There are major and minor modes. Simply changes how text input affects the buffer.
  • Packages - Extending the base functionality of emacs.

Spacemacs Keybind Reference

Note

As you press keys, watch the menu that appears at the bottom of the screen to find more useful keybinds.

KeybindDescription
SPC ?Opens all keybindings
SPC SPCOpens emacs command menu
,Opens the major chord menu
SPC f sSave file
SPC f tOpen file tree
SPC f e dOpen emacs dotfile
SPC f e RReload emacs config
SPC p fFind file in project (fuzzy)
SPC j =Auto-format code
SPC j jJump anywhere
SPC w 2Split into a 2 window layout
SPC w TABNavigate to next window
SPC b bList all buffers
SPC b xClose current buffer and window
SPC T sSwitch themes
SPC s sSearch file
SPC q qKill emacs
CTRL+c CTRL+p aAdd project to workspace
CTRL+c CTRL+p dDrop project from workspace
SPC /Search project (live grep)
SPC g sOpen Magit (git) panel
CTRL+nSelect next occurance
CTRL+h iOpens the emacs instruction manual

As you combine these with vim/emacs keybinds, everything just becomes more efficient.

Performance

Spacemacs and the OCaml layer added ~3s to my emacs startup time. Coming from neovim, this was unacceptable and that’s when I learned to run emacs as a daemon.

systemctl --user enable --now emacs

This command added emacs to my startup services. The idea is that we’ll leave emacs running all the time and connect with a client which is installed as “Emacs (Client)” on my machine.

Instead of cold starting emacs, it will now have a daemon to instantly attach to.

Org Mode

There’s a rabbit hole called org-mode which I encourage you to at least consider.

It’s useful for keeping an agenda and creating todos. GDQuest has a solid intro video here. A good follow-up is this video about tagging with org-mode.