Personal blog of Gunnari Auvinen. I enjoy writing about software engineering topics.

Picture of the author, Gunnari

Using a monospace font and Vim keybindings in Obsidian

March 25, 2021

While I was doing some homework for Bradfield's CSI course, I was using Obsidian to keep my answers and notes. Overall this was working really well, but when I started to do operations like binary addition or converting hex to binary, the fact that the regular text in the markdown editor wasn't using a monospace font was infuriating! Trying to line up 0s and 1s without a monospace font is a nightmare 🤬 Here's an example of what it looked like before I started to use a monospace font everywhere.

Example of binary numbers with non-monospace font

Here's what it looked like once I updated my markdown-source-view to use my desired monospace font 🥰

Example of binary numbers with monospace font

Updating font in Obsidian Markdown source view

Fortunately I was able to update it by adding a CSS snippet to use my desired font!

This helpful Obsidian forum post pointed me in the correct direction. Inside the vault directory for my obsidian notes, I added this snippet to vault/.obsidian/snippets as obsidian.css:

.markdown-source-view {
  font-family: 'MonoLisa', monospace;
  color: white;
}

I love using the MonoLisa font that I picked up at the tail end of last year as my primary font everywhere. It's the primary font in all of my editors, iTerm, and now Obsidian 😁 The design and spacing of the font are amazing! Not to mention that the ligatures are absolutely top notch.

To be fair, the code blocks and code snippets are monospace in Obsidian by default, but I don't want to use code blocks all of the time, when stylistically they're not what I personally want.

Vim Keybindings in Obsidian

Another great feature that I found within the options today is the fact that I can turn on Vim keybindings. OMGZ I'm in love 😍 I use those in VS Code as well as the various JetBrains IDEs and not having them in Obsidian was a bit of a let down, as I'd be attempting to use the keybindings, only to remember that they didn't exist. Lo and behold, they did exist I just hadn't realized that they've been there in the Obsidian preferences the whole time 😅

If you'd like to enable them yourself, you can open the preferences by hitting cmd + , on a Mac. Then under the Editor section, scroll down to the bottom and you'll find the Vim key bindings setting, and flip the toggle to enabled. BAM there you go Vim keybindings are enabled in Obsidian! The screenshot below shows where this option is as o Obsidian v0.11.5.

Vim keybinding location in Obsidian preferences