doom-literate-config
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDoom Literate Config
Doom Literate 配置
In a literate setup 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.
config.org在literate配置中,是源文件,其他所有文件都是**tangled(编织生成)**的——导出时生成并会被覆盖。所有修改都应在源文件中进行;对编织生成文件的修改会在下一次编织时丢失。
config.org1. Establish what tangles where
1. 确定各代码块的编织目标
Read , , , and .
init.elconfig.orgconfig.elpackages.el- in
:config literatemakesinit.elthe source.config.org - Ordinary blocks tangle to
emacs-lisp.config.el - Blocks marked tangle there;
:tangle packages.eldeclarations need that marker.package!
Done when you can name the source file and the tangle destination of every block you intend to touch.
阅读、、和文件。
init.elconfig.orgconfig.elpackages.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 and every declaration in , and confirm each one has a home in .
config.elpackage!packages.elconfig.orgCarry package-file comments into a block tangled to , so they survive regeneration.
config.orgpackages.elDone 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.elpackages.elpackage!config.org将包文件中的注释转移到编织到的代码块中,这样注释就能在重新生成时保留下来。
packages.elconfig.org完成标准:编织生成文件中的每一项生效设置、声明和注释都在源文件中有对应记录——要么被保留,要么被有意移除。
3. Make the smallest Doom-native change
3. 做出最小化的Doom原生修改
Reach for the Doom macro over raw Emacs Lisp:
| Task | Use |
|---|---|
| Declare an external package | |
| Configure a package | |
| Bind keys | |
| Set the default font | |
| Set new-frame geometry | |
Give each tool its own section and code block, with its prerequisites in a block above its configuration.
config.orgDone when every changed line traces to a preference the user stated.
优先使用Doom宏而非原生Emacs Lisp:
| 任务 | 使用方式 |
|---|---|
| 声明外部包 | |
| 配置包 | |
| 绑定按键 | |
| 设置默认字体 | |
| 设置新窗口几何尺寸 | |
为每个工具单独创建章节和代码块,并将其前置依赖放在配置代码块的上方。
config.org完成标准:每一行修改都对应用户明确提出的偏好设置。