by fronglemog
Edit the YAML source of a Base without leaving Obsidian.
Base Source Editor
An Obsidian plugin that adds a feature-rich text editor for editing the YAML source code of Bases.
Features
- Text editor for
.basefiles- Open a Base (
.basefile extension) in the Base Source Editor, and edit the raw YAML source code without leaving the Obsidian app. - Supports editor commands including:
- Undo/redo
- Indent/unindent
- Move line up/down
- Delete current line
- Open a Base (
- Autocompletion
- Suggests keys, values and formulas as you type.
- Suggests property names from your vault, file properties, and the Base's own formulas.
- Formula suggestions and function hints work the same as Obsidian's native formula editor.
- Show suggestions at any time with
Ctrl+Space, or with the Show suggestions command. - Choose which key accepts a suggestion:
Enter,Tab, or both.
- Syntax highlighting
- Theme-aware YAML syntax highlighting, utilising Obsidian's built-in CSS variables.
- Search & replace
- Supports case-sensitive search.
- Customisable appearance
- Editor font size
- Line wrapping and readable line length
- Indentation guides
- Rendering of whitespace characters (spaces, tabs)
- Mobile command toolbar
- Configurable command toolbar on mobile devices.
View the Roadmap to see planned features.
Installation
Requirements
- Obsidian version:
1.14.4+ - Bases core plugin must be enabled
Obsidian Community Directory
- Go to the plugin page on the Obsidian community directory.
- Click
Add to Obsidian.
Inside Obsidian
- Open the community plugin browser inside Obsidian, and search for
base source editor. - Select the
Base Source Editorplugin. - Click
Install.
Usage
A Base can be opened in the Base Source Editor by:
- Using the command 'Toggle source mode' from the Command palette,
- Using the 'Source mode/Base mode' toggle visible when a Base is open.
Developing
Requirements
- Node.js: Version
24.22.2or newer - pnpm: Version
12.14.0or newer- See here for pnpm installation instructions: Install pnpm
-
Clone this repo:
git clone https://github.com/fronglemog/obsidian-base-source-editor-plugin cd obsidian-base-source-editor-plugin -
Install dependencies:
pnpm install
Linting
pnpm run lint
Testing
pnpm run test
Building
New builds are created at build/main.js.
| Command | Type checks | Minified | Watches for changes |
|---|---|---|---|
pnpm run build | yes | yes | no |
pnpm run build:nocheck | no | yes | no |
pnpm run build:nocheck:watch | no | yes | yes |
pnpm run dev | no | no (inline source map) | no |
pnpm run dev:watch | no | no (inline source map) | yes |
Installing a new build
Manual installation
After creating a new build, copy the build/main.js, styles/styles.css and manifest.json to .obsidian/plugins/base-source-editor in your Obsidian vault, and reload the Obsidian app.
Using installation script
After creating a new build, run this command (replace <VAULT_PATH> with the path to your Obsidian vault) and reload the Obsidian app.
[!WARNING] Before copying any files, the script looks for an
.obsidianfolder inside<VAULT_PATH>to determine if it's an Obsidian vault. The script will throw an error if it can't be found.
pnpm run copy-plugin-to-obsidian <VAULT_PATH>
For example:
pnpm run copy-plugin-to-obsidian "C:\Users\fronglemog\Documents\MyVault"pnpm run copy-plugin-to-obsidian ~/Documents/MyVault
Contributing
I'm more than happy to accept feedback, issues, bug reports and pull requests.
AI policy
I use AI as a tool to support development. I welcome contributions or feedback from those who have done so with considered and appropriate use of AI.
However, AI slop is not welcome. Contributions 100% authored or submitted by AI agents are not welcome.
I reserve the right to decline, reject or otherwise ignore any contributions that I judge to be AI slop.
License
MIT © fronglemog
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.