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
<Space> ?Opens all keybindings
<Space> <Space>Opens emacs command menu
,Opens the major chord menu
<Space> f sSave file
<Space> f tOpen file tree
<Space> f e dOpen emacs dotfile
<Space> f e RReload emacs config
<Space> p fFind file in project (fuzzy)
<Space> j =Auto-format code
<Space> j jJump anywhere
<Space> w 2Split into a 2 window layout
<Space> w <Tab>Navigate to next window
<Space> b bList all buffers
<Space> b xClose current buffer and window
<Space> T sSwitch themes
<Space> s sSearch file
<Space> q qKill emacs
<Ctrl>+c <Ctrl>+p aAdd project to workspace
<Ctrl>+c <Ctrl>+p dDrop project from workspace
<Space> /Search project (live grep)
<Space> 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.