Skip to content

Latest commit

 

History

History
400 lines (285 loc) · 15 KB

getting-started.org

File metadata and controls

400 lines (285 loc) · 15 KB

Getting Started with Vulpea

This guide walks you through installing Vulpea, setting up your first database, and understanding the core concepts.

Installation

From MELPA

Vulpea is available on MELPA:

;; Using package.el (after adding MELPA to package-archives)
(package-install 'vulpea)

;; Using use-package
(use-package vulpea)

;; Using straight.el
(straight-use-package 'vulpea)

;; Using elpaca
(elpaca vulpea)

Doom Emacs

Add to packages.el:

(package! vulpea)

Configure in config.el:

(use-package! vulpea
  ;; load on first input after startup instead of blocking startup
  :defer t :after-call doom-first-input-hook
  :init
  ;; Vulpea derives its defaults from `org-directory'. Doom's :lang org
  ;; module sets it to ~/org/ - override here if your notes live elsewhere,
  ;; or set `vulpea-db-sync-directories' explicitly.
  ;; (setq vulpea-db-sync-directories (list "~/notes/"))
  :config
  (vulpea-db-autosync-mode +1))

Then run doom sync and restart Emacs. To update Vulpea later, use doom sync -u (you can check what you are running with M-x vulpea-version).

Prefer a ready-made module? The repository ships a Doom module (doom/) that does all of the above and adds SPC n v keybindings plus doom doctor checks for fswatch / fd. Symlink it to $DOOMDIR/modules/tools/vulpea and add :tools vulpea to your doom! block - see its README.

Important: Doom captures your shell environment (including PATH) into an env file. If you install fswatch or fd (see below) after generating it, GUI Emacs won’t see them and Vulpea silently falls back to slower methods. Re-run doom env and restart Emacs, then verify with:

(executable-find "fswatch") ; should return a path, not nil
(executable-find "fd")      ; or "fdfind" on Debian and Ubuntu

If you use Doom’s :lang org +roam2 module: Vulpea 2.x is fully independent of org-roam - they can run side by side, each with its own database. Vulpea reads aliases from ALIASES, not ROAM_ALIASES; set vulpea-buffer-alias-property to "ROAM_ALIASES" to keep the org-roam ones.

From Source

git clone https://github.com/d12frosted/vulpea

Add to your Emacs configuration:

(add-to-list 'load-path "/path/to/vulpea")
(require 'vulpea)

Dependencies

Required:

  • Emacs 29.1 or later
  • org-mode 9.4.4 or later
  • emacsql 4.3.0+ with emacsql-sqlite-builtin
  • s 1.12+
  • dash 2.19+

Optional but strongly recommended:

ToolWhat it doesHow to install
fswatchDetects file changes made outside Emacs (git, sync tools)brew install fswatch / apt install fswatch / pacman -S fswatch
fdFaster file listing than findbrew install fd / apt install fd-find / pacman -S fd

fswatch reports external changes (git pull, Dropbox sync, etc.) as they happen. Without it, Vulpea falls back to polling: every few seconds it lists your directories and checks what changed. fd makes each listing faster than find (29ms vs 72ms for 14k notes, see bench/README.md). Debian and Ubuntu install it as fdfind, and Vulpea finds it under either name.

If you sync notes via git or cloud tools, or have a large collection, install fswatch. Linux distributions do not install it by default, and polling checks every file from Emacs, which gets expensive at tens of thousands of notes (see Polling Interval). fd helps with the startup scan and with polling when fswatch is missing.

First-Time Setup

Step 1: Configure Directories

Vulpea defaults to using org-directory, so if that’s already set correctly, you may not need any configuration:

(require 'vulpea)

;; If org-directory is already set, you're done!
;; Otherwise, tell Vulpea where your notes live:
(setq vulpea-db-sync-directories '("~/org/"))

Note: Set org-directory (or vulpea-db-sync-directories) before loading Vulpea so the defaults are computed correctly.

Step 2: Enable Auto-Sync

(vulpea-db-autosync-mode +1)

On activation the mode scans your directories in the background, so the first run indexes everything the database does not know about yet. After that, file watchers keep the database up to date as you edit notes. Parsing runs in a separate background Emacs process, so neither the scan nor saving a large note freezes Emacs (see Async Extraction for the trade-offs). For a large collection the first scan takes a while; you’ll see progress messages like:

Vulpea: Syncing 1234 files...
Vulpea: Progress: 500/1234 files (450 updated, 50 unchanged)
Vulpea: Sync complete - 1234 files (1200 updated, 34 unchanged, 2.5s)

M-x vulpea-db-sync-full-scan runs the same scan by hand, which is what you want if you don’t enable the mode.

The watchers read vulpea-db-sync-directories when the mode starts. To change the list later, use M-x vulpea-db-sync-add-directory and M-x vulpea-db-sync-remove-directory, which update the running watchers; a plain setq does not reach them until you toggle the mode off and on (M-x vulpea-doctor flags the mismatch).

Step 3: Verify It Works

Try finding a note:

M-x vulpea-find

You should see a completion interface with your notes. Select one to open it.

If no notes appear, run M-x vulpea-doctor - it checks your setup (directories, database, sync state, external tools) and points at the most common problems. See also Troubleshooting below.

Core Concepts

Notes and IDs

Vulpea only indexes org entries that have an ID property. This is how Vulpea identifies and tracks notes.

File-level note:

:PROPERTIES:
:ID: 5093fc4e-8c63-4e60-a1da-83fc7ecd5db7
:END:
#+title: My Note

Content here...

Heading-level note:

* My Heading
:PROPERTIES:
:ID: cfc39858-351d-4f1e-8f98-10d16d71f49e
:END:

Content here...

Both are notes in every sense - found, linked, tagged, queried, and schema-validated the same way. This is what lets a single file hold many notes: a swimming.org where every session is its own heading is a whole collection of notes, and you can still read and edit the file as one org tree. Nothing forces one note per file.

To add an ID to an existing entry: M-x org-id-get-create

Tags

Vulpea indexes both file-level tags (#+filetags:) and heading tags:

#+filetags: :project:work:

* TODO Task :urgent:

Query notes by tags using vulpea-db-query-by-tags-some or vulpea-db-query-by-tags-every.

Links

Vulpea tracks all id: links between notes:

See [[id:other-note-id][Other Note]] for details.

This enables backlink queries - finding all notes that link to a given note.

Links inside generated content are not indexed: dynamic blocks (#+BEGIN: ... #+END:) and babel output under #+RESULTS: are views that get rewritten, not something the note says, so a collection block listing other notes does not make its note a backlink of each of them.

Metadata

Vulpea supports structured metadata using description lists:

- author :: John Smith
- rating :: 95
- related :: [[id:another-note][Another Note]]

Metadata is queryable and supports type coercion (strings, numbers, links to other notes).

→ See User Guide for details on working with metadata.

What Gets Indexed

Vulpea extracts and stores:

DataSourceExample Query
Title#+title: or heading textvulpea-db-search-by-title
Tags#+filetags: and heading tagsvulpea-db-query-by-tags-some
Linksid: links in contentvulpea-db-query-by-links-some
MetadataDescription lists (key :: val)vulpea-db-query-by-meta
PropertiesProperty drawers (:KEY: val)vulpea-db-query-by-property
AliasesALIASES property (configurable)Included in completion candidates
TODO stateTODO, DONE, etc.Available in vulpea-note struct
TimestampsSCHEDULED, DEADLINE, CLOSEDAvailable in vulpea-note struct

Excluding Notes

Excluding a Single Note

To prevent a note from being indexed, add the VULPEA_IGNORE property with any value other than nil:

:PROPERTIES:
:ID: some-uuid
:VULPEA_IGNORE: t
:END:
#+title: Private Note

This won't appear in Vulpea queries.

Any non-nil value excludes the note, so the value can double as a note to yourself (for example :VULPEA_IGNORE: private, keep this out). Setting it to nil, or leaving the property off, keeps the note indexed.

The property name is configurable through vulpea-db-exclude-property. Point it at ROAM_EXCLUDE, for instance, to reuse the exclusion marks of an existing org-roam collection:

(setq vulpea-db-exclude-property "ROAM_EXCLUDE")

The name is matched case-insensitively, the way Org treats property names, so roam_exclude and ROAM_EXCLUDE mean the same thing.

Adding or removing the property in a file takes effect on the next sync, like any other edit. Changing vulpea-db-exclude-property itself does not, since the files have not changed - apply that to an existing collection with C-u M-x vulpea-db-sync-full-scan.

Excluding a Whole Subtree

VULPEA_IGNORE_CHILDREN works the other way around: the note carrying it stays indexed, everything below it does not, however deep.

* Lead Meetings
:PROPERTIES:
:ID: some-uuid
:VULPEA_IGNORE_CHILDREN: t
:END:

** 2026-07-14 Weekly sync
:PROPERTIES:
:ID: another-uuid
:END:

Here Lead Meetings is a note you can find, link to and capture into, while the meetings filed under it stay out of the database. This is the container case: a heading worth finding by itself, holding hundreds of entries that are not.

The two properties are independent. VULPEA_IGNORE says nothing about a note’s children, VULPEA_IGNORE_CHILDREN says nothing about the note carrying it, and a note can carry both to take itself and its subtree out together.

In a file-level property drawer it applies to the whole file, so the file-level note is indexed and none of its headings are (unlike vulpea-db-index-heading-level set to nil, the headings are excluded, links included, rather than folded into the file-level note):

:PROPERTIES:
:ID: some-uuid
:VULPEA_IGNORE_CHILDREN: t
:END:
#+title: Meeting Log

Value handling matches VULPEA_IGNORE: any non-nil value excludes, so it can carry a reason, and nil or an absent property changes nothing. The property name is configurable through vulpea-db-exclude-children-property, and is matched case-insensitively as well.

Excluded headings keep their IDs, and links to them still resolve in Org, since org-id reads the files directly. But the notes are not in the database, so they have no backlinks, vulpea-db-get-by-id does not find them, and they never show up in queries or completion. Vulpea only registers the IDs it indexes, so the first jump into an excluded subtree makes org-id rescan for the ID; on a large collection that first jump is slow, and org-id-goto will not complete the heading until then.

The links written inside them go as well, and that part is easy to miss: a note the excluded meetings linked to loses those backlinks. The subtree leaves the graph in both directions, which is the point, but it does affect notes you did not mark.

One exception, worth knowing if your excluded headings do not all carry IDs: link ownership stops at headings that have an ID, and exclusion does not change that. A skipped heading with an ID takes its links with it; a skipped heading without one was never a boundary, so its links belong to the nearest indexed ancestor and stay in the database as that ancestor’s links.

That is the trade. If you want those notes queryable and merely out of the way, filter at the read side instead (see Custom Index Filters) rather than keeping them out of the database.

Adding or removing the property in a file takes effect on the next sync, like any other edit. Changing vulpea-db-exclude-children-property itself does not, since the files have not changed - apply that to an existing collection with C-u M-x vulpea-db-sync-full-scan.

Filtering in Code

Marking notes one by one does not scale to a rule that covers many of them (“no headings in the archive directory”, “nothing tagged :draft:”). For those, write the rule once as a filter function: see Custom Index Filters in the configuration guide.

Troubleshooting

No notes appear in vulpea-find

  1. Check IDs - Notes need ID properties. Use M-x org-id-get-create to add them.
  2. Check directories - Verify vulpea-db-sync-directories includes your notes:
    (message "%S" vulpea-db-sync-directories)
        
  3. Rebuild database - Run M-x vulpea-db-sync-full-scan
  4. Check note count:
    (vulpea-db-count-notes)  ; Should return number > 0
        

Database sync is slow

If syncing a large collection is slow:

  1. Install fd for faster file discovery
  2. Consider disabling heading-level indexing:
    (setq vulpea-db-index-heading-level nil)
        
  3. Use faster parse method:
    (setq vulpea-db-parse-method 'single-temp-buffer)
        

→ See Configuration for performance tuning options.

External changes not detected

If files modified by git or sync tools aren’t updating:

  1. Install fswatch: brew install fswatch (macOS) or apt install fswatch (Linux)
  2. Check that Emacs can see it: M-x vulpea-doctor lists it under External Tools, and *Messages* shows Vulpea: Started fswatch monitoring when autosync starts. If it is installed but not found, your GUI Emacs has a shorter PATH than your shell (see Troubleshooting).

Next Steps