Scripts2026年5月14日·1 分钟阅读

Doom Emacs — An Emacs Framework for the Stubborn Martian Hacker

A fast and opinionated Emacs framework that provides modular configuration through a declarative package system and aggressive lazy loading for near-instant startup.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Doom Emacs Overview
通用 CLI 安装命令
npx tokrepo install d80ea0b6-4fb0-11f1-9bc6-00163e2b0d79

Introduction

Doom Emacs is an Emacs configuration framework designed for speed and modularity. It uses its own CLI tool (doom) and a declarative package management system that compiles and byte-compiles configurations for fast startup, typically under one second even with hundreds of packages loaded.

What Doom Emacs Does

  • Provides a module system where each module bundles packages, config, and keybindings
  • Uses aggressive lazy loading and byte-compilation for sub-second startup
  • Ships a dedicated CLI (doom sync, doom upgrade, doom doctor) for managing the config
  • Integrates Evil mode for Vim-style editing with SPC and comma leader keys
  • Supports literate configuration via Org-mode files

Architecture Overview

Doom Emacs is organized into modules grouped by category: lang, tools, ui, completion, and more. The init.el file declares which modules are active, packages.el adds extra packages, and config.el holds user settings. The doom CLI compiles this into an autoloads file and byte-compiled output, avoiding the overhead of runtime package resolution that slows other Emacs setups.

Self-Hosting & Configuration

  • Clone the repo and run doom install to bootstrap packages and compile
  • Edit ~/.config/doom/init.el to enable or disable modules
  • Add custom packages in ~/.config/doom/packages.el using the package! macro
  • Run doom sync after any configuration change to recompile
  • Requires Emacs 29+, Git, and ripgrep for full functionality

Key Features

  • Sub-second startup through ahead-of-time compilation and autoloads
  • doom doctor command diagnoses common configuration issues
  • Declarative package! macro with recipe support for custom sources
  • Module flags (e.g., +lsp, +tree-sitter) toggle features within a module
  • Active community with frequent updates and a Discord server

Comparison with Similar Tools

  • Spacemacs — broader layer ecosystem; Doom is faster due to compile-time optimizations
  • Vanilla Emacs — full control but slow to configure; Doom provides instant productivity
  • Prelude — minimal starter; Doom is a comprehensive framework with its own tooling
  • Centaur Emacs — single-author config; Doom has a larger module library and contributor base
  • LazyVim — Neovim-based; Doom leverages Emacs Lisp ecosystem and Org-mode

FAQ

Q: How fast is Doom Emacs startup? A: Typically under one second with a full configuration, thanks to byte-compilation and deferred loading.

Q: Can I use Doom without Vim keybindings? A: Yes. Disable the evil module in init.el to use standard Emacs keybindings.

Q: How do I update Doom Emacs? A: Run doom upgrade from the terminal to pull framework updates and sync packages.

Q: What does doom sync do? A: It installs missing packages, removes orphaned ones, rebuilds autoloads, and byte-compiles your configuration.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产