Moving from Simplenote to Notational FZF
Posted On 2019-12-29
Having recently chosen Vim as my new text editor, I needed to re-evaluate my note-taking system. Up to that point, I had been using Simplenote. Simplenote is a plaintext note-taking system that uses the first line of every note as the title – simple. It supports full-text search and tagging. Available as an app on desktop and mobile, Simplenote stores notes in its own cloud.
There is a Vim plugin called simplenote.vim that talks to the Simplenote API, but I couldn’t get it to work at the time. Therefore, I needed a system that stored notes as plaintext files on the filesystem for Vim to access.
Simplenote exported my notes well, with the title – that first line of every note – becoming the filename, plus
.txt. I bulk-renamed these to
rename 's/\.txt/\.md/' *
Some of my notes contained carriage returns that showed up in Vim as
^M. I got rid of these with
sed -i '' 's/^M//g' *
Note that you must type
^M using Ctrl-v, Ctrl-m on the command-line. If you were to paste this character sequence instead, the command-line would treat it literally as “caret followed by M”.
Years ago, I had heard podcasters in the Apple community talk about a note-taking app called Notational Velocity and a fork of it called nvALT. Revisiting these, I liked the core functionality but needed it inside Vim. My wish was granted by Notational FZF. Notational FZF is a Vim plugin that lets you do full-text search on all your notes and either open a match or create a new note with your query as the title.
I have used Notational FZF for a few weeks now and really enjoy it. I have configured it to use a single notes folder,
~/notes, whose contents started out with my Simplenote export. When I’m in Vim, I enter
:NV to invoke the full-text search on my notes folder. The results get updated with every character I type. I navigate through the results with Ctrl-p and Ctrl-n, which are analogous to navigating through Vim’s native
/ search results with p and n. Enter opens the current result, whereas Ctrl-x creates a new note with the search term plus
.md as filename.
Notational FZF only covers searching for and creating notes. To delete the current note, I learned the Vim command
:call delete(@%). To rename the current note, I use the Vim plugin rename.vim and its command
In an upcoming post, I will describe how I replaced Simplenote on my iPhone.