Obsidian and Vim Mode

For the last several days, I have been playing around with Obsidian in Vim mode. Vim, for those who don’t know, is a powerful text editor that can take some getting used to. It uses different “modes”: for editing, for navigating and issuing commands. It’s keyboard commands are designed for touch typists so that you can do anything you need to do without your fingers ever leaving the keyboard.

Obsidian offers a “Vim mode” which gives some of Vim’s capabilities. I like the idea of Vim but I’m not completely sold on its implementation in Obsidian yet.

Because of how navigation work (basic cursor movements use the h, j, k, and l keys) a fixed-width font is better for Vim. The theme that I use, Pisum, doesn’t make use of a fixed-width font. That meant I needed to edit the styles in the theme to get what I wanted.

This was a useful side-effect of experimenting because I found that it was pretty easy to edit the styles. I copied the styles for the Pisum theme into another .css file and edited there so I didn’t mess up the original theme. I made two basic changes:

  1. I switched to a fixed-width font in the editor (but not in preview mode).
  2. I modified the emphasis style to show an underline. I like seeing the underlying for emphasis because this is what I am used to from decades of writing manuscripts in standard format–in which italicized text is represented with underlines.

Here is an example of what this looks like:

An example of my Obsidian theme changes
An example of my Obsidian theme changes

But there are some serious limitations. For one thing, Obsidian is not Vim, and that is a good thing, since Obsidian is really focused on something different from what Vim attempts to do. It means, however, there is limited support for .vimrc files in which various setting, keyboard mappings, and other configurations that customize the editor are stored. There is a plug-in that provides some limited support for .vimrc files, but it is limited

It is nice that Obsidian includes the Vim mode option because it makes the transition to Obsidian easier for people used to Vim’s keyboard mappings. But after playing around with Vim mode for several days, I think I am going to turn it off. I asked myself how often, while writing do I need to do some of the fancy things that Vim’s commands let me do? The answer is rarely.

All is not lost, however. I learned that it is easy to edit themes in Obsidian–by far easier than any other editor I’ve played with. And some of my edits I’m keeping. I’m turning off the fixed-width font. I prefer the default theme font for notes. But I’m leaving my underlined emphasis in place. And there are probably other tweaks I’ll make. I have it in my mind to produce a theme that looks like Word for DOS 5.5 (which was my all-time favorite word processor). I’d do this more for learning than actual use. After all, these days, everyone want to use a dark theme because it’s easier on the eyes, and that bright blue background in Word for DOS is the antithesis of a dark theme.

Once I have my personal theme stable, I’ll write a separate post about it.

One comment

  1. Hello! I’m someone who uses the Vim plugin in Obsidian, so I wanted to clear up how and why I do so:

    As you said, a lot of the power that Vim provides is unnecessary for writing, and the exclusion of support for a “.vimrc” file in the official plugin hints at the same.
    However, the reason people make these Vim plugins for writing software isn’t so that they can automate tasks with functions or zoom past paragraphs of text; they (and I) just really aren’t used to using the mouse and arrow keys.

    You also mentioned this by saying it’s nice that it makes it “easier for people used to Vim’s keyboard mappings [to transition to Obsidian]”, but I feel like this is an under-statement. It’s not just about keyboard mappings: using Vim is an entirely different workflow from using the mouse and arrows. This is why it’s difficult for people like me to get used to writing without it, since we’re so used to making selections with “v”, deleting characters with “x” and moving back and forth with “w” and “b” — these are all things that also come to play during plain writing.

    There’s arguably little advantage to using Vim when writing notes, articles or poems; but it does make it less annoying for those of us who are used to the Vim-style of doing things.

    It’s great that you found something useful while experimenting though! Obsidian and it’s many official and unofficial plugins really reward the curious.

    As a last note, I’d like to say I don’t use a fixed-width font with obsidian either. Vertical navigation isn’t needed much when working with entire paragraphs, and only the most hardcore tech-veterans would insist on using a mono space font, even if all they’re doing is writing a Christmas letter to their grandma 😀

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.