Skip to content

Obsidian and Foam side-by-side

For a while I've been using Foam, which is basically a VSCode extension plus a template Git repository, as my note-taking / personal knowledge management system. A little while after getting started with this I came across Obsidian, which is a popular dedicated note-taking app. This post compares the two.

The nice thing about both of these, and the primary requirement (for me) for any note-taking or PKM system, is that they're both based on storing notes locally as plain Markdown files. As far as I'm concerned, the directory of plain-text Markdown files, version-controlled by Git, is the knowledge base, and the app I use to interact with it is secondary. By restricting to plain text files only, I can just as easily make/edit/read notes using vim, or interact with them at the command line, as I can fire up the graphical application with all the bells and whistles. I thought it would be easy to have both Obsidian and Foam side by side and to use both in parallel for a while on the same data set.

I installed Obsidian (on macOS) and had a play, and found it to be very similar to VSCode/Foam, even in the feel of the interface (both are Electron apps). As you might expect, Obsidian looked to have more functionality specific to note- taking (although VSCode is pretty feature-rich in general!), but since I was only using a small fraction of the features, I pretty quickly decided to stick with what I already knew and didn't bother further with Obsidian.

Git, syncing, and iOS

One downside of Foam is that (as far as I know) it doesn't provide a convenient way to access the note data on iOS. Given that it's just a Git repository of Markdown files, one way is simply to push the repo to GitHub and access it via a web browser, which would give at least the ability to read, edit and create new notes. However since I keep a fair bit of personal information in my notes, I'm not prepared to push to GitHub even as a private repo; and I'm not overly keen to get into self-hosting at the moment. I simply sync data between my two active laptops via, and back up to, a home server, using Git via direct SSH connections on the LAN.

This prompted me to have another look at Obsidian, which does have an iOS app, to see how that worked. For syncing betwen devices, Obsidian has a community plugin to allow syncing/backup via Git, which I've set up on my laptops; or there's a (paid-for) Obsidian Sync service, which for the same reasons as above I don't want to use. To my surprise, the iOS Obsidian app does support the above-mentioned Git plugin! However, not to my surprise, SSH access is not supported...! (You can also use iCloud as a back end, which would work, but see above.)

So, it looks like to get access to my notes on iOS without syncing to a commercial cloud service (Obsidian Sync, GitHub, iCloud, ...), self-hosting is my only route forward? One to re-visit later...

Using Obsidian and Foam side-by-side

Setting aside the iOS question, I wondered whilst I was on the subject whether there was any other reason to revisit Obsidian; I suspected there was a lot of functionality I could be using if I spent a bit more time with it. So here's a feature-by-feature comparison.

  • Markdown: As mentioned already, both use only plain-text Markdown to store notes. Tick.
  • Git: Also as mentioned, Foam is based on Git, and Obsidian can use Git with the third-party plug-in.
  • FOSS/privacy: Foam and the underlying VSCode editor are both free and open-source, although VSCode is owned by a tech corporation (you can turn off telemetry, but do I really trust it not to be leaking data to Microsoft? Plus each extension can have its own telemetry that has to be turned off separately, so plenty of room to miss something). Obsidian is free and has a good privacy policy (no data collection, no telemetry, can turn off network access, developer policies prohibit plug-ins from collecting data, etc.); but it's not open-source. This isn't a showstopper, so I'm leaning marginally towards Obsidian here.
  • Vi key bindings: Yes, both VSCode and Obsidian can enable vi key bindings.
  • WikiLinks: Yes, both allow inter-note links with the [[...]] link syntax.
  • Link auto-completion: Yep.
  • Daily notes. Both apps will create daily notes, including from a template, and will automatically open today's daily note on startup if requested. Foam makes it a lot easier to create daily notes for days other than today which seems to be impossible in vanilla Obsidian; however the Calendar plugin in Obsidian tips the balance the other way, by giving a visual calendar view that you can click on to create the daily note for a given day. (Foam makes you choose from a list.)
  • Graph visualisation: Foam and Obsidian both allow your set of notes to be visualised as a graph. Obsidian looks like it has more and easier controls (e.g. the ability to colour-code subsets of nodes based on flexible queries).
  • Link updating: Both will automatically update internal links when files are renamed.
  • Link preview: Both show a preview of a linked page when you hover over the link (holding Cmd in Obsidian).
  • Show backlinks: Both will show a list of incoming links (backlinks) to, and outgoing links on, the current page (Foam will also show a single list of all incoming and outgoing).
  • Embedding within notes: Obsidian also probably wins here too. Both allow the embedding of one note within another, and the embedding of images (including pasting images directly from the clipboard; in Foam this relies on a recommended VSCode extension). In Obsidian you can embed PDFs which get rendered inline (doing the same in VSCode gives a link to open the file (PDFs can be opened in VSCode), with a 'not supported' message). Obsidian also support embedding audio files, lists from other Markdown notes, and the results of a search, by means of a special query code block.
  • Tag exploration and nested tags: Available in both.
  • Orphans and placeholders: Orphans are pages that aren't linked to, and placeholders are internal links that don't go anywhere. In both apps you can create placeholder links in notes, and click them later to create the pages; Foam also colour-codes the link to identify it as a placeholder. Foam has orphan and placeholder panels that lists all orphans and placeholders, respectively, in one place; the equivalent in Obsidian comes from a third-party plugin that runs a search and puts the output in a note, which I like less. However it will additionally will find (and delete) empty files.
  • Open random note. Available in both.

There's a ton of other functionality in Obsidian, via a huge number of third- party plug-ins, but I didn't want to go into all that. While it might be useful, I want to maintain the principle of plain-text Markdown as much as practicable, to avoid vendor lock-in, and so am avoiding Obsidian-specific extensions to Markdown. I'm happy to use things like the calendar plug-in that doesn't change the underlying Markdown, but just provides a convenient user interface.

Tips to work with both simultaneously

The templates folder needs to be set up correctly. Foam puts templates in .foam/templates by default, but if you try to use this folder as the templates directory in Obsidian, it can't find it. I can only guess it doesn't like the hidden folder. So I set up a templates directory, and in order to avoid duplication, made .foam/templates a symlink to it. (Apparently symlinking the other way won't work either; Obsidian doesn't like its templates directory to be a symlink.)

The only wrinkle I've come across so far is that, in templates themselves, the built-in variables that both systems use, such as for the current date (which can therefore be inserted automatically into daily notes) have different names. So I had to modify the Daily Note template to use the Obsidian variable names instead of the Foam variable names it was previously using, and would have to modify them back again if I went back to Foam.