Base Source Editor

approvedunreviewed

by fronglemog

Edit the YAML source of a Base without leaving Obsidian.

★ 1 stars↓ 2,855 downloadsUpdated 25d agoMIT

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 .base files
    • Open a Base (.base file 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
  • 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

  1. Go to the plugin page on the Obsidian community directory.
  2. Click Add to Obsidian.

Inside Obsidian

  1. Open the community plugin browser inside Obsidian, and search for base source editor.
  2. Select the Base Source Editor plugin.
  3. 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.2 or newer
  • pnpm: Version 12.14.0 or newer
  1. Clone this repo:

    git clone https://github.com/fronglemog/obsidian-base-source-editor-plugin
    cd obsidian-base-source-editor-plugin
    
  2. Install dependencies:

    pnpm install
    

Linting

pnpm run lint

Testing

pnpm run test

Building

New builds are created at build/main.js.

CommandType checksMinifiedWatches for changes
pnpm run buildyesyesno
pnpm run build:nochecknoyesno
pnpm run build:nocheck:watchnoyesyes
pnpm run devnono (inline source map)no
pnpm run dev:watchnono (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 .obsidian folder 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.