Shangrui3 downloadsReplace selected or preceding terminology with configurable literal text.
一个用于统一 Obsidian 笔记术语的插件。通过命令或自定义快捷键,将选中的术语或光标前的术语替换为你配置的文本,适合中英文术语转换和常用 Markdown 片段输入。
Terminology Replacer replaces selected text or a matching term immediately before the cursor with a configurable replacement in Obsidian. Use it to keep terminology consistent, convert terms between languages, or insert Markdown snippets. Replacements run only when you execute the command or a custom hotkey.
当前代码版本:**0.2.1。插件声明的最低 Obsidian 版本为 1.5.0。
术语 => 替换内容 格式的配置。Requires Obsidian 1.5.0 or later, as declared in the plugin manifest.
main.js, manifest.json, and styles.css from its Assets section.<vault>/.obsidian/plugins/terminology-replacer/ and copy the three files into that folder. Replace <vault> with your Obsidian vault directory.Use the three release assets for installation. The automatically generated source archives require a build before installation. When updating, replace the same three files and keep data.json to retain your dictionary.
打开本仓库的 Releases 页面,选择需要的版本。
在该版本的 Assets 中下载以下三个文件:
main.jsmanifest.jsonstyles.css在你的 Obsidian 仓库中创建以下目录,并将三个文件放入其中:
<vault>/.obsidian/plugins/terminology-replacer/
├── main.js
├── manifest.json
└── styles.css
重新加载 Obsidian,在“设置 → 第三方插件”中启用 Terminology Replacer。如果尚未启用第三方插件,需要先关闭受限模式。
其中 <vault> 是你的笔记仓库目录。请下载 Release 附件中的三个文件;GitHub 自动提供的 Source code 压缩包是源码,需要自行构建后才能安装。
内核 with the Markdown text `kernel`.A selection must match a dictionary term exactly. Without a selection, the longest matching suffix on the current line before the cursor is replaced. Matching is case-sensitive and does not check word boundaries or Markdown contexts. Leading and trailing whitespace in both fields is trimmed. Empty rows are ignored, incomplete rows are reported, and the last valid rule wins when a term is duplicated.
打开“设置 → Terminology Replacer”:
插件内置以下规则,可以按需修改或删除。表格右侧的反引号也是替换内容的一部分:
| 原术语 | 替换内容 |
|---|---|
| 内核 | `kernel` |
| 进程 | `process` |
| 线程 | `thread` |
| 文件描述符 | `file descriptor` |
| 系统调用 | `system call` |
在 Markdown 编辑器中,使用下面任意一种方式:
打开命令面板,搜索并执行 Terminology Replacer: 替换当前术语。也可以在“设置 → 快捷键”中搜索这个命令并绑定快捷键,例如 Windows 下的 Ctrl+;。插件不预设快捷键。
使用默认规则替换后,Markdown 源码示例为:
替换前:Linux 的内核
替换后:Linux 的`kernel`
main.js、manifest.json 和 styles.css。词典配置保存在插件目录中的 data.json。更新前可以备份该文件,更新时保留它,以继续使用已有词典。
旧版文本词典会在加载时自动转换为逐行规则,保留重复项和未填完整的规则供继续编辑,并在首次编辑后保存为新格式。
安装依赖、运行测试并生成生产构建:
npm ci
npm test
npm run build
构建会在项目根目录生成 main.js。将它与 manifest.json、styles.css 一起复制到测试仓库的插件目录,重新加载插件后验证。
开发时可以启用监听构建:
npm run dev
监听构建会更新项目中的 main.js,仍需将构建文件同步到 Obsidian 插件目录并重新加载插件。若 Windows PowerShell 提示无法运行 npm.ps1,可将上述命令中的 npm 换为 npm.cmd。
本地开发和测试无需每次修改版本号。发布新的插件版本时:
manifest.json、package.json 和 package-lock.json 中的项目版本号,包括锁文件顶层及 packages[""] 中的 version。manifest.json 的版本号完全一致,例如 0.2.0,不加 v 前缀。main.js、manifest.json 和 styles.css,填写发布说明后发布。main.js 是被 Git 忽略的构建产物,需要作为 Release 附件单独上传。
Licensed under the MIT License. Copyright (c) 2026 wool0312.
本项目采用 MIT 许可证,允许使用、修改和再分发(包括商业用途),但需要保留版权及许可证声明。