The Nuclear Option: Starting Fresh
When your config is so fucked that even --debug-init
doesn't help, sometimes you need to start over. But you don't have to lose everything you've built.
First, back up your current disaster: cp ~/.emacs.d ~/.emacs.d.broken
. Now you can always go back if things get worse (they probably will).
Start with Doom Emacs or Spacemacs as a base. I know, I know - "real Emacs users build from scratch." But these frameworks solve 90% of the configuration problems that make people give up on Emacs. You can always customize later once you're not debugging basic functionality.
Package Hell and How to Escape It
The worst part about Emacs isn't learning the keybindings. It's when packages start fighting each other and you have no idea why your editor suddenly can't do basic shit like syntax highlighting or completion.
Rule #1: Use use-package
for everything. It manages loading order, keybindings, and dependencies automatically. Without it, you're manually managing load order like it's 1985.
Rule #2: Pin your package versions. Add this to avoid surprise breakage:
(setq package-archives '((\"melpa-stable\" . \"https://stable.melpa.org/packages/\")
(\"gnu\" . \"https://elpa.gnu.org/packages/\")))
Rule #3: When a package breaks, check its GitHub issues before spending hours debugging. Someone else probably hit the same problem and posted a workaround. The use-package troubleshooting guide covers common configuration errors.
Performance Tuning That Actually Works
Native compilation in Emacs 28+ is huge, but there are still things that'll make your editor feel sluggish:
- Line numbers on huge files:
(setq display-line-numbers-type nil)
when editing massive logs - Auto-save every keystroke:
(setq auto-save-timeout 300)
saves every 5 minutes instead of constantly - Company mode being too eager:
(setq company-idle-delay 0.5)
waits half a second before showing completions
The big one that nobody talks about: Git status in your modeline. Packages like magit and doom-modeline check git status constantly. In huge repos, this destroys performance. Turn it off: (setq doom-modeline-vcs-max-length 12)
. For more performance fixes that actually work, check the LSP Mode performance guide and Emacs startup optimization strategies.
When LSP Servers Go Wrong
Eglot is built-in now, but LSP servers are still temperamental pieces of shit that crash for no reason. When your code completion stops working:
M-x eglot-reconnect
fixes 60% of issues- Check
*EGLOT*
buffer for error messages - Kill the LSP server process:
pkill -f \"language-server-name\"
- Update the LSP server - old versions break with new Emacs releases
Pro tip: Keep a `.dir-locals.el` in your project root with LSP settings. This way project-specific config doesn't pollute your global setup. For when you really need to dig into the guts of things, check out Edebug documentation and the Emacs Package Developer's Handbook.