scratching an itch with scratch comments

i've been meaning to write more (aka more than zero) for some time now. a dozen years, give or take a half decade. unfortunately, i have this habit of coming up with lofty goals and then creating impediments for myself.

not just any ordinary impediments, mind you. sneaky looking impediments that disguise themselves as activities that would seemingly help me achieve my original goal.

when it comes to writing, i've deferred actually writing until i had a place to host it that was all my own.

there are reasons for this, but let's save that for another essay...

the short story: i spent a lot of time thinking about it, but when it came to doing, i got in my own way. over. and over.

to my credit, i removed many of these self-made-roadblocks and i got pretty close to having no other excuses left.

but i found one. hopefully, the last one.

comments.

surely this will be quick

when reviewing a text file (written in markdown), there are times when i want to pepper the writing with comments. while google docs and notion have got a great UX for comments, i didn't want to give up my local first writing approach for shiny features in the cloud.

thus, there was only one thing to do: find a commenting plugin for my current text editor of choice: neovim. if there are 32 things neovim is known for, one of them is it's plugins.

this adventure did not disappoint. i found plugin after plugin after plugin. abandoned ones, ones with fresh commits this week and everything in between.

unfortunately, after using some of my favorite ones for a few days, i still felt something was missing.

they came close. very close. but not close enough. they either had too many features or too little features. but like goldilocks, i wanted something just right.

for me, just right means doing just one thing very well: writing comments.

annotator1 https://github.com/chpeters/annotator.nvim came close. VERY close.

but it also had some edges i couldn't shake off.

honestly, it was good enough. i just found a motivating excuse because i always wanted to make an nvim plugin. my kryptonite.

i wouldn't seek perfection, but i would get close enough to taste it. perfection is the enemy of good, but slightly better is better than ... better.

annotator.nvim was licensed under MIT, so i forked it and started making it feel the way i wanted. the way that would get me back to writing. eventually.

after a day or two of rewriting, not much of the original remained, but its spirit did. so did an attribution to the original author.

thank you open source. and MIT. and nvim. and chpeters2 https://github.com/chpeters.

small, on purpose

please welcome to the internet: scratch-comments.nvim3 https://git.eleith.com/eleith/scratch-comments.nvim also available on codeberg and github, a minimal nvim plugin for adding comments to your todos, notes, code, plans or any other text file.

scratch-comments.nvim gif

i kept a few guiding philosophies to keep the plugin small but usable

  1. borrow from google docs where it makes sense for nvim
  2. follow nvim conventions (aka, the nvim way...)
  3. keep the surface area minimal (no shortcuts, no colors, no configuration)

following those three wasn't a walk in the park. i didn't really know what counted as an nvim convention. not everything from google docs made sense in an offline text editor, and it was difficult to draw the line between a nice-to-have and a core feature.

however, i used the plugin itself during development, capturing comments on codediffs, architecture plans and implementation plans. whenever something frustrated me, i tried to fix it. sometimes that meant building something up. sometimes it meant tearing it back down. it's much better now than where it started. not good. not perfect. but definitely better.

i actually don't expect other people to use this plugin. it is barebones, lacks configuration and basically does one thing well and not much else. but i'm using this plugin and writing about it. so that counts for something in my book.

did i actually write anything?

ultimately, the biggest question in my mind is if this plugin helped me get back to writing.

if you are reading this, the answer is: maybe.

on one hand, i definitely should have started writing a decade ago.

on the other hand, experiences and writing feed off of each other. i'm glad i wrote the plugin. i know it was another obstacle i put in my own way. i removed that obstacle.

i wrote about removing the obstacle.

a win is a win.

i'll take it.