doom-literate-config

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Doom Literate Config

Doom Literate 配置

In a literate setup
config.org
is the source and everything else is tangled — generated on export and overwritten. Every edit belongs in the source; an edit to a tangled file is lost at the next tangle.
在literate配置中,
config.org
是源文件,其他所有文件都是**tangled(编织生成)**的——导出时生成并会被覆盖。所有修改都应在源文件中进行;对编织生成文件的修改会在下一次编织时丢失。

1. Establish what tangles where

1. 确定各代码块的编织目标

Read
init.el
,
config.org
,
config.el
, and
packages.el
.
  • :config literate
    in
    init.el
    makes
    config.org
    the source.
  • Ordinary
    emacs-lisp
    blocks tangle to
    config.el
    .
  • Blocks marked
    :tangle packages.el
    tangle there;
    package!
    declarations need that marker.
Done when you can name the source file and the tangle destination of every block you intend to touch.
阅读
init.el
config.org
config.el
packages.el
文件。
  • init.el
    中的
    :config literate
    配置会将
    config.org
    设为源文件。
  • 普通的
    emacs-lisp
    代码块会被编织到
    config.el
    中。
  • 标记为
    :tangle packages.el
    的代码块会被编织到对应文件;
    package!
    声明需要添加该标记。
完成标准:你能说出每一个要修改的代码块对应的源文件和编织目标文件。

2. Account for the current configuration

2. 梳理当前配置

Before the first edit, inventory every active setting in
config.el
and every
package!
declaration in
packages.el
, and confirm each one has a home in
config.org
.
Carry package-file comments into a
config.org
block tangled to
packages.el
, so they survive regeneration.
Done when every active setting, declaration, and comment in the tangled files is accounted for in the source — each one either preserved there or deliberately dropped.
首次修改前,清点
config.el
中的所有生效设置以及
packages.el
中的每一条
package!
声明,并确认它们都在
config.org
中有对应的位置。
将包文件中的注释转移到编织到
packages.el
config.org
代码块中,这样注释就能在重新生成时保留下来。
完成标准:编织生成文件中的每一项生效设置、声明和注释都在源文件中有对应记录——要么被保留,要么被有意移除。

3. Make the smallest Doom-native change

3. 做出最小化的Doom原生修改

Reach for the Doom macro over raw Emacs Lisp:
TaskUse
Declare an external package
package!
(in the
packages.el
block)
Configure a package
use-package!
Bind keys
map!
Set the default font
doom-font
Set new-frame geometry
default-frame-alist
Give each tool its own
config.org
section and code block, with its prerequisites in a block above its configuration.
Done when every changed line traces to a preference the user stated.
优先使用Doom宏而非原生Emacs Lisp:
任务使用方式
声明外部包
package!
(在
packages.el
对应的代码块中)
配置包
use-package!
绑定按键
map!
设置默认字体
doom-font
设置新窗口几何尺寸
default-frame-alist
为每个工具单独创建
config.org
章节和代码块,并将其前置依赖放在配置代码块的上方。
完成标准:每一行修改都对应用户明确提出的偏好设置。