
Diamond: Knowledge Manager for Markdown Notes - Wikilinks & Graph
Knowledge layer for your docs · Wikilinks · Backlinks · Knowledge graph · Local-first · Git-friendly
A knowledge manager for VS Code: a knowledge layer over your project docs, with a live Markdown editor, wikilinks, backlinks, an interactive knowledge graph, table of contents and spellcheck. Everything stays local, plain-text and Git-friendly. Turn scattered Markdown files into a connected knowledge base and navigate it without leaving VS Code. Notes are plain Markdown files that live next to your code, so Git versions them like everything else, and they can link to any file in the project: .md files, .sql scripts, .ts sources, .html pages, images, binaries, etc.

Features
| Area |
What you get |
| Live editor |
Markdown files open in an editable, formatted view by default, with a formatting toolbar: headings, bold, italic, highlights, tags, links, checkboxes, bullets, quotes, tables, code blocks, rules and images are shown rendered. Images can be Markdown (, sized with ), embeds (![[diagram.png]]), HTML <img> tags (including <p align="center">), linked badges or table cells. The raw Markdown appears only on the lines you are editing. |
| Formatting |
Toggle bold, italic, strikethrough, ==highlight== and inline code; code blocks with a language picker; bullet, numbered and checkbox lists; heading cycle; blockquote; table insert and table auto-align. The same shortcuts work in the live editor and in the source editor. |
| Editing helpers |
Paste a URL over selected text to make a link. Tab / Shift+Tab move between table cells (and keep the table aligned); Tab in the last cell adds a row. Insert a table of contents that stays current on save. Ordered lists renumber themselves when you add, remove or move items. |
| Links |
[[note]], [[note#Heading]], [[note#^block-id]], [[note\|alias]], [[folder/note]], [[schema.sql]], [[src/api.ts]], ![[diagram.png]], and normal [text](path) links |
| Navigation |
Click a link in the live editor (Ctrl/Cmd+Click while editing that line), or Ctrl+Click / F12 in the source editor. Hover a link to preview its target. Clicking a link to a note that does not exist yet offers to create it. |
| Autocomplete |
Type [[ to list every file in the project; type [[note# to list that note's headings |
| Renames |
Renaming or moving a file or folder rewrites every link to it (and the relative links inside moved notes) and saves the files, without asking |
| Status bar |
Word count, character count, backlinks and outgoing links for the current note, next to Ln/Col. A selection shows its own counts. Click the link counts to open the matching panel. |
| Side bar |
A Diamond icon in the activity bar shows a live local graph of the file you have open (its outgoing links and backlinks, with arrows showing direction), updating as you switch files, plus Backlinks and Outgoing Links panels. Untick Local in its ☰ filters for the whole graph. |
| Graph |
Local graph of the open file (on by default, depth 1–5) or the whole project, filter by name, path or #tag, toggle Docs (circles) and Files (squares), unresolved links, orphans, labels and the colour Legend (off by default). Fit zooms to show everything. Click a node to open it, Ctrl/Cmd+Click to open it beside. |
| Colours |
Colour graph nodes by folder or file pattern with .diamond/graph.yml |
| Preview |
VS Code's built-in Markdown preview also renders links, embeds, highlights and task checkboxes |
Live editor
Markdown files open in the live editor automatically. To see the raw Markdown, click the </> icon in the title bar or press Ctrl+Shift+V; the file switches in place and stays in source view until you close that tab. Press Ctrl+Shift+V again (or the eye icon) to go back. Git diffs always use the normal text diff.
The toolbar has a text-style picker (normal text, headings 1–6), bold, italic, strikethrough, highlight, inline code, bullet / numbered / checkbox lists, quote, link to a file, code block, table and divider. Buttons light up for the formatting under the cursor.
Link autocomplete. Type [[ to get a fuzzy-searchable list of every file in the workspace and press Enter to complete the link. After a note name, type # ([[Setup Guide#) to choose one of its headings. This works in both the live editor and the source editor. The live editor also closes brackets and quotes as you type (diamond.liveEditor.autoCloseBrackets).
Table of contents. Click the list icon in the toolbar (after the divider) or run Diamond: Insert / Update Table of Contents to insert a linked list of your headings at the cursor, between `
` markers. Whenever the note is saved the list between the markers is refreshed (turn this off with `diamond.toc.updateOnSave`). The document's single `#` title is left out.
Tables. Inside a table, Tab and Shift+Tab move to the next or previous cell and re-align the pipes; Tab in the last cell starts a new row. Elsewhere Tab indents as usual.
Ordered lists renumber automatically: delete the second of four items and the rest become 1, 2, 3.
Links from pasted URLs. Select some text and paste a web address: the text becomes [text](https://github.com/christian-jaimes/diamond-documentation/blob/HEAD/address).
Minimap. The live editor has a minimap on the right edge, like VS Code's code view: the viewport slider is always visible and replaces the scrollbar: drag it or click anywhere to jump, and see search matches, the selection and diagnostics marked. It follows your editor.minimap.* settings (enabled, side, renderCharacters, maxColumn, size, scale); to turn it off for notes only, set "[markdown]": { "editor.minimap.enabled": false }.
Spell checking and other diagnostics. If you have the Code Spell Checker extension, its misspelled words get a wavy underline in the live editor too. Hover a word for the message and a Quick Fix list (suggested spellings, add to dictionary, ignore…); click one to apply it. Spell checking requires that extension; without it nothing is underlined and nothing breaks. Set diamond.liveEditor.diagnostics to all to also show other diagnostics (linters, etc.) or off to hide them.
The live editor edits the same file as the source editor: saving, unsaved-changes markers, Git and undo all keep working, and both views stay in sync if you open them side by side.
To open Markdown in the source editor by default instead, turn off diamond.liveEditor.openByDefault (or run Diamond: Toggle Opening Markdown in the Live Editor).
Graph colours
Run Diamond: Configure Graph Colours (or click the colour icon on the Graph view). It creates .diamond/graph.yml pre-filled with your top-level folders:
folders: # every note and file inside the folder, sub-folders included
docs: "#4f9dff"
docs/architecture: "#a371f7" # the deepest matching folder wins
src: "#f0883e"
database: "#3fb950"
patterns: # glob patterns win over folders
"**/*.sql": "#3fb950"
defaults: # anything not matched above
documentation: "#9da5b4"
files: "#d29922"
unresolved: "#6e7681"
Any CSS colour works ("#hex", "rgb(…)", "teal"). A .diamond/graph.json with the same shape is also accepted. Changes apply as soon as you save. Tick Legend in the graph's filters to show which colour is which. Commit the .diamond folder so your team shares the same colours.
Shortcuts
These shortcuts apply in Markdown files and in the live editor.
| Action |
Windows / Linux |
macOS |
| Bold |
Ctrl+B |
Cmd+B |
| Italic |
Ctrl+I |
Cmd+I |
| Strikethrough |
Ctrl+Shift+X |
Cmd+Shift+X |
| Highlight |
Ctrl+Shift+H |
Cmd+Shift+H |
| Inline code |
Ctrl+E |
Cmd+E |
| Code block |
Ctrl+Shift+K |
Cmd+Shift+K |
| Toggle checkbox |
Ctrl+L |
Cmd+L |
| Bullet list |
Ctrl+Shift+8 |
Cmd+Shift+8 |
| Numbered list |
Ctrl+Shift+7 |
Cmd+Shift+7 |
| Cycle heading |
Ctrl+Shift+] |
Cmd+Shift+] |
| Insert link to file |
Ctrl+Alt+L |
Cmd+Alt+L |
| Live editor ⇄ source |
Ctrl+Shift+V |
Cmd+Shift+V |
| Graph view |
Ctrl+Alt+G |
Cmd+Alt+G |
Table insert, table format, blockquote, table of contents are in the Command Palette under Diamond:. Any shortcut can be changed in Keyboard Shortcuts.
Settings
| Setting |
Default |
|
diamond.updateLinksOnRename |
true |
Rewrite links when files or folders move, then save. Files that already had unsaved changes are updated but left unsaved. |
diamond.liveEditor.openByDefault |
true |
Open Markdown in the live editor |
diamond.liveEditor.toolbar |
true |
Show the formatting toolbar |
diamond.liveEditor.autoCloseBrackets |
true |
Auto-close (, [, { and " in the live editor |
diamond.liveEditor.diagnostics |
spelling |
Underline diagnostics in the live editor: spelling (Code Spell Checker), all, or off |
diamond.statusBar.enabled |
true |
Show word / character / link counts in the status bar |
diamond.exclude |
**/{node_modules,.git}/** |
Files that cannot be linked and are not indexed |
diamond.newNoteFolder |
(empty) |
Where notes created from unresolved links go (empty = next to the current note) |
diamond.graph.showFiles / showOrphans |
true |
Default graph filters |
diamond.graph.nodeLabel |
title |
How graph nodes are named: title (the note's first # heading, or parent folder + file name such as guides/setup when it has none or is not Markdown) or fileName (just the file name). Hover a node for its full path. |
diamond.liveEditor.readableLineLength / fontSize / fontFamily |
|
Live editor appearance |
diamond.toc.updateOnSave |
true |
Refresh a <!-- toc --> table of contents when the note is saved |
diamond.listContinuation |
true |
Enter continues lists in the source editor |
Layout
For building, testing and releasing, see the developer onboarding guide.
src/extension.ts: activation and wiring
src/parser.ts: link, heading and tag parser
src/linkIndex.ts: workspace file index, link resolution, backlinks, graph data
src/linkFeatures.ts: clickable links, completion, hover, go-to-definition, create-on-click
src/renameLinks.ts: link rewriting on rename / move
src/liveEditor.ts + src/webview/: the live editor (a custom text editor built on CodeMirror 6)
src/shared/format.ts: formatting operations shared by both editors
src/webview/linkComplete.ts + src/shared/wikiComplete.ts: [[ / # autocomplete for the live editor (fuzzy ranking is shared and unit-tested)
src/shared/colors.ts + src/colorConfig.ts: .diamond/graph.yml
src/graphView.ts + media/graph.js: graph panel and side bar view (canvas, Barnes–Hut force layout)
src/linkViews.ts: Backlinks and Outgoing Links views
src/statusBar.ts + src/shared/stats.ts: status bar counts
src/openDefault.ts: opening Markdown in the live editor, switching to source in place
src/webview/toolbar.ts: live editor toolbar
src/preview.ts: markdown-it plugin for the built-in preview