Emacs Configuration for Beginners: A Starter Guide to Your First init.el
You opened Emacs, saw a grey splash screen and a manual about a tutorial, and closed it again. This guide is for the second attempt: how to configure Emacs from an empty init.el into an Emacs starter config you understand line by line, with a theme, fast completion and a language server for the code you actually write.
What a starter Emacs configuration needs
Most beginners overestimate how much code this takes. A useful Emacs configuration is smaller than most people expect. Strip away the screenshots of elaborate dashboards and almost every working setup rests on the same five parts. Get these right and the rest of your Emacs configuration is a matter of taste.
1. Package archives
Emacs installs extensions from archives. GNU ELPA and NonGNU ELPA are enabled out of the box; MELPA is the large community archive and needs one line to switch on. Add it once, at the top of the file, and forget about it.
2. use-package
Since Emacs 29.1, use-package ships with the editor. It gives every package one tidy block: install it, set its options, bind its keys, load it only when needed. A starter config written with it stays readable even when it grows to a few hundred lines.
3. A completion framework
The default minibuffer completion works, but it hides your options until you press TAB. A vertical completion UI such as Vertico shows candidates as you type, which changes how quickly you find files, buffers and commands. The completion comparison covers Vertico, Ivy and Helm in detail.
4. A theme
Emacs 28 and later ship the Modus themes, which are accessible and well documented. Solarized, Zenburn and Doom One are one install away. More on that in the themes guide.
5. Language support
The built-in eglot client talks to language servers (pyright, gopls, rust-analyzer, clangd and many more), so one hook gives you completion, go-to-definition and diagnostics for most languages. Pick your language below for the details.
Everything else, from Git integration with Magit to note-taking with Org, can wait until this core works.
A minimal Emacs init.el for beginners
Here is a complete Emacs starter config. Save it as ~/.emacs.d/init.el (or ~/.config/emacs/init.el), start Emacs, and give it a minute on the first run while it downloads packages.
;;; init.el --- a small starter configuration -*- lexical-binding: t -*-
;; Package archives: GNU ELPA and NonGNU ELPA are on by default.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq use-package-always-ensure t)
;; Quieter defaults
(setq inhibit-startup-screen t
make-backup-files nil
custom-file (locate-user-emacs-file "custom.el"))
(load custom-file 'noerror)
(recentf-mode 1)
(savehist-mode 1)
;; Completion in the minibuffer
(use-package vertico :init (vertico-mode 1))
(use-package orderless
:custom (completion-styles '(orderless basic)))
(use-package marginalia :init (marginalia-mode 1))
;; A theme that ships with Emacs 28 and later
(load-theme 'modus-vivendi t)
;; Language servers through the built-in client
(use-package eglot
:ensure nil
:hook ((python-mode python-ts-mode go-mode rust-mode) . eglot-ensure)) Read it top to bottom once, because knowing what each line in your Emacs init.el does is the point of the exercise. The first block tells Emacs where packages come from and makes use-package install anything missing. The second block turns off the startup screen and backup files, and moves the settings that the Customize interface writes into a separate custom.el, so your Emacs init.el stays yours. recentf-mode and savehist-mode remember recent files and minibuffer history between sessions: two lines, and the editor feels less forgetful immediately.
The completion block installs three small packages that work together. Vertico draws the vertical list, Orderless lets you type words in any order (init el finds init.el, so does el ini), and Marginalia adds a short description next to each candidate.
The last form is where beginners usually get stuck, so it is worth a sentence. eglot is built in, which is why it carries :ensure nil; the hook starts it whenever a Python, Go or Rust file opens. It still needs the language server itself on your machine, which is a job for your package manager or the language's own tooling, not for Emacs.
If something fails on startup, run emacs --debug-init from a terminal. The backtrace names the line.
Pick your languages
Each setup page starts from the starter config above and adds only what that language needs: the major mode, the language server, formatting and a way to run code or tests from inside Emacs.
- Pythonpython-ts-mode, Eglot, a language server, virtualenvs, Ruff formatting, tests and the REPL in one short config.
- Rubyruby-ts-mode, ruby-lsp or Solargraph via eglot, inf-ruby for a live console, RuboCop on save and RSpec or Minitest from the buffer.
- Gogopls through eglot, go-ts-mode or go-mode, imports and formatting fixed on save, and go test run as a compilation buffer.
- PHPphp-mode plus Intelephense or Phpactor via eglot, web-mode for Blade and Twig, and phpcs or php-cs-fixer for house style.
- JavaScriptTree-sitter modes for JS, TS and TSX, typescript-language-server via eglot, Prettier through apheleia, ESLint in Flymake, a Node REPL.
- Web (HTML/CSS)mhtml-mode or web-mode for markup, css-ts-mode for styles, Emmet for speed, the VS Code HTML and CSS servers and a preview that reloads.
- HaskellGHCup first, then haskell-mode, HLS through Eglot, an interactive GHCi buffer and one formatter decided per project.
- ElixirPick a major mode, pick one Elixir language server, then add mix format, an IEx buffer and ExUnit commands.
- Rustrust-analyzer from rustup, Eglot pointed at it, Clippy as the checker and Cargo through compile or rust-mode's own commands.
- Racketracket-mode for the REPL and DrRacket-style annotations, an optional language server, and structural editing so parentheses stay balanced.
- CGive clangd a compilation database, then build with M-x compile, debug with the built-in GDB interface and format with clang-format.
Four dark themes worth trying first
A theme is the cheapest change with the largest effect on how Emacs feels. These four are mature, cover most major modes and look the way their names suggest. All of them load with a single load-theme call.
(defun greet (name) (message "Hello, %s" name))
Low-contrast blue-green, easy on long sessions.
(defun greet (name) (message "Hello, %s" name))
Warm grey with muted pastels, an old favourite.
(defun greet (name) (message "Hello, %s" name))
Purple and blue accents, works well beyond Spacemacs.
(defun greet (name) (message "Hello, %s" name))
Atom-style palette from the doom-themes pack.
Light themes are covered too: Modus Operandi is one of the most legible themes in any editor. The full themes guide explains how to switch cleanly between two themes without leftover colours.
Completion: Vertico, Ivy or Helm
Older guides recommend Helm or Ivy. Both still work. For a starter config in 2026 the short answer is Vertico, because it builds on Emacs's own completion functions instead of replacing them, so every command that asks you for input benefits without extra glue.
| Question | Vertico | Ivy | Helm |
|---|---|---|---|
| Uses built-in completing-read | Yes | Through its own API | Through its own API |
| Packages you usually add | Orderless, Marginalia, Consult | Counsel, Swiper | None, it is one large package |
| Configuration effort | Low | Low | Medium |
| Search inside the buffer | consult-line | swiper | helm-occur |
Switching later is not a big deal either: with Vertico the commands you call are still the standard ones, so removing it leaves a working editor behind. The completion framework comparison goes through each option with a working snippet.
The twelve keys a beginner uses every day
Emacs writes C- for Control and M- for Meta, which is Alt on most keyboards. A sequence like C-x C-f means: hold Control, press x, then (still holding Control, or not) press f.
| Keys | Does | Keys | Does |
|---|---|---|---|
| C-x C-f | Open a file | C-g | Cancel whatever is happening |
| C-x C-s | Save the buffer | M-x | Run a command by name |
| C-x b | Switch buffer | C-x k | Kill (close) a buffer |
| C-x 2 | Split the window below | C-x o | Jump to the other window |
| C-s | Search forward | C-/ | Undo |
| C-h k | Describe what a key does | C-x C-c | Quit Emacs |
C-g deserves its own line. Whenever Emacs seems stuck waiting for input you did not mean to give, press it, twice if needed. The essential keybindings cheat sheet lists the next forty.
How to configure Emacs: a five-evening guide
Trying to build the perfect setup in one sitting is the usual way people give up. If you are wondering how to configure Emacs without burning out on it, spread the work over a week. The plan below is written for beginners and assumes nothing beyond a working installation.
- Evening one: install Emacs from your platform's usual source, run the built-in tutorial with C-h t, and stop when you can open, edit and save a file without the mouse.
- Evening two: paste the starter config above, restart, and use it for real work for a day.
- Evening three: set up your main language from the list. Install its language server first, then open a project and check that diagnostics appear.
- Evening four: pick a theme and a font, then read the packages guide on how
use-packageloads things lazily. - Evening five: open your init.el and delete every line you cannot explain. Keep notes as comments.
That last step matters more than it sounds. A configuration you understand is one you can fix at 11 p.m. before a deadline, and that is the whole argument for writing your own Emacs configuration instead of borrowing somebody else's 3,000 lines.
One side note that does not fit anywhere else: put the file under version control from the first evening. git init inside ~/.emacs.d, a .gitignore for elpa/ and custom.el, and you can try any experiment knowing the way back is one git checkout away.
Questions readers ask
Where does Emacs look for my init.el?
Emacs reads ~/.emacs, then ~/.emacs.d/init.el, then ~/.config/emacs/init.el (the XDG location, used when the other two do not exist). Run C-h v user-init-file inside Emacs to see which file it actually loaded.
Should a beginner start with Doom Emacs or Spacemacs instead?
Both are good if you want a finished editor today and accept their conventions. If you want to understand every line that runs at startup, a starter config of 40 to 80 lines teaches you more and is easier to debug when an update breaks something.
Do I need MELPA at all?
For a very small setup, GNU ELPA and NonGNU ELPA already cover Vertico, Orderless, Marginalia and many themes. MELPA adds the long tail: most language modes outside the core and a large share of the community packages you will meet in other configs.
How long should Emacs take to start with a starter configuration?
A config of this size usually starts in well under a second on a current machine. Run M-x emacs-init-time after startup; if it climbs past two seconds, look for packages loaded eagerly that could wait with :defer or a hook.
Is Emacs Lisp hard to learn for configuration work?
For configuration you need very little of it: setq, a few function calls and the shape of a use-package form. The built-in manual "An Introduction to Programming in Emacs Lisp" (C-h i, then pick it from the list) covers the rest at your own pace.