Skip to content
back to blog
obsidianJune 30, 2026 · 4 min read

Obsidian for Developers: Make Your Vault Work Like Your Codebase

Obsidian is plain-text markdown all the way down, which means the same tools you use on code work on your notes. Here's how to version your vault with Git, get real syntax highlighting, and run JavaScript inside your notes.

Dan Holloran
Dan Holloran
Senior Frontend & Fullstack Developer
Obsidian for Developers: Make Your Vault Work Like Your Codebase

Most note-taking apps treat your writing as something locked inside a proprietary database. You can export, sure, but the canonical copy lives somewhere you don't control, in a format you can't diff. For developers that's a constant low-grade itch. We spend all day in plain-text files under version control, and then we're supposed to keep our actual thinking in a black box?

Obsidian scratches that itch. Every note is a .md file on your disk. There's no sync server you're forced to trust, no database to corrupt, no export step. That single design decision means the entire toolchain you already know — Git, your terminal, your editor — works on your notes too. Here's how to lean into that.

Put your vault under Git

Because a vault is just a folder of markdown, you can git init it like any other project. That gives you free, versioned backups, a full history of every edit, and sync across machines without paying for a sync service. You can even keep notes next to a codebase in the same repo if you want documentation to travel with the code.

The friction is that committing by hand interrupts your flow. The Obsidian Git community plugin fixes that. It can auto-commit and push on a timer, and it adds a Source Control view for staging, a History view for browsing commits, and a Diff view for inspecting changes — all without leaving the app. A reasonable starting config:

Auto commit-and-sync interval: 10 minutes
Auto pull on startup: enabled
Commit message: vault backup: {{date}}

Push to a private GitHub or GitLab repo and you've got the same disaster-recovery story you'd expect from any project. Pull on a second device and your notes show up, conflicts and all, resolved the way you already know how to resolve them.

One caveat: large binary attachments bloat history fast. Either keep images in a separate folder you .gitignore, or wire up Git LFS if you must track them.

Get code blocks that actually look like code

Obsidian ships with Prism-based syntax highlighting, so a fenced block with a language tag is highlighted out of the box:

markdown
```ts
function greet(name: string): string {
  return `Hello, ${name}`;
}
```

That covers the basics, but developer notes tend to be code-heavy enough that you want more. The Code Styler plugin adds line numbers, a header bar with the language and an optional filename, collapsible blocks, and click-to-copy buttons. For inline tweaks you don't even need a plugin — a CSS snippet dropped in .obsidian/snippets/ and toggled on under Settings → Appearance → CSS snippets will do it:

css
.markdown-rendered pre {
  font-size: 0.85em;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
}

If Prism doesn't highlight a niche language the way you'd like, the Style Settings plugin exposes theme variables without writing CSS, and several themes expose code-block colors directly.

Run JavaScript inside your notes

This is where Obsidian stops feeling like a notes app and starts feeling like a tiny programmable environment. The Dataview plugin lets you query your vault like a database, and its dataviewjs mode hands you a full JavaScript API:

markdown
```dataviewjs
const pages = dv.pages('"projects"')
  .where(p => p.status === "active")
  .sort(p => p.due, 'asc');
dv.table(["Project", "Due"], pages.map(p => [p.file.link, p.due]));
```

That block renders a live, always-current table of every active project note, sorted by due date. Pair it with Templater, which runs JavaScript when you insert a template, and you can auto-generate frontmatter, pull the current Git branch into a daily note, or scaffold a new file from a prompt. For shared logic, both plugins let you point at a folder of .js files and import your own functions, so you're not copy-pasting the same snippet into thirty notes.

The payoff

None of this requires abandoning the way you already work. The vault is text, the history is Git, the customization is CSS, and the automation is JavaScript — four things you reach for every day anyway. Start small: put your vault under Obsidian Git this week, then add Code Styler when your notes get code-heavy, then reach for dataviewjs the first time you catch yourself manually maintaining a list that a query could generate. The tools you trust for code turn out to work just as well on the thinking that produces it.

~/subscribe
# new posts on code, craft & travel — no noise, no schedule
$subscribe